From 8fa7f2c7a017c62645e4b2eb02e7a369be9ea8dc Mon Sep 17 00:00:00 2001 From: bubbajoe Date: Sat, 13 Apr 2024 16:43:19 +0900 Subject: [PATCH] public release --- .dockerignore | 5 + .github/workflows/built_test_bench.yml | 39 + .github/workflows/performance_test.yml | 32 + .github/workflows/release.yml | 33 + .gitignore | 14 + .goreleaser.yaml | 39 + Dockerfile | 16 + LICENSE | 201 +++++ README.md | 106 +++ TODO.md | 121 +++ cmd/dgate-cli/cmd.go | 39 + cmd/dgate-cli/main.go | 10 + cmd/dgate-cli/namespace.go | 145 +++ cmd/dgate-server/main.go | 68 ++ config.dgate.yaml | 66 ++ .../admin_tests/iphash_load_balancer.ts | 18 + .../admin_tests/iphash_load_balancer_test.sh | 46 + .../admin_tests/merge_responses.ts | 20 + .../admin_tests/merge_responses_test.sh | 43 + .../admin_tests/modify_request.ts | 35 + .../admin_tests/modify_request_test.sh | 40 + .../admin_tests/modify_response.ts | 16 + .../admin_tests/modify_response_test.sh | 40 + .../admin_tests/performance_test_prep.sh | 63 ++ .../admin_tests/performance_test_prep.ts | 15 + functional-tests/admin_tests/raft_test.sh | 17 + functional-tests/admin_tests/url_shortener.ts | 57 ++ .../admin_tests/url_shortener_test.sh | 49 + functional-tests/grpc_tests/README.md | 29 + .../grpc_tests/cmd/greeter_client/main.go | 55 ++ .../grpc_tests/cmd/greeter_server/main.go | 60 ++ functional-tests/grpc_tests/go.mod | 17 + functional-tests/grpc_tests/go.sum | 23 + .../grpc_tests/helloworld/helloworld.pb.go | 235 +++++ .../grpc_tests/helloworld/helloworld.proto | 38 + .../helloworld/helloworld_grpc.pb.go | 125 +++ functional-tests/module_tests/handler.ts | 19 + functional-tests/module_tests/imports.ts | 47 + functional-tests/module_tests/printer.ts | 146 +++ functional-tests/raft_tests/Procfile | 5 + functional-tests/raft_tests/test1.yaml | 65 ++ functional-tests/raft_tests/test2.yaml | 58 ++ functional-tests/raft_tests/test3.yaml | 59 ++ functional-tests/raft_tests/test4_watch.yaml | 61 ++ functional-tests/raft_tests/test5_watch.yaml | 62 ++ .../ws_tests/cmd/client/client.go | 103 +++ .../ws_tests/cmd/server/server.go | 88 ++ functional-tests/ws_tests/go.mod | 7 + functional-tests/ws_tests/go.sum | 3 + functional-tests/ws_tests/websockets.html | 44 + go.mod | 73 ++ go.sum | 379 ++++++++ go.work | 7 + go.work.sum | 341 +++++++ internal/admin/admin_api.go | 137 +++ internal/admin/admin_fsm.go | 104 +++ internal/admin/admin_raft.go | 236 +++++ internal/admin/admin_routes.go | 220 +++++ internal/admin/routes/collection_routes.go | 397 +++++++++ internal/admin/routes/domain_routes.go | 122 +++ internal/admin/routes/misc_routes.go | 52 ++ internal/admin/routes/module_routes.go | 107 +++ internal/admin/routes/namespace_routes.go | 86 ++ internal/admin/routes/route_routes.go | 121 +++ internal/admin/routes/service_routes.go | 116 +++ internal/config/config.go | 197 ++++ internal/config/configtest/config.go | 102 +++ internal/config/configtest/module.go | 11 + internal/config/loader.go | 299 +++++++ internal/config/resources.go | 184 ++++ internal/config/resources_test.go | 56 ++ internal/config/store_config.go | 27 + internal/config/utils.go | 141 +++ internal/pattern/pattern.go | 61 ++ internal/pattern/pattern_test.go | 111 +++ internal/proxy/change_log.go | 365 ++++++++ internal/proxy/change_log_test.go | 171 ++++ internal/proxy/dynamic_proxy.go | 344 +++++++ internal/proxy/module_executor.go | 105 +++ internal/proxy/module_extractor.go | 118 +++ internal/proxy/module_mock_test.go | 157 ++++ internal/proxy/proxy_documents.go | 33 + internal/proxy/proxy_handler.go | 322 +++++++ internal/proxy/proxy_handler_test.go | 184 ++++ internal/proxy/proxy_printer.go | 42 + internal/proxy/proxy_replication.go | 15 + internal/proxy/proxy_state.go | 564 ++++++++++++ internal/proxy/proxy_stats.go | 123 +++ internal/proxy/proxy_transport.go | 92 ++ .../proxy/proxy_transport/proxy_transport.go | 132 +++ .../proxy_transport/proxy_transport_test.go | 57 ++ internal/proxy/proxystore/proxystore.go | 167 ++++ internal/proxy/proxytest/mock_http.go | 64 ++ internal/proxy/proxytest/mock_proxy.go | 51 ++ .../proxy/proxytest/mock_proxy_transport.go | 57 ++ .../proxy/proxytest/mock_reverse_proxy.go | 107 +++ internal/proxy/request_context.go | 63 ++ internal/proxy/reverse_proxy/reverse_proxy.go | 276 ++++++ .../proxy/reverse_proxy/reverse_proxy_test.go | 291 ++++++ internal/proxy/runtime_context.go | 104 +++ internal/proxy/util.go | 47 + internal/router/router.go | 62 ++ performance-tests/long-perf-test.js | 20 + performance-tests/perf-test.js | 47 + pkg/cache/cache.go | 228 +++++ pkg/cache/cache_test.go | 120 +++ pkg/eventloop/eventloop.go | 425 +++++++++ pkg/modules/README.md | 41 + pkg/modules/dgate/crypto/crypto_mod.go | 241 +++++ pkg/modules/dgate/dgate_mod.go | 76 ++ pkg/modules/dgate/exp/exp_mod.go | 21 + pkg/modules/dgate/http/http_mod.go | 185 ++++ pkg/modules/dgate/state/state_mod.go | 167 ++++ pkg/modules/dgate/storage/storage_mod.go | 142 +++ pkg/modules/dgate/util/util_mod.go | 47 + pkg/modules/extractors/extractors.go | 306 +++++++ pkg/modules/extractors/extractors_test.go | 218 +++++ pkg/modules/extractors/runtime.go | 148 +++ pkg/modules/extractors/runtime_test.go | 164 ++++ pkg/modules/mods.go | 42 + pkg/modules/mods_test.go | 8 + pkg/modules/testutil/testutil.go | 147 +++ pkg/modules/types/generator.go | 47 + pkg/modules/types/goja_value.go | 19 + pkg/modules/types/module_context.go | 127 +++ pkg/modules/types/request.go | 64 ++ pkg/modules/types/response_writer.go | 140 +++ pkg/modules/types/upstream_response.go | 141 +++ pkg/modules/types/wrapper_test.go | 38 + pkg/raftadmin/raftadmin.go | 493 ++++++++++ pkg/raftadmin/raftadmin_client.go | 465 ++++++++++ pkg/raftadmin/raftadmin_test.go | 188 ++++ pkg/raftadmin/types.go | 98 ++ pkg/rafthttp/rafthttp.go | 304 +++++++ pkg/rafthttp/rafthttp_test.go | 73 ++ pkg/resources/document_manager.go | 10 + pkg/resources/resource_manager.go | 843 ++++++++++++++++++ pkg/resources/resource_manager_test.go | 645 ++++++++++++++ pkg/scheduler/scheduler.go | 254 ++++++ pkg/scheduler/scheduler_test.go | 156 ++++ pkg/spec/change_log.go | 162 ++++ pkg/spec/resources.go | 167 ++++ pkg/spec/resources_ext.go | 143 +++ pkg/spec/response_writer_tracker.go | 62 ++ pkg/spec/transformers.go | 353 ++++++++ pkg/storage/badger_logger.go | 33 + pkg/storage/file_storage.go | 260 ++++++ pkg/storage/memory_storage.go | 31 + pkg/storage/storage.go | 22 + pkg/typescript/typescript.go | 31 + pkg/typescript/typescript.min.js | 386 ++++++++ pkg/typescript/typescript_test.go | 73 ++ pkg/util/bytes.go | 20 + pkg/util/default.go | 15 + pkg/util/default_test.go | 24 + pkg/util/env.go | 14 + pkg/util/hash.go | 87 ++ pkg/util/heap/heap.go | 120 +++ pkg/util/heap/heap_test.go | 200 +++++ pkg/util/http.go | 15 + pkg/util/http_response.go | 55 ++ pkg/util/iplist/iplist.go | 145 +++ pkg/util/iplist/iplist_test.go | 107 +++ pkg/util/linkedlist/linkedlist.go | 163 ++++ pkg/util/linkedlist/linkedlist_sort.go | 152 ++++ pkg/util/linkedlist/linkedlist_sort_test.go | 70 ++ pkg/util/linkedlist/linkedlist_test.go | 194 ++++ pkg/util/linker/linker.go | 244 +++++ pkg/util/linker/linker_test.go | 40 + pkg/util/logger/logging.go | 143 +++ pkg/util/parse.go | 14 + pkg/util/queue/queue.go | 59 ++ pkg/util/queue/queue_test.go | 72 ++ pkg/util/safe/ref.go | 59 ++ pkg/util/safe/ref_test.go | 32 + pkg/util/sliceutil/slice.go | 69 ++ pkg/util/tree/avl/avl.go | 421 +++++++++ pkg/util/tree/avl/avl_test.go | 292 ++++++ 178 files changed, 21989 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/built_test_bench.yml create mode 100644 .github/workflows/performance_test.yml create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 .goreleaser.yaml create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 TODO.md create mode 100644 cmd/dgate-cli/cmd.go create mode 100644 cmd/dgate-cli/main.go create mode 100644 cmd/dgate-cli/namespace.go create mode 100644 cmd/dgate-server/main.go create mode 100644 config.dgate.yaml create mode 100644 functional-tests/admin_tests/iphash_load_balancer.ts create mode 100755 functional-tests/admin_tests/iphash_load_balancer_test.sh create mode 100644 functional-tests/admin_tests/merge_responses.ts create mode 100755 functional-tests/admin_tests/merge_responses_test.sh create mode 100644 functional-tests/admin_tests/modify_request.ts create mode 100755 functional-tests/admin_tests/modify_request_test.sh create mode 100644 functional-tests/admin_tests/modify_response.ts create mode 100755 functional-tests/admin_tests/modify_response_test.sh create mode 100755 functional-tests/admin_tests/performance_test_prep.sh create mode 100644 functional-tests/admin_tests/performance_test_prep.ts create mode 100755 functional-tests/admin_tests/raft_test.sh create mode 100644 functional-tests/admin_tests/url_shortener.ts create mode 100755 functional-tests/admin_tests/url_shortener_test.sh create mode 100644 functional-tests/grpc_tests/README.md create mode 100644 functional-tests/grpc_tests/cmd/greeter_client/main.go create mode 100644 functional-tests/grpc_tests/cmd/greeter_server/main.go create mode 100644 functional-tests/grpc_tests/go.mod create mode 100644 functional-tests/grpc_tests/go.sum create mode 100644 functional-tests/grpc_tests/helloworld/helloworld.pb.go create mode 100644 functional-tests/grpc_tests/helloworld/helloworld.proto create mode 100644 functional-tests/grpc_tests/helloworld/helloworld_grpc.pb.go create mode 100644 functional-tests/module_tests/handler.ts create mode 100644 functional-tests/module_tests/imports.ts create mode 100644 functional-tests/module_tests/printer.ts create mode 100644 functional-tests/raft_tests/Procfile create mode 100644 functional-tests/raft_tests/test1.yaml create mode 100644 functional-tests/raft_tests/test2.yaml create mode 100644 functional-tests/raft_tests/test3.yaml create mode 100644 functional-tests/raft_tests/test4_watch.yaml create mode 100644 functional-tests/raft_tests/test5_watch.yaml create mode 100644 functional-tests/ws_tests/cmd/client/client.go create mode 100644 functional-tests/ws_tests/cmd/server/server.go create mode 100644 functional-tests/ws_tests/go.mod create mode 100644 functional-tests/ws_tests/go.sum create mode 100644 functional-tests/ws_tests/websockets.html create mode 100644 go.mod create mode 100644 go.sum create mode 100644 go.work create mode 100644 go.work.sum create mode 100644 internal/admin/admin_api.go create mode 100644 internal/admin/admin_fsm.go create mode 100644 internal/admin/admin_raft.go create mode 100644 internal/admin/admin_routes.go create mode 100644 internal/admin/routes/collection_routes.go create mode 100644 internal/admin/routes/domain_routes.go create mode 100644 internal/admin/routes/misc_routes.go create mode 100644 internal/admin/routes/module_routes.go create mode 100644 internal/admin/routes/namespace_routes.go create mode 100644 internal/admin/routes/route_routes.go create mode 100644 internal/admin/routes/service_routes.go create mode 100644 internal/config/config.go create mode 100644 internal/config/configtest/config.go create mode 100644 internal/config/configtest/module.go create mode 100644 internal/config/loader.go create mode 100644 internal/config/resources.go create mode 100644 internal/config/resources_test.go create mode 100644 internal/config/store_config.go create mode 100644 internal/config/utils.go create mode 100644 internal/pattern/pattern.go create mode 100644 internal/pattern/pattern_test.go create mode 100644 internal/proxy/change_log.go create mode 100644 internal/proxy/change_log_test.go create mode 100644 internal/proxy/dynamic_proxy.go create mode 100644 internal/proxy/module_executor.go create mode 100644 internal/proxy/module_extractor.go create mode 100644 internal/proxy/module_mock_test.go create mode 100644 internal/proxy/proxy_documents.go create mode 100644 internal/proxy/proxy_handler.go create mode 100644 internal/proxy/proxy_handler_test.go create mode 100644 internal/proxy/proxy_printer.go create mode 100644 internal/proxy/proxy_replication.go create mode 100644 internal/proxy/proxy_state.go create mode 100644 internal/proxy/proxy_stats.go create mode 100644 internal/proxy/proxy_transport.go create mode 100644 internal/proxy/proxy_transport/proxy_transport.go create mode 100644 internal/proxy/proxy_transport/proxy_transport_test.go create mode 100644 internal/proxy/proxystore/proxystore.go create mode 100644 internal/proxy/proxytest/mock_http.go create mode 100644 internal/proxy/proxytest/mock_proxy.go create mode 100644 internal/proxy/proxytest/mock_proxy_transport.go create mode 100644 internal/proxy/proxytest/mock_reverse_proxy.go create mode 100644 internal/proxy/request_context.go create mode 100644 internal/proxy/reverse_proxy/reverse_proxy.go create mode 100644 internal/proxy/reverse_proxy/reverse_proxy_test.go create mode 100644 internal/proxy/runtime_context.go create mode 100644 internal/proxy/util.go create mode 100644 internal/router/router.go create mode 100644 performance-tests/long-perf-test.js create mode 100644 performance-tests/perf-test.js create mode 100644 pkg/cache/cache.go create mode 100644 pkg/cache/cache_test.go create mode 100644 pkg/eventloop/eventloop.go create mode 100644 pkg/modules/README.md create mode 100644 pkg/modules/dgate/crypto/crypto_mod.go create mode 100644 pkg/modules/dgate/dgate_mod.go create mode 100644 pkg/modules/dgate/exp/exp_mod.go create mode 100644 pkg/modules/dgate/http/http_mod.go create mode 100644 pkg/modules/dgate/state/state_mod.go create mode 100644 pkg/modules/dgate/storage/storage_mod.go create mode 100644 pkg/modules/dgate/util/util_mod.go create mode 100644 pkg/modules/extractors/extractors.go create mode 100644 pkg/modules/extractors/extractors_test.go create mode 100644 pkg/modules/extractors/runtime.go create mode 100644 pkg/modules/extractors/runtime_test.go create mode 100644 pkg/modules/mods.go create mode 100644 pkg/modules/mods_test.go create mode 100644 pkg/modules/testutil/testutil.go create mode 100644 pkg/modules/types/generator.go create mode 100644 pkg/modules/types/goja_value.go create mode 100644 pkg/modules/types/module_context.go create mode 100644 pkg/modules/types/request.go create mode 100644 pkg/modules/types/response_writer.go create mode 100644 pkg/modules/types/upstream_response.go create mode 100644 pkg/modules/types/wrapper_test.go create mode 100644 pkg/raftadmin/raftadmin.go create mode 100644 pkg/raftadmin/raftadmin_client.go create mode 100644 pkg/raftadmin/raftadmin_test.go create mode 100644 pkg/raftadmin/types.go create mode 100644 pkg/rafthttp/rafthttp.go create mode 100644 pkg/rafthttp/rafthttp_test.go create mode 100644 pkg/resources/document_manager.go create mode 100644 pkg/resources/resource_manager.go create mode 100644 pkg/resources/resource_manager_test.go create mode 100644 pkg/scheduler/scheduler.go create mode 100644 pkg/scheduler/scheduler_test.go create mode 100644 pkg/spec/change_log.go create mode 100644 pkg/spec/resources.go create mode 100644 pkg/spec/resources_ext.go create mode 100644 pkg/spec/response_writer_tracker.go create mode 100644 pkg/spec/transformers.go create mode 100644 pkg/storage/badger_logger.go create mode 100644 pkg/storage/file_storage.go create mode 100644 pkg/storage/memory_storage.go create mode 100644 pkg/storage/storage.go create mode 100644 pkg/typescript/typescript.go create mode 100644 pkg/typescript/typescript.min.js create mode 100644 pkg/typescript/typescript_test.go create mode 100644 pkg/util/bytes.go create mode 100644 pkg/util/default.go create mode 100644 pkg/util/default_test.go create mode 100644 pkg/util/env.go create mode 100644 pkg/util/hash.go create mode 100644 pkg/util/heap/heap.go create mode 100644 pkg/util/heap/heap_test.go create mode 100644 pkg/util/http.go create mode 100644 pkg/util/http_response.go create mode 100644 pkg/util/iplist/iplist.go create mode 100644 pkg/util/iplist/iplist_test.go create mode 100644 pkg/util/linkedlist/linkedlist.go create mode 100644 pkg/util/linkedlist/linkedlist_sort.go create mode 100644 pkg/util/linkedlist/linkedlist_sort_test.go create mode 100644 pkg/util/linkedlist/linkedlist_test.go create mode 100644 pkg/util/linker/linker.go create mode 100644 pkg/util/linker/linker_test.go create mode 100644 pkg/util/logger/logging.go create mode 100644 pkg/util/parse.go create mode 100644 pkg/util/queue/queue.go create mode 100644 pkg/util/queue/queue_test.go create mode 100644 pkg/util/safe/ref.go create mode 100644 pkg/util/safe/ref_test.go create mode 100644 pkg/util/sliceutil/slice.go create mode 100644 pkg/util/tree/avl/avl.go create mode 100644 pkg/util/tree/avl/avl_test.go diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d30ae69 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.*/ +dashboard/ +dist/ +functional-tests/ +go.work* \ No newline at end of file diff --git a/.github/workflows/built_test_bench.yml b/.github/workflows/built_test_bench.yml new file mode 100644 index 0000000..7d5a8b1 --- /dev/null +++ b/.github/workflows/built_test_bench.yml @@ -0,0 +1,39 @@ +name: DGate Build/Test/Bench + +on: + push: + branches: [ "**" ] + +jobs: + build_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.sum + + - name: Build + run: | + go mod download + go build -v ./... + + - name: Test + run: | + go test -coverprofile=cov.out -v ./... + go tool cover -func=cov.out + + - name: Benchmark + run: | + go test -bench=. -run=^# ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: dgate-io/dgate + diff --git a/.github/workflows/performance_test.yml b/.github/workflows/performance_test.yml new file mode 100644 index 0000000..c7321d0 --- /dev/null +++ b/.github/workflows/performance_test.yml @@ -0,0 +1,32 @@ +name: DGate Performance Test (short) + +on: + push: + branches: [ "**" ] + +jobs: + k6_load_test: + name: k6 Load Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + + - run: go mod download + + - run: go run cmd/dgate-server/main.go & + + - name: Wait for server to start + run: sleep 5 + - run: ./functional-tests/admin_tests/performance_test_prep.sh + + - name: Run local k6 test + uses: grafana/k6-action@v0.3.1 + with: + filename: performance-tests/perf-test.js + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c31df2f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: DGate Release + +on: + push: + tags: [ "v*" ] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.sum + + - name: GoReleaser + uses: goreleaser/goreleaser-action@v4.1.0 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + distribution: goreleaser + version: latest + args: release + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..890ef74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*__debug_bin* +.vscode +.idea +.fleet + +infra/ +.aws/ +dist/ +./dgate +./k6 + +# Local files # +.dgate*/ +cov.out \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..48bc443 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,39 @@ +before: + hooks: + - go mod tidy +builds: + - id: dgate-server + main: ./cmd/dgate-server + binary: dgate-server + ldflags: + - -s -w -X main.version={{.Version}} + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + - id: dgate-cli + main: ./cmd/dgate-cli + binary: dgate-cli + ldflags: + - -s -w -X main.version={{.Version}} + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - name_template: "dgate_{{ .Os }}_{{ .Arch }}" + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0ba0cc1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:1.21-alpine as builder +WORKDIR /app +COPY go.mod ./ +COPY go.sum ./ +RUN go mod download +COPY . ./ +RUN go build -o /usr/bin/dgate-server ./cmd/dgate-server +RUN go build -o /usr/bin/dgate-cli ./cmd/dgate-cli + +FROM alpine:latest as runner +WORKDIR /app +COPY --from=builder /usr/bin/dgate-server ./ +COPY --from=builder /usr/bin/dgate-cli ./ +COPY --from=builder /app/config.dgate.yaml ./ +EXPOSE 80 443 9080 9443 +CMD [ "./dgate-server" ] \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..63d56fd --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2023] [Joe Williams] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c623dca --- /dev/null +++ b/README.md @@ -0,0 +1,106 @@ +# DGate - Distributed API Gateway + +[![Go Report Card](https://goreportcard.com/badge/github.com/dgate-io/dgate)](https://goreportcard.com/report/github.com/dgate-io/dgate) +[![Go Reference](https://pkg.go.dev/badge/github.com/dgate-io/dgate.svg)](https://pkg.go.dev/github.com/dgate-io/dgate) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![Build Status](https://github.com/dgate-io/dgate/actions/workflows/built_test_bench.yml/badge.svg)](https://github.com/dgate-io/dgate/actions/workflows/built_test_bench.yml) +[![codecov](https://codecov.io/gh/dgate-io/dgate/graph/badge.svg?token=KIDT82HSO9)](https://codecov.io/gh/dgate-io/dgate) + + +DGate is a distributed API Gateway built for developers. DGate allows you to use JavaScript/TypeScript to modify request/response data(L7). Inpired by [k6](https://github.com/grafana/k6) and [kong](https://github.com/Kong/kong). + +> DGate is currently in development and is not ready for production use. + +## Getting Started + +Coming soon @ dgate.io/docs/getting-started + +### Prerequisites + +- Go 1.22+ + +### Installing + +```bash +go install github.com/dgate-io/dgate/cmd/dgate-server@latest +``` + +### Performance tests +``` +# requires k6 and httpie +./functional-tests/admin_tests/performance_test_prep.sh +k6 run --summary-trend-stats="min,max,med,p(99),p(99.9),p(99.99)" --out web-dashboard performance-tests/perf-test.js +``` + +## Application Architecture + +### DGate Server (dgate-server) + +DGate Server is proxy and admin server bundled into one. the admin server is responsible for managing the state of the proxy server. The proxy server is responsible for routing requests to upstream servers. The admin server can also be used to manage the state of the cluster using the Raft Consensus Algorithm. + +#### Proxy Modules + +- Fetch Upstream Module (`fetchUpstream`) - executed before the request is sent to the upstream server. This module is used to decided which upstream server to send the current request to. (Essentially a custom load balancer module) + +- Request Modifier Module (`requestModifier`) - executed before the request is sent to the upstream server. This module is used to modify the request before it is sent to the upstream server. + +- Response Modifier Module (`responseModifier`) - executed after the response is received from the upstream server. This module is used to modify the response before it is sent to the client. + +- Error Handler Module (`errorHandler`) - executed when an error occurs when sending a request to the upstream server. This module is used to modify the response before it is sent to the client. + +- Request Handler Module (`requestHandler`) - executed when a request is received from the client. This module is used to handle arbitrary requests, instead of using an upstream service. + +#### Features + +- Logs - view module logs using the Admin API +- Stats + - Track stats for each module, route, service, namespace, server and cluster + - Track request stats + - request count + - request latency + - request module latency + - request upstream latency + - request error count + - request error latency +- Testing (dgate-runtime - uses the dgate js/ts runtime to test modules) + - [ ] - Add unit testing for request handling + - [ ] - preserve host / strip path - upstream URL + - [ ] - upstream request/response headers + - [ ] - proxy request/response headers + - [ ] - Add tests for modules + - [ ] - javascript + - [ ] - typescript + - [ ] - async/await javascript/typescript + - [ ] - promises javascript/typescript +- Distributed Module Support + - [ ] - distributed module sync/async cache/storage functions + +Production Ready Checklist: +- Tests + - [ ] - Unit Tests + - changelog compaction + - [ ] - Functional Tests + - admin tests + - raft tests + - module tests (needs to be single executable) + - grpc tests (needs to be single executable) + - ws tests (needs to be single executable) + +- Examples + - [x] ip hash load balancer + - [x] short url service + - [x] modify json response + - [x] send multiple requests and combine the response + +- Add Module Permissions Functionality +- Add Change Versioning +- Add Change Rollback +- Add Server Tags +- Add Transactions + - [ ] - Add transactional support for admin API + +## Release Checklist +- Test multiple modules being used at the same time + - [ ] - ??? Add option to specify specific export variables + - [ ] - check for module export conflicts from different modules + - [ ] - check for global variable conflicts diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..94beeb2 --- /dev/null +++ b/TODO.md @@ -0,0 +1,121 @@ +# TODO List + +> `???` - maybe not needed + +## DGate Documentation (dgate.io/docs) + +Use Docusaurus to create the documentation for DGate. + +## DGate Admin Console + +Admin Console is a web-based interface that can be used to manage the state of the cluster. Manage resource, view logs, stats, and more. It can also be used to develop and test modules directly in the browser. + +## DGate Runtime (`???`) + +DGate Runtime is a JavaScript/TypeScript runtime that can be used to test modules. It can be used to test modules before deploying them to the cluster. + +## RuntimePool + +RuntimePool is a pool of runtimes that can be used to execute modules. It can be used to manage the different modules and clean up resources when they are no longer needed or idle for a certain amount of time. + +## TCP Proxy/Gateway (L4LB) (`???`) + +Using the same architecture as the HTTP Proxy/Gateway, create a TCP Proxy/Gateway that can be used to proxy TCP connections to upstream servers. + +### Custom Protocols API + +Allow users to define custom protocols that can be used to proxy TCP connections to upstream servers or handle the connections themselves. + +The custom protocols can be defined using JavaScript/TypeScript function or using protocol definitions (API) which will allow these values to be passed to the JavaScript/TypeScript code. + +``` +{ + "name": "custom_protocol", + "version": "1", + "description": "Custom Protocol", + "modules": ["module_x"] + "format_definitions": [ + { + "name": "command", + "type": "uint8" + } + { + "name": "data_len", + "type": "int16" + } + { + "name": "data", + "type": "string", + "length": "variable.data_len.length" + } + ] +} +``` + +## Server Tags + +No special characters are allowed in the tag name or value +- key:value +- value + +canary tags +canary@0.01%:canary_mod + +time based tags +@(2022-01-01T00:00:00Z)#key:value + +## Resource Tags + +- name:data + - no prefix, so this tag is ignored +- #name:data + - means that the server must have these tags, for the object to be applied +- !name:data + - means that the server must not have these tags, for the object to be applied +- ?name:data1,data2 + - means that the server must have *any* of these tags, for the object to be applied +- ?*name:data1,data2 + - means that the server must have *one (and only one)* of these tags, for the object to be applied + +## Background Jobs (`???`) + +background jobs can be used to execute code periodically or on specific events. custom events can be triggered from inside modules. + +For examples, upstream health checks to make sure that the upstream server is still available. +Also to execute code on specific events, like when a new route is added, or when an http requ. + +- event listeners: intercept events and return modified/new data + - fetch (http requests made by the proxy) + - request (http requests made to the proxy) + - resource CRUD operations (namespace/domain/service/module/route/collection/document) +- execute cron jobs: @every 1m, @cron 0 0 * * *, @daily, @weekly, @monthly, @yearly +Path Parameters Extraction +Domain Parameters Extraction + +## Replace zerolog with slog + +## Add Module Permissions Functionality + +## Improve async function performance + +There is a pretty significant difference in performance when using async function. + +# Metrics + +expose metrics for the following: +- proxy server + - request count + - request latency + - request module latency + - request upstream latency + - request error count +- admin server + - request error latency + - request count + - request latency + - request error count +- modules + - request count + - request latency + - request error count + - request error latency diff --git a/cmd/dgate-cli/cmd.go b/cmd/dgate-cli/cmd.go new file mode 100644 index 0000000..327e62a --- /dev/null +++ b/cmd/dgate-cli/cmd.go @@ -0,0 +1,39 @@ +package main + +import ( + "github.com/spf13/cobra" +) + +var ( + dgateClientCmd = &cobra.Command{ + Use: "dgate-cli", + Short: "dgate-cli - a command line interface for dgate (API Gateway)", + Long: ``, + Version: "0.1.0", + SilenceErrors: true, + SilenceUsage: true, + } + targetServer string + basicAuth string + tags []string +) + +func Execute() error { + return dgateClientCmd.Execute() +} + +func init() { + dgateClientCmd.PersistentFlags().StringVarP( + &targetServer, "server", "S", + "http://localhost:9080", + "server location (default: http://localhost:9080)") + dgateClientCmd.PersistentFlags().StringVarP( + &basicAuth, "basic-auth", "A", + "", "basic auth credentials") + tags = *dgateClientCmd.PersistentFlags().StringArrayP( + "tag", "s", nil, "tag to apply to resource") + dgateClientCmd.AddCommand(namespaceCmd) + // dgateClientCmd.AddCommand(serviceCmd) + // dgateClientCmd.AddCommand(routeCmd) + // dgateClientCmd.AddCommand(moduleCmd) +} diff --git a/cmd/dgate-cli/main.go b/cmd/dgate-cli/main.go new file mode 100644 index 0000000..c6b167a --- /dev/null +++ b/cmd/dgate-cli/main.go @@ -0,0 +1,10 @@ +package main + +import "fmt" + +func main() { + err := Execute() + if err != nil { + fmt.Println(err) + } +} diff --git a/cmd/dgate-cli/namespace.go b/cmd/dgate-cli/namespace.go new file mode 100644 index 0000000..a873c91 --- /dev/null +++ b/cmd/dgate-cli/namespace.go @@ -0,0 +1,145 @@ +package main + +import ( + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/spf13/cobra" +) + +var ( + namespaceCmd = &cobra.Command{ + Use: "namespace", + Short: "", + Args: cobra.NoArgs, + } + listNamespaceCmd = &cobra.Command{ + Use: "list", + Short: "", + RunE: listNamespaces, + Args: cobra.NoArgs, + } + getNamespaceCmd = &cobra.Command{ + Use: "get", + Short: "", + RunE: getNamespace, + Args: cobra.ExactArgs(1), + } + createNamespaceCmd = &cobra.Command{ + Use: "create", + Short: "", + RunE: createNamespace, + Args: cobra.ExactArgs(1), + } + updateNamespaceCmd = &cobra.Command{ + Use: "create", + Short: "", + RunE: updateNamespace, + Args: cobra.ExactArgs(1), + } + deleteNamespaceCmd = &cobra.Command{ + Use: "delete", + Short: "", + RunE: deleteNamespace, + Args: cobra.ExactArgs(1), + } + client = &http.Client{} +) + +func listNamespaces(ccmd *cobra.Command, args []string) error { + nsUrl, err := url.JoinPath(targetServer, "namespace") + if err != nil { + return err + } + req, err := http.NewRequest("GET", nsUrl, nil) + if err != nil { + return err + } + if basicAuth != "" { + fmt.Println("Using basic authentication creds: ", basicAuth) + creds := strings.SplitN(basicAuth, ":", 2) + if len(creds) == 2 { + req.SetBasicAuth(creds[0], creds[1]) + } else { + req.SetBasicAuth(creds[0], "") + } + } else { + fmt.Println("Not using basic authentication creds: ") + } + resp, err := client.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + // read the response body + namespaceJson, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + fmt.Println(string(namespaceJson)) + return nil +} + +func getNamespace(ccmd *cobra.Command, args []string) error { + nsUrl, err := url.JoinPath(targetServer, "namespace", args[0]) + if err != nil { + return err + } + req, err := http.NewRequest("GET", nsUrl, nil) + if err != nil { + return err + } + if basicAuth != "" { + fmt.Println("Using basic authentication creds: ", basicAuth) + creds := strings.SplitN(basicAuth, ":", 2) + if len(creds) == 2 { + req.SetBasicAuth(creds[0], creds[1]) + } else { + req.SetBasicAuth(creds[0], "") + } + } else { + fmt.Println("Not using basic authentication creds: ") + } + resp, err := client.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + fmt.Println(resp.Body) + return nil +} + +func createNamespace(ccmd *cobra.Command, args []string) error { + return nil +} + +func updateNamespace(ccmd *cobra.Command, args []string) error { + ccmd.Help() + return nil +} + +func deleteNamespace(ccmd *cobra.Command, args []string) error { + ccmd.Help() + return nil +} + +func init() { + includeFlags(namespaceCmd) +} + +func includeFlags(cmd *cobra.Command) { + cmd.AddCommand(listNamespaceCmd) + cmd.AddCommand(createNamespaceCmd) + cmd.AddCommand(getNamespaceCmd) + cmd.AddCommand(updateNamespaceCmd) + cmd.AddCommand(deleteNamespaceCmd) +} diff --git a/cmd/dgate-server/main.go b/cmd/dgate-server/main.go new file mode 100644 index 0000000..e2b648f --- /dev/null +++ b/cmd/dgate-server/main.go @@ -0,0 +1,68 @@ +package main + +import ( + "fmt" + "os" + + "runtime/debug" + + "github.com/dgate-io/dgate/internal/admin" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/util" + "github.com/spf13/pflag" +) + +var version string = "dev" + +func main() { + showVersion := pflag.BoolP("version", "v", false, "print current version") + configPath := pflag.StringP("config", "c", "", "path to config file") + help := pflag.BoolP("help", "h", false, "show help") + + pflag.Parse() + + if *help { + pflag.Usage() + return + } + + // get version from build info when installed using `go install`` + buildInfo, ok := debug.ReadBuildInfo() + bversion := buildInfo.Main.Version + if ok && bversion != "" && bversion != "(devel)" { + version = buildInfo.Main.Version + } + + if version == "dev" { + version = fmt.Sprintf("dev/PID:%d", os.Getpid()) + } + + if *showVersion { + println(version) + } else { + if !util.EnvVarCheckBool("DG_DISABLE_BANNER") { + fmt.Println( + "_________________ _____ \n" + + "___ __ \\_ ____/_____ __ /_____ \n" + + "__ / / / / __ _ __ `/ __/ _ \\\n" + + "_ /_/ // /_/ / / /_/ // /_ / __/\n" + + "/_____/ \\____/ \\__,_/ \\__/ \\___/ \n" + + " \n" + + "DGate - API Gateway Server (" + version + ")\n" + + "-----------------------------------\n", + ) + } + dgateConfig, err := config.LoadConfig(*configPath) + if err != nil { + panic(err) + } + + proxyState, err := proxy.StartProxyGateway(dgateConfig) + if err != nil { + panic(err) + } + + admin.StartAdminAPI(dgateConfig, proxyState) + } +} diff --git a/config.dgate.yaml b/config.dgate.yaml new file mode 100644 index 0000000..44c309e --- /dev/null +++ b/config.dgate.yaml @@ -0,0 +1,66 @@ +version: v1 +debug: true +log_level: ${LOG_LEVEL:-info} +disable_default_namespace: true +tags: + - debug +storage: + type: file + dir: .dgate/data/ +test_server: + port: 8888 + host: 0.0.0.0 + global_headers: + X-Node-Id: ${HOSTNAME:-N/A} +proxy: + port: ${PORT:-80} + host: 0.0.0.0 + enable_console_logger: true + init_resources: + namespaces: + - name: "admin" + services: + - name: "admin-svc" + namespace: "admin" + urls: + - "http://localhost:9080" + routes: + - name: "admin-rt" + paths: ["/*"] + methods: ["*"] + namespace: "admin" + service: "admin-svc" + domains: + - name: "admin" + namespace: "admin" + patterns: ["admin.*"] + tls: + port: 443 + auto_generate: true + cert_file: .lego/certificates/ufosoup.com.crt + key_file: .lego/certificates/ufosoup.com.key + client_transport: + dns_server: 8.8.8.8:53 + dns_timeout: 10s + max_conns_per_host: 1000 + max_idle_conns: 5000 + max_idle_conns_per_host: 1000 + idle_conn_timeout: 60s + tls_handshake_timeout: 10s + expect_continue_timeout: 5s + max_response_header_bytes: 4096 + write_buffer_size: 4096 + read_buffer_size: 4096 + max_conns_per_client: 1000 + disable_keep_alives: false + response_header_timeout: 10s + dial_timeout: 10s +admin: + port: 9080 + host: 0.0.0.0 + allow_list: + - "127.0.0.1" + - "127.0.0.1/8" + - "::1" + auth_method: null + diff --git a/functional-tests/admin_tests/iphash_load_balancer.ts b/functional-tests/admin_tests/iphash_load_balancer.ts new file mode 100644 index 0000000..c710991 --- /dev/null +++ b/functional-tests/admin_tests/iphash_load_balancer.ts @@ -0,0 +1,18 @@ +import { useCache, getCache, setCache } from "dgate/util"; +import { createHash } from "dgate/crypto"; + +export const fetchUpstream = async (ctx) => { + // Get the hash of the IP address in hex format + const hasher = createHash("sha1"); + // WARN: This code is vulnerable to IP spoofing attacks, do not use it in production. + const remoteAddr = ctx.request().headers.get("X-Forwarded-For") || ctx.request().remoteAddress; + const hash = hasher.update(remoteAddr).digest("hex"); + // turn the hex hash into a number by getting the first 4 characters and converting to a number + const hexHash = parseInt(hash.substr(0, 4), 16); + const upstreamUrls = ctx.service().urls + // Use the hash to select an upstream server + ctx.response().headers.add("X-Hash", hexHash + " / " + upstreamUrls.length); + ctx.response().headers.add("X-Remote-Address", remoteAddr); + return upstreamUrls[hexHash % upstreamUrls.length]; +}; + diff --git a/functional-tests/admin_tests/iphash_load_balancer_test.sh b/functional-tests/admin_tests/iphash_load_balancer_test.sh new file mode 100755 index 0000000..4bd846a --- /dev/null +++ b/functional-tests/admin_tests/iphash_load_balancer_test.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -eo xtrace + +ADMIN_URL=${ADMIN_URL:-"http://localhost:9080/api/v1"} +PROXY_URL=${PROXY_URL:-"http://localhost"} + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +CALL='http --check-status -p=mb -F' + +$CALL PUT ${ADMIN_URL}/namespace \ + name=test-lb-ns + +$CALL PUT ${ADMIN_URL}/domain \ + name=test-lb-dm \ + patterns:='["test-lb.com"]' \ + namespace=test-lb-ns + +$CALL ${ADMIN_URL}/domain + +MOD_B64="$(base64 < $DIR/iphash_load_balancer.ts)" +$CALL PUT ${ADMIN_URL}/module \ + name=printer \ + payload=$MOD_B64 \ + namespace=test-lb-ns + + +http -m PUT ${ADMIN_URL}/service \ + name=base_svc \ + urls:='["http://localhost:8888/a","http://localhost:8888/b","http://localhost:8888/c"]' \ + namespace=test-lb-ns + +$CALL PUT ${ADMIN_URL}/route \ + name=base_rt \ + paths:='["/test-lb","/hello"]' \ + methods:='["GET"]' \ + modules:='["printer"]' \ + service=base_svc \ + stripPath:=true \ + preserveHost:=true \ + namespace=test-lb-ns + +http -m -p=hbm ${PROXY_URL}/test-lb Host:test-lb.com + +http -m -p=hbm ${PROXY_URL}/test-lb Host:test-lb.com X-Forwarded-For:192.168.0.1 diff --git a/functional-tests/admin_tests/merge_responses.ts b/functional-tests/admin_tests/merge_responses.ts new file mode 100644 index 0000000..5fddad7 --- /dev/null +++ b/functional-tests/admin_tests/merge_responses.ts @@ -0,0 +1,20 @@ +import { fetch } from "dgate/http"; + +export const requestHandler = async (ctx) => { + await Promise.allSettled([ + fetch("https://httpbin.org/uuid"), + fetch("https://httpbin.org/headers"), + fetch("https://httpbin.org/user-agent"), + ]).then(async (results) => { + let baseObject = {}; + for (const result of results) { + if (result.status === "fulfilled") { + const jsonResults = await result.value.json() + console.log("INFO time", result.value._debug_time); + baseObject = {...baseObject, ...jsonResults}; + } + } + console.log("INFO fetch", JSON.stringify(baseObject)); + return ctx.response().status(200).json(baseObject); + }); +}; \ No newline at end of file diff --git a/functional-tests/admin_tests/merge_responses_test.sh b/functional-tests/admin_tests/merge_responses_test.sh new file mode 100755 index 0000000..0f217c8 --- /dev/null +++ b/functional-tests/admin_tests/merge_responses_test.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -eo xtrace + +ADMIN_URL=${ADMIN_URL:-"http://localhost:9080/api/v1"} +PROXY_URL=${PROXY_URL:-"http://localhost"} + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +CALL='http --check-status -p=mb -F' + +$CALL PUT ${ADMIN_URL}/namespace \ + name=test-ns + +$CALL PUT ${ADMIN_URL}/domain \ + name=test-dm \ + patterns:='["test.com"]' \ + namespace=test-ns + +$CALL ${ADMIN_URL}/domain + +MOD_B64="$(base64 < $DIR/merge_responses.ts)" +$CALL PUT ${ADMIN_URL}/module \ + name=printer \ + payload=$MOD_B64 \ + namespace=test-ns + + +# http -m PUT ${ADMIN_URL}/service \ +# name=base_svc \ +# urls:='["http://localhost:8888"]' \ +# namespace=test-ns + +$CALL PUT ${ADMIN_URL}/route \ + name=base_rt \ + paths:='["/test","/hello"]' \ + methods:='["GET"]' \ + modules:='["printer"]' \ + stripPath:=true \ + preserveHost:=true \ + namespace=test-ns #\ service='base_svc' + +http -m -p=hbm ${PROXY_URL}/hello Host:test.com diff --git a/functional-tests/admin_tests/modify_request.ts b/functional-tests/admin_tests/modify_request.ts new file mode 100644 index 0000000..cbaf175 --- /dev/null +++ b/functional-tests/admin_tests/modify_request.ts @@ -0,0 +1,35 @@ +import { fetch } from "dgate/http"; + +export const requestModifier = async (ctx) => { + // WARN: This code is vulnerable to IP spoofing attacks, do not use it in production. + const remoteAddr = ctx.request().headers.get("X-Forwarded-For") + || ctx.request().remoteAddress; + if (!remoteAddr) { + throw new Error("Failed to get remote address"); + } + // cache the geodata for 1 hour + // const [geodata, setGeodata] = useCache('geodata:'+remoteAddr, { ttl: 3600 }); + + const georesp = await fetch(`http://ip-api.com/json/${remoteAddr}?fields=192511`); + if (georesp.status !== 200) { + throw new Error("Failed to fetch geodata"); + } + const geodata = await georesp.json(); + if (geodata.status === "fail") { + console.error(JSON.stringify(georesp)); + throw new Error(("IP API: " + geodata?.message) ?? "Failed to fetch geodata"); + } + + const headers = ctx.request().headers; + headers.set("X-Geo-Country", geodata.country); + headers.set("X-Geo-CountryCode", geodata.countryCode); + headers.set("X-Geo-Region", geodata.regionName); + headers.set("X-Geo-RegionCode", geodata.region); + headers.set("X-Geo-City", geodata.city); + headers.set("X-Geo-Latitude", geodata.lat); + headers.set("X-Geo-Longitude", geodata.lon); + headers.set("X-Geo-Proxy", geodata.proxy); + headers.set("X-Geo-Postal", geodata.zip); + headers.set("X-Geo-ISP", geodata.isp); + headers.set("X-Geo-AS", geodata.as); +}; \ No newline at end of file diff --git a/functional-tests/admin_tests/modify_request_test.sh b/functional-tests/admin_tests/modify_request_test.sh new file mode 100755 index 0000000..c8fb616 --- /dev/null +++ b/functional-tests/admin_tests/modify_request_test.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -eo xtrace + +ADMIN_URL=${ADMIN_URL:-"http://localhost:9080/api/v1"} +PROXY_URL=${PROXY_URL:-"http://localhost"} + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +CALL='http --check-status -p=mb -F' + +$CALL PUT ${ADMIN_URL}/namespace \ + name=modify_request_test-ns + +$CALL PUT ${ADMIN_URL}/domain \ + name=modify_request_test-dm \ + patterns:='["modify_request_test.com"]' \ + namespace=modify_request_test-ns + +MOD_B64="$(base64 < $DIR/modify_request.ts)" +$CALL PUT ${ADMIN_URL}/module \ + name=printer payload=$MOD_B64 \ + namespace=modify_request_test-ns + +$CALL PUT ${ADMIN_URL}/service \ + name=base_svc \ + urls:='["http://localhost:8888"]' \ + namespace=modify_request_test-ns + +$CALL PUT ${ADMIN_URL}/route \ + name=base_rt \ + paths:='["/modify_request_test"]' \ + methods:='["GET"]' \ + modules:='["printer"]' \ + stripPath:=true \ + preserveHost:=true \ + namespace=modify_request_test-ns \ + service='base_svc' + +http -m -p=hmb ${PROXY_URL}/modify_request_test Host:modify_request_test.com X-Forwarded-For:1.1.1.1 diff --git a/functional-tests/admin_tests/modify_response.ts b/functional-tests/admin_tests/modify_response.ts new file mode 100644 index 0000000..2c44ede --- /dev/null +++ b/functional-tests/admin_tests/modify_response.ts @@ -0,0 +1,16 @@ +export const responseModifier = async (ctx) => { + return fetch("https://httpbin.org/uuid") + .then(async (res) => { + const uuidData = await res.json(); + console.log("INFO uuid", JSON.stringify(uuidData)); + const resp = ctx.upstream(); + const results = await resp.getJson(); + results.data.uuid = uuidData.uuid; + return resp.setStatus(200).setJson(results); + }); +}; + +export const errorHandler = async (ctx, error) => { + console.error("ERROR", error); + ctx.response().status(500).json({ error: error?.message ?? "Unknown error" }); +}; \ No newline at end of file diff --git a/functional-tests/admin_tests/modify_response_test.sh b/functional-tests/admin_tests/modify_response_test.sh new file mode 100755 index 0000000..8815741 --- /dev/null +++ b/functional-tests/admin_tests/modify_response_test.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -eo xtrace + +ADMIN_URL=${ADMIN_URL:-"http://localhost:9080/api/v1"} +PROXY_URL=${PROXY_URL:-"http://localhost"} + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +CALL='http --check-status -p=mb -F' + +$CALL PUT ${ADMIN_URL}/namespace \ + name=test-ns + +$CALL PUT ${ADMIN_URL}/domain \ + name=test-dm \ + patterns:='["test.com"]' \ + namespace=test-ns + +MOD_B64="$(base64 < $DIR/modify_response.ts)" +$CALL PUT ${ADMIN_URL}/module \ + name=printer payload=$MOD_B64 \ + namespace=test-ns + +$CALL PUT ${ADMIN_URL}/service \ + name=base_svc \ + urls:='["http://localhost:8888"]' \ + namespace=test-ns + +$CALL PUT ${ADMIN_URL}/route \ + name=base_rt \ + paths:='["/test","/hello"]' \ + methods:='["GET"]' \ + modules:='["printer"]' \ + stripPath:=true \ + preserveHost:=true \ + namespace=test-ns \ + service='base_svc' + +http -m -p=hmb ${PROXY_URL}/test Host:test.com diff --git a/functional-tests/admin_tests/performance_test_prep.sh b/functional-tests/admin_tests/performance_test_prep.sh new file mode 100755 index 0000000..b32b642 --- /dev/null +++ b/functional-tests/admin_tests/performance_test_prep.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +set -eo xtrace + +ADMIN_URL=${ADMIN_URL:-"http://localhost:9080/api/v1"} +PROXY_URL=${PROXY_URL:-"http://localhost"} + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +# SETUP BASE + +CALL='http --check-status -p=mb -F' + +# domain setup + +$CALL PUT ${ADMIN_URL}/namespace \ + name=test-ns1 + +$CALL PUT ${ADMIN_URL}/domain \ + name=test-dm patterns:='["dgate.dev"]' \ + namespace=test-ns1 + +$CALL PUT ${ADMIN_URL}/service \ + name=test-svc urls:='["http://localhost:8080"]' \ + namespace=test-ns1 + +MOD_B64="$(base64 < $DIR/performance_test_prep.ts)" +$CALL PUT ${ADMIN_URL}/module \ + name=test-mod payload=$MOD_B64 \ + namespace=test-ns1 + +$CALL PUT ${ADMIN_URL}/route \ + name=base-rt1 \ + service=test-svc \ + methods:='["GET"]' \ + paths:='["/svctest"]' \ + preserveHost:=false \ + stripPath:=true \ + namespace=test-ns1 + +$CALL PUT ${ADMIN_URL}/route \ + name=test-rt2 \ + paths:='["/modtest","/modview"]' \ + methods:='["GET"]' \ + modules:='["test-mod"]' \ + stripPath:=false \ + preserveHost:=false \ + namespace=test-ns1 + +$CALL PUT ${ADMIN_URL}/route \ + name=test-rt3 \ + paths:='["/blank"]' \ + methods:='["GET"]' \ + stripPath:=false \ + preserveHost:=false \ + namespace=test-ns1 + + +http ${PROXY_URL}/svctest Host:dgate.dev + +http ${PROXY_URL}/modtest Host:dgate.dev + +http ${PROXY_URL}/blank Host:dgate.dev \ No newline at end of file diff --git a/functional-tests/admin_tests/performance_test_prep.ts b/functional-tests/admin_tests/performance_test_prep.ts new file mode 100644 index 0000000..ee7be81 --- /dev/null +++ b/functional-tests/admin_tests/performance_test_prep.ts @@ -0,0 +1,15 @@ + +export const fetchUpstream = (ctx) => + console.debug("fetchUpstream:", JSON.stringify(ctx)); + +export const requestModifier = (ctx) => + console.debug("requestModifier:", JSON.stringify(ctx)); + +export const responseModifier = (ctx) => + console.debug("responseModifier:", JSON.stringify(ctx)); + +export const errorHandler = (ctx, err) => + console.debug("errorHandler:", JSON.stringify(ctx), err); + +export const requestHandler = (ctx) => + console.debug("requestHandler:", JSON.stringify(ctx)); diff --git a/functional-tests/admin_tests/raft_test.sh b/functional-tests/admin_tests/raft_test.sh new file mode 100755 index 0000000..529a2cb --- /dev/null +++ b/functional-tests/admin_tests/raft_test.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -ea + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +ADMIN_URL=${ADMIN_URL:-"http://localhost:9081/api/v1"} +PROXY_URL=${PROXY_URL:-"http://localhost:81"} + +# SETUP BASE + +# make sure we're talking to the leader +http ${ADMIN_URL}/raftadmin/VerifyLeader + +. $DIR/namespace_test.sh + +set +a \ No newline at end of file diff --git a/functional-tests/admin_tests/url_shortener.ts b/functional-tests/admin_tests/url_shortener.ts new file mode 100644 index 0000000..2ce8d82 --- /dev/null +++ b/functional-tests/admin_tests/url_shortener.ts @@ -0,0 +1,57 @@ +import { + addDocument, + getDocument, +} from "dgate/state"; +import { createHash } from "dgate/crypto"; + +export const requestHandler = async (ctx) => { + const req = ctx.request(); + const res = ctx.response(); + console.log("req", JSON.stringify(req)); + console.log("res", JSON.stringify(res)); + if (req.method == "GET") { + if (!req.query.has("id")) { + res.status(400).json({ error: "id is required" }) + return; + } + await getDocument("short_link", req.query.get("id")) + .then((doc) => { + console.log("doc", JSON.stringify(doc)); + if (!doc?.data?.url) { + res.status(404).json({ error: "not found" }); + } else { + console.log("doc", JSON.stringify(doc), req.query.encode()); + res.redirect(doc.data.url); + } + }) + .catch((e) => { + console.log("error", e, JSON.stringify(e)); + res.status(500).json({ error: e?.message }); + }); + return; + } else if (req.method == "POST") { + const hasher = createHash("sha1") + const link = req.query.get("url"); + console.log("link", link); + if (!link) { + res.status(400).json({ error: "link is required" }); + } + let hash = hasher.update(link).digest("base64rawurl"); + console.log("hash", hash); + hash = hash.slice(-8); + console.log("hash", hash); + return addDocument({ + id: hash, + collection: "short_link", + data: { + url: link, + } + }).then(() => { + res.status(201).json({ id: hash }); + }).catch((e) => { + res.status(500).json({ error: e?.message }); + }); + } else { + res.status(405).json({ error: "method not allowed" }); + } +}; \ No newline at end of file diff --git a/functional-tests/admin_tests/url_shortener_test.sh b/functional-tests/admin_tests/url_shortener_test.sh new file mode 100755 index 0000000..13414a8 --- /dev/null +++ b/functional-tests/admin_tests/url_shortener_test.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -eo xtrace + +ADMIN_URL=${ADMIN_URL:-"http://localhost:9080/api/v1"} +PROXY_URL=${PROXY_URL:-"http://localhost"} + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +CALL='http --check-status -p=mhb -F' + +$CALL PUT ${ADMIN_URL}/namespace \ + name=url_shortener-ns + +$CALL PUT ${ADMIN_URL}/domain \ + name=url_shortener-dm \ + patterns:='["url_shortener.com"]' \ + namespace=url_shortener-ns + +$CALL PUT ${ADMIN_URL}/collection \ + schema:='{"type":"object","properties":{"url":{"type":"string"}}}' \ + name=short_link \ + type=document \ + namespace=url_shortener-ns + +MOD_B64="$(base64 < $DIR/url_shortener.ts)" +$CALL PUT ${ADMIN_URL}/module \ + name=printer \ + payload=$MOD_B64 \ + namespace=url_shortener-ns + +$CALL PUT ${ADMIN_URL}/route \ + name=base_rt \ + paths:='["/test","/hello"]' \ + methods:='["GET","POST"]' \ + modules:='["printer"]' \ + stripPath:=true \ + preserveHost:=true \ + namespace=url_shortener-ns #\ service='base_svc' + +$CALL POST \ + ${PROXY_URL}/test\?url\=${PROXY_URL}/hello \ + Host:url_shortener.com + +URL_ID=$(http POST \ + ${PROXY_URL}/test\?url\=${PROXY_URL}/hello \ + Host:url_shortener.com | jq -re '.id') + +http -m -p=hbm ${PROXY_URL}/test\?id\=$URL_ID Host:url_shortener.com diff --git a/functional-tests/grpc_tests/README.md b/functional-tests/grpc_tests/README.md new file mode 100644 index 0000000..bb2138f --- /dev/null +++ b/functional-tests/grpc_tests/README.md @@ -0,0 +1,29 @@ +# gRPC Hello World + +Follow these setup to run the [quick start][] example: + + 1. Get the code: + + ```console + $ go get google.golang.org/grpc/examples/helloworld/greeter_client + $ go get google.golang.org/grpc/examples/helloworld/greeter_server + ``` + + 2. Run the server: + + ```console + $ $(go env GOPATH)/bin/greeter_server & + ``` + + 3. Run the client: + + ```console + $ $(go env GOPATH)/bin/greeter_client + Greeting: Hello world + ``` + +For more details (including instructions for making a small change to the +example code) or if you're having trouble running this example, see [Quick +Start][]. + +[quick start]: https://grpc.io/docs/languages/go/quickstart diff --git a/functional-tests/grpc_tests/cmd/greeter_client/main.go b/functional-tests/grpc_tests/cmd/greeter_client/main.go new file mode 100644 index 0000000..77ede37 --- /dev/null +++ b/functional-tests/grpc_tests/cmd/greeter_client/main.go @@ -0,0 +1,55 @@ +package main + +import ( + "context" + "crypto/tls" + "flag" + "log" + "time" + + pb "grpc_tests/helloworld" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" +) + +const ( + defaultName = "world" +) + +var ( + addr = flag.String("addr", "localhost:50051", "the address to connect to") + name = flag.String("name", defaultName, "Name to greet") + _insecure = flag.Bool("insecure", false, "Use insecure connection") +) + +func main() { + flag.Parse() + // Set up a connection to the server. + dailOpts := []grpc.DialOption{} + if *_insecure { + dailOpts = append(dailOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) + } else { + dailOpts = append(dailOpts, grpc.WithTransportCredentials( + credentials.NewTLS(&tls.Config{ + InsecureSkipVerify: true, + }), + )) + } + conn, err := grpc.Dial(*addr, dailOpts...) + if err != nil { + log.Fatalf("did not connect: %v", err) + } + defer conn.Close() + c := pb.NewGreeterClient(conn) + + // Contact the server and print out its response. + ctx, cancel := context.WithTimeout(context.Background(), time.Second*120) + defer cancel() + r, err := c.SayHello(ctx, &pb.HelloRequest{Name: *name}) + if err != nil { + log.Fatalf("could not greet: %v", err) + } + log.Printf("Greeting: %s", r.GetMessage()) +} diff --git a/functional-tests/grpc_tests/cmd/greeter_server/main.go b/functional-tests/grpc_tests/cmd/greeter_server/main.go new file mode 100644 index 0000000..7a62a9b --- /dev/null +++ b/functional-tests/grpc_tests/cmd/greeter_server/main.go @@ -0,0 +1,60 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package main implements a server for Greeter service. +package main + +import ( + "context" + "flag" + "fmt" + "log" + "net" + + "google.golang.org/grpc" + pb "google.golang.org/grpc/examples/helloworld/helloworld" +) + +var ( + port = flag.Int("port", 50051, "The server port") +) + +// server is used to implement helloworld.GreeterServer. +type server struct { + pb.UnimplementedGreeterServer +} + +// SayHello implements helloworld.GreeterServer +func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) { + log.Printf("Received: %v", in.GetName()) + return &pb.HelloReply{Message: "Hello " + in.GetName()}, nil +} + +func main() { + flag.Parse() + lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port)) + if err != nil { + log.Fatalf("failed to listen: %v", err) + } + s := grpc.NewServer() + pb.RegisterGreeterServer(s, &server{}) + log.Printf("server listening at %v", lis.Addr()) + if err := s.Serve(lis); err != nil { + log.Fatalf("failed to serve: %v", err) + } +} diff --git a/functional-tests/grpc_tests/go.mod b/functional-tests/grpc_tests/go.mod new file mode 100644 index 0000000..1e23995 --- /dev/null +++ b/functional-tests/grpc_tests/go.mod @@ -0,0 +1,17 @@ +module grpc_tests + +go 1.21 + +require ( + google.golang.org/grpc v1.59.0 + google.golang.org/grpc/examples v0.0.0-20231115232036-7935c4f75941 + google.golang.org/protobuf v1.31.0 +) + +require ( + github.com/golang/protobuf v1.5.3 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect +) diff --git a/functional-tests/grpc_tests/go.sum b/functional-tests/grpc_tests/go.sum new file mode 100644 index 0000000..b6f0863 --- /dev/null +++ b/functional-tests/grpc_tests/go.sum @@ -0,0 +1,23 @@ +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc/examples v0.0.0-20231115232036-7935c4f75941 h1:9YNaaLayg54sRRKbc83BNUQzNCJ2hoSfgSDWE40LzlM= +google.golang.org/grpc/examples v0.0.0-20231115232036-7935c4f75941/go.mod h1:j5uROIAAgi3YmtiETMt1LW0d/lHqQ7wwrIY4uGRXLQ4= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/functional-tests/grpc_tests/helloworld/helloworld.pb.go b/functional-tests/grpc_tests/helloworld/helloworld.pb.go new file mode 100644 index 0000000..9229969 --- /dev/null +++ b/functional-tests/grpc_tests/helloworld/helloworld.pb.go @@ -0,0 +1,235 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.22.0 +// source: examples/helloworld/helloworld/helloworld.proto + +package helloworld + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The request message containing the user's name. +type HelloRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *HelloRequest) Reset() { + *x = HelloRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_examples_helloworld_helloworld_helloworld_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelloRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelloRequest) ProtoMessage() {} + +func (x *HelloRequest) ProtoReflect() protoreflect.Message { + mi := &file_examples_helloworld_helloworld_helloworld_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead. +func (*HelloRequest) Descriptor() ([]byte, []int) { + return file_examples_helloworld_helloworld_helloworld_proto_rawDescGZIP(), []int{0} +} + +func (x *HelloRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// The response message containing the greetings +type HelloReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *HelloReply) Reset() { + *x = HelloReply{} + if protoimpl.UnsafeEnabled { + mi := &file_examples_helloworld_helloworld_helloworld_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelloReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelloReply) ProtoMessage() {} + +func (x *HelloReply) ProtoReflect() protoreflect.Message { + mi := &file_examples_helloworld_helloworld_helloworld_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HelloReply.ProtoReflect.Descriptor instead. +func (*HelloReply) Descriptor() ([]byte, []int) { + return file_examples_helloworld_helloworld_helloworld_proto_rawDescGZIP(), []int{1} +} + +func (x *HelloReply) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_examples_helloworld_helloworld_helloworld_proto protoreflect.FileDescriptor + +var file_examples_helloworld_helloworld_helloworld_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, + 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, + 0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0a, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x22, 0x22, 0x0a, + 0x0c, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x26, 0x0a, 0x0a, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x49, 0x0a, 0x07, 0x47, 0x72, 0x65, + 0x65, 0x74, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, + 0x12, 0x18, 0x2e, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x48, 0x65, + 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x68, 0x65, 0x6c, + 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x22, 0x00, 0x42, 0x67, 0x0a, 0x1b, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, + 0x72, 0x6c, 0x64, 0x42, 0x0f, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, + 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, + 0x6c, 0x64, 0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_examples_helloworld_helloworld_helloworld_proto_rawDescOnce sync.Once + file_examples_helloworld_helloworld_helloworld_proto_rawDescData = file_examples_helloworld_helloworld_helloworld_proto_rawDesc +) + +func file_examples_helloworld_helloworld_helloworld_proto_rawDescGZIP() []byte { + file_examples_helloworld_helloworld_helloworld_proto_rawDescOnce.Do(func() { + file_examples_helloworld_helloworld_helloworld_proto_rawDescData = protoimpl.X.CompressGZIP(file_examples_helloworld_helloworld_helloworld_proto_rawDescData) + }) + return file_examples_helloworld_helloworld_helloworld_proto_rawDescData +} + +var file_examples_helloworld_helloworld_helloworld_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_examples_helloworld_helloworld_helloworld_proto_goTypes = []interface{}{ + (*HelloRequest)(nil), // 0: helloworld.HelloRequest + (*HelloReply)(nil), // 1: helloworld.HelloReply +} +var file_examples_helloworld_helloworld_helloworld_proto_depIdxs = []int32{ + 0, // 0: helloworld.Greeter.SayHello:input_type -> helloworld.HelloRequest + 1, // 1: helloworld.Greeter.SayHello:output_type -> helloworld.HelloReply + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_examples_helloworld_helloworld_helloworld_proto_init() } +func file_examples_helloworld_helloworld_helloworld_proto_init() { + if File_examples_helloworld_helloworld_helloworld_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_examples_helloworld_helloworld_helloworld_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelloRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_examples_helloworld_helloworld_helloworld_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelloReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_examples_helloworld_helloworld_helloworld_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_examples_helloworld_helloworld_helloworld_proto_goTypes, + DependencyIndexes: file_examples_helloworld_helloworld_helloworld_proto_depIdxs, + MessageInfos: file_examples_helloworld_helloworld_helloworld_proto_msgTypes, + }.Build() + File_examples_helloworld_helloworld_helloworld_proto = out.File + file_examples_helloworld_helloworld_helloworld_proto_rawDesc = nil + file_examples_helloworld_helloworld_helloworld_proto_goTypes = nil + file_examples_helloworld_helloworld_helloworld_proto_depIdxs = nil +} diff --git a/functional-tests/grpc_tests/helloworld/helloworld.proto b/functional-tests/grpc_tests/helloworld/helloworld.proto new file mode 100644 index 0000000..692ef9d --- /dev/null +++ b/functional-tests/grpc_tests/helloworld/helloworld.proto @@ -0,0 +1,38 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option go_package = "google.golang.org/grpc/examples/helloworld/helloworld"; +option java_multiple_files = true; +option java_package = "io.grpc.examples.helloworld"; +option java_outer_classname = "HelloWorldProto"; + +package helloworld; + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// The response message containing the greetings +message HelloReply { + string message = 1; +} diff --git a/functional-tests/grpc_tests/helloworld/helloworld_grpc.pb.go b/functional-tests/grpc_tests/helloworld/helloworld_grpc.pb.go new file mode 100644 index 0000000..55e4f31 --- /dev/null +++ b/functional-tests/grpc_tests/helloworld/helloworld_grpc.pb.go @@ -0,0 +1,125 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.22.0 +// source: examples/helloworld/helloworld/helloworld.proto + +package helloworld + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Greeter_SayHello_FullMethodName = "/helloworld.Greeter/SayHello" +) + +// GreeterClient is the client API for Greeter service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GreeterClient interface { + // Sends a greeting + SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) +} + +type greeterClient struct { + cc grpc.ClientConnInterface +} + +func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient { + return &greeterClient{cc} +} + +func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { + out := new(HelloReply) + err := c.cc.Invoke(ctx, Greeter_SayHello_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GreeterServer is the server API for Greeter service. +// All implementations must embed UnimplementedGreeterServer +// for forward compatibility +type GreeterServer interface { + // Sends a greeting + SayHello(context.Context, *HelloRequest) (*HelloReply, error) + mustEmbedUnimplementedGreeterServer() +} + +// UnimplementedGreeterServer must be embedded to have forward compatible implementations. +type UnimplementedGreeterServer struct { +} + +func (UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") +} +func (UnimplementedGreeterServer) mustEmbedUnimplementedGreeterServer() {} + +// UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GreeterServer will +// result in compilation errors. +type UnsafeGreeterServer interface { + mustEmbedUnimplementedGreeterServer() +} + +func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer) { + s.RegisterService(&Greeter_ServiceDesc, srv) +} + +func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HelloRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).SayHello(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_SayHello_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Greeter_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "helloworld.Greeter", + HandlerType: (*GreeterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SayHello", + Handler: _Greeter_SayHello_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "examples/helloworld/helloworld/helloworld.proto", +} diff --git a/functional-tests/module_tests/handler.ts b/functional-tests/module_tests/handler.ts new file mode 100644 index 0000000..9c6d997 --- /dev/null +++ b/functional-tests/module_tests/handler.ts @@ -0,0 +1,19 @@ +export const requestHandler1 = (res: any, req: any) => { + res.header.add("Import-Testing", "true"); + res.header.set("Content-Type", "text/plain"); + res.header.remove("Via"); + res.status(200).send("Hello World"); +}; + +export const requestHandler2 = (res: any, req: any) => { + // 301: res.redirectPermanent("https://www.google.com"); + res.redirect("https://www.google.com"); +}; + +export const requestHandler3 = (res: any, req: any) => { + // res.sendBuffer(Buffer.from("Hello World")); +}; + +export const requestHandler4 = (res: any, req: any) => { + res.redirect("https://www.google.com"); +}; \ No newline at end of file diff --git a/functional-tests/module_tests/imports.ts b/functional-tests/module_tests/imports.ts new file mode 100644 index 0000000..15a20a8 --- /dev/null +++ b/functional-tests/module_tests/imports.ts @@ -0,0 +1,47 @@ +// Description: Example usage of the dgate library + +// fetch - make a request to a remote server (https://fetch.spec.whatwg.org/#fetch-method) +// readWriteBody - reads the body of the request and writes it back. This is useful for modifying the body of a request +// writeResponse - write the custom response +// import { fetch, readWriteBody, writeResponse } from "dgate/http"; +// namespaceCache - local server key/value storage for the current namespace +// serviceCache - local server key/value storage for the current service +// requestCache - local server key/value storage for the current request +// import { namespaceCache, serviceCache, routeCache, requestCache } from "dgate/storage"; +// useCache(string, opts):[ø,ƒ] - use the cache if it exists +// check(request) - check if the cache exists +// storage(request) - storage the response in the cache and optionally ignore the cache control headers +import { storeRequest, check, useCache } from "dgate/storage"; +// fail() - respond with a 500 error +// random(number) - generate a random string of a given length +// sleep(number) - sleep for a number of milliseconds +// import { fail, random, sleep } from "dgate/util"; +// callModule - call another module +// checkModule - check if a module exists +// import { callModule, checkModule } from "dgate/modules"; +// system - get system information +// import { sleep, fail, retry } from "dgate/util"; +// import dgate from "dgate"; + + +export const requestModifier = (res: any, req: any) => { + res.header.set("Import-Testing"); + // console.log("dgate (JSON.stringify)", JSON.stringify(dgate)); + // retry(4, (i: number) => { + // console.log("retry", i); + // sleep(0.01); + // return i > 3; + // }); + const [id, setId] = useCache('id', { + ttl: 10, + default: (): any => { + return 0; + }, + callback: (id: any): any => { + console.log("callback", id); + return id + 1; + } + }); + + console.log("After top"); +}; diff --git a/functional-tests/module_tests/printer.ts b/functional-tests/module_tests/printer.ts new file mode 100644 index 0000000..7c11f2c --- /dev/null +++ b/functional-tests/module_tests/printer.ts @@ -0,0 +1,146 @@ +import { sleep } from "dgate"; +import { fetch } from "dgate/http"; +import { useCache } from "dgate/storage"; +let i = 0; + +export const testAsync = async (host: string) => { + // sleep(1); + // throw new Error("DGate: test async"); + return host +} + +let fetchUpstream = async (svc: any, route: any, param: any): Promise => { + i += 1; + console.log( + useCache('svc', { initialValue: svc }) + ); + console.log("fetchUpstream.svc.name", svc.name); + svc.name = "test" + console.log("fetchUpstream.svc.name", svc.name); + console.log("fetchUpstream.param", JSON.stringify(param)); + console.log("fetchUpstream.svc", JSON.stringify(svc)); + return await testAsync(svc.urls[0]); +}; + +type Route = { + name: string; + path: string; + method: string; + service: string; + domain: string; + namespace: string; + request: any; + response: any; + error: any; + requestModifier: any; + responseModifier: any; + upstream: any; + timeout: number; + retry: any; + cache: any; + cors: any; + security: any; + metrics: any; + tracing: any; + logging: any; + circuitBreaker: any; + loadBalancing: any; + rateLimiting: any; + authentication: any; + authorization: any; + transformation: any; + validation: any; + monitoring: any; + alerting: any; + testing: any; + documentation: any; + custom: any; +} + +type DGateContext = { + route: Readonly; + service?: Readonly; + domain: Readonly; + namespace: Readonly; + + pathParams: Readonly>; + domainParams: Readonly>; + + request: Readonly; + response: Readonly; + + error?: Readonly; + +}; + +const requestModifier = async (ctx: DGateContext, req: any, resp: any) => { + // ctx.response.type + // Response + // DGate + // requestContext + // routeContext + // serviceContext + // namespaceContext + + const [svc,] = useCache('svc'); + // console.log("svc", JSON.stringify(svc)); + // console.log("path", req.url.path); + const [id, setId] = useCache('id', { + initialValue: 0, + reducer: (state: number, action: number) => { + // console.log("state", state); + // console.log("action", action); + return state + action; + } + }); + console.log("---", id); + setId(1); + const [_id, _] = useCache('id', { + defaultValue: 1, + }); + // console.log("id", _id); + i += 1; + // console.log("requestModifier.i", i); + // console.log("requestModifier.req", JSON.stringify(req)); + if ("/stats") { + // console.log("sleeping hi"); + // console.log("fetch", fetch); + sleep(0.01) + // const resp = await fetch("https://jsonplaceholder.typicode.com/todos/22", { + // method: "GET", + // headers: { + // "Content-Type": "application/json", + // }, + // // TODO: Implement retry + // // retry: { + // // attempts: 3, + // // delay: 1000, + // // maxDelay: 5000, + // // statusCodes: [500, 502, 503, 504], + // // }, + // }).catch((err) => { + // console.log("resp err", err); + // }); + // console.log("resp", JSON.stringify(resp), Object.keys(Math), 1); + } + // console.log(sleep, "sleep") + console.log("requestModifier.req", JSON.stringify(req)); + // console.log("requestModifier.upstream", upstream); + // console.log("requestModifier.upstream", JSON.stringify(upstream)); +}; + +let responseModifier = (res: any, req: any) => { + console.log("responseModifier.req", JSON.stringify(req)); + console.log("responseModifier.res", JSON.stringify(res)); + res.header.set("Module", "Printer"); + // i += 1; + // console.log("responseModifier.i", i); + // console.log("responseModifier.res", JSON.stringify(res)); + // console.log("responseModifier.req", JSON.stringify(req)); +}; + +export { + requestModifier, + responseModifier, + fetchUpstream, +} \ No newline at end of file diff --git a/functional-tests/raft_tests/Procfile b/functional-tests/raft_tests/Procfile new file mode 100644 index 0000000..b4374c3 --- /dev/null +++ b/functional-tests/raft_tests/Procfile @@ -0,0 +1,5 @@ +test1: go run ../../cmd/dgate-server/main.go --config test1.yaml +test2: go run ../../cmd/dgate-server/main.go --config test2.yaml +test3: go run ../../cmd/dgate-server/main.go --config test3.yaml +test4: go run ../../cmd/dgate-server/main.go --config test4_watch.yaml +test5: go run ../../cmd/dgate-server/main.go --config test5_watch.yaml diff --git a/functional-tests/raft_tests/test1.yaml b/functional-tests/raft_tests/test1.yaml new file mode 100644 index 0000000..e77e83d --- /dev/null +++ b/functional-tests/raft_tests/test1.yaml @@ -0,0 +1,65 @@ +version: v1 +debug: true +log_level: trace + +# read_only: false +tags: + - "dev" + - "internal" + - "tokyo1" +storage: + type: file + dir: .dgate/test1/data/ +stats?: + enable_request_stats: true + enable_response_stats: true + enable_transport_stats: true + enable_cache_stats: true + enable_stream_stats: true + enable_cluster_stats: true +# read_only must be true +test_server: + port: 8080 + host: 0.0.0.0 +proxy: + port: 81 + host: 0.0.0.0 + redirect_https: + - /^(.+\.)?example\.(yyy|net)$/ + allowed_domains: + - "bubba" + - "localhost" + - /^(.+\.)?example\.(yyy|com|net)$/ + client_transport: + dns_server: udp://1.1.1.1:53 + dns_timeout: 10s + max_conns_per_host: 5 + max_idle_conns: 100 + max_idle_conns_per_host: 5 + idle_conn_timeout: 60s + force_attempt_http2: false + disable_compression: false + tls_handshake_timeout: 10s + expect_continue_timeout: 5s + max_response_header_bytes: 262144 + write_buffer_size: 4096 + read_buffer_size: 4096 + max_conns_per_client: 1000 + max_body_bytes: 32768 + disable_keep_alives: false + response_header_timeout: 10s + dial_timeout: 10s +admin: + port: 9081 + host: 0.0.0.0 + # read_only: true + replication: + id: "test1" + bootstrap_cluster: true + advert_address: "localhost:9081" + cluster_address: + - "localhost:9081" + - "localhost:9082" + - "localhost:9083" + - "localhost:9084" + - "localhost:9085" \ No newline at end of file diff --git a/functional-tests/raft_tests/test2.yaml b/functional-tests/raft_tests/test2.yaml new file mode 100644 index 0000000..aa54d36 --- /dev/null +++ b/functional-tests/raft_tests/test2.yaml @@ -0,0 +1,58 @@ +version: v1 +debug: true +log_level: trace +tags: + - "dev" + - "internal" + - "tokyo1" +storage: + type: file + dir: .dgate/test2/data/ +stats?: + enable_request_stats: true + enable_response_stats: true + enable_transport_stats: true + enable_cache_stats: true + enable_stream_stats: true + enable_cluster_stats: true +# read_only must be true +proxy: + port: 82 + host: 0.0.0.0 + redirect_https: + - /^(.+\.)?example\.(yyy|net)$/ + allowed_domains: + - "bubba" + - "localhost" + - /^(.+\.)?example\.(yyy|com|net)$/ + client_transport: + dns_server: udp://1.1.1.1:53 + dns_timeout: 10s + max_conns_per_host: 1000 + max_idle_conns: 5000 + max_idle_conns_per_host: 1000 + idle_conn_timeout: 60s + force_attempt_http2: false + disable_compression: false + tls_handshake_timeout: 10s + expect_continue_timeout: 5s + max_response_header_bytes: 4096 + write_buffer_size: 4096 + read_buffer_size: 4096 + max_conns_per_client: 1000 + max_body_bytes: 32768 + disable_keep_alives: false + response_header_timeout: 10s + dial_timeout: 10s +admin: + port: 9082 + host: 0.0.0.0 + # read_only: true + replication: + id: "test2" + bootstrap_cluster: false + advert_address: "localhost:9082" + cluster_address: + - "localhost:9081" + - "localhost:9082" + - "localhost:9083" \ No newline at end of file diff --git a/functional-tests/raft_tests/test3.yaml b/functional-tests/raft_tests/test3.yaml new file mode 100644 index 0000000..6237fb9 --- /dev/null +++ b/functional-tests/raft_tests/test3.yaml @@ -0,0 +1,59 @@ +version: v1 +debug: true +log_level: trace +# read_only: false +tags: + - "dev" + - "internal" + - "tokyo1" +storage: + type: file + dir: .dgate/test3/data/ +stats?: + enable_request_stats: true + enable_response_stats: true + enable_transport_stats: true + enable_cache_stats: true + enable_stream_stats: true + enable_cluster_stats: true +# read_only must be true +proxy: + port: 83 + host: 0.0.0.0 + redirect_https: + - /^(.+\.)?example\.(yyy|net)$/ + allowed_domains: + - "bubba" + - "localhost" + - /^(.+\.)?example\.(yyy|com|net)$/ + client_transport: + dns_server: udp://1.1.1.1:53 + dns_timeout: 10s + max_conns_per_host: 1000 + max_idle_conns: 5000 + max_idle_conns_per_host: 1000 + idle_conn_timeout: 60s + force_attempt_http2: false + disable_compression: false + tls_handshake_timeout: 10s + expect_continue_timeout: 5s + max_response_header_bytes: 4096 + write_buffer_size: 4096 + read_buffer_size: 4096 + max_conns_per_client: 1000 + max_body_bytes: 32768 + disable_keep_alives: false + response_header_timeout: 10s + dial_timeout: 10s +admin: + port: 9083 + host: 0.0.0.0 + # read_only: true + replication: + id: "test3" + bootstrap_cluster: false + advert_address: "localhost:9083" + cluster_address: + - "localhost:9081" + - "localhost:9082" + - "localhost:9083" \ No newline at end of file diff --git a/functional-tests/raft_tests/test4_watch.yaml b/functional-tests/raft_tests/test4_watch.yaml new file mode 100644 index 0000000..232e4ae --- /dev/null +++ b/functional-tests/raft_tests/test4_watch.yaml @@ -0,0 +1,61 @@ +version: v1 +debug: true +log_level: info +tags: + - "dev" + - "internal" + - "tokyo1" +storage: + type: file + dir: .dgate/test4/data/ +stats?: + enable_request_stats: true + enable_response_stats: true + enable_transport_stats: true + enable_cache_stats: true + enable_stream_stats: true + enable_cluster_stats: true +# read_only must be true +proxy: + port: 84 + host: 0.0.0.0 + redirect_https: + - /^(.+\.)?example\.(yyy|net)$/ + allowed_domains: + - "bubba" + - "localhost" + - /^(.+\.)?example\.(yyy|com|net)$/ + client_transport: + dns_server: udp://1.1.1.1:53 + dns_timeout: 10s + max_conns_per_host: 1000 + max_idle_conns: 5000 + max_idle_conns_per_host: 1000 + idle_conn_timeout: 60s + force_attempt_http2: false + disable_compression: false + tls_handshake_timeout: 10s + expect_continue_timeout: 5s + max_response_header_bytes: 4096 + write_buffer_size: 4096 + read_buffer_size: 4096 + max_conns_per_client: 1000 + max_body_bytes: 32768 + disable_keep_alives: false + response_header_timeout: 10s + dial_timeout: 10s +admin: + port: 9084 + host: 0.0.0.0 + # read_only: true + replication: + bootstrap_cluster: false + id: "test4" + watch_only: true + advert_address: "localhost:9084" + cluster_address: + - "localhost:9081" + - "localhost:9082" + - "localhost:9083" + - "localhost:9084" + - "localhost:9085" \ No newline at end of file diff --git a/functional-tests/raft_tests/test5_watch.yaml b/functional-tests/raft_tests/test5_watch.yaml new file mode 100644 index 0000000..753fc41 --- /dev/null +++ b/functional-tests/raft_tests/test5_watch.yaml @@ -0,0 +1,62 @@ +version: v1 +debug: true +log_level: info +# read_only: false +tags: + - "dev" + - "internal" + - "tokyo1" +storage: + type: file + dir: .dgate/test5/data/ +stats?: + enable_request_stats: true + enable_response_stats: true + enable_transport_stats: true + enable_cache_stats: true + enable_stream_stats: true + enable_cluster_stats: true +# read_only must be true +proxy: + port: 85 + host: 0.0.0.0 + redirect_https: + - /^(.+\.)?example\.(yyy|net)$/ + allowed_domains: + - "bubba" + - "localhost" + - /^(.+\.)?example\.(yyy|com|net)$/ + client_transport: + dns_server: udp://1.1.1.1:53 + dns_timeout: 10s + max_conns_per_host: 1000 + max_idle_conns: 5000 + max_idle_conns_per_host: 1000 + idle_conn_timeout: 60s + force_attempt_http2: false + disable_compression: false + tls_handshake_timeout: 10s + expect_continue_timeout: 5s + max_response_header_bytes: 4096 + write_buffer_size: 4096 + read_buffer_size: 4096 + max_conns_per_client: 1000 + max_body_bytes: 32768 + disable_keep_alives: false + response_header_timeout: 10s + dial_timeout: 10s +admin: + port: 9085 + host: 0.0.0.0 + # read_only: true + replication: + bootstrap_cluster: false + id: "test5" + watch_only: true + advert_address: "localhost:9085" + cluster_address: + - "localhost:9081" + - "localhost:9082" + - "localhost:9083" + - "localhost:9084" + - "localhost:9085" \ No newline at end of file diff --git a/functional-tests/ws_tests/cmd/client/client.go b/functional-tests/ws_tests/cmd/client/client.go new file mode 100644 index 0000000..50e64cc --- /dev/null +++ b/functional-tests/ws_tests/cmd/client/client.go @@ -0,0 +1,103 @@ +package main + +import ( + "crypto/tls" + "flag" + "log" + "net/url" + "os" + "os/signal" + "time" + + "github.com/gorilla/websocket" +) + +var addr = flag.String("addr", "ws://localhost:18080", "http service address") + +func main() { + flag.Parse() + log.SetFlags(0) + + interrupt := make(chan os.Signal, 1) + signal.Notify(interrupt, os.Interrupt) + + u, err := url.Parse(*addr) + if err != nil { + log.Fatal(err) + } + if u.Scheme == "" || u.Scheme == "http" { + u.Scheme = "ws" + } + if u.Scheme == "https" { + u.Scheme = "wss" + } + u.Path = "/todo" + log.Printf("connecting to %s", u.String()) + dailer := websocket.DefaultDialer + dailer.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: true, + } + c, _, err := dailer.Dial(u.String(), nil) + if err != nil { + log.Fatal("dial:", err) + } + defer c.Close() + + done := make(chan struct{}) + + timeLimit := time.After(time.Second * 5) + go func() { + defer close(done) + for { + select { + case <-timeLimit: + return + default: + _, message, err := c.ReadMessage() + if err != nil { + log.Println("read:", err) + return + } + log.Printf("recv: %s", message) + } + } + }() + + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + + for { + select { + case <-done: + return + case <-ticker.C: + err := c.WriteMessage(websocket.TextMessage, []byte("add task")) + if err != nil { + log.Println("write:", err) + return + } + err = c.WriteMessage(websocket.TextMessage, []byte("done task")) + if err != nil { + log.Println("write:", err) + return + } + case <-interrupt: + log.Println("interrupt") + + // Cleanly close the connection by sending a close message and then + // waiting (with timeout) for the server to close the connection. + err := c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) + if err != nil { + log.Println("write close:", err) + return + } + select { + case <-done: + case <-time.After(time.Second): + } + return + case <-timeLimit: + return + } + } +} diff --git a/functional-tests/ws_tests/cmd/server/server.go b/functional-tests/ws_tests/cmd/server/server.go new file mode 100644 index 0000000..27b137a --- /dev/null +++ b/functional-tests/ws_tests/cmd/server/server.go @@ -0,0 +1,88 @@ +package main + +import ( + "encoding/json" + "fmt" + "log" + "net/http" + "strings" + + "github.com/gorilla/websocket" +) + +var upgrader = websocket.Upgrader{} +var todoList []string + +func getCmd(input string) string { + inputArr := strings.Split(input, " ") + return inputArr[0] +} + +func getMessage(input string) string { + inputArr := strings.Split(input, " ") + var result string + for i := 1; i < len(inputArr); i++ { + result += inputArr[i] + } + return result +} + +func updateTodoList(input string) { + tmpList := todoList + todoList = []string{} + for _, val := range tmpList { + if val == input { + continue + } + todoList = append(todoList, val) + } +} + +func main() { + upgrader.CheckOrigin = func(r *http.Request) bool { return true } + http.HandleFunc("/todo", func(w http.ResponseWriter, r *http.Request) { + headers, _ := json.MarshalIndent(r.Header, "", " ") + fmt.Println("Headers", string(headers)) + // Upgrade upgrades the HTTP server connection to the WebSocket protocol. + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + log.Print("upgrade failed: ", err) + return + } + defer conn.Close() + + // Continuosly read and write message + for { + mt, message, err := conn.ReadMessage() + if err != nil { + log.Println("read failed:", err) + break + } + input := string(message) + cmd := getCmd(input) + msg := getMessage(input) + if cmd == "add" { + todoList = append(todoList, msg) + } else if cmd == "done" { + updateTodoList(msg) + } + output := "Current Todos: \n" + for _, todo := range todoList { + output += "\n - " + todo + "\n" + } + output += "\n----------------------------------------" + message = []byte(output) + err = conn.WriteMessage(mt, message) + if err != nil { + log.Println("write failed:", err) + break + } + } + }) + + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "websockets.html") + }) + + http.ListenAndServe(":18080", nil) +} diff --git a/functional-tests/ws_tests/go.mod b/functional-tests/ws_tests/go.mod new file mode 100644 index 0000000..6784f74 --- /dev/null +++ b/functional-tests/ws_tests/go.mod @@ -0,0 +1,7 @@ +module dgate-ws-test + +go 1.21 + +require github.com/gorilla/websocket v1.5.1 + +require golang.org/x/net v0.18.0 // indirect diff --git a/functional-tests/ws_tests/go.sum b/functional-tests/ws_tests/go.sum new file mode 100644 index 0000000..6145ff9 --- /dev/null +++ b/functional-tests/ws_tests/go.sum @@ -0,0 +1,3 @@ +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= diff --git a/functional-tests/ws_tests/websockets.html b/functional-tests/ws_tests/websockets.html new file mode 100644 index 0000000..4d3c758 --- /dev/null +++ b/functional-tests/ws_tests/websockets.html @@ -0,0 +1,44 @@ + +
+

Go websockets TO DO LIST example

+

Available commands for todo app

+

- add [task]

+

- done [task]

+ + +

+  
+ + + \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..d1063d1 --- /dev/null +++ b/go.mod @@ -0,0 +1,73 @@ +module github.com/dgate-io/dgate + +go 1.22.0 + +require ( + github.com/clarkmcc/go-typescript v0.7.0 + github.com/dgate-io/chi-router v0.0.0-20231217131951-d154152d5115 + github.com/dgate-io/raft-badger v0.0.0-20231217131807-c5eb3f9eafa5 + github.com/dgraph-io/badger/v4 v4.2.0 + github.com/dop251/goja v0.0.0-20240220182346-e401ed450204 + github.com/dop251/goja_nodejs v0.0.0-20231122114759-e84d9a924c5c + github.com/google/uuid v1.3.1 + github.com/hashicorp/go-hclog v1.6.2 + github.com/hashicorp/raft v1.6.0 + github.com/knadh/koanf/parsers/json v0.1.0 + github.com/knadh/koanf/parsers/toml v0.1.0 + github.com/knadh/koanf/parsers/yaml v0.1.0 + github.com/knadh/koanf/providers/confmap v0.1.0 + github.com/knadh/koanf/providers/file v0.1.0 + github.com/knadh/koanf/providers/rawbytes v0.1.0 + github.com/knadh/koanf/v2 v2.0.1 + github.com/mitchellh/mapstructure v1.5.0 + github.com/montanaflynn/stats v0.7.1 + github.com/rs/zerolog v1.31.0 + github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 + github.com/spf13/cobra v1.8.0 + github.com/spf13/pflag v1.0.5 + github.com/stoewer/go-strcase v1.3.0 + github.com/stretchr/testify v1.8.4 + golang.org/x/net v0.19.0 + golang.org/x/sync v0.6.0 +) + +require ( + github.com/armon/go-metrics v0.4.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dlclark/regexp2 v1.10.0 // indirect + github.com/dop251/base64dec v0.0.0-20231022112746-c6c9f9a96217 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect + github.com/fatih/color v1.14.1 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.0.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-msgpack/v2 v2.1.1 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/klauspost/compress v1.17.0 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rogpeppe/go-internal v1.11.1-0.20231026093722-fa6a31e0812c // indirect + github.com/stretchr/objx v0.5.0 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..4035739 --- /dev/null +++ b/go.sum @@ -0,0 +1,379 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= +github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clarkmcc/go-typescript v0.7.0 h1:3nVeaPYyTCWjX6Lf8GoEOTxME2bM5tLuWmwhSZ86uxg= +github.com/clarkmcc/go-typescript v0.7.0/go.mod h1:IZ/nzoVeydAmyfX7l6Jmp8lJDOEnae3jffoXwP4UyYg= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgate-io/chi-router v0.0.0-20231217131951-d154152d5115 h1:AVEnGd1UBqJU7MnbyAtPfp47mlI5GvMS4fFNZVMS0KA= +github.com/dgate-io/chi-router v0.0.0-20231217131951-d154152d5115/go.mod h1:MyLj6L03q1t8GW/541pHuP6co58QfLppSYPS0PvLtC8= +github.com/dgate-io/raft-badger v0.0.0-20231217131807-c5eb3f9eafa5 h1:clmNs28JV+F8rV6cXhByKOvQIMWLNfIvOrBD9nxkUUE= +github.com/dgate-io/raft-badger v0.0.0-20231217131807-c5eb3f9eafa5/go.mod h1:vXdEq7albbhewiVglqyJ4+gTlGhRVVYKO4jhKv0qVuk= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0= +github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dop251/base64dec v0.0.0-20231022112746-c6c9f9a96217 h1:16iT9CBDOniJwFGPI41MbUDfEk74hFaKTqudrX8kenY= +github.com/dop251/base64dec v0.0.0-20231022112746-c6c9f9a96217/go.mod h1:eIb+f24U+eWQCIsj9D/ah+MD9UP+wdxuqzsdLD+mhGM= +github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20240220182346-e401ed450204 h1:O7I1iuzEA7SG+dK8ocOBSlYAA9jBUmCYl/Qa7ey7JAM= +github.com/dop251/goja v0.0.0-20240220182346-e401ed450204/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= +github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= +github.com/dop251/goja_nodejs v0.0.0-20231122114759-e84d9a924c5c h1:hLoodLRD4KLWIH8eyAQCLcH8EqIrjac7fCkp/fHnvuQ= +github.com/dop251/goja_nodejs v0.0.0-20231122114759-e84d9a924c5c/go.mod h1:bhGPmCgCCTSRfiMYWjpS46IDo9EUZXlsuUaPXSWGbv0= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= +github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 h1:pUa4ghanp6q4IJHwE9RwLgmVFfReJN+KbQ8ExNEUUoQ= +github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= +github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack/v2 v2.1.1 h1:xQEY9yB2wnHitoSzk/B9UjXWRQ67QKu5AOm8aFp8N3I= +github.com/hashicorp/go-msgpack/v2 v2.1.1/go.mod h1:upybraOAblm4S7rx0+jeNy+CWWhzywQsSRV5033mMu4= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/raft v1.6.0 h1:tkIAORZy2GbJ2Trp5eUSggLXDPOJLXC+JJLNMMqtgtM= +github.com/hashicorp/raft v1.6.0/go.mod h1:Xil5pDgeGwRWuX4uPUmwa+7Vagg4N804dz6mhNi6S7o= +github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/parsers/json v0.1.0 h1:dzSZl5pf5bBcW0Acnu20Djleto19T0CfHcvZ14NJ6fU= +github.com/knadh/koanf/parsers/json v0.1.0/go.mod h1:ll2/MlXcZ2BfXD6YJcjVFzhG9P0TdJ207aIBKQhV2hY= +github.com/knadh/koanf/parsers/toml v0.1.0 h1:S2hLqS4TgWZYj4/7mI5m1CQQcWurxUz6ODgOub/6LCI= +github.com/knadh/koanf/parsers/toml v0.1.0/go.mod h1:yUprhq6eo3GbyVXFFMdbfZSo928ksS+uo0FFqNMnO18= +github.com/knadh/koanf/parsers/yaml v0.1.0 h1:ZZ8/iGfRLvKSaMEECEBPM1HQslrZADk8fP1XFUxVI5w= +github.com/knadh/koanf/parsers/yaml v0.1.0/go.mod h1:cvbUDC7AL23pImuQP0oRw/hPuccrNBS2bps8asS0CwY= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/providers/file v0.1.0 h1:fs6U7nrV58d3CFAFh8VTde8TM262ObYf3ODrc//Lp+c= +github.com/knadh/koanf/providers/file v0.1.0/go.mod h1:rjJ/nHQl64iYCtAW2QQnF0eSmDEX/YZ/eNFj5yR6BvA= +github.com/knadh/koanf/providers/rawbytes v0.1.0 h1:dpzgu2KO6uf6oCb4aP05KDmKmAmI51k5pe8RYKQ0qME= +github.com/knadh/koanf/providers/rawbytes v0.1.0/go.mod h1:mMTB1/IcJ/yE++A2iEZbY1MLygX7vttU+C+S/YmPu9c= +github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= +github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= +github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.1-0.20231026093722-fa6a31e0812c h1:fPpdjePK1atuOg28PXfNSqgwf9I/qD1Hlo39JFwKBXk= +github.com/rogpeppe/go-internal v1.11.1-0.20231026093722-fa6a31e0812c/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= +github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/go.work b/go.work new file mode 100644 index 0000000..71b0758 --- /dev/null +++ b/go.work @@ -0,0 +1,7 @@ +go 1.22.0 + +use ( + ./ + ./functional-tests/grpc_tests + ./functional-tests/ws_tests +) diff --git a/go.work.sum b/go.work.sum new file mode 100644 index 0000000..34d93e1 --- /dev/null +++ b/go.work.sum @@ -0,0 +1,341 @@ +cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= +cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= +cloud.google.com/go/firestore v1.9.0 h1:IBlRyxgGySXu5VuW0RgGFlTtLukSnNkpDiEOMkQkmpA= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= +cloud.google.com/go/storage v1.14.0 h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU= +cuelabs.dev/go/oci/ociregistry v0.0.0-20231103182354-93e78c079a13 h1:zkiIe8AxZ/kDjqQN+mDKc5BxoVJOqioSdqApjc+eB1I= +cuelabs.dev/go/oci/ociregistry v0.0.0-20231103182354-93e78c079a13/go.mod h1:XGKYSMtsJWfqQYPwq51ZygxAPqpEUj/9bdg16iDPTAA= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= +github.com/AdamSLevy/jsonrpc2/v14 v14.1.0/go.mod h1:ZakZtbCXxCz82NJvq7MoREtiQesnDfrtF6RFUGzQfLo= +github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.1.0/go.mod h1:copqlcjMWc/wgQ1N2fzsJFQxDdqKGg1EQt8T5wJMOGE= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.1.0/go.mod h1:y2zXtLSMM/X5Mfawq0lOftpWn3f4V6OCsRdINsvWBPI= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc= +github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= +github.com/Azure/go-autorest/autorest/azure/auth v0.5.12/go.mod h1:84w/uV8E37feW2NCJ08uT9VBfjfUHpgLVnG2InYD6cg= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.5/go.mod h1:ADQAXrkgm7acgWVUNamOgh8YNrv4p27l3Wc55oVfpzg= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= +github.com/Sereal/Sereal/Go/sereal v0.0.0-20231009093132-b9187f1a92c6 h1:5kUcJJAKWWI82Xnp/CaU0eu5hLlHkmm9acjowSkwCd0= +github.com/Sereal/Sereal/Go/sereal v0.0.0-20231009093132-b9187f1a92c6/go.mod h1:JwrycNnC8+sZPDyzM3MQ86LvaGzSpfxg885KOOwFRW4= +github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2/go.mod h1:QlXr/TrICfQ/ANa76sLeQyhAJyNR9sEcfNuZBkY9jgY= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.1755/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= +github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= +github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= +github.com/aws/aws-sdk-go-v2/config v1.18.28/go.mod h1:nIL+4/8JdAuNHEjn/gPEXqtnS02Q3NXB/9Z7o5xE4+A= +github.com/aws/aws-sdk-go-v2/credentials v1.13.27/go.mod h1:syOqAek45ZXZp29HlnRS/BNgMIW6uiRmeuQsz4Qh2UE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.5/go.mod h1:Gj7tm95r+QsDoN2Fhuz/3npQvcZbkEf5mL70n3Xfluc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35/go.mod h1:ipR5PvpSPqIqL5Mi82BxLnfMkHVbmco8kUwO2xrCi0M= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29/go.mod h1:M/eUABlDbw2uVrdAn+UsI6M727qp2fxkp8K0ejcBDUY= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.36/go.mod h1:Rmw2M1hMVTwiUhjwMoIBFWFJMhvJbct06sSidxInkhY= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.27/go.mod h1:ZdjYvJpDlefgh8/hWelJhqgqJeodxu4SmbVsSdBlL7E= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.30/go.mod h1:qQtIBl5OVMfmeQkz8HaVyh5DzFmmFXyvK27UgIgOr4c= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29/go.mod h1:fDbkK4o7fpPXWn8YAPmTieAMuB9mk/VgvW64uaUqxd4= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.4/go.mod h1:JniVpqvw90sVjNqanGLufrVapWySL28fhBlYgl96Q/w= +github.com/aws/aws-sdk-go-v2/service/lightsail v1.27.2/go.mod h1:gQhLZrTEath4zik5ixIe6axvgY5jJrgSBDJ360Fxnco= +github.com/aws/aws-sdk-go-v2/service/route53 v1.28.4/go.mod h1:VBLWpaHvhQNeu7N9rMEf00SWeOONb/HvaDUxe/7b44k= +github.com/aws/aws-sdk-go-v2/service/s3 v1.37.0/go.mod h1:PwyKKVL0cNkC37QwLcrhyeCrAk+5bY8O2ou7USyAS2A= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.13/go.mod h1:DfX0sWuT46KpcqbMhJ9QWtxAIP1VozkDWf8VAkByjYY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.13/go.mod h1:BzqsVVFduubEmzrVtUFQQIQdFqvUItF8XUq2EnS8Wog= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.3/go.mod h1:yVGZA1CPkmUhBdA039jXNJJG7/6t+G+EBWmFq23xqnY= +github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89 h1:aPflPkRFkVwbW6dmcVqfgwp1i+UWGFH6VgR1Jim5Ygc= +github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= +github.com/chromedp/chromedp v0.9.2 h1:dKtNz4kApb06KuSXoTQIyUC2TrA0fhGDwNZf3bcgfKw= +github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs= +github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= +github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= +github.com/chzyer/logex v1.2.0 h1:+eqR0HfOetur4tgnC8ftU5imRnhi4te+BadWS95c5AM= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23 h1:dZ0/VyGgQdVGAss6Ju0dt5P0QltE0SFY5Woh6hbIfiQ= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY= +github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA= +github.com/civo/civogo v0.3.11/go.mod h1:7+GeeFwc4AYTULaEshpT2vIcl3Qq8HPoxA17viX3l6g= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= +github.com/cloudflare/cloudflare-go v0.70.0/go.mod h1:VW6GuazkaZ4xEDkFt24lkXQUsE8q7BiGqDniC2s8WEM= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY= +github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 h1:rtAn27wIbmOGUs7RIbVgPEjb31ehTVniDwPGXyMxm5U= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/cpu/goacmedns v0.1.1/go.mod h1:MuaouqEhPAHxsbqjgnck5zeghuwBP1dLnPoobeGqugQ= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= +github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892 h1:qg9VbHo1TlL0KDM0vYvBG9EY0X0Yku5WYIPoFWt8f6o= +github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892/go.mod h1:CTDl0pzVzE5DEzZhPfvhY/9sPFMQIxaJ9VAMs9AagrE= +github.com/deepmap/oapi-codegen v1.9.1/go.mod h1:PLqNAhdedP8ttRpBBkzLKU3bp+Fpy+tTgeAMlztR2cw= +github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= +github.com/dnsimple/dnsimple-go v1.2.0/go.mod h1:z/cs26v/eiRvUyXsHQBLd8lWF8+cD6GbmkPH84plM4U= +github.com/dop251/goja v0.0.0-20240220182346-e401ed450204 h1:O7I1iuzEA7SG+dK8ocOBSlYAA9jBUmCYl/Qa7ey7JAM= +github.com/dop251/goja v0.0.0-20240220182346-e401ed450204/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= +github.com/emicklei/proto v1.10.0 h1:pDGyFRVV5RvV+nkBK9iy3q67FBy9Xa7vwrOTE+g5aGw= +github.com/emicklei/proto v1.10.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= +github.com/envoyproxy/go-control-plane v0.11.1 h1:wSUXTlLfiAQRWs2F+p+EKOY9rUyis1MyGqJ2DIk5HpM= +github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/exoscale/egoscale v0.100.1/go.mod h1:BAb9p4rmyU+Wl400CJZO5270H2sXtdsZjLcm5xMKkz4= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= +github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= +github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= +github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= +github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/googleapis/enterprise-certificate-proxy v0.2.1 h1:RY7tHKZcRlk788d5WSo/e83gOyyy742E8GSs771ySpg= +github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 h1:tlyzajkF3030q6M8SvmJSemC9DTHL/xaMa18b65+JM4= +github.com/gophercloud/gophercloud v1.0.0/go.mod h1:Q8fZtyi5zZxPS/j9aj3sSxtvj41AdQMDwyo1myduD5c= +github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae/go.mod h1:wx8HMD8oQD0Ryhz6+6ykq75PJ79iPyEqYHfwZ4l7OsA= +github.com/hashicorp/consul/api v1.18.0 h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g= +github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3 h1:QlWt0KvWT0lq8MFppF9tsJGF+ynG7ztc2KIPhzRGk7s= +github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab h1:BA4a7pe6ZTd9F8kXETBoijjFJ/ntaa//1wiH9BZu4zU= +github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= +github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= +github.com/infobloxopen/infoblox-go-client v1.1.1/go.mod h1:BXiw7S2b9qJoM8MS40vfgCNB2NLHGusk1DtO16BD9zI= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= +github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= +github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= +github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= +github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= +github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= +github.com/linode/linodego v1.17.2/go.mod h1:C2iyT3Vg2O2sPxkWka4XAQ5WSUtm5LmTZ3Adw43Ra7Q= +github.com/liquidweb/go-lwApi v0.0.5/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs= +github.com/liquidweb/liquidweb-cli v0.6.9/go.mod h1:cE1uvQ+x24NGUL75D0QagOFCG8Wdvmwu8aL9TLmA/eQ= +github.com/liquidweb/liquidweb-go v1.6.3/go.mod h1:SuXXp+thr28LnjEw18AYtWwIbWMHSUiajPQs8T9c/Rc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/mimuret/golang-iij-dpf v0.9.1/go.mod h1:sl9KyOkESib9+KRD3HaGpgi1xk7eoN2+d96LCLsME2M= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= +github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= +github.com/nrdcg/auroradns v1.1.0/go.mod h1:O7tViUZbAcnykVnrGkXzIJTHoQCHcgalgAe6X1mzHfk= +github.com/nrdcg/bunny-go v0.0.0-20230728143221-c9dda82568d9/go.mod h1:HUoHXDrFvidN1NK9Wb/mZKNOfDNutKkzF2Pg71M9hHA= +github.com/nrdcg/desec v0.7.0/go.mod h1:e1uRqqKv1mJdd5+SQROAhmy75lKMphLzWIuASLkpeFY= +github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= +github.com/nrdcg/freemyip v0.2.0/go.mod h1:HjF0Yz0lSb37HD2ihIyGz9esyGcxbCrrGFLPpKevbx4= +github.com/nrdcg/goinwx v0.8.2/go.mod h1:mnMSTi7CXBu2io4DzdOBoGFA1XclD0sEPWJaDhNgkA4= +github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= +github.com/nrdcg/nodion v0.1.0/go.mod h1:inbuh3neCtIWlMPZHtEpe43TmRXxHV6+hk97iCZicms= +github.com/nrdcg/porkbun v0.2.0/go.mod h1:i0uLMn9ItFsLsSQIAeEu1wQ9/+6EvX1eQw15hulMMRw= +github.com/nzdjb/go-metaname v1.0.0/go.mod h1:0GR0LshZax1Lz4VrOrfNSE4dGvTp7HGjiemdczXT2H4= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= +github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= +github.com/ovh/go-ovh v1.4.2/go.mod h1:AkPXVtgwB6xlKblMjRKJJmjRp+ogrE7fz2lVgcQY8SY= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= +github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= +github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= +github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 h1:xoIK0ctDddBMnc74udxJYBqlo9Ylnsp1waqjLsnef20= +github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= +github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= +github.com/prometheus/client_golang v1.4.0 h1:YVIb/fVcOTMSqtqZWSKnHpSLBxu8DKgxq8z6RuBZwqI= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= +github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= +github.com/protocolbuffers/txtpbfmt v0.0.0-20230328191034-3462fbc510c0 h1:sadMIsgmHpEOGbUs6VtHBXRR1OHevnj7hLx9ZcdNGW4= +github.com/protocolbuffers/txtpbfmt v0.0.0-20230328191034-3462fbc510c0/go.mod h1:jgxiZysxFPM+iWKwQwPR+y+Jvo54ARd4EisXxKYpB5c= +github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= +github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= +github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/sacloud/api-client-go v0.2.8/go.mod h1:0CV/kWNYlS1hCNdnk6Wx7Wdg8DPFCnv0zOIzdXjeAeY= +github.com/sacloud/go-http v0.1.6/go.mod h1:oLAHoDJRkptf8sq4fE8oERLkdCh0kJWfWu+paoJY7I0= +github.com/sacloud/iaas-api-go v1.11.1/go.mod h1:uBDSa06F/V0OnoR66jGdbH0PVnCJw+NeE9RVbVgMfss= +github.com/sacloud/packages-go v0.0.9/go.mod h1:k+EEUMF2LlncjbNIJNOqLyZ9wjTESPIWIk1OA7x9j2Q= +github.com/sagikazarmark/crypt v0.9.0 h1:fipzMFW34hFUEc4D7fsLQFtE7yElkpgyS2zruedRdZk= +github.com/sagikazarmark/crypt v0.9.0/go.mod h1:RnH7sEhxfdnPm1z+XMgSLjWTEIjyK4z2dw6+4vHTMuo= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= +github.com/softlayer/softlayer-go v1.1.2/go.mod h1:hvAbzGH4LRXA6yXY8BNx99yoqZ7urfDdtl9mvBf0G+g= +github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e/go.mod h1:fKZCUVdirrxrBpwd9wb+lSoVixvpwAu8eHzbQB2tums= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.490/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.490/go.mod h1:l9q4vc1QiawUB1m3RU+87yLvrrxe54jc0w/kEl4DbSQ= +github.com/tetratelabs/wazero v1.0.2/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= +github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= +github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= +github.com/transip/gotransip/v6 v6.20.0/go.mod h1:nzv9eN2tdsUrm5nG5ZX6AugYIU4qgsMwIn2c0EZLk8c= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= +github.com/ultradns/ultradns-go-sdk v1.5.0-20230427130837-23c9b0c/go.mod h1:F4UyVEmq4/m5lAmx+GccrxyRCXmnBjzUL09JLTQFp94= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= +github.com/vinyldns/go-vinyldns v0.9.16/go.mod h1:5qIJOdmzAnatKjurI+Tl4uTus7GJKJxb+zitufjHs3Q= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/yandex-cloud/go-genproto v0.0.0-20220805142335-27b56ddae16f/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= +github.com/yandex-cloud/go-sdk v0.0.0-20220805164847-cf028e604997/go.mod h1:2CHKs/YGbCcNn/BPaCkEBwKz/FNCELi+MLILjR9RaTA= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +go.etcd.io/etcd/api/v3 v3.5.6 h1:Cy2qx3npLcYqTKqGJzMypnMv2tiRyifZJ17BlWIWA7A= +go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= +go.etcd.io/etcd/client/pkg/v3 v3.5.6 h1:TXQWYceBKqLp4sa87rcPs11SXxUA/mHwH975v+BDvLU= +go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= +go.etcd.io/etcd/client/v2 v2.305.6 h1:fIDR0p4KMjw01MJMfUIDWdQbjo06PD6CeYM5z4EHLi0= +go.etcd.io/etcd/client/v2 v2.305.6/go.mod h1:BHha8XJGe8vCIBfWBpbBLVZ4QjOIlfoouvOwydu63E0= +go.etcd.io/etcd/client/v3 v3.5.6 h1:coLs69PWCXE9G4FKquzNaSHrRyMCAXwF+IX1tAPVO8E= +go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4 h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= +golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= +golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.107.0 h1:I2SlFjD8ZWabaIFOfeEDg3pf0BHJDh6iYQ1ic3Yu/UU= +google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/ns1/ns1-go.v2 v2.7.6/go.mod h1:GMnKY+ZuoJ+lVLL+78uSTjwTz2jMazq6AfGKQOYhsPk= +gopkg.in/vmihailenco/msgpack.v2 v2.9.2 h1:gjPqo9orRVlSAH/065qw3MsFCDpH7fa1KpiizXyllY4= +gopkg.in/vmihailenco/msgpack.v2 v2.9.2/go.mod h1:/3Dn1Npt9+MYyLpYYXjInO/5jvMLamn+AEGwNEOatn8= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= +honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= +rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= +rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= +software.sslmate.com/src/go-pkcs12 v0.2.0/go.mod h1:23rNcYsMabIc1otwLpTkCCPwUq6kQsTyowttG/as0kQ= diff --git a/internal/admin/admin_api.go b/internal/admin/admin_api.go new file mode 100644 index 0000000..8c8cd73 --- /dev/null +++ b/internal/admin/admin_api.go @@ -0,0 +1,137 @@ +package admin + +import ( + "fmt" + "log" + "net/http" + "os" + "strings" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/chi-router/middleware" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/util" + "github.com/rs/zerolog" + "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" +) + +func StartAdminAPI(conf *config.DGateConfig, proxyState *proxy.ProxyState) { + if conf.AdminConfig == nil { + proxyState.Logger().Warn(). + Msg("Admin API is disabled") + // wait forever + select {} + } + + // Start HTTP Server + mux := chi.NewRouter() + configureRoutes(mux, proxyState, conf) + + // Start HTTPS Server + go func() { + if conf.AdminConfig.TLS != nil { + adminHttpsLogger := proxyState.Logger( + proxy.WithComponentLogger("admin-https"), + proxy.WithDefaultLevel(zerolog.InfoLevel), + ) + secureHostPort := fmt.Sprintf("%s:%d", + conf.AdminConfig.Host, conf.AdminConfig.TLS.Port) + secureServer := &http.Server{ + Addr: secureHostPort, + Handler: mux, + ErrorLog: log.New(adminHttpsLogger, "", 0), + } + proxyState.Logger().Info(). + Msgf("Starting secure admin api on %s", secureHostPort) + proxyState.Logger().Debug(). + Msgf("TLS Cert: %s", conf.AdminConfig.TLS.CertFile) + proxyState.Logger().Debug(). + Msgf("TLS Key: %s", conf.AdminConfig.TLS.KeyFile) + if err := secureServer.ListenAndServeTLS( + conf.AdminConfig.TLS.CertFile, + conf.AdminConfig.TLS.KeyFile, + ); err != nil { + panic(err) + } + } + }() + + // Start Test Server + if conf.TestServerConfig != nil && !conf.Debug { + proxyState.Logger().Warn(). + Msg("Test server is disabled in non-debug mode") + } else if conf.Debug && conf.TestServerConfig != nil { + go func() { + testHostPort := fmt.Sprintf("%s:%d", + conf.TestServerConfig.Host, conf.TestServerConfig.Port) + mux := chi.NewRouter() + mux.HandleFunc("/*", func(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.URL.Path, "/debug") { + // strip /debug prefix + r.URL.Path = strings.TrimPrefix(r.URL.Path, "/debug") + middleware.Profiler().ServeHTTP(w, r) + return + } + respMap := map[string]any{} + respMap["method"] = r.Method + respMap["path"] = r.URL.String() + respMap["remote_addr"] = r.RemoteAddr + respMap["host"] = r.Host + respMap["req_headers"] = r.Header + if conf.TestServerConfig.EnableEnvVars { + respMap["env"] = os.Environ() + } + respMap["global_headers"] = conf.TestServerConfig.GlobalHeaders + for k, v := range conf.TestServerConfig.GlobalHeaders { + w.Header().Set(k, v) + } + util.JsonResponse(w, http.StatusOK, respMap) + }) + + testServerLogger := proxyState.Logger( + proxy.WithComponentLogger("test-server-http"), + proxy.WithDefaultLevel(zerolog.InfoLevel), + ) + testServer := &http.Server{ + Addr: testHostPort, + Handler: mux, + ErrorLog: log.New(testServerLogger, "", 0), + } + if conf.TestServerConfig.EnableHTTP2 { + h2Server := &http2.Server{} + err := http2.ConfigureServer(testServer, h2Server) + if err != nil { + panic(err) + } + if conf.TestServerConfig.EnableH2C { + testServer.Handler = h2c.NewHandler(mux, h2Server) + } + } + proxyState.Logger().Info(). + Msgf("Starting test server on %s", testHostPort) + + if err := testServer.ListenAndServe(); err != nil { + panic(err) + } + }() + } + + adminHttpLogger := proxyState.Logger( + proxy.WithComponentLogger("admin-http"), + proxy.WithDefaultLevel(zerolog.InfoLevel), + ) + hostPort := fmt.Sprintf("%s:%d", + conf.AdminConfig.Host, conf.AdminConfig.Port) + proxyState.Logger().Info(). + Msgf("Starting admin api on %s", hostPort) + server := &http.Server{ + Addr: hostPort, + Handler: mux, + ErrorLog: log.New(adminHttpLogger, "", 0), + } + if err := server.ListenAndServe(); err != nil { + panic(err) + } +} diff --git a/internal/admin/admin_fsm.go b/internal/admin/admin_fsm.go new file mode 100644 index 0000000..1058b3a --- /dev/null +++ b/internal/admin/admin_fsm.go @@ -0,0 +1,104 @@ +package admin + +import ( + "encoding/json" + "io" + + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/hashicorp/raft" + "github.com/rs/zerolog" +) + +type dgateAdminFSM struct { + ps *proxy.ProxyState + logger zerolog.Logger +} + +var _ raft.BatchingFSM = (*dgateAdminFSM)(nil) + +func newDGateAdminFSM(ps *proxy.ProxyState) *dgateAdminFSM { + dgateFSMLogger := ps.Logger().With(). + Str("component", "dgateAdminFSM"). + Logger() + return &dgateAdminFSM{ + ps: ps, + logger: dgateFSMLogger, + } +} + +func (fsm *dgateAdminFSM) Apply(log *raft.Log) interface{} { + switch log.Type { + case raft.LogCommand: + rft := fsm.ps.Raft() + fsm.logger.Debug(). + Msgf("log cmd: %d, %v, %s - applied: %v, latest: %v", + log.Index, log.Type, log.Data, + rft.AppliedIndex(), rft.LastIndex()) + var cl spec.ChangeLog + err := json.Unmarshal(log.Data, &cl) + if err != nil { + fsm.logger.Error().Err(err). + Msg("Error unmarshalling change log") + return err + } + // find a way to apply only if latest index to save time + return fsm.ps.ProcessChangeLog(&cl, false) + case raft.LogNoop: + fsm.logger.Debug().Msg("Noop Log - current leader is still leader") + case raft.LogConfiguration: + servers := raft.DecodeConfiguration(log.Data).Servers + for i, server := range servers { + fsm.logger.Debug(). + Msgf("%d: config update - server: %s", i, server.Address) + } + case raft.LogBarrier: + fsm.ps.WaitForChanges() + default: + fsm.ps.Logger().Error(). + Msg("Unknown log type in FSM Apply") + } + return nil +} + +func (fsm *dgateAdminFSM) ApplyBatch(logs []*raft.Log) []interface{} { + fsm.logger.Debug(). + Msgf("applying log batch of %d logs", len(logs)) + results := make([]interface{}, len(logs)) + for i, log := range logs { + results[i] = fsm.Apply(log) + } + defer func() { + if err := fsm.ps.ReloadState(); err != nil { + fsm.logger.Error().Err(err). + Msg("Error reloading state") + } + }() + return results +} + +func (fsm *dgateAdminFSM) Snapshot() (raft.FSMSnapshot, error) { + return &dgateAdminState{ + snap: fsm.ps.Snapshot(), + }, nil +} + +func (fsm *dgateAdminFSM) Restore(rc io.ReadCloser) error { + defer rc.Close() + return fsm.ps.RestoreState(rc) +} + +type dgateAdminState struct { + snap *proxy.ProxySnapshot + psRef *proxy.ProxyState +} + +func (state *dgateAdminState) Persist(sink raft.SnapshotSink) error { + defer sink.Close() + return state.snap.PersistState(sink) +} + +func (state *dgateAdminState) Release() { + state.psRef = nil + state.snap = nil +} diff --git a/internal/admin/admin_raft.go b/internal/admin/admin_raft.go new file mode 100644 index 0000000..cbab821 --- /dev/null +++ b/internal/admin/admin_raft.go @@ -0,0 +1,236 @@ +package admin + +import ( + "context" + "fmt" + "net" + "net/http" + "path" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/raftadmin" + "github.com/dgate-io/dgate/pkg/rafthttp" + "github.com/dgate-io/dgate/pkg/storage" + "github.com/dgate-io/dgate/pkg/util/logger" + raftbadgerdb "github.com/dgate-io/raft-badger" + "github.com/hashicorp/raft" +) + +func setupRaft(conf *config.DGateConfig, server *chi.Mux, ps *proxy.ProxyState) { + adminConfig := conf.AdminConfig + var sstore raft.StableStore + var lstore raft.LogStore + snapstore := raft.NewInmemSnapshotStore() + switch conf.Storage.StorageType { + case config.StorageTypeMemory: + sstore = raft.NewInmemStore() + lstore = raft.NewInmemStore() + case config.StorageTypeFile: + fileConfig, err := config.StoreConfig[storage.FileStoreConfig](conf.Storage.Config) + if err != nil { + panic(fmt.Errorf("invalid config: %s", err)) + } + badgerStore, err := raftbadgerdb.NewBadgerStore( + path.Join(fileConfig.Directory, "raft"), + ) + if err != nil { + panic(err) + } + sstore = badgerStore + lstore = badgerStore + default: + panic(fmt.Errorf("invalid storage type: %s", conf.Storage.StorageType)) + } + raftId := adminConfig.Replication.RaftID + + raftConfig := adminConfig.Replication.LoadRaftConfig( + &raft.Config{ + ProtocolVersion: raft.ProtocolVersionMax, + LocalID: raft.ServerID(raftId), + HeartbeatTimeout: time.Millisecond * 8000, + ElectionTimeout: time.Second * 10, + CommitTimeout: time.Second * 5, + BatchApplyCh: true, + MaxAppendEntries: 16, + SnapshotInterval: time.Hour * 72, + LeaderLeaseTimeout: time.Millisecond * 4000, + SnapshotThreshold: 8192, + Logger: logger.NewZeroHCLogger( + ps.Logger().With(). + Str("component", "raft"). + Logger(), + ), + }, + ) + advertAddr := adminConfig.Replication.AdvertAddr + if advertAddr == "" { + advertAddr = fmt.Sprintf("%s:%d", adminConfig.Host, adminConfig.Port) + } + address := raft.ServerAddress(advertAddr) + raftHttpLogger := ps.Logger().With().Str("component", "raftHttp").Logger() + + if adminConfig.Replication.AdvertScheme != "http" && adminConfig.Replication.AdvertScheme != "https" { + panic(fmt.Errorf("invalid scheme: %s", adminConfig.Replication.AdvertScheme)) + } + + trans := rafthttp.NewHTTPTransport(address, + http.DefaultClient, raftHttpLogger, + adminConfig.Replication.AdvertScheme+ + "://(address)/raft", + ) + raftNode, err := raft.NewRaft(raftConfig, newDGateAdminFSM(ps), + lstore, sstore, snapstore, trans) + if err != nil { + panic(err) + } + + ps.EnableRaft(raftNode, raftConfig) + // Setup raft handler + server.Handle("/raft/*", trans) + + raftAdminLogger := ps.Logger().With().Str("component", "raftAdmin").Logger() + raftAdmin := raftadmin.NewRaftAdminHTTPServer( + raftNode, raftAdminLogger, + []raft.ServerAddress{address}, + ) + + // Setup handler raft + server.HandleFunc("/raftadmin/*", func(w http.ResponseWriter, r *http.Request) { + if adminConfig.Replication.SharedKey != "" { + sharedKey := r.Header.Get("X-DGate-Shared-Key") + if sharedKey != adminConfig.Replication.SharedKey { + http.Error(w, "Unauthorized", http.StatusUnauthorized) + return + } + } + raftAdmin.ServeHTTP(w, r) + }) + + configFuture := raftNode.GetConfiguration() + + if err = configFuture.Error(); err != nil { + panic(err) + } + serverConfig := configFuture.Configuration() + + ps.Logger().Debug(). + Interface("config", adminConfig). + Msg("Replication config") + + if adminConfig.Replication.BootstrapCluster { + raftNode.BootstrapCluster(raft.Configuration{ + Servers: []raft.Server{ + { + Suffrage: raft.Voter, + ID: raft.ServerID(raftId), + Address: raft.ServerAddress(adminConfig.Replication.AdvertAddr), + }, + }, + }) + } else if len(serverConfig.Servers) == 0 { + go func() { + addresses := make([]string, 0) + if adminConfig.Replication.DiscoveryDomain != "" { + ps.Logger().Debug(). + Msgf("no previous configuration found, attempting to discover cluster at %s", + adminConfig.Replication.DiscoveryDomain) + addrs, err := net.LookupHost(adminConfig.Replication.DiscoveryDomain) + if err != nil { + panic(err) + } + if len(addrs) == 0 { + panic(fmt.Errorf("no addrs found for %s", adminConfig.Replication.DiscoveryDomain)) + } + ps.Logger().Info(). + Msgf("discovered addrs: %v", addrs) + for _, addr := range addrs { + if addr[len(addr)-1] == '.' { + addr = addr[:len(addr)-1] + } + addresses = append(addresses, fmt.Sprintf("%s:%d", addr, adminConfig.Port)) + } + } + + if adminConfig.Replication.ClusterAddrs != nil && len(adminConfig.Replication.ClusterAddrs) > 0 { + addresses = append(addresses, adminConfig.Replication.ClusterAddrs...) + } + + if len(addresses) > 0 { + addresses = append(addresses, adminConfig.Replication.ClusterAddrs...) + retries := 0 + doer := func(req *http.Request) (*http.Response, error) { + req.Header.Set("User-Agent", "dgate") + if adminConfig.Replication.SharedKey != "" { + req.Header.Set("X-DGate-Shared-Key", adminConfig.Replication.SharedKey) + } + return http.DefaultClient.Do(req) + } + adminClient := raftadmin.NewHTTPAdminClient(doer, + adminConfig.Replication.AdvertScheme+"://(address)/raftadmin", + ps.Logger().With().Str("component", "raftAdminClient").Logger(), + ) + RETRY: + for _, url := range addresses { + err = adminClient.VerifyLeader(context.Background(), raft.ServerAddress(url)) + if err != nil { + if err == raftadmin.ErrNotLeader { + continue + } + if retries > 15 { + ps.Logger().Error(). + Msgf("Skipping verifying leader at %s: %s", url, err) + continue + } + retries += 1 + ps.Logger().Debug(). + Msgf("Retrying verifying leader at %s: %s", url, err) + <-time.After(3 * time.Second) + goto RETRY + } + // If this node is watch only, add it as a non-voter node, otherwise add it as a voter node + if adminConfig.WatchOnly { + ps.Logger().Debug(). + Msgf("Adding non-voter: %s", url) + resp, err := adminClient.AddNonvoter(context.Background(), raft.ServerAddress(url), &raftadmin.AddNonvoterRequest{ + ID: raftId, + Address: adminConfig.Replication.AdvertAddr, + }) + if err != nil { + panic(err) + } + if resp.Error != "" { + panic(resp.Error) + } + } else { + ps.Logger().Debug(). + Msgf("Adding voter: %s - leader: %s", + adminConfig.Replication.AdvertAddr, url) + resp, err := adminClient.AddVoter(context.Background(), raft.ServerAddress(url), &raftadmin.AddVoterRequest{ + ID: raftId, + Address: adminConfig.Replication.AdvertAddr, + }) + if err != nil { + panic(err) + } + if resp.Error != "" { + panic(resp.Error) + } + } + break + } + if err != nil { + panic(err) + } + } else { + ps.Logger().Warn(). + Msg("no admin urls specified, waiting to be added to cluster") + } + }() + } else { + ps.Logger().Debug(). + Msgf("previous configuration found - %v", serverConfig) + } +} diff --git a/internal/admin/admin_routes.go b/internal/admin/admin_routes.go new file mode 100644 index 0000000..da55e65 --- /dev/null +++ b/internal/admin/admin_routes.go @@ -0,0 +1,220 @@ +package admin + +import ( + "encoding/json" + "fmt" + "math" + "net" + "net/http" + "runtime" + "strings" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/admin/routes" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/util" + "github.com/dgate-io/dgate/pkg/util/iplist" + "github.com/hashicorp/raft" +) + +func configureRoutes(server *chi.Mux, proxyState *proxy.ProxyState, conf *config.DGateConfig) { + adminConfig := conf.AdminConfig + server.Use(func(next http.Handler) http.Handler { + ipList := iplist.NewIPList() + for _, address := range adminConfig.AllowList { + if strings.Contains(address, "/") { + err := ipList.AddCIDRString(address) + if err != nil { + panic(fmt.Sprintf("invalid cidr address in admin.allow_list: %s", address)) + } + } else { + err := ipList.AddIPString(address) + if err != nil { + panic(fmt.Sprintf("invalid ip address in admin.allow_list: %s", address)) + } + } + } + // basic auth + var userMap map[string]string + // key auth + var keyMap map[string]struct{} + + switch adminConfig.AuthMethod { + case config.AuthMethodBasicAuth: + userMap = make(map[string]string) + if len(adminConfig.BasicAuth.Users) > 0 { + for i, user := range adminConfig.BasicAuth.Users { + if user.Username == "" || user.Password == "" { + panic(fmt.Sprintf("both username and password are required: admin.basic_auth.users[%d]", i)) + } + userMap[user.Username] = user.Password + } + } + case config.AuthMethodKeyAuth: + keyMap = make(map[string]struct{}) + if adminConfig.KeyAuth != nil && len(adminConfig.KeyAuth.Keys) > 0 { + if adminConfig.KeyAuth.QueryParamName != "" && adminConfig.KeyAuth.HeaderName != "" { + panic("only one of admin.key_auth.query_param_name or admin.key_auth.header_name can be set") + } + for _, key := range adminConfig.KeyAuth.Keys { + keyMap[key] = struct{}{} + } + } + case config.AuthMethodJWTAuth: + panic("JWT Auth is not supported yet") + } + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if ipList.Len() > 0 { + remoteHost, _, err := net.SplitHostPort(r.RemoteAddr) + if err != nil { + remoteHost = r.RemoteAddr + } + allowed, err := ipList.Contains(remoteHost) + if !allowed && adminConfig.XForwardedForDepth > 0 { + xForwardedForIps := r.Header.Values("X-Forwarded-For") + count := min(adminConfig.XForwardedForDepth, len(xForwardedForIps)) + for i := 0; i < count; i++ { + allowed, err = ipList.Contains(xForwardedForIps[i]) + if err != nil { + proxyState.Logger().Error().Err(err).Msgf("error checking x-forwarded-for ip: %s", xForwardedForIps[i]) + if conf.Debug { + http.Error(w, "Bad Request: could not parse x-forwarded-for IP address", http.StatusBadRequest) + } + http.Error(w, "Bad Request", http.StatusBadRequest) + return + } + if allowed { + break + } + } + } + + if err != nil { + if conf.Debug { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + http.Error(w, "Internal Server Error", http.StatusInternalServerError) + return + } + if !allowed { + if conf.Debug { + http.Error(w, "Unauthorized IP Address: "+remoteHost, http.StatusUnauthorized) + return + } + http.Error(w, "Unauthorized", http.StatusUnauthorized) + return + } + } + // basic auth + if adminConfig.AuthMethod == config.AuthMethodBasicAuth { + if len(adminConfig.BasicAuth.Users) == 0 { + http.Error(w, "Unauthorized", http.StatusUnauthorized) + return + } + user, pass, ok := r.BasicAuth() + if userPass, userFound := userMap[user]; !ok || !userFound || userPass != pass { + w.Header().Set("WWW-Authenticate", `Basic realm="Access to DGate Admin API"`) + http.Error(w, "Unauthorized", http.StatusUnauthorized) + return + } + } else if adminConfig.KeyAuth != nil && len(adminConfig.KeyAuth.Keys) > 0 { + // key auth + var key string + if adminConfig.KeyAuth.QueryParamName != "" { + key = r.URL.Query().Get(adminConfig.KeyAuth.QueryParamName) + } else if adminConfig.KeyAuth.HeaderName != "" { + key = r.Header.Get(adminConfig.KeyAuth.HeaderName) + } else { + key = r.Header.Get("X-API-Key") + } + if _, keyFound := keyMap[key]; !keyFound { + http.Error(w, "Unauthorized", http.StatusUnauthorized) + return + } + } + raftInstance := proxyState.Raft() + if r.Method == http.MethodPut && raftInstance != nil { + leader := raftInstance.Leader() + if leader == "" { + util.JsonError(w, http.StatusServiceUnavailable, "raft: no leader") + return + } + if raftInstance.State() != raft.Leader { + r.URL.Host = string(leader) + http.Redirect(w, r, r.URL.String(), http.StatusTemporaryRedirect) + return + } + } + + next.ServeHTTP(w, r) + }) + }) + + server.Get("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/plain") + w.Header().Set("X-DGate-Raft", fmt.Sprintf("%t", proxyState.Raft() != nil)) + w.Header().Set("X-DGate-WatchOnly", fmt.Sprintf("%t", adminConfig.WatchOnly)) + w.Header().Set("X-DGate-ChangeHash", fmt.Sprintf("%d", proxyState.ChangeHash())) + w.Header().Set("X-DGate-AdminAPI", "true") + w.WriteHeader(http.StatusOK) + w.Write([]byte("DGate Admin API")) + })) + + if adminConfig.Replication != nil { + setupRaft(conf, server, proxyState) + } + if adminConfig != nil && !adminConfig.WatchOnly { + server.Route("/api/v1", func(api chi.Router) { + routes.ConfigureRouteAPI(api, proxyState, conf) + routes.ConfigureModuleAPI(api, proxyState, conf) + routes.ConfigureServiceAPI(api, proxyState, conf) + routes.ConfigureNamespaceAPI(api, proxyState, conf) + routes.ConfigureDomainAPI(api, proxyState, conf) + routes.ConfigureCollectionAPI(api, proxyState, conf) + }) + } + + server.Group(func(misc chi.Router) { + routes.ConfigureChangeLogAPI(misc, proxyState, conf) + routes.ConfigureHealthAPI(misc, proxyState, conf) + + misc.Get("/stats", func(w http.ResponseWriter, r *http.Request) { + snapshot := proxyState.Stats().Snapshot() + b, err := json.Marshal(snapshot) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + w.Write([]byte("Error getting stats: " + err.Error())) + return + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(b)) + }) + + misc.Get("/system", func(w http.ResponseWriter, r *http.Request) { + var m runtime.MemStats + runtime.ReadMemStats(&m) + systemStats := map[string]any{ + "goroutines": runtime.NumGoroutine(), + "mem_alloc_mb": bToMb(m.Alloc), + "mem_total_alloc_mb": bToMb(m.TotalAlloc), + "mem_sys_mb": bToMb(m.Sys), + "mem_num_gc": m.NumGC, + } + b, err := json.Marshal(systemStats) + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + w.Write([]byte("Error getting stats: " + err.Error())) + return + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(b)) + }) + }) +} + +func bToMb(b uint64) float64 { + v := float64(b) / 1048576 + return math.Round(v*100) / 100 +} diff --git a/internal/admin/routes/collection_routes.go b/internal/admin/routes/collection_routes.go new file mode 100644 index 0000000..28324cd --- /dev/null +++ b/internal/admin/routes/collection_routes.go @@ -0,0 +1,397 @@ +package routes + +import ( + "encoding/json" + "io" + "net/http" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util" + "github.com/santhosh-tekuri/jsonschema/v5" +) + +func ConfigureCollectionAPI(server chi.Router, proxyState *proxy.ProxyState, appConfig *config.DGateConfig) { + rm := proxyState.ResourceManager() + server.Put("/collection", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + collection := spec.Collection{} + err = json.Unmarshal(eb, &collection) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + + if collection.Name == "" { + util.JsonError(w, http.StatusBadRequest, "name is required") + return + } + + if collection.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + collection.NamespaceName = spec.DefaultNamespace.Name + } + + if oldCollection, ok := rm.GetCollection(collection.Name, collection.NamespaceName); ok { + if oldCollection.Type == spec.CollectionTypeDocument && + collection.Type == spec.CollectionTypeFetcher { + docs, err := proxyState.GetDocuments( + collection.NamespaceName, collection.Name, 0, 0) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + if len(docs) > 0 { + util.JsonError(w, http.StatusBadRequest, "one or more documents already exist for this collection, please delete existing documents before replacing") + return + } + } + } + + cl := spec.NewChangeLog(&collection, collection.NamespaceName, spec.AddCollectionCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + + if repl := proxyState.Raft(); repl != nil { + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + + util.JsonResponse(w, http.StatusCreated, spec.TransformDGateCollections( + rm.GetCollectionsByNamespace(collection.NamespaceName)...)) + }) + + server.Get("/collection", func(w http.ResponseWriter, r *http.Request) { + namespace := r.URL.Query().Get("namespace") + if namespace == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + namespace = spec.DefaultNamespace.Name + } + collections := rm.GetCollectionsByNamespace(namespace) + b, err := json.Marshal(spec.TransformDGateCollections(collections...)) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + w.Header().Set("Content-Type", "application/json") + w.Write(b) + }) + + server.Get("/document", func(w http.ResponseWriter, r *http.Request) { + namespaceName := r.URL.Query().Get("namespace") + if namespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + namespaceName = spec.DefaultNamespace.Name + } + if _, ok := rm.GetNamespace(namespaceName); !ok { + util.JsonError(w, http.StatusNotFound, "namespace not found: "+namespaceName) + return + } + collectionName := r.URL.Query().Get("collection") + if collectionName == "" { + util.JsonError(w, http.StatusBadRequest, "collection is required") + return + } + if collection, ok := rm.GetCollection(collectionName, namespaceName); !ok { + util.JsonError(w, http.StatusNotFound, "collection not found") + return + } else { + if collection.Type != spec.CollectionTypeDocument { + util.JsonError(w, http.StatusBadRequest, "collection is not a document collection") + return + } + } + limit, err := util.ParseInt(r.URL.Query().Get("limit"), 100) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "limit must be an integer") + return + } + offset, err := util.ParseInt(r.URL.Query().Get("offset"), 0) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "offset must be an integer") + return + } + docs, err := proxyState.GetDocuments(namespaceName, collectionName, offset, limit) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + b, err := json.Marshal(map[string]any{ + "documents": docs, + "limit": limit, + "offset": offset, + "count": len(docs), + "collection": collectionName, + "namespace": namespaceName, + }) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + w.Header().Set("Content-Type", "application/json") + w.Write(b) + }) + + server.Get("/document/{document_id}", func(w http.ResponseWriter, r *http.Request) { + namespaceName := r.URL.Query().Get("namespace") + if namespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + namespaceName = spec.DefaultNamespace.Name + } + documentId := chi.URLParam(r, "document_id") + if documentId == "" { + util.JsonError(w, http.StatusBadRequest, "document_id is required") + return + } + collectionName := r.URL.Query().Get("collection") + if collectionName == "" { + util.JsonError(w, http.StatusBadRequest, "collection is required") + return + } + if collection, ok := rm.GetCollection(collectionName, namespaceName); !ok { + util.JsonError(w, http.StatusNotFound, "collection not found") + return + } else { + + if collection.Type != spec.CollectionTypeDocument { + util.JsonError(w, http.StatusBadRequest, "collection is not a document collection") + return + } + } + document, err := proxyState.GetDocumentByID(namespaceName, collectionName, documentId) + if err != nil { + util.JsonError(w, http.StatusNotFound, err.Error()) + return + } + + util.JsonResponse(w, http.StatusOK, document) + }) + + server.Put("/document/{document_id}", func(w http.ResponseWriter, r *http.Request) { + namespaceName := r.URL.Query().Get("namespace") + if namespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + namespaceName = spec.DefaultNamespace.Name + } + collectionName := r.URL.Query().Get("collection") + if collectionName == "" { + util.JsonError(w, http.StatusBadRequest, "collection is required") + return + } + collection, ok := rm.GetCollection(collectionName, namespaceName) + if !ok { + util.JsonError(w, http.StatusNotFound, "collection not found") + return + } + documentId := chi.URLParam(r, "document_id") + if documentId == "" { + documentId = r.URL.Query().Get("document_id") + if documentId == "" { + util.JsonError(w, http.StatusBadRequest, "document_id is required") + return + } + } + if documentId == "" { + util.JsonError(w, http.StatusBadRequest, "document_id is required") + return + } + + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + var payloadData any + err = json.Unmarshal(eb, &payloadData) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + if collection.Type == spec.CollectionTypeDocument && collection.Schema != nil { + err := collection.Schema.Validate(payloadData) + + if err != nil { + verrs := err.(*jsonschema.ValidationError) + validationErrs := make([]string, len(verrs.Causes)) + for i, ve := range verrs.Causes { + validationErrs[i] = ve.Error() + } + util.JsonErrors(w, http.StatusBadRequest, validationErrs) + return + } + } + + doc := spec.Document{ + ID: documentId, + NamespaceName: namespaceName, + CollectionName: collectionName, + Data: payloadData, + } + + cl := spec.NewChangeLog(&doc, doc.NamespaceName, spec.AddDocumentCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + + if repl := proxyState.Raft(); repl != nil { + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + + util.JsonResponse(w, http.StatusCreated, doc) + }) + + server.Delete("/document", func(w http.ResponseWriter, r *http.Request) { + document := spec.Document{} + namespaceName := r.URL.Query().Get("namespace") + if namespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + namespaceName = spec.DefaultNamespace.Name + } + + if _, ok := rm.GetNamespace(namespaceName); !ok { + util.JsonError(w, http.StatusNotFound, "namespace not found: "+namespaceName) + return + } + + collectionName := r.URL.Query().Get("collection") + if collectionName == "" { + util.JsonError(w, http.StatusBadRequest, "collection is required") + return + } + + if _, ok := rm.GetCollection(collectionName, namespaceName); !ok { + util.JsonError(w, http.StatusNotFound, "collection not found") + return + } + + document.NamespaceName = namespaceName + document.CollectionName = collectionName + + cl := spec.NewChangeLog(&document, document.NamespaceName, spec.DeleteDocumentCommand) + err := proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + w.WriteHeader(http.StatusAccepted) + }) + + server.Delete("/document/{document_id}", func(w http.ResponseWriter, r *http.Request) { + documentId := chi.URLParam(r, "document_id") + namespaceName := r.URL.Query().Get("namespace") + if namespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + namespaceName = spec.DefaultNamespace.Name + } + collectionName := r.URL.Query().Get("collection") + if collectionName == "" { + util.JsonError(w, http.StatusBadRequest, "collection is required") + return + } + if _, ok := rm.GetCollection(collectionName, namespaceName); !ok { + util.JsonError(w, http.StatusNotFound, "collection not found") + return + } + if documentId == "" { + util.JsonError(w, http.StatusBadRequest, "document_id is required") + return + } + document, err := proxyState.GetDocumentByID(namespaceName, collectionName, documentId) + if err != nil { + util.JsonError(w, http.StatusNotFound, err.Error()) + return + } + cl := spec.NewChangeLog(document, namespaceName, spec.DeleteDocumentCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + w.WriteHeader(http.StatusAccepted) + }) + + server.Delete("/collection/{collection_name}", func(w http.ResponseWriter, r *http.Request) { + collectionName := chi.URLParam(r, "collection_name") + if collectionName == "" { + util.JsonError(w, http.StatusBadRequest, "collection_name is required") + return + } + namespaceName := r.URL.Query().Get("namespace") + if namespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + namespaceName = spec.DefaultNamespace.Name + } + var ( + collection *spec.DGateCollection + ok bool + ) + if collection, ok = rm.GetCollection(collectionName, namespaceName); !ok { + util.JsonError(w, http.StatusNotFound, "collection not found") + return + } + if collection.Type == spec.CollectionTypeDocument { + docs, err := proxyState.GetDocuments( + namespaceName, collectionName, 0, 1) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + if len(docs) > 0 { + util.JsonError(w, http.StatusBadRequest, "one or more documents already exist for this collection, please delete existing documents before deleting") + return + } + } + cl := spec.NewChangeLog(collection, namespaceName, spec.DeleteCollectionCommand) + err := proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + w.WriteHeader(http.StatusAccepted) + }) +} diff --git a/internal/admin/routes/domain_routes.go b/internal/admin/routes/domain_routes.go new file mode 100644 index 0000000..081cf4d --- /dev/null +++ b/internal/admin/routes/domain_routes.go @@ -0,0 +1,122 @@ +package routes + +import ( + "encoding/json" + "io" + "net/http" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util" +) + +func ConfigureDomainAPI(server chi.Router, proxyState *proxy.ProxyState, appConfig *config.DGateConfig) { + rm := proxyState.ResourceManager() + server.Put("/domain", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + domain := spec.Domain{} + err = json.Unmarshal(eb, &domain) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + + if domain.Name == "" { + util.JsonError(w, http.StatusBadRequest, "name is required") + return + } + if domain.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + domain.NamespaceName = spec.DefaultNamespace.Name + } + cl := spec.NewChangeLog(&domain, domain.NamespaceName, spec.AddDomainCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + + if repl := proxyState.Raft(); repl != nil { + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + util.JsonResponse(w, http.StatusCreated, spec.TransformDGateDomains(rm.GetDomainsByNamespace(domain.NamespaceName)...)) + }) + + server.Delete("/domain", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + domain := spec.Domain{} + err = json.Unmarshal(eb, &domain) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + + if domain.Name == "" { + util.JsonError(w, http.StatusBadRequest, "name is required") + return + } + + if domain.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + domain.NamespaceName = spec.DefaultNamespace.Name + } + + _, ok := rm.GetDomain(domain.Name, domain.NamespaceName) + if !ok { + util.JsonError(w, http.StatusUnprocessableEntity, "domain not found: "+domain.Name) + return + } + + cl := spec.NewChangeLog(&domain, domain.NamespaceName, spec.DeleteDomainCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + w.WriteHeader(http.StatusAccepted) + }) + + server.Get("/domain", func(w http.ResponseWriter, r *http.Request) { + nsName := r.URL.Query().Get("namespace") + var dgateDomains []*spec.DGateDomain + if nsName != "" { + if _, ok := rm.GetNamespace(nsName); !ok { + util.JsonError(w, http.StatusBadRequest, "namespace not found: "+nsName) + return + } + } else { + if !appConfig.DisableDefaultNamespace { + nsName = spec.DefaultNamespace.Name + } + } + if nsName == "" { + dgateDomains = rm.GetDomains() + } else { + dgateDomains = rm.GetDomainsByNamespace(nsName) + } + util.JsonResponse(w, http.StatusOK, spec.TransformDGateDomains(dgateDomains...)) + }) +} diff --git a/internal/admin/routes/misc_routes.go b/internal/admin/routes/misc_routes.go new file mode 100644 index 0000000..3c01593 --- /dev/null +++ b/internal/admin/routes/misc_routes.go @@ -0,0 +1,52 @@ +package routes + +import ( + "encoding/json" + "net/http" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/util" +) + +func ConfigureChangeLogAPI(server chi.Router, proxyState *proxy.ProxyState, appConfig *config.DGateConfig) { + server.Get("/changelog/hash", func(w http.ResponseWriter, r *http.Request) { + if repl := proxyState.Raft(); repl != nil { + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + b, err := json.Marshal(map[string]any{ + "hash": proxyState.ChangeHash(), + }) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(b)) + }) +} + +func ConfigureHealthAPI(server chi.Router, ps *proxy.ProxyState, _ *config.DGateConfig) { + server.Get("/healthz", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"status":"ok"}`)) + }) + + server.Get("/readyz", func(w http.ResponseWriter, r *http.Request) { + if r := ps.Raft(); r != nil { + if r.Leader() == "" { + w.WriteHeader(http.StatusServiceUnavailable) + w.Write([]byte(`{"status":"no leader"}`)) + return + } + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"status":"ok"}`)) + }) +} diff --git a/internal/admin/routes/module_routes.go b/internal/admin/routes/module_routes.go new file mode 100644 index 0000000..74b549b --- /dev/null +++ b/internal/admin/routes/module_routes.go @@ -0,0 +1,107 @@ +package routes + +import ( + "encoding/json" + "io" + "net/http" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util" +) + +func ConfigureModuleAPI(server chi.Router, proxyState *proxy.ProxyState, appConfig *config.DGateConfig) { + rm := proxyState.ResourceManager() + server.Put("/module", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + mod := spec.Module{} + err = json.Unmarshal(eb, &mod) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + if mod.Payload == "" { + util.JsonError(w, http.StatusBadRequest, "payload is required") + return + } + if mod.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + mod.NamespaceName = spec.DefaultNamespace.Name + } + if !mod.Type.Valid() { + mod.Type = spec.ModuleTypeTypescript + } + cl := spec.NewChangeLog(&mod, mod.NamespaceName, spec.AddModuleCommand) + if err = proxyState.ApplyChangeLog(cl); err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + if repl := proxyState.Raft(); repl != nil { + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + util.JsonResponse(w, http.StatusCreated, spec.TransformDGateModules( + rm.GetModulesByNamespace(mod.NamespaceName)...)) + }) + + server.Delete("/module", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + mod := spec.Module{} + err = json.Unmarshal(eb, &mod) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + if mod.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + mod.NamespaceName = spec.DefaultNamespace.Name + } + cl := spec.NewChangeLog(&mod, mod.NamespaceName, spec.DeleteModuleCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + w.WriteHeader(http.StatusAccepted) + }) + + server.Get("/module", func(w http.ResponseWriter, r *http.Request) { + nsName := r.URL.Query().Get("namespace") + if nsName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + nsName = spec.DefaultNamespace.Name + } else { + if _, ok := rm.GetNamespace(nsName); !ok { + util.JsonError(w, http.StatusBadRequest, "namespace not found: "+nsName) + return + } + } + util.JsonResponse(w, http.StatusCreated, spec.TransformDGateModules( + rm.GetModulesByNamespace(nsName)...)) + }) +} diff --git a/internal/admin/routes/namespace_routes.go b/internal/admin/routes/namespace_routes.go new file mode 100644 index 0000000..c93dde1 --- /dev/null +++ b/internal/admin/routes/namespace_routes.go @@ -0,0 +1,86 @@ +package routes + +import ( + "encoding/json" + "io" + "net/http" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util" +) + +func ConfigureNamespaceAPI(server chi.Router, proxyState *proxy.ProxyState, _ *config.DGateConfig) { + rm := proxyState.ResourceManager() + server.Put("/namespace", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + namespace := spec.Namespace{} + err = json.Unmarshal(eb, &namespace) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + + if namespace.Name == "" { + util.JsonError(w, http.StatusBadRequest, "name is required") + return + } + + cl := spec.NewChangeLog(&namespace, namespace.Name, spec.AddNamespaceCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + + if repl := proxyState.Raft(); repl != nil { + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + + util.JsonResponse(w, http.StatusCreated, spec.TransformDGateNamespaces(rm.GetNamespaces()...)) + }) + + server.Delete("/namespace", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + namespace := spec.Namespace{} + err = json.Unmarshal(eb, &namespace) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + + if namespace.Name == "" { + util.JsonError(w, http.StatusBadRequest, "name is required") + return + } + + cl := spec.NewChangeLog(&namespace, namespace.Name, spec.DeleteNamespaceCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + w.WriteHeader(http.StatusAccepted) + }) + + server.Get("/namespace", func(w http.ResponseWriter, r *http.Request) { + util.JsonResponse(w, http.StatusOK, spec.TransformDGateNamespaces(rm.GetNamespaces()...)) + }) +} diff --git a/internal/admin/routes/route_routes.go b/internal/admin/routes/route_routes.go new file mode 100644 index 0000000..3527f8e --- /dev/null +++ b/internal/admin/routes/route_routes.go @@ -0,0 +1,121 @@ +package routes + +import ( + "encoding/json" + "io" + "net/http" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util" +) + +func ConfigureRouteAPI(server chi.Router, proxyState *proxy.ProxyState, appConfig *config.DGateConfig) { + rm := proxyState.ResourceManager() + server.Put("/route", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + route := spec.Route{} + err = json.Unmarshal(eb, &route) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + + if route.Name == "" { + util.JsonError(w, http.StatusBadRequest, "name is required") + return + } + + if route.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + route.NamespaceName = spec.DefaultNamespace.Name + } + + cl := spec.NewChangeLog(&route, route.NamespaceName, spec.AddRouteCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + + if repl := proxyState.Raft(); repl != nil { + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + + util.JsonResponse(w, http.StatusCreated, spec.TransformDGateRoutes(rm.GetRoutesByNamespace(route.NamespaceName)...)) + }) + + server.Delete("/route", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + route := spec.Route{} + err = json.Unmarshal(eb, &route) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + + if route.Name == "" { + util.JsonError(w, http.StatusBadRequest, "name is required") + return + } + + if route.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + route.NamespaceName = spec.DefaultNamespace.Name + } + + cl := spec.NewChangeLog(&route, route.NamespaceName, spec.DeleteRouteCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + w.WriteHeader(http.StatusAccepted) + }) + + server.Get("/route", func(w http.ResponseWriter, r *http.Request) { + nsName := r.URL.Query().Get("namespace") + if nsName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + nsName = spec.DefaultNamespace.Name + } else { + if _, ok := rm.GetNamespace(nsName); !ok { + util.JsonError(w, http.StatusBadRequest, "namespace not found: "+nsName) + return + } + } + b, err := json.Marshal(spec.TransformDGateRoutes(rm.GetRoutesByNamespace(nsName)...)) + if err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(b)) + }) +} diff --git a/internal/admin/routes/service_routes.go b/internal/admin/routes/service_routes.go new file mode 100644 index 0000000..c4e1050 --- /dev/null +++ b/internal/admin/routes/service_routes.go @@ -0,0 +1,116 @@ +package routes + +import ( + "encoding/json" + "io" + "net/http" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util" +) + +func ConfigureServiceAPI(server chi.Router, proxyState *proxy.ProxyState, appConfig *config.DGateConfig) { + rm := proxyState.ResourceManager() + server.Put("/service", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + svc := spec.Service{} + err = json.Unmarshal(eb, &svc) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + if svc.Retries == nil { + retries := 3 + svc.Retries = &retries + } else { + if *svc.Retries < 0 { + util.JsonError(w, http.StatusBadRequest, "retries must be greater than 0") + return + } + } + if svc.RetryTimeout != nil && *svc.RetryTimeout < 0 { + util.JsonError(w, http.StatusBadRequest, "retry timeout must be greater than 0") + return + } + if svc.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + svc.NamespaceName = spec.DefaultNamespace.Name + } + cl := spec.NewChangeLog(&svc, svc.NamespaceName, spec.AddServiceCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + + if repl := proxyState.Raft(); repl != nil { + proxyState.Logger().Debug(). + Msg("Waiting for raft barrier") + future := repl.Barrier(time.Second * 5) + if err := future.Error(); err != nil { + util.JsonError(w, http.StatusInternalServerError, err.Error()) + return + } + } + util.JsonResponse(w, http.StatusCreated, spec.TransformDGateServices(rm.GetServicesByNamespace(svc.NamespaceName)...)) + }) + + server.Delete("/service", func(w http.ResponseWriter, r *http.Request) { + eb, err := io.ReadAll(r.Body) + defer r.Body.Close() + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error reading body") + return + } + svc := spec.Service{} + err = json.Unmarshal(eb, &svc) + if err != nil { + util.JsonError(w, http.StatusBadRequest, "error unmarshalling body") + return + } + if svc.NamespaceName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + svc.NamespaceName = spec.DefaultNamespace.Name + } + cl := spec.NewChangeLog(&svc, svc.NamespaceName, spec.DeleteServiceCommand) + err = proxyState.ApplyChangeLog(cl) + if err != nil { + util.JsonError(w, http.StatusBadRequest, err.Error()) + return + } + w.WriteHeader(http.StatusNoContent) + }) + + server.Get("/service", func(w http.ResponseWriter, r *http.Request) { + nsName := r.URL.Query().Get("namespace") + if nsName == "" { + if appConfig.DisableDefaultNamespace { + util.JsonError(w, http.StatusBadRequest, "namespace is required") + return + } + nsName = spec.DefaultNamespace.Name + } else { + if _, ok := rm.GetNamespace(nsName); !ok { + util.JsonError(w, http.StatusBadRequest, "namespace not found: "+nsName) + util.JsonError(w, http.StatusBadRequest, "namespace not found: "+nsName) + return + } + } + util.JsonResponse(w, http.StatusOK, spec.TransformDGateServices(rm.GetServicesByNamespace(nsName)...)) + }) +} diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..ce6b320 --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,197 @@ +package config + +import ( + "time" + + "github.com/dgate-io/dgate/pkg/spec" +) + +type ( + DGateConfig struct { + Version string `koanf:"version"` + LogLevel string `koanf:"log_level"` + Debug bool `koanf:"debug"` + Tags []string `koanf:"tags"` + Storage DGateStorageConfig `koanf:"storage"` + ProxyConfig DGateProxyConfig `koanf:"proxy"` + AdminConfig *DGateAdminConfig `koanf:"admin"` + TestServerConfig *DGateTestServerConfig `koanf:"test_server"` + DisableDefaultNamespace bool `koanf:"disable_default_namespace"` + } + + DGateProxyConfig struct { + Host string `koanf:"host"` + Port int `koanf:"port"` + TLS *DGateTLSConfig `koanf:"tls"` + EnableH2C bool `koanf:"enable_h2c"` + EnableHTTP2 bool `koanf:"enable_http2"` + EnableConsoleLogger bool `koanf:"enable_console_logger"` + RedirectHttpsDomains []string `koanf:"redirect_https"` + AllowedDomains []string `koanf:"allowed_domains"` + GlobalHeaders map[string]string `koanf:"global_headers"` + Transport DGateHttpTransportConfig `koanf:"client_transport"` + InitResources *DGateResources `koanf:"init_resources"` + DisableXForwardedHeaders bool `koanf:"disable_x_forwarded_headers"` + } + + DGateTestServerConfig struct { + Host string `koanf:"host"` + Port int `koanf:"port"` + EnableH2C bool `koanf:"enable_h2c"` + EnableHTTP2 bool `koanf:"enable_http2"` + EnableEnvVars bool `koanf:"enable_env_vars"` + GlobalHeaders map[string]string `koanf:"global_headers"` + } + + DGateNativeModulesConfig struct { + Name string `koanf:"name"` + Path string `koanf:"path"` + } + + DGateAdminConfig struct { + Host string `koanf:"host"` + Port int `koanf:"port"` + AllowList []string `koanf:"allow_list"` + XForwardedForDepth int `koanf:"x_forwarded_for_depth"` + WatchOnly bool `koanf:"watch_only"` + Replication *DGateReplicationConfig `koanf:"replication,omitempty"` + Dashboard *DGateDashboardConfig `koanf:"dashboard"` + TLS *DGateTLSConfig `koanf:"tls"` + AuthMethod AuthMethodType `koanf:"auth_method"` + BasicAuth *DGateBasicAuthConfig `koanf:"basic_auth"` + KeyAuth *DGateKeyAuthConfig `koanf:"key_auth"` + JWTAuth *DGateJWTAuthConfig `koanf:"jwt_auth"` + } + + DGateReplicationConfig struct { + RaftID string `koanf:"id"` + SharedKey string `koanf:"shared_key"` + BootstrapCluster bool `koanf:"bootstrap_cluster"` + DiscoveryDomain string `koanf:"discovery_domain"` + ClusterAddrs []string `koanf:"cluster_address"` + AdvertAddr string `koanf:"advert_address"` + AdvertScheme string `koanf:"advert_scheme"` + RaftConfig *RaftConfig `koanf:"raft_config"` + } + + RaftConfig struct { + HeartbeatTimeout time.Duration `koanf:"heartbeat_timeout"` + ElectionTimeout time.Duration `koanf:"election_timeout"` + CommitTimeout time.Duration `koanf:"commit_timeout"` + SnapshotInterval time.Duration `koanf:"snapshot_interval"` + SnapshotThreshold int `koanf:"snapshot_threshold"` + MaxAppendEntries int `koanf:"max_append_entries"` + TrailingLogs int `koanf:"trailing_logs"` + LeaderLeaseTimeout time.Duration `koanf:"leader_lease_timeout"` + } + + DGateDashboardConfig struct { + Enable bool `koanf:"enable"` + } + + AuthMethodType string + + DGateBasicAuthConfig struct { + Users []DGateUserCredentials `koanf:"users"` + } + + DGateUserCredentials struct { + Username string `koanf:"username"` + Password string `koanf:"password"` + } + + DGateKeyAuthConfig struct { + QueryParamName string `koanf:"query_param_name"` + HeaderName string `koanf:"header_name"` + Keys []string `koanf:"keys"` + } + + DGateJWTAuthConfig struct { + // HeaderName is the name of the header to extract the JWT token from + HeaderName string `koanf:"header_name"` + Algorithm string `koanf:"algorithm"` + SignatureConfig map[string]any `koanf:",remain"` + } + + AsymmetricSignatureConfig struct { + // ES256, ES384, ES512 + // PS256, PS384, PS512 + // RS256, RS384, RS512 + Algorithm string `koanf:"algorithm"` + PublicKey string `koanf:"public_key"` + PublicKeyFile string `koanf:"public_key_file"` + } + + SymmetricSignatureConfig struct { + // HS256, HS384, HS512 + Algorithm string `koanf:"algorithm"` + Key string `koanf:"key"` + } + + DGateTLSConfig struct { + Port int `koanf:"port"` + CertFile string `koanf:"cert_file"` + KeyFile string `koanf:"key_file"` + } + + DGateHttpTransportConfig struct { + DNSServer string `koanf:"dns_server"` + DNSTimeout time.Duration `koanf:"dns_timeout"` + DNSPreferGo bool `koanf:"dns_prefer_go"` + MaxIdleConns int `koanf:"max_idle_conns"` + MaxIdleConnsPerHost int `koanf:"max_idle_conns_per_host"` + MaxConnsPerHost int `koanf:"max_conns_per_host"` + IdleConnTimeout time.Duration `koanf:"idle_conn_timeout"` + ForceAttemptHttp2 bool `koanf:"force_attempt_http2"` + DisableCompression bool `koanf:"disable_compression"` + TLSHandshakeTimeout time.Duration `koanf:"tls_handshake_timeout"` + ExpectContinueTimeout time.Duration `koanf:"expect_continue_timeout"` + MaxResponseHeaderBytes int64 `koanf:"max_response_header_bytes"` + WriteBufferSize int `koanf:"write_buffer_size"` + ReadBufferSize int `koanf:"read_buffer_size"` + MaxConnsPerClient int `koanf:"max_conns_per_client"` + MaxBodyBytes int `koanf:"max_body_bytes"` + DisableKeepAlives bool `koanf:"disable_keep_alives"` + KeepAlive time.Duration `koanf:"keep_alive"` + ResponseHeaderTimeout time.Duration `koanf:"response_header_timeout"` + DialTimeout time.Duration `koanf:"dial_timeout"` + } + + DGateStorageConfig struct { + StorageType StorageType `koanf:"type"` + Config map[string]any `koanf:",remain"` + } + + DGateFileConfig struct { + Dir string `koanf:"dir"` + } + + DGateResources struct { + SkipValidation bool `koanf:"skip_validation"` + Namespaces []spec.Namespace `koanf:"namespaces"` + Services []spec.Service `koanf:"services"` + Routes []spec.Route `koanf:"routes"` + Modules []ModuleSpec `koanf:"modules"` + Domains []DomainSpec `koanf:"domains"` + Collections []spec.Collection `koanf:"-"` + Documents []spec.Document `koanf:"documents"` + } + + DomainSpec struct { + spec.Domain `koanf:",squash"` + CertFile string `koanf:"cert_file"` + KeyFile string `koanf:"key_file"` + } + + ModuleSpec struct { + spec.Module `koanf:",squash"` + PayloadFile string `koanf:"payload_file"` + } +) + +const ( + AuthMethodNone AuthMethodType = "none" + AuthMethodBasicAuth AuthMethodType = "basic" + AuthMethodKeyAuth AuthMethodType = "key" + AuthMethodJWTAuth AuthMethodType = "jwt" +) diff --git a/internal/config/configtest/config.go b/internal/config/configtest/config.go new file mode 100644 index 0000000..4c1210d --- /dev/null +++ b/internal/config/configtest/config.go @@ -0,0 +1,102 @@ +package configtest + +import ( + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/pkg/spec" +) + +func NewTestDGateConfig() *config.DGateConfig { + return &config.DGateConfig{ + LogLevel: "panic", + Debug: true, + Version: "v1", + Tags: []string{"test"}, + Storage: config.DGateStorageConfig{ + StorageType: config.StorageTypeMemory, + }, + ProxyConfig: config.DGateProxyConfig{ + Host: "localhost", + Port: 8080, + InitResources: &config.DGateResources{ + Namespaces: []spec.Namespace{ + { + Name: "test", + }, + }, + Routes: []spec.Route{ + { + Name: "test", + Paths: []string{"/", "/test"}, + Methods: []string{"GET", "PUT"}, + Modules: []string{"test"}, + ServiceName: "test", + NamespaceName: "test", + Tags: []string{"test"}, + }, + }, + Services: []spec.Service{ + { + Name: "test", + URLs: []string{"http://localhost:8080"}, + NamespaceName: "test", + Tags: []string{"test"}, + }, + }, + Modules: []config.ModuleSpec{ + { + Module: spec.Module{ + Name: "test", + NamespaceName: "test", + Payload: EmptyAsyncModuleFunctionsTS, + Tags: []string{"test"}, + }, + }, + }, + }, + }, + } +} + +func NewTest2DGateConfig() *config.DGateConfig { + return &config.DGateConfig{ + LogLevel: "panic", + Debug: true, + Version: "v1", + Tags: []string{"test"}, + Storage: config.DGateStorageConfig{ + StorageType: config.StorageTypeMemory, + }, + ProxyConfig: config.DGateProxyConfig{ + Host: "localhost", + Port: 16436, + InitResources: &config.DGateResources{ + Namespaces: []spec.Namespace{ + { + Name: "test", + }, + }, + Routes: []spec.Route{ + { + Name: "test", + Paths: []string{"/", "/test"}, + Methods: []string{"GET", "PUT"}, + Modules: []string{"test"}, + NamespaceName: "test", + Tags: []string{"test"}, + }, + }, + Modules: []config.ModuleSpec{ + { + Module: spec.Module{ + Name: "test", + NamespaceName: "test", + Payload: EmptyAsyncModuleFunctionsTS, + Tags: []string{"test"}, + }, + }, + }, + }, + }, + } +} + diff --git a/internal/config/configtest/module.go b/internal/config/configtest/module.go new file mode 100644 index 0000000..f97cd72 --- /dev/null +++ b/internal/config/configtest/module.go @@ -0,0 +1,11 @@ +package configtest + +const ( + EmptyAsyncModuleFunctionsTS = ` + export const fetchUpstream = async () => {} + export const requestModifier = async () => {} + export const responseModifier = async () => {} + export const errorHandler = async () => {} + export const requestHandler = async () => {} + ` +) diff --git a/internal/config/loader.go b/internal/config/loader.go new file mode 100644 index 0000000..952b3a6 --- /dev/null +++ b/internal/config/loader.go @@ -0,0 +1,299 @@ +package config + +import ( + "context" + "encoding/base64" + "errors" + "fmt" + "os" + "os/exec" + "path" + "regexp" + "strings" + "time" + + "github.com/dgate-io/dgate/pkg/util" + "github.com/hashicorp/raft" + kjson "github.com/knadh/koanf/parsers/json" + ktoml "github.com/knadh/koanf/parsers/toml" + kyaml "github.com/knadh/koanf/parsers/yaml" + "github.com/knadh/koanf/providers/confmap" + "github.com/knadh/koanf/providers/file" + "github.com/knadh/koanf/providers/rawbytes" + "github.com/knadh/koanf/v2" + "github.com/mitchellh/mapstructure" +) + +func LoadConfig(dgateConfigPath string) (*DGateConfig, error) { + var dgateConfigData string + if dgateConfigPath == "" { + dgateConfigPath = os.Getenv("DG_CONFIG_PATH") + dgateConfigData = os.Getenv("DG_CONFIG_DATA") + } + + configDataType := os.Getenv("DG_CONFIG_TYPE") + if configDataType == "" && dgateConfigPath != "" { + fileExt := strings.ToLower(path.Ext(dgateConfigPath)) + if fileExt == "" { + return nil, errors.New("no config file extension: set env DG_CONFIG_TYPE to json, toml or yaml") + } + configDataType = fileExt[1:] + } + + var k = koanf.New(".") + var parser koanf.Parser + + dgateConfig := &DGateConfig{} + if dgateConfigPath != "" { + parser, err := determineParser(configDataType) + if err != nil { + return nil, err + } + err = k.Load(file.Provider(dgateConfigPath), parser) + if err != nil { + return nil, fmt.Errorf("error loading '%s' with %s parser: %v", dgateConfigPath, configDataType, err) + } + } else if dgateConfigData != "" { + configFileData, err := base64.StdEncoding.DecodeString( + strings.TrimSpace(dgateConfigData)) + if err != nil { + return nil, err + } + k.Load(rawbytes.Provider(configFileData), parser) + } else { + defaultConfigExts := []string{ + "yml", "yaml", "json", "toml", + } + + var err error + for _, ext := range defaultConfigExts { + parser, err = determineParser(ext) + if err != nil { + return nil, err + } + err := k.Load(file.Provider("./config.dgate."+ext), parser) + if err == nil { + break + } + } + if err != nil { + return nil, fmt.Errorf( + "no config file: ./config.dgate.%s", + defaultConfigExts, + ) + } + } + + panicVars := []string{} + data := k.All() + if !util.EnvVarCheckBool("DG_DISABLE_SHELL_PARSER") { + commandRegex := regexp.MustCompile(`\$\((?P.*?)\)`) + shell := "/bin/sh" + if shellEnv, exists := os.LookupEnv("SHELL"); exists { + shell = shellEnv + } + resolveConfigStringPattern(data, commandRegex, func(value string, results map[string]string) (string, error) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + cmdResult, err := exec.CommandContext(ctx, shell, "-c", results["cmd"]).Output() + if err != nil { + return "", err + } + return strings.TrimSpace(string(cmdResult)), nil + }, func(results map[string]string, err error) { + panic("error on command - `" + results["cmd"] + "`: " + err.Error()) + }) + } + + if !util.EnvVarCheckBool("DG_DISABLE_ENV_PARSER") { + envVarRe := regexp.MustCompile(`\${(?P[a-zA-Z0-9_]{1,})(:-(?P.*?)?)?}`) + resolveConfigStringPattern(data, envVarRe, func(value string, results map[string]string) (string, error) { + if envVar := os.Getenv(results["var_name"]); envVar != "" { + return envVar, nil + } else if strings.Contains(value, results["var_name"]+":-") { + return results["default"], nil + } + panicVars = append(panicVars, results["var_name"]) + return "", nil + }, func(results map[string]string, err error) { + panicVars = append(panicVars, results["var_name"]) + }) + + if len(panicVars) > 0 { + panic("required env vars not set: " + strings.Join(panicVars, ", ")) + } + } + + k.Load(confmap.Provider(data, "."), nil) + + // validate configuration + var err error + kDefault(k, "log_level", "info") + err = kRequireAll(k, "version") + if err != nil { + return nil, err + } + + err = kRequireAll(k, "storage", "storage.type") + if err != nil { + return nil, err + } + if k.Get("storage.type") == "file" { + err = kRequireAll(k, "storage.dir") + if err != nil { + return nil, errors.New("if storage.type is file, " + err.Error()) + } + } + + kDefault(k, "proxy.port", 80) + kDefault(k, "proxy.enable_h2c", false) + kDefault(k, "proxy.enable_http2", false) + + if k.Get("proxy.enable_h2c") == true && + k.Get("proxy.enable_http2") == false { + return nil, errors.New("proxy: enable_h2c is true but enable_http2 is false") + } + + err = kRequireIfExists(k, "proxy.tls", "proxy.tls.port") + if err != nil { + return nil, err + } + + kDefault(k, "proxy.transport.max_idle_conns", 100) + kDefault(k, "proxy.transport.force_attempt_http2", true) + kDefault(k, "proxy.transport.idle_conn_timeout", "90s") + kDefault(k, "proxy.transport.tls_handshake_timeout", "10s") + kDefault(k, "proxy.transport.expect_continue_timeout", "1s") + if k.Exists("test_server") { + kDefault(k, "test_server.enable_h2c", true) + kDefault(k, "test_server.enable_http2", true) + if k.Get("test_server.enable_h2c") == true && + k.Get("test_server.enable_http2") == false { + panic("test_server: enable_h2c is true but enable_http2 is false") + } + } + if k.Exists("admin") { + kDefault(k, "admin.host", "127.0.0.1") + err = kRequireAll(k, "admin.port") + if err != nil { + return nil, err + } + err = kRequireIfExists(k, "admin.tls", "admin.tls.port") + if err != nil { + return nil, err + } + + if k.Exists("admin.replication") { + err = kRequireAll(k, "admin.host") + if err != nil { + return nil, err + } + err = kRequireAll(k, "admin.replication.bootstrap_cluster") + if err != nil { + return nil, err + } + defaultScheme := "http" + if k.Exists("admin.tls") { + defaultScheme = "https" + address := fmt.Sprintf("%s:%s", k.Get("admin.host"), k.Get("admin.tls.port")) + kDefault(k, "admin.replication.advert_address", address) + } else { + address := fmt.Sprintf("%s:%s", k.Get("admin.host"), k.Get("admin.port")) + kDefault(k, "admin.replication.advert_address", address) + } + kDefault(k, "admin.replication.advert_scheme", defaultScheme) + } + + if k.Exists("admin.auth_method") { + switch authMethod := k.Get("admin.auth_method"); authMethod { + case "basic": + err = kRequireAll(k, "admin.basic_auth", "admin.basic_auth.users") + case "key": + err = kRequireAll(k, "admin.key_auth.key") + case "jwt": + err = kRequireAny(k, "admin.jwt_auth.secret", "admin.jwt_auth.secret_file") + if err == nil { + err = kRequireAny(k, "admin.jwt_auth.header_name") + } + case "none", "", nil: + default: + return nil, fmt.Errorf("admin: invalid auth_method: %v", authMethod) + } + if err != nil { + return nil, err + } + } + } + + err = k.UnmarshalWithConf("", dgateConfig, koanf.UnmarshalConf{ + Tag: "koanf", + DecoderConfig: &mapstructure.DecoderConfig{ + Result: dgateConfig, + DecodeHook: mapstructure.ComposeDecodeHookFunc( + mapstructure.StringToTimeDurationHookFunc(), + StringToIntHookFunc(), + ), + }, + }) + if err != nil { + return nil, err + } + return dgateConfig, nil +} + +func determineParser(configDataType string) (koanf.Parser, error) { + switch configDataType { + case "json": + return kjson.Parser(), nil + case "toml": + return ktoml.Parser(), nil + case "yaml", "yml": + return kyaml.Parser(), nil + default: + return nil, errors.New("unknown config type: " + configDataType) + } +} + +func (config *DGateReplicationConfig) LoadRaftConfig(defaultConfig *raft.Config) *raft.Config { + rc := defaultConfig + if defaultConfig == nil { + rc = raft.DefaultConfig() + } + if rc.ProtocolVersion == raft.ProtocolVersionMin { + rc.ProtocolVersion = raft.ProtocolVersionMax + } + if config.RaftConfig != nil { + if config.RaftConfig.HeartbeatTimeout != 0 { + rc.HeartbeatTimeout = config.RaftConfig.HeartbeatTimeout + } + if config.RaftConfig.ElectionTimeout != 0 { + rc.ElectionTimeout = config.RaftConfig.ElectionTimeout + } + if config.RaftConfig.SnapshotThreshold > 0 { + rc.SnapshotThreshold = uint64(config.RaftConfig.SnapshotThreshold) + } + if config.RaftConfig.SnapshotInterval != 0 { + rc.SnapshotInterval = config.RaftConfig.SnapshotInterval + } + if config.RaftConfig.LeaderLeaseTimeout != 0 { + rc.LeaderLeaseTimeout = config.RaftConfig.LeaderLeaseTimeout + } + if config.RaftConfig.CommitTimeout != 0 { + rc.CommitTimeout = config.RaftConfig.CommitTimeout + } + if config.RaftConfig.MaxAppendEntries != 0 { + rc.MaxAppendEntries = config.RaftConfig.MaxAppendEntries + } + if config.RaftConfig.TrailingLogs > 0 { + rc.TrailingLogs = uint64(config.RaftConfig.TrailingLogs) + } + if config.RaftID != "" { + rc.LocalID = raft.ServerID(config.RaftID) + } + } + err := raft.ValidateConfig(rc) + if err != nil { + panic(err) + } + return rc +} diff --git a/internal/config/resources.go b/internal/config/resources.go new file mode 100644 index 0000000..5a0d1f9 --- /dev/null +++ b/internal/config/resources.go @@ -0,0 +1,184 @@ +package config + +import ( + "errors" + + "github.com/dgate-io/dgate/pkg/spec" +) + +func (resources *DGateResources) Validate() error { + if resources == nil || resources.SkipValidation { + return nil + } + namespaces := make(map[string]*spec.Namespace) + services := make(map[string]*spec.Service) + routes := make(map[string]*spec.Route) + domains := make(map[string]*spec.Domain) + modules := make(map[string]*spec.Module) + collections := make(map[string]*spec.Collection) + documents := make(map[string]*spec.Document) + + for _, ns := range resources.Namespaces { + if _, ok := namespaces[ns.Name]; ok { + return errors.New("duplicate namespace: " + ns.Name) + } + if ns.Name == "" { + return errors.New("namespace name must be specified") + } + namespaces[ns.Name] = &ns + } + + for _, mod := range resources.Modules { + key := mod.Name + "-" + mod.NamespaceName + if _, ok := modules[key]; ok { + return errors.New("duplicate module: " + mod.Name) + } + if mod.Name == "" { + return errors.New("module name must be specified") + } + if mod.NamespaceName != "" { + if _, ok := namespaces[mod.NamespaceName]; !ok { + return errors.New("module (" + mod.Name + ") references non-existent namespace (" + mod.NamespaceName + ")") + } + } else { + return errors.New("module (" + mod.Name + ") must specify namespace") + } + if mod.Payload == "" && mod.PayloadFile == "" { + return errors.New("module payload or payload file must be specified") + } + if mod.Payload != "" && mod.PayloadFile != "" { + return errors.New("module payload and payload file cannot both be specified") + } + modules[key] = &mod.Module + } + + for _, svc := range resources.Services { + key := svc.Name + "-" + svc.NamespaceName + if _, ok := services[key]; ok { + return errors.New("duplicate service: " + svc.Name) + } + if svc.Name == "" { + return errors.New("service name must be specified") + } + if svc.NamespaceName != "" { + if _, ok := namespaces[svc.NamespaceName]; !ok { + return errors.New("service (" + svc.Name + ") references non-existent namespace (" + svc.NamespaceName + ")") + } + } else { + return errors.New("service (" + svc.Name + ") must specify namespace") + } + services[key] = &svc + } + + for _, route := range resources.Routes { + key := route.Name + "-" + route.NamespaceName + if _, ok := routes[key]; ok { + return errors.New("duplicate route: " + route.Name) + } + if route.Name == "" { + return errors.New("route name must be specified") + } + if route.ServiceName != "" { + if _, ok := services[route.ServiceName+"-"+route.NamespaceName]; !ok { + return errors.New("route (" + route.Name + ") references non-existent service (" + route.ServiceName + ")") + } + } + if route.NamespaceName != "" { + if _, ok := namespaces[route.NamespaceName]; !ok { + return errors.New("route (" + route.Name + ") references non-existent namespace (" + route.NamespaceName + ")") + } + } else { + return errors.New("route (" + route.Name + ") must specify namespace") + } + for _, modName := range route.Modules { + if _, ok := modules[modName+"-"+route.NamespaceName]; !ok { + return errors.New("route (" + route.Name + ") references non-existent module (" + modName + ")") + } + } + routes[key] = &route + } + + for _, dom := range resources.Domains { + key := dom.Name + "-" + dom.NamespaceName + if _, ok := domains[key]; ok { + return errors.New("duplicate domain: " + dom.Name) + } + if dom.Name == "" { + return errors.New("domain name must be specified") + } + if dom.NamespaceName != "" { + if _, ok := namespaces[dom.NamespaceName]; !ok { + return errors.New("domain (" + dom.Name + ") references non-existent namespace (" + dom.NamespaceName + ")") + } + } else { + return errors.New("domain (" + dom.Name + ") must specify namespace") + } + if dom.Cert != "" && dom.CertFile != "" { + return errors.New("domain cert and cert file cannot both be specified") + } + if dom.Key != "" && dom.KeyFile != "" { + return errors.New("domain key and key file cannot both be specified") + } + if (dom.Cert == "") != (dom.Key == "") { + return errors.New("domain cert (file) and key (file) must both be specified, or neither") + } + domains[key] = &dom.Domain + } + + for _, col := range resources.Collections { + key := col.Name + "-" + col.NamespaceName + if _, ok := collections[key]; ok { + return errors.New("duplicate collection: " + col.Name) + } + if col.Name == "" { + return errors.New("collection name must be specified") + } + if col.NamespaceName != "" { + if _, ok := namespaces[col.NamespaceName]; !ok { + return errors.New("collection (" + col.Name + ") references non-existent namespace (" + col.NamespaceName + ")") + } + } else { + return errors.New("collection (" + col.Name + ") must specify namespace") + } + if col.Schema == nil { + return errors.New("collection (" + col.Name + ") must specify schema") + } + if col.Type != spec.CollectionTypeDocument && col.Type != spec.CollectionTypeFetcher { + return errors.New("collection (" + col.Name + ") must specify type") + } + if col.Visibility != spec.CollectionVisibilityPublic && col.Visibility != spec.CollectionVisibilityPrivate { + return errors.New("collection (" + col.Name + ") must specify visibility") + } + for _, modName := range col.Modules { + if _, ok := modules[modName+"-"+col.NamespaceName]; !ok { + return errors.New("collection (" + col.Name + ") references non-existent module (" + modName + ")") + } + } + collections[key] = &col + } + + for _, doc := range resources.Documents { + key := doc.ID + "-" + doc.NamespaceName + if _, ok := documents[key]; ok { + return errors.New("duplicate document: " + doc.ID) + } + if doc.ID == "" { + return errors.New("document ID must be specified") + } + if doc.NamespaceName != "" { + if _, ok := namespaces[doc.NamespaceName]; !ok { + return errors.New("document (" + doc.ID + ") references non-existent namespace (" + doc.NamespaceName + ")") + } + } else { + return errors.New("document (" + doc.ID + ") must specify namespace") + } + if doc.CollectionName != "" { + if _, ok := collections[doc.CollectionName+"-"+doc.NamespaceName]; !ok { + return errors.New("document (" + doc.ID + ") references non-existent collection (" + doc.CollectionName + ")") + } + } + documents[key] = &doc + } + + return nil +} diff --git a/internal/config/resources_test.go b/internal/config/resources_test.go new file mode 100644 index 0000000..bdfa6bf --- /dev/null +++ b/internal/config/resources_test.go @@ -0,0 +1,56 @@ +package config + +import ( + "testing" + + "github.com/dgate-io/dgate/pkg/spec" +) + +func TestValidate(t *testing.T) { + resources := &DGateResources{ + SkipValidation: false, + Namespaces: []spec.Namespace{ + { + Name: "default", + Tags: []string{"default"}, + }, + }, + Services: []spec.Service{ + { + Name: "default", + NamespaceName: "default", + Tags: []string{"default"}, + }, + }, + Routes: []spec.Route{ + { + Name: "default", + Tags: []string{"default"}, + NamespaceName: "default", + }, + }, + Domains: []DomainSpec{ + { + Domain: spec.Domain{ + Name: "default", + NamespaceName: "default", + Tags: []string{"default"}, + }, + }, + }, + Modules: []ModuleSpec{ + { + Module: spec.Module{ + Name: "default", + NamespaceName: "default", + Payload: "void(0)", + Tags: []string{"default"}, + }, + }, + }, + } + err := resources.Validate() + if err != nil { + t.Error(err) + } +} diff --git a/internal/config/store_config.go b/internal/config/store_config.go new file mode 100644 index 0000000..d4e74a8 --- /dev/null +++ b/internal/config/store_config.go @@ -0,0 +1,27 @@ +package config + +import ( + "github.com/mitchellh/mapstructure" +) + +type StorageType string + +const ( + StorageTypeMemory StorageType = "memory" + StorageTypeFile StorageType = "file" +) + +func StoreConfig[T any, C any](config C) (T, error) { + var output T + cfg := &mapstructure.DecoderConfig{ + TagName: "koanf", + Metadata: nil, + Result: &output, + } + decoder, err := mapstructure.NewDecoder(cfg) + if err != nil { + return output, err + } + err = decoder.Decode(config) + return output, err +} \ No newline at end of file diff --git a/internal/config/utils.go b/internal/config/utils.go new file mode 100644 index 0000000..59d7e89 --- /dev/null +++ b/internal/config/utils.go @@ -0,0 +1,141 @@ +package config + +import ( + "errors" + "fmt" + "reflect" + "regexp" + "strconv" + + "github.com/knadh/koanf/v2" + "github.com/mitchellh/mapstructure" +) + +type FoundFunc func(string, map[string]string) (string, error) + +type ErrorFunc func(map[string]string, error) + +func resolveConfigStringPattern(data map[string]any, re *regexp.Regexp, foundFunc FoundFunc, errorFunc ErrorFunc) { + for k, v := range data { + var values []string + switch vt := v.(type) { + case string: + values = []string{vt} + case []any: + values = sliceMap(vt, func(val any) string { + if s, ok := val.(string); ok { + return s + } + return fmt.Sprint(val) + }) + if len(values) == 0 { + continue + } + default: + continue + } + if len(values) == 0 { + continue + } + hasMatch := false + for i, value := range values { + if value == "" { + continue + } + newValue := re.ReplaceAllStringFunc(value, func(s string) string { + matches := re.FindAllStringSubmatch(s, -1) + results := make(map[string]string) + for _, match := range matches { + for name, match := range mapSlices(re.SubexpNames(), match) { + if name != "" { + results[name] = match + hasMatch = true + } + } + } + result, err := foundFunc(value, results) + if err != nil { + errorFunc(results, err) + } + + return result + }) + + values[i] = newValue + } + if hasMatch { + if len(values) == 1 { + data[k] = values[0] + continue + } + data[k] = values + } + } +} + +func mapSlices[K comparable, V any](ks []K, vs []V) map[K]V { + if len(ks) != len(vs) { + panic("length of ks and vs must be equal") + } + result := make(map[K]V, len(ks)) + for i, k := range ks { + result[k] = vs[i] + } + return result +} + +func sliceMap[T any, V any](s []T, f func(T) V) []V { + result := make([]V, len(s)) + for i, v := range s { + result[i] = f(v) + } + return result +} + +func StringToIntHookFunc() mapstructure.DecodeHookFunc { + return func(from, to reflect.Type, data any) (interface{}, error) { + if from.Kind() != reflect.String { + return data, nil + } + if to.Kind() != reflect.Int { + return data, nil + } + return strconv.Atoi(data.(string)) + } +} + +func kDefault(k *koanf.Koanf, key string, value any) { + initialValue := k.Get(key) + if !k.Exists(key) || initialValue == nil || value == "" { + k.Set(key, value) + } +} + +func kRequireAll(k *koanf.Koanf, keys ...string) error { + for _, key := range keys { + if !k.Exists(key) { + return errors.New(key + " is required") + } + } + return nil +} + +func kRequireAny(k *koanf.Koanf, keys ...string) error { + for _, key := range keys { + if k.Exists(key) { + return nil + } + } + return fmt.Errorf("one of %v is required", keys) +} + +func kRequireIfExists(k *koanf.Koanf, dependent string, targets ...string) error { + for _, target := range targets { + if k.Exists(dependent) { + if k.Get(target) == "" { + return fmt.Errorf("%s is required, if %s is set", target, dependent) + } + } + } + return nil +} diff --git a/internal/pattern/pattern.go b/internal/pattern/pattern.go new file mode 100644 index 0000000..8f88235 --- /dev/null +++ b/internal/pattern/pattern.go @@ -0,0 +1,61 @@ +package pattern + +import ( + "errors" + "regexp" + "strings" +) + +var ( + ErrEmptyPattern = errors.New("empty pattern") +) + +func PatternMatch(value, pattern string) (bool, error) { + if pattern == "" { + return false, ErrEmptyPattern + } + if pattern == "*" || pattern == "**" { + return true, nil + } + + asteriskPrefix := strings.HasPrefix(pattern, "*") + asteriskSuffix := strings.HasSuffix(pattern, "*") + if asteriskPrefix && asteriskSuffix { + return strings.Contains(value, pattern[1:len(pattern)-1]), nil + } else if asteriskPrefix { + return strings.HasSuffix(value, pattern[1:]), nil + } else if asteriskSuffix{ + return strings.HasPrefix(value, pattern[:len(pattern)-1]), nil + } else if strings.HasPrefix(pattern, "/") && strings.HasSuffix(pattern, "/") { + re := pattern[1 : len(pattern)-1] + result, err := regexp.MatchString(re, value) + return result, err + } + return pattern == value, nil +} + +func MatchAnyPattern(value string, patterns []string) (string, bool, error) { + for _, pattern := range patterns { + match, err := PatternMatch(value, pattern) + if err != nil { + return "", false, err + } + if match { + return pattern, true, nil + } + } + return "", false, nil +} + +func MatchAllPatterns(value string, patterns []string) (bool, error) { + for _, pattern := range patterns { + match, err := PatternMatch(value, pattern) + if err != nil { + return false, err + } + if !match { + return false, nil + } + } + return true, nil +} diff --git a/internal/pattern/pattern_test.go b/internal/pattern/pattern_test.go new file mode 100644 index 0000000..7d97835 --- /dev/null +++ b/internal/pattern/pattern_test.go @@ -0,0 +1,111 @@ +package pattern_test + +import ( + "strings" + "testing" + + "github.com/dgate-io/dgate/internal/pattern" + "github.com/stretchr/testify/assert" +) + +func TestCheckDomainMatch(t *testing.T) { + domains := []string{ + "example.com", + "a.example.com", + "b.example.com", + "example.net", + "a.example.net", + "b.example.net", + } + patterns := map[string][]int{ + "example.com": {0}, + "example.*": {0, 3}, + "*.example.net*": {4, 5}, + "/.+\\.example\\.(com|net)/": {1, 2, 4, 5}, + "*": {0, 1, 2, 3, 4, 5}, + } + + for pt, expected := range patterns { + for i, name := range domains { + match, err := pattern.PatternMatch(name, pt) + if err != nil { + t.Fatal(err) + } + if contains(expected, i) { + if !match { + t.Fatalf("expected %v to match %v", name, pt) + } + } else { + if match { + t.Fatalf("expected %v to not match %v", name, pt) + } + } + } + } +} + +func TestDomainMatchAnyPatternError(t *testing.T) { + var err error + _, _, err = pattern.MatchAnyPattern("example.com", []string{""}) + if err == nil { + t.Fail() + } else { + assert.Equal(t, pattern.ErrEmptyPattern, err) + } + _, _, err = pattern.MatchAnyPattern("example.com", []string{`/\/`}) + if err == nil { + t.Fail() + } else { + assert.True(t, strings.HasPrefix(err.Error(), "error parsing regexp: trailing backslash")) + } +} + +func contains(s []int, e int) bool { + for _, a := range s { + if a == e { + return true + } + } + return false +} + +func TestDomainMatchAnyPattern(t *testing.T) { + domains := []string{ + "example.com", + "a.example.com", + "b.example.com", + "example.net", + "a.example.net", + "b.example.net", + } + for _, d := range domains { + _, matches, err := pattern.MatchAnyPattern(d, domains) + if err != nil { + t.Fatal(err) + } + if !matches { + t.Fatalf("expected %v to match itself", d) + } + } + _, matches, err := pattern.MatchAnyPattern("test.com", domains) + if err != nil { + t.Fatal(err) + } + if matches { + t.Fatalf("expected %v to not match any domain", "test.com") + } +} + +func TestDomainMatchAnyPatternCache(t *testing.T) { + for i := 0; i < 10; i++ { + _, matches, err := pattern.MatchAnyPattern( + "example.com", []string{"example.com"}, + ) + if err != nil { + t.Fatal(err) + } + if !matches { + t.Fatalf("expected %v to match itself", "example.com") + } + } +} diff --git a/internal/proxy/change_log.go b/internal/proxy/change_log.go new file mode 100644 index 0000000..bba0f52 --- /dev/null +++ b/internal/proxy/change_log.go @@ -0,0 +1,365 @@ +package proxy + +import ( + "fmt" + "time" + + "errors" + + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util/sliceutil" + "github.com/dgraph-io/badger/v4" + "github.com/mitchellh/mapstructure" + "github.com/rs/zerolog" +) + +// processChangeLog - processes a change log and applies the change to the proxy state +func (ps *ProxyState) processChangeLog( + cl *spec.ChangeLog, apply, store bool, +) (err error) { + // TODO: add revert cl function to check if storage fails or something + if !cl.Cmd.IsNoop() { + switch cl.Cmd.Resource() { + case spec.Namespaces: + var item spec.Namespace + item, err = decode[spec.Namespace](cl.Item) + if err == nil { + ps.logger.Trace().Msgf("Processing namespace: %s", item.Name) + err = ps.processNamespace(&item, cl) + } + case spec.Services: + var item spec.Service + item, err = decode[spec.Service](cl.Item) + if err == nil { + ps.logger.Trace().Msgf("Processing service: %s", item.Name) + err = ps.processService(&item, cl) + } + case spec.Routes: + var item spec.Route + item, err = decode[spec.Route](cl.Item) + if err == nil { + ps.logger.Trace().Msgf("Processing route: %s", item.Name) + err = ps.processRoute(&item, cl) + } + case spec.Modules: + var item spec.Module + item, err = decode[spec.Module](cl.Item) + if err == nil { + ps.logger.Trace().Msgf("Processing module: %s", item.Name) + err = ps.processModule(&item, cl) + } + case spec.Domains: + var item spec.Domain + item, err = decode[spec.Domain](cl.Item) + if err == nil { + ps.logger.Trace().Msgf("Processing domain: %s", item.Name) + err = ps.processDomain(&item, cl) + } + case spec.Collections: + var item spec.Collection + item, err = decode[spec.Collection](cl.Item) + if err == nil { + ps.logger.Trace().Msgf("Processing domain: %s", item.Name) + err = ps.processCollection(&item, cl) + } + case spec.Documents: + var item spec.Document + item, err = decode[spec.Document](cl.Item) + if err == nil { + ps.logger.Trace().Msgf("Processing domain: %s", item.ID) + err = ps.processDocument(&item, cl) + } + default: + err = fmt.Errorf("unknown command: %s", cl.Cmd) + } + if err != nil { + ps.logger.Err(err).Msg("error processing change log") + return + } + } + if apply && (cl.Cmd.Resource().IsRelatedTo(spec.Routes) || cl.Cmd.IsNoop()) { + ps.logger.Trace().Msgf("Registering change log: %s", cl.Cmd) + errChan := ps.applyChange(cl) + select { + case err = <-errChan: + break + case <-time.After(time.Second * 15): + err = errors.New("timeout applying change log") + } + if err != nil { + ps.logger.Err(err).Msg("Error registering change log") + return + } + } + if store { + err = ps.store.StoreChangeLog(cl) + if err != nil { + // TODO: Add config option to panic on persistent storage errors + // TODO: maybe revert change here or add to some in-memory queue for changes? + ps.logger.Err(err).Msg("Error storing change log") + return + } + } + changeHash, err := HashAny[*spec.ChangeLog](ps.changeHash, cl) + if err != nil { + if !ps.config.Debug { + return err + } + ps.logger.Error(). + Err(err). + Msg("error updating change log hash") + } else { + ps.changeHash = changeHash + } + + return nil +} + +func decode[T any](input any) (T, error) { + var output T + cfg := &mapstructure.DecoderConfig{ + Metadata: nil, + Result: &output, + TagName: "json", + DecodeHook: mapstructure.StringToTimeHookFunc(time.RFC3339), + } + decoder, _ := mapstructure.NewDecoder(cfg) + err := decoder.Decode(input) + if err != nil { + return output, err + } + return output, nil +} + +func (ps *ProxyState) processNamespace(ns *spec.Namespace, cl *spec.ChangeLog) error { + switch cl.Cmd.Action() { + case spec.Add: + ps.rm.AddNamespace(ns) + return nil + case spec.Delete: + return ps.rm.RemoveNamespace(ns.Name) + default: + return fmt.Errorf("unknown command: %s", cl.Cmd) + } +} + +func (ps *ProxyState) processService(svc *spec.Service, cl *spec.ChangeLog) (err error) { + switch cl.Cmd.Action() { + case spec.Add: + _, err = ps.rm.AddService(svc) + case spec.Delete: + _, err = ps.rm.AddService(svc) + default: + err = fmt.Errorf("unknown command: %s", cl.Cmd) + } + return err +} + +func (ps *ProxyState) processRoute(route *spec.Route, cl *spec.ChangeLog) (err error) { + switch cl.Cmd.Action() { + case spec.Add: + _, err = ps.rm.AddRoute(route) + case spec.Delete: + _, err = ps.rm.AddRoute(route) + default: + err = fmt.Errorf("unknown command: %s", cl.Cmd) + } + return err +} + +func (ps *ProxyState) processModule(module *spec.Module, cl *spec.ChangeLog) (err error) { + switch cl.Cmd.Action() { + case spec.Add: + _, err = ps.rm.AddModule(module) + case spec.Delete: + _, err = ps.rm.AddModule(module) + default: + err = fmt.Errorf("unknown command: %s", cl.Cmd) + } + return err +} + +func (ps *ProxyState) processDomain(domain *spec.Domain, cl *spec.ChangeLog) (err error) { + switch cl.Cmd.Action() { + case spec.Add: + _, err = ps.rm.AddDomain(domain) + case spec.Delete: + _, err = ps.rm.AddDomain(domain) + default: + err = fmt.Errorf("unknown command: %s", cl.Cmd) + } + return err +} + +func (ps *ProxyState) processCollection(col *spec.Collection, cl *spec.ChangeLog) (err error) { + switch cl.Cmd.Action() { + case spec.Add: + _, err = ps.rm.AddCollection(col) + case spec.Delete: + _, err = ps.rm.AddCollection(col) + default: + err = fmt.Errorf("unknown command: %s", cl.Cmd) + } + return err +} + +func (ps *ProxyState) processDocument(doc *spec.Document, cl *spec.ChangeLog) (err error) { + switch cl.Cmd.Action() { + case spec.Add: + err = ps.store.StoreDocument(doc) + case spec.Delete: + err = ps.store.DeleteDocument(doc) + default: + err = fmt.Errorf("unknown command: %s", cl.Cmd) + } + return err +} + +// applyChange - apply a change to the proxy state, returns a channel that will receive an error when the state has been updated +func (ps *ProxyState) applyChange(changeLog *spec.ChangeLog) <-chan error { + done := make(chan error, 1) + if changeLog == nil { + changeLog = &spec.ChangeLog{ + Cmd: spec.NoopCommand, + } + } + changeLog.SetErrorChan(done) + ps.changeChan <- changeLog + return done +} + +func (ps *ProxyState) rollbackChange(changeLog *spec.ChangeLog) { + if changeLog == nil { + return + } + ps.changeChan <- changeLog +} + +func (ps *ProxyState) restoreFromChangeLogs() error { + // restore state change logs + logs, err := ps.store.FetchChangeLogs() + if err != nil { + if err == badger.ErrKeyNotFound { + ps.logger.Debug().Msg("no state change logs found in storage") + } else { + return errors.New("failed to get state change logs from storage: " + err.Error()) + } + } else { + ps.logger.Info().Msg(fmt.Sprintf("restoring %d state change logs from storage", len(logs))) + // we might need to sort the change logs by timestamp + for i, cl := range logs { + ps.logger.Trace(). + Interface("changeLog: "+cl.Name, cl).Msgf("restoring change log index: %d", i) + lastIteration := i == len(logs)-1 + err = ps.processChangeLog(cl, lastIteration, false) + if err != nil { + if ps.config.Debug { + ps.logger.Err(err).Msg("error processing change log, ignoring while in debug mode") + } else { + return err + } + } + } + // TODO: change to configurable variable + if len(logs) > 1 { + removed, err := ps.compactChangeLogs(logs) + if err != nil { + ps.logger.Error().Err(err).Msg("failed to compact state change logs") + return err + } + if removed > 0 { + ps.logger.Info().Msgf("compacted change logs by removing %d out of %d logs", removed, len(logs)) + } + } + } + return nil +} + +func (ps *ProxyState) compactChangeLogs(logs []*spec.ChangeLog) (int, error) { + removeList := compactChangeLogsRemoveList(&ps.logger, sliceutil.SliceCopy(logs)) + removed, err := ps.store.DeleteChangeLogs(removeList) + if err != nil { + return removed, err + } + return removed, nil +} + +/* +compactChangeLogsRemoveList - compacts a list of change logs by removing redundant logs + +TODO: perhaps add flag for compacting change logs on startup (mark as experimental) + +compaction rules: +- if an add command is followed by a delete command with matching keys, remove both commands +- if an add command is followed by another add command with matching keys, remove the first add command +*/ +func compactChangeLogsRemoveList(logger *zerolog.Logger, logs []*spec.ChangeLog) []*spec.ChangeLog { + removeList := make([]*spec.ChangeLog, 0) + iterations := 0 +START: + var prevLog *spec.ChangeLog + // TODO: this can be extended by separating the logs into namespace groups and then compacting each group + for i := 0; i < len(logs); i++ { + iterations++ + curLog := logs[i] + if prevLog != nil { + if prevLog.Cmd.IsNoop() { + removeList = append(removeList, prevLog) + logs = append(logs[:i-1], logs[i:]...) + goto START + } + commonResource := prevLog.Cmd.Resource() == curLog.Cmd.Resource() + if prevLog.Cmd.Action() == spec.Add && curLog.Cmd.Action() == spec.Delete && commonResource { + // Rule 1: if an add command is followed by a delete command with matching keys, remove both commands + if prevLog.Name == curLog.Name && prevLog.Namespace == curLog.Namespace { + removeList = append(removeList, prevLog, curLog) + logs = append(logs[:i-1], logs[i+1:]...) + goto START + } + } + + commonAction := prevLog.Cmd.Action() == curLog.Cmd.Action() + if prevLog.Cmd.Action() == spec.Add && commonAction && commonResource { + // Rule 2: if an add command is followed by another add command with matching keys, remove the first add command + if prevLog.Name == curLog.Name && prevLog.Namespace == curLog.Namespace { + removeList = append(removeList, prevLog) + logs = append(logs[:i-1], logs[i:]...) + goto START + } + } + } + prevLog = curLog + } + if logger != nil { + logger.Debug().Msgf("compacted change logs in %d iterations", iterations) + } + // remove duplicates from list + removeList = sliceutil.SliceUnique(removeList, func(cl *spec.ChangeLog) string { return cl.ID }) + return removeList +} + +// Function to check if there is a delete command between two logs with matching keys +// func hasDeleteBetween(logs []*spec.ChangeLog, start, end *spec.ChangeLog) bool { +// startIndex := -1 +// endIndex := -1 + +// for i, log := range logs { +// if log.ID == start.ID { +// startIndex = i +// } +// if log.ID == end.ID { +// endIndex = i +// } +// } + +// if startIndex == -1 || endIndex == -1 { +// return false +// } + +// for i := startIndex + 1; i < endIndex; i++ { +// if logs[i].Cmd.IsDeleteCommand() { +// return true +// } +// } +// return false +// } diff --git a/internal/proxy/change_log_test.go b/internal/proxy/change_log_test.go new file mode 100644 index 0000000..98025a2 --- /dev/null +++ b/internal/proxy/change_log_test.go @@ -0,0 +1,171 @@ +package proxy + +import ( + "strconv" + "testing" + + "github.com/dgate-io/dgate/pkg/spec" +) + +func TestCompactChangeLog_DifferentNamespace(t *testing.T) { + cmds := []spec.Command{ + spec.AddModuleCommand, + spec.AddServiceCommand, + spec.AddRouteCommand, + } + for _, cmd := range cmds { + t.Run("test "+cmd.String(), func(tt *testing.T) { + logs := []*spec.ChangeLog{ + { + Cmd: cmd, + Name: "test1", + Namespace: "test-ns1", + }, + { + Cmd: cmd, + Name: "test1", + Namespace: "test-ns2", + }, + { + Cmd: cmd, + Name: "test1", + Namespace: "test-ns3", + }, + } + setSequentialChangeLogs(logs) + removeList := compactChangeLogsRemoveList(nil, logs) + testChangeLogRemoveList(tt, removeList) + }) + } +} + +func TestCompactChangeLog_SameNamespace(t *testing.T) { + cmds := []spec.Command{ + spec.AddModuleCommand, + spec.AddServiceCommand, + spec.AddRouteCommand, + } + for _, cmd := range cmds { + t.Run("test "+cmd.String(), func(tt *testing.T) { + logs := []*spec.ChangeLog{ + { + Cmd: cmd, + Name: "test1", + Namespace: "test-ns", + }, + { + Cmd: cmd, + Name: "test1", + Namespace: "test-ns", + }, + { + Cmd: cmd, + Name: "test1", + Namespace: "test-ns", + }, + } + setSequentialChangeLogs(logs) + removeList := compactChangeLogsRemoveList(nil, logs) + testChangeLogRemoveList(tt, removeList, 0, 1) + }) + } +} + +func TestCompactChangeLog_Mirror(t *testing.T) { + logs := []*spec.ChangeLog{ + newCommonChangeLog(spec.AddNamespaceCommand), + newCommonChangeLog(spec.AddDomainCommand), + newCommonChangeLog(spec.AddServiceCommand), + newCommonChangeLog(spec.AddRouteCommand), + newCommonChangeLog(spec.AddModuleCommand), + newCommonChangeLog(spec.DeleteModuleCommand), + newCommonChangeLog(spec.DeleteRouteCommand), + newCommonChangeLog(spec.DeleteServiceCommand), + newCommonChangeLog(spec.DeleteDomainCommand), + newCommonChangeLog(spec.DeleteNamespaceCommand), + } + setSequentialChangeLogs(logs) + removeList := compactChangeLogsRemoveList(nil, logs) + testChangeLogRemoveList(t, removeList, 4, 5, 3, 6, 2, 7, 1, 8, 0, 9) +} + +func TestCompactChangeLog_Noop(t *testing.T) { + logs := []*spec.ChangeLog{ + newCommonChangeLog(spec.NoopCommand), + newCommonChangeLog(spec.NoopCommand), + newCommonChangeLog(spec.NoopCommand), + newCommonChangeLog(spec.AddDomainCommand), + newCommonChangeLog(spec.AddServiceCommand), + newCommonChangeLog(spec.NoopCommand), + newCommonChangeLog(spec.AddRouteCommand), + newCommonChangeLog(spec.AddModuleCommand), + } + setSequentialChangeLogs(logs) + removeList := compactChangeLogsRemoveList(nil, logs) + testChangeLogRemoveList(t, removeList, 0, 1, 2, 5) +} + +func TestCompactChangeLog_AddDelete(t *testing.T) { + logs := []*spec.ChangeLog{ + newCommonChangeLog(spec.AddNamespaceCommand), + newCommonChangeLog(spec.DeleteNamespaceCommand), + } + setSequentialChangeLogs(logs) + removeList := compactChangeLogsRemoveList(nil, logs) + testChangeLogRemoveList(t, removeList, 0, 1) +} + +// TODO: Add test cases for DiffNamespaces for all tests cases when that is implemented (like the one below) +func TestCompactChangeLog_AddDeleteDiffNamespaces(t *testing.T) { + t.Skip() + // logs := []*spec.ChangeLog{ + // newCommonChangeLog(spec.AddNamespaceCommand, "t1", "test-ns1"), + // newCommonChangeLog(spec.AddNamespaceCommand, "t2", "test-ns2"), + // newCommonChangeLog(spec.DeleteNamespaceCommand, "t1", "test-ns1"), + // newCommonChangeLog(spec.DeleteNamespaceCommand, "t2", "test-ns2"), + // } + // setSequentialChangeLogs(logs) + // removeList := compactChangeLogsRemoveList(nil, logs) + // testChangeLogRemoveList(t, removeList, 0, 1, 2, 3) +} + +func newCommonChangeLog(cmd spec.Command, others ...string) *spec.ChangeLog { + cl := &spec.ChangeLog{ + Cmd: cmd, + Name: "test1", + Namespace: "test-ns", + } + if len(others) > 0 && others[0] != "" { + cl.Name = others[0] + } + if len(others) > 1 && others[1] != "" { + cl.Namespace = others[1] + } + return cl +} + +func setSequentialChangeLogs(logs []*spec.ChangeLog) { + for i, log := range logs { + log.ID = strconv.FormatInt(int64(i), 36) + log.Item = i + } +} + +func testChangeLogRemoveList(t *testing.T, logs []*spec.ChangeLog, order ...int) { + logItems := make([]any, 0, len(logs)) + for _, log := range logs { + logItems = append(logItems, log.Item) + } + t.Logf("logItems: %v", logItems) + if len(logs) != len(order) { + t.Fatalf("length mismatch, expected: %v but got: %v", len(order), len(logs)) + return + } + for i, logItem := range logItems { + if logItem != order[i] { + t.Errorf("order mismatch: expected '%v' next, but got '%v'", order, logItems) + t.FailNow() + return + } + } +} diff --git a/internal/proxy/dynamic_proxy.go b/internal/proxy/dynamic_proxy.go new file mode 100644 index 0000000..5445601 --- /dev/null +++ b/internal/proxy/dynamic_proxy.go @@ -0,0 +1,344 @@ +package proxy + +import ( + "context" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "time" + + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/router" + "github.com/dgate-io/dgate/pkg/modules/extractors" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/typescript" + "github.com/dgate-io/dgate/pkg/util/sliceutil" + "github.com/dgate-io/dgate/pkg/util/tree/avl" + "github.com/dop251/goja" + "github.com/rs/zerolog" + "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" + "golang.org/x/sync/errgroup" +) + +func (state *ProxyState) reconfigureState(log *spec.ChangeLog) error { + start := time.Now() + err := state.setupModules() + if err != nil { + return err + } + err = state.setupRoutes() + if err != nil { + return err + } + if log != nil { + state.logger.Info(). + Msgf("State reloaded in %s: %s", + time.Since(start), log.Cmd) + } + return nil +} + +func (ps *ProxyState) setupModules() error { + ps.logger.Debug().Msg("Setting up modules") + eg, _ := errgroup.WithContext(context.Background()) + newModPrograms := avl.NewTree[string, *goja.Program]() + for _, route := range ps.rm.GetRoutes() { + // TODO: check if route/module has changes + for _, mod := range route.Modules { + eg.Go(func() error { + var ( + err error + program *goja.Program + modPayload string = mod.Payload + ) + start := time.Now() + if mod.Type == spec.ModuleTypeTypescript { + modPayload, err = typescript.Transpile(modPayload) + if err != nil { + ps.logger.Err(err).Msg("Error transpiling module: " + mod.Name) + return err + } + } + if mod.Type == spec.ModuleTypeJavascript || mod.Type == spec.ModuleTypeTypescript { + program, err = goja.Compile(mod.Name+".js", modPayload, true) + if err != nil { + ps.logger.Err(err).Msg("Error compiling module: " + mod.Name) + return err + } + } else { + return errors.New("invalid module type: " + mod.Type.String()) + } + + rtCtx := NewRuntimeContext(ps, route, mod) + loop, err := extractors.NewModuleEventLoop(ps.printer, rtCtx) + if err != nil { + ps.logger.Err(err). + Msgf("Error applying module '%s' changes", mod.Name) + return err + } + defer loop.Stop() + newModPrograms.Insert(mod.Name+"/"+mod.Namespace.Name, program) + elapsed := time.Since(start) + ps.logger.Debug(). + Msgf("Module '%s/%s' changed applied in %s", mod.Name, mod.Namespace.Name, elapsed) + return nil + }) + } + } + if err := eg.Wait(); err != nil { + ps.logger.Err(err).Msg("Error setting up modules") + return err + } else { + ps.modPrograms = newModPrograms + + } + return nil +} + +func (ps *ProxyState) setupRoutes() (err error) { + ps.logger.Debug().Msg("Setting up routes") + reqCtxProviders := avl.NewTree[string, *RequestContextProvider]() + for namespaceName, routes := range ps.rm.GetRouteNamespaceMap() { + mux := router.NewMux() + for _, r := range routes { + reqCtxProvider := NewRequestContextProvider(r) + reqCtxProviders.Insert(r.Namespace.Name+"/"+r.Name, reqCtxProvider) + if len(r.Modules) > 0 { + modBuf, err := NewModuleBuffer( + 256, 1024, reqCtxProvider, + createModuleExtractorFunc(ps, r), + ) + if err != nil { + ps.logger.Err(err).Msg("Error creating module buffer") + return err + } + reqCtxProvider.SetModuleBuffer(modBuf) + } + err = func() (err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("%v", r) + } + }() + for _, path := range r.Paths { + if len(r.Methods) > 0 && r.Methods[0] == "*" { + if len(r.Methods) > 1 { + return errors.New("route methods cannot have other methods with *") + } + mux.Handle(path, ps.HandleRoute(reqCtxProvider, path)) + } else { + if len(r.Methods) == 0 { + return errors.New("route must have at least one method") + } + for _, method := range r.Methods { + mux.Method(method, path, ps.HandleRoute(reqCtxProvider, path)) + } + } + } + return nil + }() + } + + ps.logger.Info().Msg("Routes have changed, reloading") + if dr, ok := ps.routers.Find(namespaceName); ok { + dr.ReplaceMux(mux) + } else { + dr := router.NewRouterWithMux(mux) + ps.routers.Insert(namespaceName, dr) + } + } + return +} + +func createModuleExtractorFunc(ps *ProxyState, r *spec.DGateRoute) ModuleExtractorFunc { + return func(reqCtx *RequestContextProvider) ModuleExtractor { + programs := sliceutil.SliceMapper(r.Modules, func(m *spec.DGateModule) *goja.Program { + program, ok := ps.modPrograms.Find(m.Name + "/" + r.Namespace.Name) + if !ok { + ps.logger.Error().Msg("Error getting module program: invalid state") + panic("Error getting module program: invalid state") + } + return program + }) + rtCtx := NewRuntimeContext(ps, r, r.Modules...) + if loop, err := extractors.NewModuleEventLoop(ps.printer, rtCtx, programs...); err != nil { + ps.logger.Err(err).Msg("Error creating runtime for route: " + reqCtx.route.Name) + return nil + } else { + errorHandler, err := extractors.ExtractErrorHandlerFunction(loop) + if err != nil { + ps.logger.Err(err).Msg("Error extracting error handler function") + return nil + } + fetchUpstream, err := extractors.ExtractFetchUpstreamFunction(loop) + if err != nil { + ps.logger.Err(err).Msg("Error extracting fetch upstream function") + return nil + } + reqModifier, err := extractors.ExtractRequestModifierFunction(loop) + if err != nil { + ps.logger.Err(err).Msg("Error extracting request modifier function") + return nil + } + resModifier, err := extractors.ExtractResponseModifierFunction(loop) + if err != nil { + ps.logger.Err(err).Msg("Error extracting response modifier function") + return nil + } + reqHandler, err := extractors.ExtractRequestHandlerFunction(loop) + if err != nil { + ps.logger.Err(err).Msg("Error extracting request handler function") + return nil + } + return NewModuleExtractor( + rtCtx, fetchUpstream, + reqModifier, resModifier, + errorHandler, reqHandler, + ) + } + } +} + +func StartProxyGateway(conf *config.DGateConfig) (*ProxyState, error) { + ps := NewProxyState(conf) + + go func() { + ps.proxyLock.Lock() + err := ps.reconfigureState(nil) + if err != nil { + ps.logger.Err(err).Msg("Error initiating state") + os.Exit(1) + } + ps.proxyLock.Unlock() + + for { + ps.status = ProxyStatusRunning + var log = <-ps.changeChan + if ps.status == ProxyStatusStopping || ps.status == ProxyStatusClosed { + ps.logger.Info().Msg("Stopping proxy gracefully :D") + os.Exit(0) + return + } + func() { + ps.proxyLock.Lock() + defer ps.proxyLock.Unlock() + ps.status = ProxyStatusModifying + var err error + defer func() { log.PushError(err) }() + err = ps.reconfigureState(log) + if err != nil { + ps.logger.Err(err).Msg("Error reconfiguring state") + ps.rollbackChange(log) + } + }() + } + }() + + err := ps.store.InitStore() + if err != nil { + return nil, err + } + if !ps.replicationEnabled { + err = ps.restoreFromChangeLogs() + if err != nil { + return nil, err + } + } + + go func() { + config := conf.ProxyConfig + hostPort := fmt.Sprintf("%s:%d", config.Host, config.Port) + ps.logger.Info(). + Msgf("Starting proxy server on %s", hostPort) + proxyHttpLogger := ps.Logger( + WithComponentLogger("proxy-http"), + WithDefaultLevel(zerolog.InfoLevel), + ) + server := &http.Server{ + Addr: hostPort, + Handler: ps, + ErrorLog: log.New(proxyHttpLogger, "", 0), + } + if config.EnableHTTP2 { + h2Server := &http2.Server{} + err := http2.ConfigureServer(server, h2Server) + if err != nil { + panic(err) + } + if config.EnableH2C { + server.Handler = h2c.NewHandler(ps, h2Server) + } + } + if err := server.ListenAndServe(); err != nil { + ps.logger.Err(err).Msg("Error starting proxy server") + os.Exit(1) + } + }() + + if conf.ProxyConfig.TLS != nil { + go func() { + config := conf.ProxyConfig + hostPort := fmt.Sprintf("%s:%d", config.Host, config.TLS.Port) + ps.logger.Info(). + Msgf("Starting secure proxy server on %s", hostPort) + proxyHttpsLogger := ps.Logger( + WithComponentLogger("proxy-https"), + WithDefaultLevel(zerolog.InfoLevel), + ) + secureServer := &http.Server{ + Addr: hostPort, + Handler: ps, + ErrorLog: log.New(proxyHttpsLogger, "", 0), + TLSConfig: ps.DynamicTLSConfig( + conf.ProxyConfig.TLS.CertFile, + conf.ProxyConfig.TLS.KeyFile, + ), + } + if config.EnableHTTP2 { + h2Server := &http2.Server{} + err := http2.ConfigureServer(secureServer, h2Server) + if err != nil { + panic(err) + } + if config.EnableH2C { + secureServer.Handler = h2c.NewHandler(ps, h2Server) + } + } + if err := secureServer.ListenAndServeTLS("", ""); err != nil { + ps.logger.Err(err).Msg("Error starting secure proxy server") + os.Exit(1) + } + }() + } + + return ps, nil +} + +func (ps *ProxyState) HandleRoute(requestCtxProvider *RequestContextProvider, pattern string) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + ctx, cancel := context.WithCancel(requestCtxProvider.ctx) + defer cancel() + reqCtx := requestCtxProvider. + CreateRequestContext(ctx, w, r, pattern) + ps.ProxyHandlerFunc(ps, reqCtx) + } +} + +func TimeoutDialer(connTimeout time.Duration) func(net, addr string) (c net.Conn, err error) { + return func(_net, _addr string) (net.Conn, error) { + conn, err := net.DialTimeout(_net, _addr, connTimeout) + if err != nil { + return nil, err + } + return conn, nil + } +} + +func RouteHash(routes ...*spec.DGateRoute) (hash uint32, err error) { + hash, err = HashAny[*spec.Route](0, spec.TransformDGateRoutes(routes...)) + return +} diff --git a/internal/proxy/module_executor.go b/internal/proxy/module_executor.go new file mode 100644 index 0000000..1567bf1 --- /dev/null +++ b/internal/proxy/module_executor.go @@ -0,0 +1,105 @@ +package proxy + +import ( + "context" + "errors" + "time" +) + +type ModuleBuffer interface { + Load(cb func()) + Borrow() (ModuleExtractor, bool) + Return(me ModuleExtractor) + Close() +} + +type moduleBuffer struct { + modExtBuffer chan ModuleExtractor + min, max int + + ctxCancel context.CancelFunc + ctx context.Context + + createModuleExtract func() ModuleExtractor +} + +func NewModuleBuffer( + minBuffers, maxBuffers int, + reqCtxProvider *RequestContextProvider, + createModExts func(*RequestContextProvider) ModuleExtractor, +) (ModuleBuffer, error) { + if minBuffers < 1 { + panic("module concurrency must be greater than 0") + } + if maxBuffers < minBuffers { + panic("maxBuffers must be greater than minBuffers") + } + + me := createModExts(reqCtxProvider) + if me == nil { + return nil, errors.New("could not load moduleExtract") + } + mb := &moduleBuffer{ + min: minBuffers, + max: maxBuffers, + modExtBuffer: make(chan ModuleExtractor, maxBuffers), + } + mb.createModuleExtract = func() ModuleExtractor { + return createModExts(reqCtxProvider) + } + mb.ctx, mb.ctxCancel = context.WithCancel(reqCtxProvider.ctx) + return mb, nil +} + +func (mb *moduleBuffer) Load(cb func()) { + go func() { + for i := 0; i < mb.min; i++ { + me := mb.createModuleExtract() + if me == nil { + panic("could not load moduleExtract") + } + mb.modExtBuffer <- me + } + if cb != nil { + cb() + } + }() +} + +func (mb *moduleBuffer) Borrow() (ModuleExtractor, bool) { + if mb == nil || mb.ctx == nil || mb.ctx.Err() != nil { + return nil, false + } + var me ModuleExtractor + select { + case me = <-mb.modExtBuffer: + break + // NOTE: important for performance + case <-time.After(2 * time.Millisecond): + default: + me = mb.createModuleExtract() + break + } + return me, true +} + +func (mb *moduleBuffer) Return(me ModuleExtractor) { + me.SetModuleContext(nil) + if mb.ctx == nil || mb.ctx.Err() != nil { + return + } + + select { + case mb.modExtBuffer <- me: + default: + // if buffer is full, discard module extract + me.Stop(true) + } +} + +func (mb *moduleBuffer) Close() { + if mb.ctxCancel != nil { + mb.ctxCancel() + } + close(mb.modExtBuffer) +} diff --git a/internal/proxy/module_extractor.go b/internal/proxy/module_extractor.go new file mode 100644 index 0000000..e1b3349 --- /dev/null +++ b/internal/proxy/module_extractor.go @@ -0,0 +1,118 @@ +package proxy + +import ( + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/modules/extractors" + "github.com/dgate-io/dgate/pkg/modules/types" +) + +type ModuleExtractor interface { + // Start starts the event loop for the module extractor; ret is true if the event loop was started, false otherwise + Start() + // Stop stops the event loop for the module extractor + Stop(wait bool) + + // RuntimeContext returns the runtime context for the module extractor + RuntimeContext() modules.RuntimeContext + + // SetModuleContext sets the module context for the module extractor + SetModuleContext(*types.ModuleContext) + // ModuleContext returns the module context for the module extractor + ModuleContext() *types.ModuleContext + + // ModHash returns the hash of the module + ModHash() uint32 + + FetchUpstreamUrlFunc() (extractors.FetchUpstreamUrlFunc, bool) + RequestModifierFunc() (extractors.RequestModifierFunc, bool) + ResponseModifierFunc() (extractors.ResponseModifierFunc, bool) + ErrorHandlerFunc() (extractors.ErrorHandlerFunc, bool) + RequestHandlerFunc() (extractors.RequestHandlerFunc, bool) +} + +type moduleExtract struct { + runtimeContext modules.RuntimeContext + moduleContext *types.ModuleContext + fetchUpstreamUrl extractors.FetchUpstreamUrlFunc + requestModifier extractors.RequestModifierFunc + responseModifier extractors.ResponseModifierFunc + errorHandler extractors.ErrorHandlerFunc + requestHandler extractors.RequestHandlerFunc + numUses int + modHash uint32 +} + +func NewModuleExtractor( + runtimeContext modules.RuntimeContext, + fetchUpstreamUrl extractors.FetchUpstreamUrlFunc, + requestModifier extractors.RequestModifierFunc, + responseModifier extractors.ResponseModifierFunc, + errorHandler extractors.ErrorHandlerFunc, + requestHandler extractors.RequestHandlerFunc, +) ModuleExtractor { + return &moduleExtract{ + runtimeContext: runtimeContext, + fetchUpstreamUrl: fetchUpstreamUrl, + requestModifier: requestModifier, + responseModifier: responseModifier, + errorHandler: errorHandler, + requestHandler: requestHandler, + } +} + +func (me *moduleExtract) Start() { + me.runtimeContext.EventLoop().Start() + me.numUses++ +} + +// Stop stops the event loop for the module extractor +func (me *moduleExtract) Stop(wait bool) { + me.moduleContext = nil + if wait { + me.runtimeContext.EventLoop().Stop() + } else { + me.runtimeContext.EventLoop().StopNoWait() + } +} + +func (me *moduleExtract) SetModuleContext(moduleContext *types.ModuleContext) { + me.moduleContext = moduleContext +} + +func (me *moduleExtract) RuntimeContext() modules.RuntimeContext { + return me.runtimeContext +} + +func (me *moduleExtract) ModuleContext() *types.ModuleContext { + return me.moduleContext +} + +func (me *moduleExtract) ModHash() uint32 { + return me.modHash +} + +func (me *moduleExtract) FetchUpstreamUrlFunc() (extractors.FetchUpstreamUrlFunc, bool) { + return me.fetchUpstreamUrl, me.fetchUpstreamUrl != nil +} + +func (me *moduleExtract) RequestModifierFunc() (extractors.RequestModifierFunc, bool) { + return me.requestModifier, me.requestModifier != nil +} + +func (me *moduleExtract) ResponseModifierFunc() (extractors.ResponseModifierFunc, bool) { + return me.responseModifier, me.responseModifier != nil +} + +func (me *moduleExtract) ErrorHandlerFunc() (extractors.ErrorHandlerFunc, bool) { + return me.errorHandler, me.errorHandler != nil +} + +func (me *moduleExtract) RequestHandlerFunc() (extractors.RequestHandlerFunc, bool) { + return me.requestHandler, me.requestHandler != nil +} + +func NewEmptyModuleExtractor() ModuleExtractor { + return &moduleExtract{} +} + +type ModuleExtractorFunc func(*RequestContextProvider) ModuleExtractor diff --git a/internal/proxy/module_mock_test.go b/internal/proxy/module_mock_test.go new file mode 100644 index 0000000..0417970 --- /dev/null +++ b/internal/proxy/module_mock_test.go @@ -0,0 +1,157 @@ +package proxy_test + +import ( + "net/http" + + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/modules/extractors" + "github.com/dgate-io/dgate/pkg/modules/types" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/stretchr/testify/mock" +) + +type mockModuleBuffer struct { + mock.Mock +} + +var _ proxy.ModuleBuffer = &mockModuleBuffer{} + +func NewMockModuleBuffer() *mockModuleBuffer { + return &mockModuleBuffer{} +} + +// Borrow implements proxy.ModuleBuffer. +func (mb *mockModuleBuffer) Borrow() (proxy.ModuleExtractor, bool) { + args := mb.Called() + return args.Get(0).(proxy.ModuleExtractor), args.Bool(1) +} + +// Close implements proxy.ModuleBuffer. +func (mb *mockModuleBuffer) Close() { + mb.Called() +} + +// Load implements proxy.ModuleBuffer. +func (mb *mockModuleBuffer) Load(cb func()) { + mb.Called(cb) +} + +// Return implements proxy.ModuleBuffer. +func (mb *mockModuleBuffer) Return(me proxy.ModuleExtractor) { + mb.Called(me) +} + +type mockModuleExtractor struct { + mock.Mock +} + +var _ proxy.ModuleExtractor = &mockModuleExtractor{} + +func NewMockModuleExtractor() *mockModuleExtractor { + return &mockModuleExtractor{} +} + +func (m *mockModuleExtractor) ConfigureEmptyMock() { + rtCtx := proxy.NewRuntimeContext(nil, nil) + m.On("Start").Return() + m.On("Stop", mock.Anything).Return() + m.On("RuntimeContext").Return(rtCtx) + m.On("ModuleContext").Return(nil) + m.On("ModHash").Return(uint32(1)) + m.On("SetModuleContext", mock.Anything).Return() + m.On("FetchUpstreamUrlFunc").Return(nil, false) + m.On("RequestModifierFunc").Return(nil, false) + m.On("ResponseModifierFunc").Return(nil, false) + m.On("ErrorHandlerFunc").Return(nil, false) + m.On("RequestHandlerFunc").Return(nil, false) +} + +func (m *mockModuleExtractor) ConfigureDefaultMock( + req *http.Request, + rw http.ResponseWriter, + ps *proxy.ProxyState, + rt *spec.DGateRoute, + mods ...*spec.DGateModule, +) { + rtCtx := proxy.NewRuntimeContext(ps, rt, mods...) + modCtx := types.NewModuleContext(nil, rw, req, rt, nil) + m.On("Start").Return().Maybe() + m.On("Stop", mock.Anything).Return().Maybe() + m.On("RuntimeContext").Return(rtCtx).Maybe() + m.On("ModuleContext").Return(modCtx).Maybe() + m.On("ModHash").Return(uint32(123)).Maybe() + m.On("SetModuleContext", mock.Anything).Return().Maybe() + m.On("FetchUpstreamUrlFunc").Return(extractors.DefaultFetchUpstreamFunction(), true).Maybe() + m.On("ErrorHandlerFunc").Return(extractors.DefaultErrorHandlerFunction(), true).Maybe() + m.On("RequestModifierFunc").Return(nil, false).Maybe() + m.On("ResponseModifierFunc").Return(nil, false).Maybe() + m.On("RequestHandlerFunc").Return(nil, false).Maybe() +} + +func (m *mockModuleExtractor) Start() { + m.Called() +} + +func (m *mockModuleExtractor) Stop(wait bool) { + m.Called(wait) +} + +func (m *mockModuleExtractor) RuntimeContext() modules.RuntimeContext { + args := m.Called() + return args.Get(0).(modules.RuntimeContext) +} + +func (m *mockModuleExtractor) ModuleContext() *types.ModuleContext { + args := m.Called() + return args.Get(0).(*types.ModuleContext) +} + +func (m *mockModuleExtractor) ModHash() uint32 { + args := m.Called() + return args.Get(0).(uint32) +} + +func (m *mockModuleExtractor) SetModuleContext(modCtx *types.ModuleContext) { + m.Called(modCtx) +} + +func (m *mockModuleExtractor) FetchUpstreamUrlFunc() (extractors.FetchUpstreamUrlFunc, bool) { + args := m.Called() + if args.Get(0) == nil { + return nil, args.Bool(1) + } + return args.Get(0).(extractors.FetchUpstreamUrlFunc), args.Bool(1) +} + +func (m *mockModuleExtractor) RequestModifierFunc() (extractors.RequestModifierFunc, bool) { + args := m.Called() + if args.Get(0) == nil { + return nil, args.Bool(1) + } + return args.Get(0).(extractors.RequestModifierFunc), args.Bool(1) +} + +func (m *mockModuleExtractor) ResponseModifierFunc() (extractors.ResponseModifierFunc, bool) { + args := m.Called() + if args.Get(0) == nil { + return nil, args.Bool(1) + } + return args.Get(0).(extractors.ResponseModifierFunc), args.Bool(1) +} + +func (m *mockModuleExtractor) ErrorHandlerFunc() (extractors.ErrorHandlerFunc, bool) { + args := m.Called() + if args.Get(0) == nil { + return nil, args.Bool(1) + } + return args.Get(0).(extractors.ErrorHandlerFunc), args.Bool(1) +} + +func (m *mockModuleExtractor) RequestHandlerFunc() (extractors.RequestHandlerFunc, bool) { + args := m.Called() + if args.Get(0) == nil { + return nil, args.Bool(1) + } + return args.Get(0).(extractors.RequestHandlerFunc), args.Bool(1) +} diff --git a/internal/proxy/proxy_documents.go b/internal/proxy/proxy_documents.go new file mode 100644 index 0000000..256475e --- /dev/null +++ b/internal/proxy/proxy_documents.go @@ -0,0 +1,33 @@ +package proxy + +import ( + "github.com/dgate-io/dgate/pkg/resources" + "github.com/dgate-io/dgate/pkg/spec" +) + +// DocumentManager is an interface that defines the methods for managing documents. +func (ps *ProxyState) DocumentManager() resources.DocumentManager { + return ps +} + +// GetDocuments is a function that returns a list of documents in a collection. +func (ps *ProxyState) GetDocuments(collection, namespace string, limit, offset int) ([]*spec.Document, error) { + if _, ok := ps.rm.GetNamespace(namespace); !ok { + return nil, spec.ErrNamespaceNotFound(namespace) + } + if _, ok := ps.rm.GetCollection(namespace, collection); !ok { + return nil, spec.ErrCollectionNotFound(collection) + } + return ps.store.FetchDocuments(namespace, collection, limit, offset) +} + +// GetDocumentByID is a function that returns a document in a collection by its ID. +func (ps *ProxyState) GetDocumentByID(namespace, collection, id string) (*spec.Document, error) { + if _, ok := ps.rm.GetNamespace(namespace); !ok { + return nil, spec.ErrNamespaceNotFound(namespace) + } + if _, ok := ps.rm.GetCollection(collection, namespace); !ok { + return nil, spec.ErrCollectionNotFound(collection) + } + return ps.store.FetchDocument(namespace, collection, id) +} diff --git a/internal/proxy/proxy_handler.go b/internal/proxy/proxy_handler.go new file mode 100644 index 0000000..06ca298 --- /dev/null +++ b/internal/proxy/proxy_handler.go @@ -0,0 +1,322 @@ +package proxy + +import ( + "crypto/tls" + "io" + "net" + "net/http" + "net/url" + "time" + + "github.com/dgate-io/chi-router" + "github.com/dgate-io/dgate/pkg/modules/types" + "github.com/dgate-io/dgate/pkg/util" +) + +type ProxyHandlerFunc func(ps *ProxyState, reqCtx *RequestContext) + +func proxyHandler(ps *ProxyState, reqCtx *RequestContext) { + rs := NewRequestStats(reqCtx.route) + var err error + defer func() { + event := ps.logger.Debug(). + Str("route", reqCtx.route.Name). + Str("namespace", reqCtx.route.Namespace.Name) + if err != nil { + event = event.Err(err) + } + if reqCtx.route.Service != nil { + event = event. + Str("service", reqCtx.route.Service.Name) + event = event. + Stringer("upstream", rs.UpstreamRequestDur) + } + for k, v := range rs.MiscDurs { + event = event.Stringer(k, v) + } + event.Msg("[STATS] Request Latency") + ps.stats.AddRequestStats(rs) + }() + + defer func() { + if reqCtx.req.Body != nil { + // Ensure that the request body is drained/closed, so the connection can be reused + io.Copy(io.Discard, reqCtx.req.Body) + reqCtx.req.Body.Close() + } + }() + + var modExt ModuleExtractor + if len(reqCtx.route.Modules) != 0 { + runtimeStart := time.Now() + if reqCtx.provider.modBuf == nil { + ps.logger.Error().Msg("Error getting module buffer: invalid state") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + var ok bool + modExt, ok = reqCtx.provider.modBuf.Borrow() + if !ok || modExt == nil { + ps.logger.Error().Msg("Error borrowing module") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + + if rtCtx, ok := modExt.RuntimeContext().(*runtimeContext); ok { + pathParams := make(map[string]string) + if chiCtx := chi.RouteContext(reqCtx.req.Context()); chiCtx != nil { + for i, key := range chiCtx.URLParams.Keys { + pathParams[key] = chiCtx.URLParams.Values[i] + } + } + // set request context for runtime + rtCtx.SetRequestContext(reqCtx, pathParams) + // set module context for runtime + modExt.SetModuleContext( + types.NewModuleContext( + rtCtx.loop, reqCtx.rw, reqCtx.req, + rtCtx.reqCtx.route, pathParams, + ), + ) + // TODO: consider using context to properly close + modExt.Start() + defer func() { + rtCtx.Clean() + modExt.Stop(true) + reqCtx.provider.modBuf.Return(modExt) + }() + } else { + ps.logger.Error().Msg("Error getting runtime context") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + + runtimeElapsed := time.Since(runtimeStart) + rs.AddMiscDuration("moduleExtract", runtimeElapsed) + ps.logger.Trace(). + Str("duration", runtimeElapsed.String()). + Msg("[STATS] Runtime Created") + } else { + modExt = NewEmptyModuleExtractor() + } + + if reqCtx.route.Service != nil { + handleServiceProxy(ps, reqCtx, modExt, rs) + } else { + requestHandlerModule(ps, reqCtx, modExt, rs) + } +} + +func handleServiceProxy(ps *ProxyState, reqCtx *RequestContext, modExt ModuleExtractor, rs *RequestStats) { + var host string + if fetchUpstreamUrl, ok := modExt.FetchUpstreamUrlFunc(); ok { + fetchUpstreamStart := time.Now() + hostUrl, err := fetchUpstreamUrl(modExt.ModuleContext()) + if err != nil { + ps.logger.Err(err).Msg("Error fetching upstream") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + host = hostUrl.String() + fetchUpstreamElapsed := time.Since(fetchUpstreamStart) + rs.AddMiscDuration("fetchUpstreamUrl", fetchUpstreamElapsed) + ps.logger.Trace(). + Str("duration", fetchUpstreamElapsed.String()). + Msg("[STATS] fetch upstream module") + } else { + if reqCtx.route.Service.URLs == nil || len(reqCtx.route.Service.URLs) == 0 { + ps.logger.Error().Msg("Error getting service urls") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + host = reqCtx.route.Service.URLs[0].String() + } + + if reqCtx.route.Service.HideDGateHeaders { + if ps.debugMode { + reqCtx.rw.Header().Set("X-Upstream-URL", host) + } + reqCtx.req.Header.Set("X-DGate-Service", reqCtx.route.Service.Name) + reqCtx.req.Header.Set("X-DGate-Route", reqCtx.route.Name) + reqCtx.req.Header.Set("X-DGate-Namespace", reqCtx.route.Namespace.Name) + for _, tag := range ps.config.Tags { + reqCtx.req.Header.Add("X-DGate-Tags", tag) + } + } + upstreamUrl, err := url.Parse(host) + if err != nil { + ps.logger.Err(err).Msg("Error parsing upstream url") + util.WriteStatusCodeError(reqCtx.rw, http.StatusBadGateway) + return + } + proxyTransport := setupTranportFromConfig( + ps.config.ProxyConfig.Transport, + func(dialer *net.Dialer, t *http.Transport) { + t.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: reqCtx.route.Service.TLSSkipVerify, + } + dialer.Timeout = reqCtx.route.Service.ConnectTimeout + t.ForceAttemptHTTP2 = reqCtx.route.Service.HTTP2Only + }, + ) + + ptb := ps.ProxyTransportBuilder.Clone(). + Transport(proxyTransport). + Retries(reqCtx.route.Service.Retries). + RetryTimeout(reqCtx.route.Service.RetryTimeout). + RequestTimeout(reqCtx.route.Service.RequestTimeout) + + proxy, err := ptb.Build() + if err != nil { + ps.logger.Err(err).Msg("Error creating proxy transport") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + + rpb := ps.ReverseProxyBuilder.Clone(). + Transport(proxy).FlushInterval(-1). + ProxyRewrite( + reqCtx.route.StripPath, + reqCtx.route.PreserveHost, + reqCtx.route.Service.DisableQueryParams, + ps.config.ProxyConfig.DisableXForwardedHeaders, + ). + ModifyResponse(func(res *http.Response) error { + if reqCtx.route.Service.HideDGateHeaders { + res.Header.Set("Via", "DGate Proxy") + } + if responseModifier, ok := modExt.ResponseModifierFunc(); ok { + resModifierStart := time.Now() + err = responseModifier(modExt.ModuleContext(), res) + resModifierElapsed := time.Since(resModifierStart) + if err != nil { + ps.logger.Err(err).Msg("Error modifying response") + return err + } + rs.AddMiscDuration("responseModifier", resModifierElapsed) + ps.logger.Trace(). + Str("duration", resModifierElapsed.String()). + Msg("[STATS] respond modifier module") + } + return nil + }). + ErrorHandler(func(w http.ResponseWriter, r *http.Request, reqErr error) { + ps.logger.Debug().Err(reqErr).Msg("Error proxying request") + if reqCtx.rw.HeadersSent() { + return + } + if errorHandler, ok := modExt.ErrorHandlerFunc(); ok { + errorHandlerStart := time.Now() + err = errorHandler(modExt.ModuleContext(), reqErr) + errorHandlerElapsed := time.Since(errorHandlerStart) + rs.AddMiscDuration("errorHandler", errorHandlerElapsed) + ps.logger.Trace(). + Str("duration", errorHandlerElapsed.String()). + Msg("[STATS] error handler module") + ps.logger.Trace().Err(reqErr).Msg("Error proxying request") + if err != nil { + ps.logger.Err(err).Msg("Error handling error") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + } else { + ps.logger.Err(reqErr).Msg("Error handling error") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + }) + + if requestModifier, ok := modExt.RequestModifierFunc(); ok { + reqModifierStart := time.Now() + err = requestModifier(modExt.ModuleContext()) + if err != nil { + ps.logger.Err(err).Msg("Error modifying request") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + reqModifierElapsed := time.Since(reqModifierStart) + rs.AddMiscDuration("requestModifier", reqModifierElapsed) + ps.logger.Trace(). + Str("duration", reqModifierElapsed.String()). + Msg("[STATS] request modifier module") + } + + upstreamStart := time.Now() + rp, err := rpb.Build(upstreamUrl, reqCtx.pattern) + if err != nil { + ps.logger.Err(err).Msg("Error creating reverse proxy") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + // Set Upstream Response Headers + for k, v := range ps.config.ProxyConfig.GlobalHeaders { + reqCtx.rw.Header().Set(k, v) + } + + rp.ServeHTTP(reqCtx.rw, reqCtx.req) + + upstreamElapsed := time.Since(upstreamStart) + rs.AddUpstreamRequestDuration(upstreamElapsed) + ps.logger.Trace(). + Str("duration", upstreamElapsed.String()). + Msg("[STATS] upstream") +} + +func requestHandlerModule(ps *ProxyState, reqCtx *RequestContext, modExt ModuleExtractor, rs *RequestStats) { + var err error + if requestModifier, ok := modExt.RequestModifierFunc(); ok { + // extract request modifier function from module + reqModifierStart := time.Now() + err = requestModifier(modExt.ModuleContext()) + if err != nil { + ps.logger.Err(err).Msg("Error modifying request") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + reqModifierElapsed := time.Since(reqModifierStart) + rs.AddMiscDuration("requestModifier", reqModifierElapsed) + ps.logger.Trace(). + Str("duration", reqModifierElapsed.String()). + Msg("[STATS] request modifier module") + } + if requestHandler, ok := modExt.RequestHandlerFunc(); ok { + requestHandlerStart := time.Now() + if err := requestHandler(modExt.ModuleContext()); err != nil { + ps.logger.Error().Err(err).Msg("Error handling request") + if errorHandler, ok := modExt.ErrorHandlerFunc(); ok { + // extract error handler function from module + errorHandlerStart := time.Now() + if err = errorHandler(modExt.ModuleContext(), err); err != nil { + ps.logger.Err(err).Msg("Error handling error") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + errorHandlerElapsed := time.Since(errorHandlerStart) + rs.AddMiscDuration("errorHandler", errorHandlerElapsed) + ps.logger.Trace(). + Str("duration", errorHandlerElapsed.String()). + Msg("[STATS] error handler module") + } else { + ps.logger.Err(err).Msg("Error handling request") + util.WriteStatusCodeError(reqCtx.rw, http.StatusInternalServerError) + return + } + } else { + requestHandlerElapsed := time.Since(requestHandlerStart) + rs.AddMiscDuration("requestHandler", requestHandlerElapsed) + ps.logger.Trace(). + Str("duration", requestHandlerElapsed.String()). + Msg("[STATS] request handler module") + if !reqCtx.rw.HeadersSent() { + if reqCtx.rw.BytesWritten() > 0 { + reqCtx.rw.WriteHeader(http.StatusOK) + } else { + reqCtx.rw.WriteHeader(http.StatusNoContent) + } + } + } + } else { + util.WriteStatusCodeError(reqCtx.rw, http.StatusNotImplemented) + return + } +} diff --git a/internal/proxy/proxy_handler_test.go b/internal/proxy/proxy_handler_test.go new file mode 100644 index 0000000..2df5ce3 --- /dev/null +++ b/internal/proxy/proxy_handler_test.go @@ -0,0 +1,184 @@ +package proxy_test + +import ( + "context" + "errors" + "io" + "net/http" + "os" + "strings" + "testing" + + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/config/configtest" + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/internal/proxy/proxytest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +// TODO: clean up the tests - make then simpler, more readable. + +func TestProxyHandler_ReverseProxy(t *testing.T) { + os.Setenv("LOG_NO_COLOR", "true") + configs := []*config.DGateConfig{ + configtest.NewTestDGateConfig(), + // configtest.NewTest2DGateConfig(), + } + for _, conf := range configs { + ps := proxy.NewProxyState(conf) + rpBuilder := proxytest.CreateMockReverseProxyBuilder() + rpBuilder.On("FlushInterval", mock.Anything).Return(rpBuilder).Once() + // rpBuilder.On("CustomRewrite", mock.Anything).Return(rpBuilder).Times(0) + rpBuilder.On("ModifyResponse", mock.Anything).Return(rpBuilder).Once() + rpBuilder.On("ErrorHandler", mock.Anything).Return(rpBuilder).Once() + rpBuilder.On("Transport", mock.Anything).Return(rpBuilder).Once() + rpBuilder.On("ProxyRewrite", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(rpBuilder).Once() + rpBuilder.On("Clone").Return(rpBuilder).Once() + rpe := proxytest.CreateMockReverseProxyExecutor() + rpe.On("ServeHTTP", mock.Anything, mock.Anything).Return().Once() + rpBuilder.On("Build", mock.Anything, mock.Anything).Return(rpe, nil).Once() + defer rpBuilder.AssertExpectations(t) + defer rpe.AssertExpectations(t) + ps.ReverseProxyBuilder = rpBuilder + + rm := ps.ResourceManager() + rt, ok := rm.GetRoute("test", "test") + if !ok { + t.Fatal("namespace not found") + } + + reqCtxProvider := proxy.NewRequestContextProvider(rt) + + req, wr := proxytest.NewMockRequestAndResponseWriter("GET", "http://localhost:8080/test", []byte{}) + // wr.On("WriteHeader", 200).Return().Once() + wr.SetWriteFallThrough() + wr.On("Header").Return(http.Header{}) + wr.On("Write", mock.Anything).Return(0, nil).Maybe() + reqCtx := reqCtxProvider.CreateRequestContext( + context.Background(), wr, req, "/") + + modExt := NewMockModuleExtractor() + modExt.ConfigureDefaultMock(req, wr, ps, rt) + modBuf := NewMockModuleBuffer() + modBuf.On("Borrow").Return(modExt, true).Once() + modBuf.On("Return", modExt).Return().Once() + reqCtxProvider.SetModuleBuffer(modBuf) + + ps.ProxyHandlerFunc(ps, reqCtx) + + wr.AssertExpectations(t) + modBuf.AssertExpectations(t) + modExt.AssertExpectations(t) + } +} + +func TestProxyHandler_ProxyHandler(t *testing.T) { + os.Setenv("LOG_NO_COLOR", "true") + configs := []*config.DGateConfig{ + configtest.NewTestDGateConfig(), + // configtest.NewTest2DGateConfig(), + } + for _, conf := range configs { + ps := proxy.NewProxyState(conf) + ptBuilder := proxytest.CreateMockProxyTransportBuilder() + ptBuilder.On("Retries", mock.Anything).Return(ptBuilder).Once() + ptBuilder.On("Transport", mock.Anything).Return(ptBuilder).Once() + ptBuilder.On("RequestTimeout", mock.Anything).Return(ptBuilder).Once() + ptBuilder.On("RetryTimeout", mock.Anything).Return(ptBuilder).Maybe() + ptBuilder.On("Clone").Return(ptBuilder).Once() + tp := proxytest.CreateMockTransport() + resp := &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: io.NopCloser(strings.NewReader("abc")), + ContentLength: 3, + } + tp.On("RoundTrip", mock.Anything).Return(resp, nil) + ptBuilder.On("Build").Return(tp, nil).Once() + defer ptBuilder.AssertExpectations(t) + ps.ProxyTransportBuilder = ptBuilder + + rm := ps.ResourceManager() + rt, ok := rm.GetRoute("test", "test") + if !ok { + t.Fatal("namespace not found") + } + req, wr := proxytest.NewMockRequestAndResponseWriter("GET", "http://localhost:8080/test", []byte("123")) + wr.On("WriteHeader", resp.StatusCode).Return().Maybe() + wr.On("Header").Return(http.Header{}).Maybe() + wr.On("Write", mock.Anything).Return(0, nil).Once().Run(func(args mock.Arguments) { + b := args.Get(0).([]byte) + assert.Equal(t, b, []byte("abc")) + }) + + reqCtxProvider := proxy.NewRequestContextProvider(rt) + modExt := NewMockModuleExtractor() + modExt.ConfigureDefaultMock(req, wr, ps, rt) + modBuf := NewMockModuleBuffer() + modBuf.On("Borrow").Return(modExt, true).Once() + modBuf.On("Return", modExt).Return().Once() + reqCtxProvider.SetModuleBuffer(modBuf) + + reqCtx := reqCtxProvider.CreateRequestContext( + context.Background(), wr, req, "/") + ps.ProxyHandlerFunc(ps, reqCtx) + + wr.AssertExpectations(t) + modBuf.AssertExpectations(t) + modExt.AssertExpectations(t) + } +} + +func TestProxyHandler_ProxyHandlerError(t *testing.T) { + os.Setenv("LOG_NO_COLOR", "true") + configs := []*config.DGateConfig{ + configtest.NewTestDGateConfig(), + // configtest.NewTest2DGateConfig(), + } + for _, conf := range configs { + ps := proxy.NewProxyState(conf) + ptBuilder := proxytest.CreateMockProxyTransportBuilder() + ptBuilder.On("Retries", mock.Anything).Return(ptBuilder).Maybe() + ptBuilder.On("Transport", mock.Anything).Return(ptBuilder).Maybe() + ptBuilder.On("RequestTimeout", mock.Anything).Return(ptBuilder).Maybe() + ptBuilder.On("RetryTimeout", mock.Anything).Return(ptBuilder).Maybe() + ptBuilder.On("Clone").Return(ptBuilder).Maybe() + tp := proxytest.CreateMockTransport() + tp.On("RoundTrip", mock.Anything).Return( + nil, errors.New("testing error"), + ) + ptBuilder.On("Build").Return(tp, nil).Maybe() + defer ptBuilder.AssertExpectations(t) + ps.ProxyTransportBuilder = ptBuilder + + rm := ps.ResourceManager() + rt, ok := rm.GetRoute("test", "test") + if !ok { + t.Fatal("namespace not found") + } + + req, wr := proxytest.NewMockRequestAndResponseWriter("GET", "http://localhost:8080/test", []byte("123")) + + wr.On("WriteHeader", 502).Return().Maybe() + wr.On("WriteHeader", 500).Return().Maybe() + wr.On("Header").Return(http.Header{}).Maybe() + wr.On("Write", mock.Anything).Return(0, nil).Maybe() + + modExt := NewMockModuleExtractor() + modExt.ConfigureDefaultMock(req, wr, ps, rt) + modBuf := NewMockModuleBuffer() + modBuf.On("Borrow").Return(modExt, true).Once() + modBuf.On("Return", modExt).Return().Once() + + reqCtxProvider := proxy.NewRequestContextProvider(rt) + reqCtxProvider.SetModuleBuffer(modBuf) + reqCtx := reqCtxProvider.CreateRequestContext( + context.Background(), wr, req, "/") + ps.ProxyHandlerFunc(ps, reqCtx) + + wr.AssertExpectations(t) + modBuf.AssertExpectations(t) + modExt.AssertExpectations(t) + } +} diff --git a/internal/proxy/proxy_printer.go b/internal/proxy/proxy_printer.go new file mode 100644 index 0000000..bfe56c1 --- /dev/null +++ b/internal/proxy/proxy_printer.go @@ -0,0 +1,42 @@ +package proxy + +import ( + "github.com/rs/zerolog" +) + +type ( + ProxyPrinter struct { + logger zerolog.Logger + // logs []*printerLog + } + // printerLog struct { + // time time.Time + // level string + // msg string + // } +) + +func NewProxyPrinter(logger zerolog.Logger) *ProxyPrinter { + return &ProxyPrinter{ + logger: logger, + // logs: make([]*printerLog, 0), + } +} + +func (pp *ProxyPrinter) Error(s string) { + // pp.logs = append(pp.logs, &printerLog{ + // time.Now(), "error", s}) + pp.logger.Error().Msg(s) +} + +func (pp *ProxyPrinter) Warn(s string) { + // pp.logs = append(pp.logs, &printerLog{ + // time.Now(), "warn", s}) + pp.logger.Warn().Msg(s) +} + +func (pp *ProxyPrinter) Log(s string) { + // pp.logs = append(pp.logs, &printerLog{ + // time.Now(), "info", s}) + pp.logger.Debug().Msg(s) +} diff --git a/internal/proxy/proxy_replication.go b/internal/proxy/proxy_replication.go new file mode 100644 index 0000000..782084e --- /dev/null +++ b/internal/proxy/proxy_replication.go @@ -0,0 +1,15 @@ +package proxy + +import "github.com/hashicorp/raft" + +type ProxyReplication struct { + raft *raft.Raft + raftConfig *raft.Config +} + +func NewProxyReplication(raft *raft.Raft, raftConfig *raft.Config) *ProxyReplication { + return &ProxyReplication{ + raft: raft, + raftConfig: raftConfig, + } +} diff --git a/internal/proxy/proxy_state.go b/internal/proxy/proxy_state.go new file mode 100644 index 0000000..6daad1d --- /dev/null +++ b/internal/proxy/proxy_state.go @@ -0,0 +1,564 @@ +package proxy + +import ( + "bytes" + "crypto/tls" + "encoding/base64" + "encoding/gob" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "net/http" + "os" + "sort" + "sync" + "time" + + "github.com/dgate-io/dgate/internal/config" + "github.com/dgate-io/dgate/internal/pattern" + "github.com/dgate-io/dgate/internal/proxy/proxy_transport" + "github.com/dgate-io/dgate/internal/proxy/proxystore" + "github.com/dgate-io/dgate/internal/proxy/reverse_proxy" + "github.com/dgate-io/dgate/internal/router" + "github.com/dgate-io/dgate/pkg/cache" + "github.com/dgate-io/dgate/pkg/modules/extractors" + "github.com/dgate-io/dgate/pkg/resources" + "github.com/dgate-io/dgate/pkg/scheduler" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/storage" + "github.com/dgate-io/dgate/pkg/util" + "github.com/dgate-io/dgate/pkg/util/tree/avl" + "github.com/dop251/goja" + "github.com/dop251/goja_nodejs/console" + "github.com/hashicorp/raft" + "github.com/rs/zerolog" +) + +type ProxyState struct { + debugMode bool + config *config.DGateConfig + status ProxyStatus + logger zerolog.Logger + printer console.Printer + stats *ProxyStats + store *proxystore.ProxyStore + proxyLock *sync.RWMutex + changeHash uint32 + + sharedCache cache.TCache + + changeChan chan *spec.ChangeLog + rm *resources.ResourceManager + skdr scheduler.Scheduler + + providers avl.Tree[string, *RequestContextProvider] + modPrograms avl.Tree[string, *goja.Program] + + replicationSettings *ProxyReplication + replicationEnabled bool + + routers avl.Tree[string, *router.DynamicRouter] + + ReverseProxyBuilder reverse_proxy.Builder + ProxyTransportBuilder proxy_transport.Builder + ProxyHandlerFunc ProxyHandlerFunc +} + +type ( + ProxyStatus byte +) + +const ( + ProxyStatusStarting ProxyStatus = iota + ProxyStatusModifying + ProxyStatusRunning + ProxyStatusStopping + ProxyStatusClosed +) + +type ProxySnapshot struct { + ResourceManager *resources.ResourceManager `json:"resource_manager"` +} + +func NewProxyState(conf *config.DGateConfig) *ProxyState { + var logger zerolog.Logger + level, err := zerolog.ParseLevel(conf.LogLevel) + if err != nil { + panic(fmt.Errorf("invalid log level: %s", err)) + } + if level == zerolog.NoLevel { + level = zerolog.InfoLevel + } + + if util.EnvVarCheckBool("LOG_JSON") { + logger = zerolog.New(os.Stdout). + Level(level).With(). + Timestamp().Logger() + } else { + cw := zerolog.NewConsoleWriter() + cw.TimeFormat = "2006/01/02T03:04:05PM" + cw.NoColor = util.EnvVarCheckBool("LOG_NO_COLOR") + logger = zerolog.New(cw). + Level(level).With(). + Timestamp().Logger() + } + logger = logger.Level(level) + + var dataStore storage.Storage + switch conf.Storage.StorageType { + case config.StorageTypeMemory: + memConfig := storage.MemoryStoreConfig{} + memConfig.Logger = logger + dataStore = storage.NewMemoryStore(&memConfig) + case config.StorageTypeFile: + fileConfig, err := config.StoreConfig[storage.FileStoreConfig](conf.Storage.Config) + if err != nil { + panic(fmt.Errorf("invalid config: %s", err)) + } + fileConfig.Logger = logger + dataStore = storage.NewFileStore(&fileConfig) + default: + panic(fmt.Errorf("invalid storage type: %s", conf.Storage.StorageType)) + } + // kl := keylock.NewKeyLock() + var opt resources.Options + if conf.DisableDefaultNamespace { + logger.Debug().Msg("default namespace disabled") + } else { + opt = resources.WithDefaultNamespace(spec.DefaultNamespace) + } + var printer console.Printer = &extractors.NoopPrinter{} + if conf.ProxyConfig.EnableConsoleLogger { + printer = NewProxyPrinter(logger) + } + state := &ProxyState{ + logger: logger, + debugMode: conf.Debug, + config: conf, + status: ProxyStatusModifying, + stats: NewProxyStats(20), + printer: printer, + routers: avl.NewTree[string, *router.DynamicRouter](), + changeChan: make(chan *spec.ChangeLog, 1), + rm: resources.NewManager(opt), + providers: avl.NewTree[string, *RequestContextProvider](), + modPrograms: avl.NewTree[string, *goja.Program](), + proxyLock: new(sync.RWMutex), + sharedCache: cache.New(), + + ReverseProxyBuilder: reverse_proxy.NewBuilder(). + FlushInterval(time.Millisecond * 10). + CustomRewrite(func(in *http.Request, out *http.Request) { + if in.URL.Scheme == "ws" { + out.URL.Scheme = "http" + } else if in.URL.Scheme == "wss" { + out.URL.Scheme = "https" + } else if in.URL.Scheme == "" { + if in.TLS != nil { + out.URL.Scheme = "https" + } else { + out.URL.Scheme = "http" + } + } + }), + ProxyTransportBuilder: proxy_transport.NewBuilder(), + ProxyHandlerFunc: proxyHandler, + } + + state.store = proxystore.New(dataStore, state.Logger(WithComponentLogger("proxystore"))) + + err = state.initConfigResources(conf.ProxyConfig.InitResources) + if err != nil { + panic("error initializing resources: " + err.Error()) + } + return state +} + +func (ps *ProxyState) RestoreState(r io.Reader) error { + // register empty change to refresh state + defer ps.applyChange(nil) + dec := gob.NewDecoder(r) + var snapshot *ProxySnapshot + err := dec.Decode(snapshot) + if err != nil { + return err + } + // TODO: ps.rm.RestoreState(snapshot) + return nil +} + +// func (ps *ProxyState) CaptureState() *ProxySnapshot { +// unlock := ps.keyLock.LockAll() +// defer unlock() +// return &ProxySnapshot{ +// Namespaces: ps.namespaces, +// NamespaceModuleMap: ps.namespaceModuleMap, +// NamespaceRouteMap: ps.namespaceRouteMap, +// NamespaceServiceMap: ps.namespaceServiceMap, +// } +// } + +func (ps *ProxySnapshot) PersistState(w io.Writer) error { + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + return enc.Encode(ps) +} + +func (ps *ProxyState) Stats() *ProxyStats { + return ps.stats +} + +type LoggerOptions func(zerolog.Context) zerolog.Context + +func (ps *ProxyState) Logger(opts ...LoggerOptions) *zerolog.Logger { + logCtx := ps.logger.With() + + for _, opt := range opts { + logCtx = opt(logCtx) + } + logger := logCtx.Logger() + return &logger +} + +func WithComponentLogger(component string) LoggerOptions { + return func(ctx zerolog.Context) zerolog.Context { + return ctx.Str("component", component) + } +} + +func WithDefaultLevel(level zerolog.Level) LoggerOptions { + return func(ctx zerolog.Context) zerolog.Context { + return ctx.Str(zerolog.LevelFieldName, zerolog.LevelFieldMarshalFunc(level)) + } +} + +func (ps *ProxyState) ChangeHash() uint32 { + return ps.changeHash +} + +func (ps *ProxyState) Raft() *raft.Raft { + if ps.replicationEnabled { + return ps.replicationSettings.raft + } + return nil +} + +func (ps *ProxyState) EnableRaft(r *raft.Raft, rc *raft.Config) { + ps.proxyLock.Lock() + defer ps.proxyLock.Unlock() + ps.replicationEnabled = true + ps.replicationSettings = NewProxyReplication(r, rc) + +} + +func (ps *ProxyState) WaitForChanges() { + ps.proxyLock.RLock() + defer ps.proxyLock.RUnlock() +} + +func (ps *ProxyState) ApplyChangeLog(log *spec.ChangeLog) error { + ps.logger.Trace(). + Bool("replication_enabled", ps.replicationEnabled). + Msgf("Applying change log: %s", log.Cmd) + if ps.replicationEnabled { + r := ps.replicationSettings.raft + if r.State() != raft.Leader { + return raft.ErrNotLeader + } + encodedCL, err := json.Marshal(log) + if err != nil { + return err + } + raftLog := raft.Log{ + Data: encodedCL, + } + future := r.ApplyLog(raftLog, time.Second*15) + ps.logger.Trace(). + Interface("changelog", log). + Msgf("waiting for reply: %s", log.ID) + return future.Error() + } else { + return ps.processChangeLog(log, true, true) + } +} + +func (ps *ProxyState) ResourceManager() *resources.ResourceManager { + if ps == nil { + return nil + } + return ps.rm +} + +func (ps *ProxyState) Scheduler() scheduler.Scheduler { + return ps.skdr +} + +func (ps *ProxyState) SharedCache() cache.TCache { + return ps.sharedCache +} + +func (ps *ProxyState) ReloadState() error { + return <-ps.applyChange(nil) +} + +func (ps *ProxyState) ProcessChangeLog(log *spec.ChangeLog, register bool) error { + err := ps.processChangeLog(log, register, !ps.replicationEnabled) + if err != nil { + ps.logger.Error().Err(err).Msg("error processing change log") + return err + } + return nil +} + +func (ps *ProxyState) DynamicTLSConfig( + certFile, keyFile string, +) *tls.Config { + var fallbackCert *tls.Certificate + return &tls.Config{ + GetCertificate: func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { + cert, ok, err := ps.getDomainCertificate(info.ServerName) + if err != nil { + return nil, err + } else if !ok { + if certFile != "" && keyFile != "" { + cert, err := ps.loadCertFromFile(certFile, keyFile) + if err != nil { + return nil, err + } + fallbackCert = cert + } else if fallbackCert != nil { + return fallbackCert, nil + } else { + return nil, errors.New("no cert found") + } + } + return cert, nil + }, + } +} + +func (ps *ProxyState) loadCertFromFile(certFile, keyFile string) (*tls.Certificate, error) { + cert, err := tls.LoadX509KeyPair(certFile, keyFile) + if err != nil { + return nil, err + } + return &cert, nil +} + +func (ps *ProxyState) getDomainCertificate(domain string) (*tls.Certificate, bool, error) { + allowedDomains := ps.config.ProxyConfig.AllowedDomains + _, domainAllowed, err := pattern.MatchAnyPattern(domain, allowedDomains) + if err != nil { + ps.logger.Error().Msgf("Error checking domain match list: %s", err.Error()) + return nil, false, err + } + if domainAllowed || len(allowedDomains) == 0 { + domains := ps.rm.GetDomains() + sort.Slice(domains, func(i, j int) bool { + if domains[i].Priority == domains[j].Priority { + return domains[i].Name > domains[j].Name + } + return domains[i].Priority > domains[j].Priority + }) + for _, d := range domains { + if _, domainMatches, err := pattern.MatchAnyPattern(domain, d.Patterns); err != nil { + ps.logger.Error().Msgf("Error checking domain match list: %s", err.Error()) + return nil, false, err + } else { + if domainMatches { + if d.TLSCert == nil { + return nil, false, nil + } + return d.TLSCert, true, nil + } + } + } + } + return nil, false, nil +} + +func (ps *ProxyState) initConfigResources(resources *config.DGateResources) error { + if resources != nil { + err := resources.Validate() + if err != nil { + return err + } + ps.logger.Info().Msg("Initializing resources") + for _, ns := range resources.Namespaces { + cl := spec.NewChangeLog(&ns, ns.Name, spec.AddNamespaceCommand) + err := ps.processChangeLog(cl, false, false) + if err != nil { + return err + } + } + for _, mod := range resources.Modules { + if mod.PayloadFile != "" { + payload, err := os.ReadFile(mod.PayloadFile) + if err != nil { + return err + } + mod.Payload = base64.StdEncoding.EncodeToString(payload) + } + if mod.Payload != "" { + mod.Payload = base64.StdEncoding.EncodeToString( + []byte(mod.Payload), + ) + } + cl := spec.NewChangeLog(&mod.Module, mod.NamespaceName, spec.AddModuleCommand) + err := ps.processChangeLog(cl, false, false) + if err != nil { + return err + } + } + for _, svc := range resources.Services { + cl := spec.NewChangeLog(&svc, svc.NamespaceName, spec.AddServiceCommand) + err := ps.processChangeLog(cl, false, false) + if err != nil { + return err + } + } + for _, rt := range resources.Routes { + cl := spec.NewChangeLog(&rt, rt.NamespaceName, spec.AddRouteCommand) + err := ps.processChangeLog(cl, false, false) + if err != nil { + return err + } + } + for _, dom := range resources.Domains { + if dom.CertFile != "" { + cert, err := os.ReadFile(dom.CertFile) + if err != nil { + return err + } + dom.Cert = string(cert) + } + if dom.KeyFile != "" { + key, err := os.ReadFile(dom.KeyFile) + if err != nil { + return err + } + dom.Key = string(key) + } + cl := spec.NewChangeLog(&dom.Domain, dom.NamespaceName, spec.AddDomainCommand) + err := ps.processChangeLog(cl, false, false) + if err != nil { + return err + } + } + for _, col := range resources.Collections { + cl := spec.NewChangeLog(&col, col.NamespaceName, spec.AddCollectionCommand) + err := ps.processChangeLog(cl, false, false) + if err != nil { + return err + } + } + for _, doc := range resources.Documents { + cl := spec.NewChangeLog(&doc, doc.NamespaceName, spec.AddDocumentCommand) + err := ps.processChangeLog(cl, false, false) + if err != nil { + return err + } + } + } + return nil +} + +func (ps *ProxyState) FindNamespaceByRequest(r *http.Request) *spec.DGateNamespace { + host, _, err := net.SplitHostPort(r.Host) + if err != nil { + host = r.Host + } + + domains := ps.rm.GetDomains() + if len(domains) > 0 { + sort.Slice(domains, func(i, j int) bool { + if domains[i].Priority == domains[j].Priority { + return domains[i].Name > domains[j].Name + } + return domains[i].Priority > domains[j].Priority + }) + var priority uint + var namespace *spec.DGateNamespace + for _, d := range domains { + if d.Priority < priority { + continue + } + _, match, err := pattern.MatchAnyPattern(host, d.Patterns) + if err != nil { + ps.logger.Error().Err(err). + Msg("error matching namespace") + continue + } + if match { + priority, namespace = d.Priority, d.Namespace + } + } + return namespace + } + return nil +} + +func (ps *ProxyState) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if ns := ps.FindNamespaceByRequest(r); ns != nil { + allowedDomains := ps.config.ProxyConfig.AllowedDomains + // if allowed domains is empty, allow all domains + host, _, err := net.SplitHostPort(r.Host) + if err != nil { + host = r.Host + } + if len(allowedDomains) > 0 { + _, ok, err := pattern.MatchAnyPattern(host, allowedDomains) + if err != nil { + ps.logger.Trace().Msgf("Error checking domain match list: %s", err.Error()) + util.WriteStatusCodeError(w, http.StatusInternalServerError) + return + } + if !ok { + ps.logger.Trace().Msgf("Domain %s not allowed", host) + // if debug mode is enabled, return a 403 + util.WriteStatusCodeError(w, http.StatusForbidden) + if ps.debugMode { + w.Write([]byte(" - Domain not allowed")) + } + return + } + } + if r.TLS == nil && len(ps.config.ProxyConfig.RedirectHttpsDomains) > 0 { + _, match, err := pattern.MatchAnyPattern(host, ps.config.ProxyConfig.RedirectHttpsDomains) + if err != nil { + ps.logger.Error().Msgf("Error checking domain match list: %s", err.Error()) + util.WriteStatusCodeError(w, http.StatusInternalServerError) + return + } + if match { + url := *r.URL + url.Scheme = "https" + ps.logger.Info().Msgf("Redirecting to https: %s", url.String()) + http.Redirect(w, r, url.String(), + // maybe change to http.StatusMovedPermanently + http.StatusTemporaryRedirect) + return + } + } + if router, ok := ps.routers.Find(ns.Name); ok { + router.ServeHTTP(w, r) + } else { + ps.logger.Debug().Msgf("No router found for namespace: %s", ns.Name) + util.WriteStatusCodeError(w, http.StatusNotFound) + } + } else { + ps.logger.Debug().Msgf( + "No namespace found for request - %s %s %s secure:%t from %s", + r.Proto, r.Host, r.URL.String(), r.TLS != nil, r.RemoteAddr, + ) + util.WriteStatusCodeError(w, http.StatusNotFound) + } +} + +func (ps *ProxyState) Snapshot() *ProxySnapshot { + return &ProxySnapshot{ + ResourceManager: ps.rm, + } +} diff --git a/internal/proxy/proxy_stats.go b/internal/proxy/proxy_stats.go new file mode 100644 index 0000000..050181d --- /dev/null +++ b/internal/proxy/proxy_stats.go @@ -0,0 +1,123 @@ +package proxy + +import ( + "fmt" + "sync" + "time" + + "github.com/dgate-io/dgate/pkg/spec" + "github.com/montanaflynn/stats" +) + +type ProxyStats struct { + serviceRequestCount map[string]int64 + RouteRequestCount map[string]int64 + LastNRequestsDurs []float64 + LastNModExtractDurs []float64 + lock *sync.RWMutex + count int64 + windowSize int + amean, stdev, variance, sum float64 +} + +type RequestStats struct { + Service *spec.DGateService + Route *spec.DGateRoute + UpstreamRequestDur time.Duration + MiscDurs map[string]time.Duration +} + +func NewProxyStats(windowSize int) *ProxyStats { + return &ProxyStats{ + lock: &sync.RWMutex{}, + windowSize: windowSize, + serviceRequestCount: make(map[string]int64), + RouteRequestCount: make(map[string]int64), + LastNRequestsDurs: make([]float64, 0, windowSize), + LastNModExtractDurs: make([]float64, 0, windowSize), + } +} + +func NewRequestStats(route *spec.DGateRoute) *RequestStats { + return &RequestStats{ + Service: route.Service, + Route: route, + MiscDurs: make(map[string]time.Duration), + } +} + +func (rs *RequestStats) AddMiscDuration(name string, dur time.Duration) { + rs.MiscDurs[name] = dur +} + +func (rs *RequestStats) AddUpstreamRequestDuration(dur time.Duration) { + rs.UpstreamRequestDur = dur +} + +func (rs *RequestStats) String() string { + return fmt.Sprintf( + "service=%s route=%s upstream_request_dur=%s module_durs=%s", + rs.Service.Name, + rs.Route.Name, + rs.UpstreamRequestDur, + rs.MiscDurs, + ) +} + +func (ps *ProxyStats) AddRequestStats(rs *RequestStats) { + reqDur := float64(rs.UpstreamRequestDur.Milliseconds()) + ps.lock.Lock() + defer ps.lock.Unlock() + ps.count++ + + if ps.count > 1 { + ps.amean, _ = stats.Mean(ps.LastNRequestsDurs) + ps.variance, _ = stats.Variance(ps.LastNRequestsDurs) + ps.sum, _ = stats.Sum(ps.LastNRequestsDurs) + if ps.count < 3 { + goto SKIP + } + ps.stdev, _ = stats.StandardDeviationSample(ps.LastNRequestsDurs) + } +SKIP: + + if rs.Service != nil { + if src, ok := ps.serviceRequestCount[rs.Service.Name]; ok { + ps.serviceRequestCount[rs.Service.Name] = src + 1 + } else { + ps.serviceRequestCount[rs.Service.Name] = 1 + } + } + + if rs.Route != nil { + if src, ok := ps.RouteRequestCount[rs.Route.Name]; ok { + ps.RouteRequestCount[rs.Route.Name] = src + 1 + } else { + ps.RouteRequestCount[rs.Route.Name] = 1 + } + } + reqDurLen := len(ps.LastNRequestsDurs) + if reqDurLen >= ps.windowSize { + ps.LastNRequestsDurs = ps.LastNRequestsDurs[1:] + ps.LastNModExtractDurs = ps.LastNModExtractDurs[1:] + } + ps.LastNRequestsDurs = append(ps.LastNRequestsDurs, reqDur) + ps.LastNModExtractDurs = append(ps.LastNModExtractDurs, float64(rs.MiscDurs["moduleExtract"].Nanoseconds())) +} + +func (ps *ProxyStats) Snapshot() map[string]any { + data := make(map[string]any) + ps.lock.RLock() + defer ps.lock.RUnlock() + data["req_count"] = ps.count + data["service_request_count"] = ps.serviceRequestCount + data["route_request_count"] = ps.RouteRequestCount + // data["request_durs"] = ps.LastNRequestsDurs + data["mod_extracts_ns"] = ps.LastNModExtractDurs + data["req_dur_mean_ms"] = ps.amean + data["req_dur_stddev_ms"] = ps.stdev + data["req_dur_variance_ms"] = ps.variance + data["req_dur_sum_ms"] = ps.sum + data["req_dur_window_size"] = ps.windowSize + return data +} diff --git a/internal/proxy/proxy_transport.go b/internal/proxy/proxy_transport.go new file mode 100644 index 0000000..a58eba2 --- /dev/null +++ b/internal/proxy/proxy_transport.go @@ -0,0 +1,92 @@ +package proxy + +import ( + "context" + "crypto/tls" + "net" + "net/http" + + "github.com/dgate-io/dgate/internal/config" + "golang.org/x/net/http2" +) + +func setupTranportFromConfig( + c config.DGateHttpTransportConfig, + modifyTransport func(*net.Dialer, *http.Transport), +) http.RoundTripper { + t1 := http.DefaultTransport.(*http.Transport).Clone() + dailer := &net.Dialer{ + Timeout: c.DialTimeout, + KeepAlive: c.KeepAlive, + Resolver: &net.Resolver{ + PreferGo: c.DNSPreferGo, + Dial: func(ctx context.Context, network, address string) (net.Conn, error) { + d := net.Dialer{ + Timeout: c.DNSTimeout, + } + return d.DialContext(ctx, network, c.DNSServer) + }, + }, + } + if t1.DisableKeepAlives { + dailer.KeepAlive = -1 + } + t1.DialContext = dailer.DialContext + t1.MaxIdleConns = c.MaxIdleConns + t1.IdleConnTimeout = c.IdleConnTimeout + t1.TLSHandshakeTimeout = c.TLSHandshakeTimeout + t1.ExpectContinueTimeout = c.ExpectContinueTimeout + t1.MaxIdleConnsPerHost = c.MaxIdleConnsPerHost + t1.MaxConnsPerHost = c.MaxConnsPerHost + t1.MaxResponseHeaderBytes = c.MaxResponseHeaderBytes + t1.WriteBufferSize = c.WriteBufferSize + t1.ReadBufferSize = c.ReadBufferSize + t1.DisableKeepAlives = c.DisableKeepAlives + t1.DisableCompression = c.DisableCompression + t1.ForceAttemptHTTP2 = c.ForceAttemptHttp2 + t1.ResponseHeaderTimeout = c.ResponseHeaderTimeout + if modifyTransport != nil { + modifyTransport(dailer, t1) + } + + return newRoundTripper(t1) +} + +func newRoundTripper(transport *http.Transport) http.RoundTripper { + transportH2C := &h2cTransport{ + transport: &http2.Transport{ + DialTLS: func(network, addr string, cfg *tls.Config) (net.Conn, error) { + return net.Dial(network, addr) + }, + AllowHTTP: true, + }, + } + + return &dynamicRoundTripper{ + hx: transport, + h2c: transportH2C, + } +} + +// dynamicRoundTripper implements RoundTrip while making sure that HTTP/2 is not used +// with protocols that start with a Connection Upgrade, such as SPDY or Websocket. +type dynamicRoundTripper struct { + hx *http.Transport + h2c *h2cTransport +} + +func (m *dynamicRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + if req.ProtoAtLeast(2, 0) && (req.URL.Scheme == "h2c") { + return m.h2c.RoundTrip(req) + } + return m.hx.RoundTrip(req) +} + +type h2cTransport struct { + transport *http2.Transport +} + +func (t *h2cTransport) RoundTrip(req *http.Request) (*http.Response, error) { + req.URL.Scheme = "http" + return t.transport.RoundTrip(req) +} diff --git a/internal/proxy/proxy_transport/proxy_transport.go b/internal/proxy/proxy_transport/proxy_transport.go new file mode 100644 index 0000000..56a7da6 --- /dev/null +++ b/internal/proxy/proxy_transport/proxy_transport.go @@ -0,0 +1,132 @@ +package proxy_transport + +import ( + "context" + "net/http" + "time" + + "errors" +) + +type Builder interface { + Transport(transport http.RoundTripper) Builder + RequestTimeout(requestTimeout time.Duration) Builder + Retries(retries int) Builder + RetryTimeout(retryTimeout time.Duration) Builder + Clone() Builder + Build() (http.RoundTripper, error) +} + +type proxyTransportBuilder struct { + transport http.RoundTripper + requestTimeout time.Duration + retries int + retryTimeout time.Duration +} + +var _ Builder = (*proxyTransportBuilder)(nil) + +func NewBuilder() Builder { + return &proxyTransportBuilder{} +} + +func (b *proxyTransportBuilder) Transport(transport http.RoundTripper) Builder { + b.transport = transport + return b +} + +func (b *proxyTransportBuilder) RequestTimeout(requestTimeout time.Duration) Builder { + b.requestTimeout = requestTimeout + return b +} + +func (b *proxyTransportBuilder) Retries(retries int) Builder { + b.retries = retries + return b +} + +func (b *proxyTransportBuilder) RetryTimeout(retryTimeout time.Duration) Builder { + b.retryTimeout = retryTimeout + return b +} + +func (b *proxyTransportBuilder) Clone() Builder { + return &proxyTransportBuilder{ + transport: b.transport, + requestTimeout: b.requestTimeout, + retries: b.retries, + retryTimeout: b.requestTimeout, + } +} + +func (b *proxyTransportBuilder) Build() (http.RoundTripper, error) { + return create(b.transport, b.requestTimeout, b.retries, b.retryTimeout) +} + +func create( + transport http.RoundTripper, + requestTimeout time.Duration, + retries int, + retryTimeout time.Duration, +) (http.RoundTripper, error) { + if retries < 0 { + return nil, errors.New("retries must be greater than or equal to 0") + } + if retryTimeout < 0 { + return nil, errors.New("retryTimeout must be greater than or equal to 0") + } + if transport == nil { + transport = http.DefaultTransport + } + if requestTimeout < 0 { + return nil, errors.New("requestTimeout must be greater than or equal to 0") + } + return &retryRoundTripper{ + transport: transport, + retries: retries, + retryTimeout: retryTimeout, + requestTimeout: requestTimeout, + }, nil +} + +type retryRoundTripper struct { + transport http.RoundTripper + requestTimeout time.Duration + retries int + retryTimeout time.Duration +} + +func (m *retryRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + if req.URL.Scheme == "ws" || req.URL.Scheme == "wss" { + return m.transport.RoundTrip(req) + } + var ( + resp *http.Response + err error + // retryTimeoutChan <-chan time.Time + ) + // if m.retryTimeout != 0 { + // retryTimeoutChan = time.After(m.retryTimeout) + // } + ogReq := req + for i := 0; i <= m.retries; i++ { + if m.requestTimeout != 0 { + ctx, cancel := context.WithTimeout(ogReq.Context(), m.requestTimeout) + req = req.WithContext(ctx) + defer cancel() + } + resp, err = m.transport.RoundTrip(req) + if err == nil { + break + } + // if m.retryTimeout != 0 { + // select { + // case <-retryTimeoutChan: + // return nil, errors.New("retry timeout exceeded") + // default: + // // ensures that this fails fast + // } + // } + } + return resp, err +} diff --git a/internal/proxy/proxy_transport/proxy_transport_test.go b/internal/proxy/proxy_transport/proxy_transport_test.go new file mode 100644 index 0000000..2bc209f --- /dev/null +++ b/internal/proxy/proxy_transport/proxy_transport_test.go @@ -0,0 +1,57 @@ +package proxy_transport_test + +import ( + "context" + "errors" + "io" + "net/http" + "net/url" + "strings" + "testing" + + "github.com/dgate-io/dgate/internal/proxy/proxy_transport" + "github.com/dgate-io/dgate/internal/proxy/proxytest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +func TestDGateProxy(t *testing.T) { + mockTp := proxytest.CreateMockTransport() + header := make(http.Header) + header.Add("X-Testing", "testing") + mockTp.On("RoundTrip", mock.Anything). + Return(nil, errors.New("testing error")). + Times(4) + mockTp.On("RoundTrip", mock.Anything).Return(&http.Response{ + StatusCode: 200, + ContentLength: 0, + Header: header, + Body: io.NopCloser(strings.NewReader("")), + }, nil).Once() + + numRetries := 5 + proxy, err := proxy_transport.NewBuilder(). + Retries(numRetries). + Transport(mockTp). + Build() + if err != nil { + t.Fatal(err) + } + req := &http.Request{ + URL: &url.URL{}, + Header: header, + } + + mockRw := proxytest.CreateMockResponseWriter() + mockRw.On("Header").Return(header) + mockRw.On("Write3xdHeader", mock.Anything).Return() + req = req.WithContext(context.WithValue(context.Background(), proxytest.S("testing"), "testing")) + proxy.RoundTrip(req) + + // ensure roundtrip is called at least once + mockTp.AssertCalled(t, "RoundTrip", mock.Anything) + // ensure retries are called + assert.Equal(t, numRetries, mockTp.CallCount) + // ensure context is passed through + assert.Equal(t, "testing", req.Context().Value(proxytest.S("testing"))) +} diff --git a/internal/proxy/proxystore/proxystore.go b/internal/proxy/proxystore/proxystore.go new file mode 100644 index 0000000..c7d5d29 --- /dev/null +++ b/internal/proxy/proxystore/proxystore.go @@ -0,0 +1,167 @@ +package proxystore + +import ( + "encoding/json" + + "errors" + + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/storage" + "github.com/dgraph-io/badger/v4" + "github.com/rs/zerolog" +) + +type ProxyStore struct { + storage storage.Storage + logger *zerolog.Logger +} + +func New(storage storage.Storage, logger *zerolog.Logger) *ProxyStore { + return &ProxyStore{ + storage: storage, + logger: logger, + } +} + +func (store *ProxyStore) InitStore() error { + err := store.storage.Connect() + if err != nil { + return err + } + return nil +} + +func (store *ProxyStore) FetchChangeLogs() ([]*spec.ChangeLog, error) { + clBytes, err := store.storage.GetPrefix("changelog/", 0, -1) + if err != nil { + if err == badger.ErrKeyNotFound { + return nil, nil + } + return nil, errors.New("failed to fetch changelog" + err.Error()) + } + if len(clBytes) == 0 { + return nil, nil + } + store.logger.Debug().Msgf("found %d changelog entries", len(clBytes)) + logs := make([]*spec.ChangeLog, len(clBytes)) + for i, clKv := range clBytes { + var clObj spec.ChangeLog + err = json.Unmarshal(clKv.Value, &clObj) + if err != nil { + store.logger.Debug().Msgf("failed to unmarshal changelog entry: %s", err.Error()) + return nil, errors.New("failed to unmarshal changelog entry: " + err.Error()) + } + logs[i] = &clObj + } + + return logs, nil +} + +// TODO: add retry for failed store operations +func (store *ProxyStore) StoreChangeLog(cl *spec.ChangeLog) error { + clBytes, err := json.Marshal(*cl) + if err != nil { + return err + } + store.logger.Trace().Msgf("storing changelog:%s", string(clBytes)) + err = store.storage.Set("changelog/"+cl.ID, clBytes) + if err != nil { + return err + } + return nil +} + +func (store *ProxyStore) DeleteChangeLogs(logs []*spec.ChangeLog) (int, error) { + removed := 0 + for _, cl := range logs { + err := store.storage.Delete("changelog/" + cl.ID) + if err != nil { + return removed, err + } + removed++ + } + return removed, nil +} + +func createDocumentKey(nsName, colName, docId string) string { + return "doc/" + nsName + "/" + colName + "/" + docId +} + +func (store *ProxyStore) FetchDocument(nsName, colName, docId string) (*spec.Document, error) { + docBytes, err := store.storage.Get(createDocumentKey(nsName, colName, docId)) + if err != nil { + if err == storage.ErrStoreLocked { + return nil, err + } + return nil, errors.New("failed to fetch document: " + err.Error()) + } + doc := &spec.Document{} + err = json.Unmarshal(docBytes, doc) + if err != nil { + store.logger.Debug(). + Msgf("failed to unmarshal document entry: %s, skipping %s", err.Error(), docId) + return nil, errors.New("failed to unmarshal document entry" + err.Error()) + } + return doc, nil +} + +func (store *ProxyStore) FetchDocuments( + namespaceName string, + collectionName string, + offset, limit int, +) ([]*spec.Document, error) { + docs := make([]*spec.Document, 0) + docPrefix := createDocumentKey(namespaceName, collectionName, "") + err := store.storage.IterateValuesPrefix(docPrefix, func(key string, val []byte) error { + if offset -= 1; offset > 0 { + return nil + } else if limit -= 1; limit != 0 { + var newDoc spec.Document + err := json.Unmarshal(val, &newDoc) + if err != nil { + return err + } + docs = append(docs, &newDoc) + } + return nil + }) + if err != nil { + return nil, errors.New("failed to fetch documents: " + err.Error()) + } + return docs, nil +} + +func (store *ProxyStore) StoreDocument(doc *spec.Document) error { + docBytes, err := json.Marshal(doc) + if err != nil { + return err + } + store.logger.Trace().Msgf("storing document: %s", string(docBytes)) + err = store.storage.Set(createDocumentKey(doc.NamespaceName, doc.CollectionName, doc.ID), docBytes) + if err != nil { + return err + } + return nil +} + +func (store *ProxyStore) DeleteDocument(doc *spec.Document) error { + err := store.storage.Delete(createDocumentKey(doc.NamespaceName, doc.CollectionName, doc.ID)) + if err != nil { + if err == badger.ErrKeyNotFound { + return nil + } + return err + } + return nil +} + +func (store *ProxyStore) DeleteDocuments(doc *spec.Document) error { + err := store.storage.IterateTxnPrefix(createDocumentKey(doc.NamespaceName, doc.CollectionName, ""), + func(txn storage.StorageTxn, key string) error { + return txn.Delete(key) + }) + if err != nil { + return err + } + return nil +} diff --git a/internal/proxy/proxytest/mock_http.go b/internal/proxy/proxytest/mock_http.go new file mode 100644 index 0000000..cf7a256 --- /dev/null +++ b/internal/proxy/proxytest/mock_http.go @@ -0,0 +1,64 @@ +package proxytest + +import ( + "net/http" + + "github.com/stretchr/testify/mock" +) + +type S string + +type mockTransport struct { + mock.Mock + CallCount int +} + +var _ http.RoundTripper = (*mockTransport)(nil) +var _ http.ResponseWriter = (*mockResponseWriter)(nil) + +func (m *mockTransport) RoundTrip(req *http.Request) (*http.Response, error) { + m.CallCount++ + args := m.Called(req) + resp := args.Get(0) + if resp == nil { + return nil, args.Error(1) + } + return args.Get(0).(*http.Response), nil +} + +type mockResponseWriter struct { + mock.Mock +} + +func (rw *mockResponseWriter) Header() http.Header { + if firstArg := rw.Called().Get(0); firstArg == nil { + return nil + } else { + return firstArg.(http.Header) + } +} + +func (rw *mockResponseWriter) Write(b []byte) (int, error) { + args := rw.Called(b) + return args.Int(0), args.Error(1) +} + +func (rw *mockResponseWriter) WriteHeader(i int) { + rw.Called(i) +} + +func CreateMockTransport() *mockTransport { + return new(mockTransport) +} + +func CreateMockResponseWriter() *mockResponseWriter { + return new(mockResponseWriter) +} + +func CreateMockRequest(method string, url string) *http.Request { + req, err := http.NewRequest(method, url, nil) + if err != nil { + panic(err) + } + return req +} diff --git a/internal/proxy/proxytest/mock_proxy.go b/internal/proxy/proxytest/mock_proxy.go new file mode 100644 index 0000000..543e0b4 --- /dev/null +++ b/internal/proxy/proxytest/mock_proxy.go @@ -0,0 +1,51 @@ +package proxytest + +import ( + "bytes" + "io" + "net/http" + + "github.com/stretchr/testify/mock" +) + +func NewMockRequestAndResponseWriter( + method string, + url string, + data []byte, +) (*http.Request, *MockResponseWriter) { + body := io.NopCloser(bytes.NewReader(data)) + req, err := http.NewRequest(method, url, body) + if err != nil { + panic(err) + } + req.ContentLength = int64(len(data)) + rw := &MockResponseWriter{} + return req, rw +} + +type MockResponseWriter struct { + mock.Mock + + writeFallthrough bool +} + +func (rw *MockResponseWriter) Header() http.Header { + args := rw.Called() + return args.Get(0).(http.Header) +} + +func (rw *MockResponseWriter) Write(bytes []byte) (int, error) { + args := rw.Called(bytes) + if rw.writeFallthrough { + return len(bytes), nil + } + return args.Int(0), args.Error(1) +} + +func (rw *MockResponseWriter) WriteHeader(statusCode int) { + rw.Called(statusCode) +} + +func (rw *MockResponseWriter) SetWriteFallThrough() { + rw.writeFallthrough = true +} diff --git a/internal/proxy/proxytest/mock_proxy_transport.go b/internal/proxy/proxytest/mock_proxy_transport.go new file mode 100644 index 0000000..3aacb2a --- /dev/null +++ b/internal/proxy/proxytest/mock_proxy_transport.go @@ -0,0 +1,57 @@ +package proxytest + +import ( + "net/http" + "time" + + "github.com/dgate-io/dgate/internal/proxy/proxy_transport" + "github.com/stretchr/testify/mock" +) + +type mockProxyTransportBuilder struct { + mock.Mock +} + +var _ proxy_transport.Builder = &mockProxyTransportBuilder{} + +func CreateMockProxyTransportBuilder() *mockProxyTransportBuilder { + return &mockProxyTransportBuilder{} +} + +func (m *mockProxyTransportBuilder) Transport( + transport http.RoundTripper, +) proxy_transport.Builder { + m.Called(transport) + return m +} + +func (m *mockProxyTransportBuilder) RequestTimeout( + requestTimeout time.Duration, +) proxy_transport.Builder { + m.Called(requestTimeout) + return m +} + +func (m *mockProxyTransportBuilder) Retries( + retries int, +) proxy_transport.Builder { + m.Called(retries) + return m +} + +func (m *mockProxyTransportBuilder) RetryTimeout( + retryTimeout time.Duration, +) proxy_transport.Builder { + m.Called(retryTimeout) + return m +} + +func (b *mockProxyTransportBuilder) Clone() proxy_transport.Builder { + args := b.Called() + return args.Get(0).(proxy_transport.Builder) +} + +func (m *mockProxyTransportBuilder) Build() (http.RoundTripper, error) { + args := m.Called() + return args.Get(0).(http.RoundTripper), args.Error(1) +} diff --git a/internal/proxy/proxytest/mock_reverse_proxy.go b/internal/proxy/proxytest/mock_reverse_proxy.go new file mode 100644 index 0000000..91d734d --- /dev/null +++ b/internal/proxy/proxytest/mock_reverse_proxy.go @@ -0,0 +1,107 @@ +package proxytest + +import ( + "log" + "net/http" + "net/url" + "time" + + "github.com/dgate-io/dgate/internal/proxy/reverse_proxy" + "github.com/stretchr/testify/mock" +) + +type mockReverseProxyExecutor struct { + mock.Mock +} + +type mockReverseProxyBuilder struct { + mock.Mock +} + +var _ http.Handler = &mockReverseProxyExecutor{} +var _ reverse_proxy.Builder = &mockReverseProxyBuilder{} + +func CreateMockReverseProxyExecutor() *mockReverseProxyExecutor { + return &mockReverseProxyExecutor{} +} + +func (m *mockReverseProxyExecutor) ServeHTTP( + w http.ResponseWriter, + r *http.Request, +) { + m.Called(w, r) +} + +func CreateMockReverseProxyBuilder() *mockReverseProxyBuilder { + return &mockReverseProxyBuilder{} +} +func (m *mockReverseProxyBuilder) Transport( + transport http.RoundTripper, +) reverse_proxy.Builder { + m.Called(transport) + return m +} + +func (m *mockReverseProxyBuilder) RequestTimeout( + requestTimeout time.Duration, +) reverse_proxy.Builder { + m.Called(requestTimeout) + return m +} + +func (m *mockReverseProxyBuilder) FlushInterval( + flushInterval time.Duration, +) reverse_proxy.Builder { + m.Called(flushInterval) + return m +} + +func (m *mockReverseProxyBuilder) ModifyResponse( + modifyResponse reverse_proxy.ModifyResponseFunc, +) reverse_proxy.Builder { + m.Called(modifyResponse) + return m +} + +func (m *mockReverseProxyBuilder) ErrorHandler( + errorHandler reverse_proxy.ErrorHandlerFunc, +) reverse_proxy.Builder { + m.Called(errorHandler) + return m +} + +func (m *mockReverseProxyBuilder) ErrorLogger( + logger *log.Logger, +) reverse_proxy.Builder { + m.Called(logger) + return m +} + +func (m *mockReverseProxyBuilder) ProxyRewrite( + stripPath bool, + preserveHost bool, + disableQueryParams bool, + disableXForwardedHeaders bool, +) reverse_proxy.Builder { + m.Called(stripPath, preserveHost, disableQueryParams, disableXForwardedHeaders) + return m +} + +func (m *mockReverseProxyBuilder) CustomRewrite( + rewrite reverse_proxy.RewriteFunc, +) reverse_proxy.Builder { + m.Called(rewrite) + return m +} + +func (m *mockReverseProxyBuilder) Clone() reverse_proxy.Builder { + args := m.Called() + return args.Get(0).(reverse_proxy.Builder) +} + +func (m *mockReverseProxyBuilder) Build( + upstreamUrl *url.URL, proxyPattern string, +) (http.Handler, error) { + args := m.Called(upstreamUrl, proxyPattern) + return args.Get(0).(http.Handler), args.Error(1) +} diff --git a/internal/proxy/request_context.go b/internal/proxy/request_context.go new file mode 100644 index 0000000..9fb3639 --- /dev/null +++ b/internal/proxy/request_context.go @@ -0,0 +1,63 @@ +package proxy + +import ( + "context" + "net/http" + + "github.com/dgate-io/dgate/pkg/spec" +) + +type S string + +type RequestContextProvider struct { + ctx context.Context + route *spec.DGateRoute + modBuf ModuleBuffer +} + +type RequestContext struct { + pattern string + context context.Context + route *spec.DGateRoute + rw spec.ResponseWriterTracker + req *http.Request + provider *RequestContextProvider +} + +func NewRequestContextProvider(route *spec.DGateRoute) *RequestContextProvider { + ctx := context.Background() + + // set context values + ctx = context.WithValue(ctx, spec.Name("route"), route.Name) + ctx = context.WithValue(ctx, spec.Name("namespace"), route.Namespace.Name) + serviceName := "" + if route.Service != nil { + serviceName = route.Service.Name + } + ctx = context.WithValue(ctx, spec.Name("service"), serviceName) + + return &RequestContextProvider{ + ctx: ctx, + route: route, + } +} + +func (reqCtxProvider *RequestContextProvider) SetModuleBuffer(mb ModuleBuffer) { + reqCtxProvider.modBuf = mb +} + +func (reqCtxProvider *RequestContextProvider) CreateRequestContext( + ctx context.Context, + rw http.ResponseWriter, + req *http.Request, + pattern string, +) *RequestContext { + return &RequestContext{ + rw: spec.NewResponseWriterTracker(rw), + req: req.WithContext(ctx), + route: reqCtxProvider.route, + provider: reqCtxProvider, + pattern: pattern, + context: ctx, + } +} diff --git a/internal/proxy/reverse_proxy/reverse_proxy.go b/internal/proxy/reverse_proxy/reverse_proxy.go new file mode 100644 index 0000000..52f402f --- /dev/null +++ b/internal/proxy/reverse_proxy/reverse_proxy.go @@ -0,0 +1,276 @@ +package reverse_proxy + +import ( + "errors" + "log" + "net" + "net/http" + "net/http/httputil" + "net/url" + "path" + "strings" + "time" +) + +type RewriteFunc func(*http.Request, *http.Request) + +type ModifyResponseFunc func(*http.Response) error + +type ErrorHandlerFunc func(http.ResponseWriter, *http.Request, error) + +type Builder interface { + // FlushInterval sets the flush interval for flushable response bodies. + FlushInterval(time.Duration) Builder + + // Rewrite sets the rewrite function for the reverse proxy. + CustomRewrite(RewriteFunc) Builder + + // ModifyResponse sets the modify response function for the reverse proxy. + ModifyResponse(ModifyResponseFunc) Builder + + // ErrorHandler sets the error handler function for the reverse proxy. + ErrorHandler(ErrorHandlerFunc) Builder + + // Transport sets the transport for the reverse proxy. + Transport(http.RoundTripper) Builder + + // ErrorLogger sets the (go) logger for the reverse proxy. + ErrorLogger(*log.Logger) Builder + + // ProxyRewrite sets the proxy rewrite function for the reverse proxy. + ProxyRewrite( + stripPath bool, + preserveHost bool, + disableQueryParams bool, + xForwardedHeaders bool, + ) Builder + + // Build builds the reverse proxy executor. + Build( + upstreamUrl *url.URL, + proxyPattern string, + ) (http.Handler, error) + + // Clone clones the builder. + Clone() Builder +} + +var _ Builder = (*reverseProxyBuilder)(nil) + +type reverseProxyBuilder struct { + rewrite RewriteFunc + errorLogger *log.Logger + customRewrite RewriteFunc + upstreamUrl *url.URL + proxyPattern string + transport http.RoundTripper + flushInterval time.Duration + modifyResponse ModifyResponseFunc + errorHandler ErrorHandlerFunc +} + +func NewBuilder() Builder { + return &reverseProxyBuilder{} +} + +func (b *reverseProxyBuilder) Clone() Builder { + return &reverseProxyBuilder{ + rewrite: b.rewrite, + errorLogger: b.errorLogger, + customRewrite: b.customRewrite, + upstreamUrl: b.upstreamUrl, + proxyPattern: b.proxyPattern, + transport: b.transport, + flushInterval: b.flushInterval, + modifyResponse: b.modifyResponse, + errorHandler: b.errorHandler, + } +} + +func (b *reverseProxyBuilder) FlushInterval(interval time.Duration) Builder { + b.flushInterval = interval + return b +} + +func (b *reverseProxyBuilder) CustomRewrite(rewrite RewriteFunc) Builder { + b.customRewrite = rewrite + return b +} + +func (b *reverseProxyBuilder) ModifyResponse(modifyResponse ModifyResponseFunc) Builder { + b.modifyResponse = modifyResponse + return b +} + +func (b *reverseProxyBuilder) ErrorHandler(errorHandler ErrorHandlerFunc) Builder { + b.errorHandler = errorHandler + return b +} + +func (b *reverseProxyBuilder) ErrorLogger(logger *log.Logger) Builder { + b.errorLogger = logger + return b +} + +func (b *reverseProxyBuilder) Transport(transport http.RoundTripper) Builder { + b.transport = transport + return b +} + +func (b *reverseProxyBuilder) ProxyRewrite( + stripPath bool, + preserveHost bool, + disableQueryParams bool, + xForwardedHeaders bool, +) Builder { + b.rewrite = func(in, out *http.Request) { + in.URL.Scheme = b.upstreamUrl.Scheme + in.URL.Host = b.upstreamUrl.Host + + b.stripPath(stripPath)(in, out) + b.preserveHost(preserveHost)(in, out) + b.disableQueryParams(disableQueryParams)(in, out) + b.xForwardedHeaders(xForwardedHeaders)(in, out) + } + return b +} + +func (b *reverseProxyBuilder) stripPath(strip bool) RewriteFunc { + return func(in, out *http.Request) { + reqCall := in.URL.Path + proxyPatternPath := b.proxyPattern + upstreamPath := b.upstreamUrl.Path + in.URL = b.upstreamUrl + if strip { + if strings.HasSuffix(proxyPatternPath, "*") { + // this will remove the proxy path before the wildcard from the upstream url + // ex. (upstreamPath: /v1, proxyPattern: '/path/*', reqCall: '/path/test') -> '/v1/test' + proxyPattern := strings.TrimSuffix(proxyPatternPath, "*") + reqCallNoProxy := strings.TrimPrefix(reqCall, proxyPattern) + out.URL.Path = path.Join(upstreamPath, reqCallNoProxy) + } else { + // this will remove the proxy path from the upstream url + // ex. (upstreamPath: /v1, proxyPattern: '/path/{id}', reqCall: '/path/1') -> '/v1' + out.URL.Path = upstreamPath + } + } else { + // ex. (upstreamPath: /v1, proxyPattern: '/path/*', reqCall: '/path/test') -> '/v1/path/test' + out.URL.Path = path.Join(upstreamPath, reqCall) + } + } +} + +func (b *reverseProxyBuilder) preserveHost(preserve bool) RewriteFunc { + return func(in, out *http.Request) { + scheme := "http" + out.URL.Host = b.upstreamUrl.Host + if preserve { + out.Host = in.Host + if out.Host == "" { + out.Host = out.URL.Host + } + if in.TLS != nil { + scheme = "https" + } + } else { + out.Host = out.URL.Host + scheme = b.upstreamUrl.Scheme + } + if out.URL.Scheme == "" { + out.URL.Scheme = scheme + } + } +} + +func (b *reverseProxyBuilder) disableQueryParams(disableQueryParams bool) RewriteFunc { + return func(in, out *http.Request) { + if !disableQueryParams { + targetQuery := b.upstreamUrl.RawQuery + if targetQuery == "" || in.URL.RawQuery == "" { + in.URL.RawQuery = targetQuery + in.URL.RawQuery + } else { + in.URL.RawQuery = targetQuery + "&" + in.URL.RawQuery + } + } else { + out.URL.RawQuery = "" + } + } +} + +func (b *reverseProxyBuilder) xForwardedHeaders(xForwardedHeaders bool) RewriteFunc { + return func(in, out *http.Request) { + if xForwardedHeaders { + clientIP, _, err := net.SplitHostPort(in.RemoteAddr) + if err == nil { + out.Header.Add("X-Forwarded-For", clientIP) + out.Header.Set("X-Real-IP", clientIP) + } else { + out.Header.Add("X-Forwarded-For", in.RemoteAddr) + out.Header.Set("X-Real-IP", in.RemoteAddr) + } + out.Header.Set("X-Forwarded-Host", in.Host) + if in.TLS == nil { + out.Header.Set("X-Forwarded-Proto", "http") + } else { + out.Header.Set("X-Forwarded-Proto", "https") + } + } else { + out.Header.Del("X-Forwarded-For") + out.Header.Del("X-Forwarded-Host") + out.Header.Del("X-Forwarded-Proto") + out.Header.Del("X-Real-IP") + } + } +} + +var ( + ErrNilUpstreamUrl = errors.New("upstream url cannot be nil") + ErrEmptyProxyPattern = errors.New("proxy pattern cannot be empty") +) + +func (b *reverseProxyBuilder) Build( + upstreamUrl *url.URL, + proxyPattern string, +) (http.Handler, error) { + if upstreamUrl == nil { + return nil, ErrNilUpstreamUrl + } + b.upstreamUrl = upstreamUrl + + if proxyPattern == "" { + return nil, ErrEmptyProxyPattern + } + b.proxyPattern = proxyPattern + + if b.transport == nil { + b.transport = http.DefaultTransport + } + + if b.flushInterval == 0 { + b.flushInterval = time.Millisecond * 100 + } + + if b.errorHandler == nil { + b.errorHandler = func(rw http.ResponseWriter, req *http.Request, err error) { + http.Error(rw, err.Error(), http.StatusBadGateway) + } + } + proxy := &httputil.ReverseProxy{} + proxy.ErrorHandler = b.errorHandler + proxy.FlushInterval = b.flushInterval + proxy.ModifyResponse = b.modifyResponse + proxy.Transport = b.transport + proxy.ErrorLog = b.errorLogger + proxy.Rewrite = func(pr *httputil.ProxyRequest) { + if b.customRewrite != nil { + b.customRewrite(pr.In, pr.Out) + } + if b.rewrite != nil { + b.rewrite(pr.In, pr.Out) + } + if pr.Out.URL.Path == "/" { + pr.Out.URL.Path = "" + } + } + return proxy, nil +} diff --git a/internal/proxy/reverse_proxy/reverse_proxy_test.go b/internal/proxy/reverse_proxy/reverse_proxy_test.go new file mode 100644 index 0000000..bb97a43 --- /dev/null +++ b/internal/proxy/reverse_proxy/reverse_proxy_test.go @@ -0,0 +1,291 @@ +package reverse_proxy_test + +import ( + "context" + "errors" + "io" + "net/http" + "net/url" + "strings" + "testing" + + "github.com/dgate-io/dgate/internal/proxy/proxytest" + "github.com/dgate-io/dgate/internal/proxy/reverse_proxy" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +type ProxyParams struct { + host string + newHost string + + upstreamUrl *url.URL + newUpsteamURL *url.URL + + proxyPattern string + proxyPath string +} + +type RewriteParams struct { + stripPath bool + preserveHost bool + disableQueryParams bool + xForwardedHeaders bool +} + +func testDGateProxyRewrite( + t *testing.T, params ProxyParams, + rewriteParams RewriteParams, +) { + mockTp := proxytest.CreateMockTransport() + header := make(http.Header) + header.Add("X-Testing", "testing") + rp, err := reverse_proxy.NewBuilder(). + Transport(mockTp). + ProxyRewrite( + rewriteParams.stripPath, + rewriteParams.preserveHost, + rewriteParams.disableQueryParams, + rewriteParams.xForwardedHeaders, + ).Build(params.upstreamUrl, params.proxyPattern) + if err != nil { + t.Fatal(err) + } + + req := proxytest.CreateMockRequest("GET", params.proxyPath) + req.RemoteAddr = "::1" + req.Host = params.host + req.URL.Scheme = "" + req.URL.Host = "" + mockRw := proxytest.CreateMockResponseWriter() + mockRw.On("Header").Return(header) + mockRw.On("WriteHeader", mock.Anything).Return() + mockRw.On("Write", mock.Anything).Return(0, nil) + req = req.WithContext(context.WithValue( + context.Background(), proxytest.S("testing"), "testing")) + + mockTp.On("RoundTrip", mock.Anything).Run(func(args mock.Arguments) { + req := args.Get(0).(*http.Request) + if req.URL.String() != params.newUpsteamURL.String() { + t.Errorf("FAIL: Expected URL %s, got %s", params.newUpsteamURL, req.URL) + } else { + t.Logf("PASS: upstreamUrl: %s, proxyPattern: %s, proxyPath: %s, newUpsteamURL: %s", + params.upstreamUrl, params.proxyPattern, params.proxyPath, params.newUpsteamURL) + } + if params.newHost != "" && req.Host != params.newHost { + t.Errorf("FAIL: Expected Host %s, got %s", params.newHost, req.Host) + } + if rewriteParams.xForwardedHeaders { + if req.Header.Get("X-Forwarded-For") == "" { + t.Errorf("FAIL: Expected X-Testing header, got %s", req.Header.Get("X-Testing")) + } + if req.Header.Get("X-Real-IP") == "" { + t.Errorf("FAIL: Expected X-Testing header, got %s", req.Header.Get("X-Testing")) + } + if req.Header.Get("X-Forwarded-Host") == "" { + t.Errorf("FAIL: Expected X-Testing header, got %s", req.Header.Get("X-Testing")) + } + if req.Header.Get("X-Forwarded-Proto") == "" { + t.Errorf("FAIL: Expected X-Testing header, got %s", req.Header.Get("X-Testing")) + } + } else { + if req.Header.Get("X-Forwarded-For") != "" { + t.Errorf("FAIL: Expected no X-Testing header, got %s", req.Header.Get("X-Testing")) + } + if req.Header.Get("X-Real-IP") != "" { + t.Errorf("FAIL: Expected X-Testing header, got %s", req.Header.Get("X-Testing")) + } + if req.Header.Get("X-Forwarded-Host") != "" { + t.Errorf("FAIL: Expected X-Testing header, got %s", req.Header.Get("X-Testing")) + } + if req.Header.Get("X-Forwarded-Proto") != "" { + t.Errorf("FAIL: Expected X-Testing header, got %s", req.Header.Get("X-Testing")) + } + } + }).Return(&http.Response{ + StatusCode: 200, + ContentLength: 0, + Header: header, + Body: io.NopCloser(strings.NewReader("")), + }, nil).Once() + + rp.ServeHTTP(mockRw, req) + + // ensure roundtrip is called at least once + mockTp.AssertExpectations(t) + // ensure retries are called + // ensure context is passed through + assert.Equal(t, "testing", req.Context().Value(proxytest.S("testing"))) +} + +func mustParseURL(t *testing.T, s string) *url.URL { + u, err := url.Parse(s) + if err != nil { + t.Fatal(err) + } + return u +} + +func TestDGateProxyError(t *testing.T) { + mockTp := proxytest.CreateMockTransport() + header := make(http.Header) + header.Add("X-Testing", "testing") + mockTp.On("RoundTrip", mock.Anything). + Return(nil, errors.New("testing error")). + Times(4) + mockTp.On("RoundTrip", mock.Anything).Return(&http.Response{ + StatusCode: 200, + ContentLength: 0, + Header: header, + Body: io.NopCloser(strings.NewReader("")), + }, nil).Once() + + upstreamUrl, _ := url.Parse("http://example.com") + rp, err := reverse_proxy.NewBuilder(). + Clone().FlushInterval(-1). + Transport(mockTp). + ProxyRewrite( + true, true, + true, true, + ).Build(upstreamUrl, "/test/*") + if err != nil { + t.Fatal(err) + } + + req := proxytest.CreateMockRequest("GET", "http://localhost") + req.RemoteAddr = "::1" + mockRw := proxytest.CreateMockResponseWriter() + mockRw.On("Header").Return(header) + mockRw.On("WriteHeader", mock.Anything).Return() + mockRw.On("Write", mock.Anything).Return(0, nil) + req = req.WithContext(context.WithValue( + context.Background(), proxytest.S("testing"), "testing")) + rp.ServeHTTP(mockRw, req) + + // ensure roundtrip is called at least once + mockTp.AssertCalled(t, "RoundTrip", mock.Anything) + // ensure retries are called + // ensure context is passed through + assert.Equal(t, "testing", req.Context().Value(proxytest.S("testing"))) +} + +func TestDGateProxyRewriteStripPath(t *testing.T) { + // if proxy pattern is a prefix (ends with *) + testDGateProxyRewrite(t, ProxyParams{ + host: "test.net", + newHost: "example.com", + + upstreamUrl: mustParseURL(t, "http://example.com"), + newUpsteamURL: mustParseURL(t, "http://example.com/test/ing"), + + proxyPattern: "/test/*", + proxyPath: "/test/test/ing", + }, RewriteParams{ + stripPath: true, + preserveHost: false, + disableQueryParams: false, + xForwardedHeaders: false, + }) + + testDGateProxyRewrite(t, ProxyParams{ + host: "test.net", + newHost: "example.com", + + upstreamUrl: mustParseURL(t, "http://example.com/pre"), + newUpsteamURL: mustParseURL(t, "http://example.com/pre"), + + proxyPattern: "/test/*", + proxyPath: "/test/", + }, RewriteParams{ + stripPath: true, + preserveHost: false, + disableQueryParams: false, + xForwardedHeaders: false, + }) +} + +func TestDGateProxyRewritePreserveHost(t *testing.T) { + testDGateProxyRewrite(t, ProxyParams{ + upstreamUrl: mustParseURL(t, "http://example.com"), + newUpsteamURL: mustParseURL(t, "http://example.com/test"), + + host: "test.net", + newHost: "test.net", + + proxyPattern: "/test", + proxyPath: "/test", + }, RewriteParams{ + stripPath: false, + preserveHost: true, + disableQueryParams: false, + xForwardedHeaders: false, + }) +} + +func TestDGateProxyRewriteDisableQueryParams(t *testing.T) { + testDGateProxyRewrite(t, ProxyParams{ + upstreamUrl: mustParseURL(t, "http://example.com"), + newUpsteamURL: mustParseURL(t, "http://example.com/test"), + + host: "test.net", + newHost: "example.com", + + proxyPattern: "/test", + proxyPath: "/test?testing=testing", + }, RewriteParams{ + stripPath: false, + preserveHost: false, + disableQueryParams: true, + xForwardedHeaders: false, + }) + + testDGateProxyRewrite(t, ProxyParams{ + upstreamUrl: mustParseURL(t, "http://example.com"), + newUpsteamURL: mustParseURL(t, "http://example.com/test?testing=testing"), + + host: "test.net", + newHost: "example.com", + + proxyPattern: "/test", + proxyPath: "/test?testing=testing", + }, RewriteParams{ + stripPath: false, + preserveHost: false, + disableQueryParams: false, + xForwardedHeaders: false, + }) +} + +func TestDGateProxyRewriteXForwardedHeaders(t *testing.T) { + testDGateProxyRewrite(t, ProxyParams{ + upstreamUrl: mustParseURL(t, "http://example.com"), + newUpsteamURL: mustParseURL(t, "http://example.com/test"), + + host: "test.net", + newHost: "example.com", + + proxyPattern: "/test", + proxyPath: "/test", + }, RewriteParams{ + stripPath: false, + preserveHost: false, + disableQueryParams: false, + xForwardedHeaders: true, + }) + + testDGateProxyRewrite(t, ProxyParams{ + upstreamUrl: mustParseURL(t, "http://example.com"), + newUpsteamURL: mustParseURL(t, "http://example.com/test"), + + host: "test.net", + newHost: "example.com", + + proxyPattern: "/test", + proxyPath: "/test", + }, RewriteParams{ + stripPath: false, + preserveHost: false, + disableQueryParams: false, + xForwardedHeaders: false, + }) +} diff --git a/internal/proxy/runtime_context.go b/internal/proxy/runtime_context.go new file mode 100644 index 0000000..3f95f11 --- /dev/null +++ b/internal/proxy/runtime_context.go @@ -0,0 +1,104 @@ +package proxy + +import ( + "context" + "errors" + "sort" + "strings" + + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/resources" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/typescript" + "github.com/dop251/goja" + "github.com/dop251/goja_nodejs/require" +) + +// RuntimeContext is the context for the runtime. one per request +type runtimeContext struct { + reqCtx *RequestContext + + loop *eventloop.EventLoop + state modules.StateManager + rm *resources.ResourceManager + route *spec.Route + modules []*spec.Module +} + +func NewRuntimeContext( + proxyState *ProxyState, + route *spec.DGateRoute, + modules ...*spec.DGateModule, +) *runtimeContext { + rtCtx := &runtimeContext{ + state: proxyState, + rm: proxyState.ResourceManager(), + modules: spec.TransformDGateModules(modules...), + route: spec.TransformDGateRoute(route), + // cache: proxyState.sharedCache, + } + sort.Slice(rtCtx.modules, func(i, j int) bool { + return rtCtx.modules[i].Name < rtCtx.modules[j].Name + }) + // func (r *Registry) getCompiledSource(p string) wraps the code in a modular function + reg := require.NewRegistryWithLoader(func(path string) ([]byte, error) { + requireMod := strings.Replace(path, "node_modules/", "", 1) + // 'https://' - requires network permissions and must be enabled in the config + // 'file://' - requires file system permissions and must be enabled in the config + // 'module://' - requires a module lookup and module permissions + if mod, ok := findInSortedWith(rtCtx.modules, requireMod, + func(m *spec.Module) string { return m.Name }); !ok { + return nil, errors.New(requireMod + " not found") + } else { + if mod.Type == spec.ModuleTypeJavascript { + return []byte(mod.Payload), nil + } + // TODO: add transpilation cache somewhere + payload, err := typescript.Transpile(mod.Payload) + if err != nil { + return nil, err + } + return []byte(payload), nil + } + }) + rtCtx.loop = eventloop.NewEventLoop(eventloop.WithRegistry(reg)) + return rtCtx +} + +var _ modules.RuntimeContext = &runtimeContext{} + +// UseRequestContext sets the request context +func (rtCtx *runtimeContext) SetRequestContext( + reqCtx *RequestContext, pathParams map[string]string, +) { + if reqCtx != nil { + if err := reqCtx.context.Err(); err != nil { + panic("context is already closed: " + err.Error()) + } + } + rtCtx.reqCtx = reqCtx +} + +func (rtCtx *runtimeContext) Clean() { + rtCtx.reqCtx = nil +} + +func (rtCtx *runtimeContext) Context() context.Context { + if rtCtx.reqCtx == nil { + panic("request context is not set") + } + return rtCtx.reqCtx.context +} + +func (rtCtx *runtimeContext) EventLoop() *eventloop.EventLoop { + return rtCtx.loop +} + +func (rtCtx *runtimeContext) Runtime() *goja.Runtime { + return rtCtx.loop.Runtime() +} + +func (rtCtx *runtimeContext) State() modules.StateManager { + return rtCtx.state +} diff --git a/internal/proxy/util.go b/internal/proxy/util.go new file mode 100644 index 0000000..8e17e0c --- /dev/null +++ b/internal/proxy/util.go @@ -0,0 +1,47 @@ +package proxy + +import ( + "bytes" + "cmp" + "encoding/json" + "errors" + "hash/crc32" + "sort" +) + +func HashAny[T any](salt uint32, objs ...any) (uint32, error) { + hash := crc32.NewIEEE() + if salt != 0 { + // uint32 to byte array + b := make([]byte, 4) + b[0] = byte(salt >> 24) + b[1] = byte(salt >> 16) + b[2] = byte(salt >> 8) + b[3] = byte(salt) + hash.Write(b) + } + + if len(objs) == 0 { + return 0, errors.New("no objects provided") + } + for _, r := range objs { + b := bytes.Buffer{} + err := json.NewEncoder(&b).Encode(r) + if err != nil { + return 0, err + } + hash.Write(b.Bytes()) + } + return hash.Sum32(), nil +} + +func findInSortedWith[T any, K cmp.Ordered](arr []T, k K, f func(T) K) (T, bool) { + i := sort.Search(len(arr), func(i int) bool { + return f(arr[i]) >= k + }) + var t T + if i < len(arr) && f(arr[i]) == k { + return arr[i], true + } + return t, false +} diff --git a/internal/router/router.go b/internal/router/router.go new file mode 100644 index 0000000..adf679a --- /dev/null +++ b/internal/router/router.go @@ -0,0 +1,62 @@ +package router + +import ( + "net/http" + "sync" + + "github.com/dgate-io/chi-router" +) + +// Router is a wrapper around chi.Router +type DynamicRouter struct { + router *chi.Mux + routeCtx *chi.Context + lock sync.RWMutex +} + +// NewRouter creates a new router +func NewRouter() *DynamicRouter { + chiMux := chi.NewRouter() + return NewRouterWithMux(chiMux) +} + +// NewRouter creates a new router +func NewRouterWithMux(mux *chi.Mux) *DynamicRouter { + return &DynamicRouter{ + mux, + chi.NewRouteContext(), + sync.RWMutex{}, + } +} + +func NewMux() *chi.Mux { + chi.NewRouter() + return chi.NewRouter() +} + +func (r *DynamicRouter) ModifyMux(fn func(*chi.Mux)) { + r.lock.Lock() + defer r.lock.Unlock() + fn(r.router) +} + +func (r *DynamicRouter) Match(method, path string) bool { + r.lock.Lock() + defer r.lock.Unlock() + return r.router.Match(r.routeCtx, method, path) +} + +// ReplaceRouter replaces the router +func (r *DynamicRouter) ReplaceMux(router *chi.Mux) { + r.lock.Lock() + defer r.lock.Unlock() + r.routeCtx = chi.NewRouteContext() + r.router = router +} + +// ServeHTTP is a wrapper around chi.Router.ServeHTTP +func (r *DynamicRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { + r.lock.RLock() + defer r.lock.RUnlock() + r.router.ServeHTTP(w, req) +} diff --git a/performance-tests/long-perf-test.js b/performance-tests/long-perf-test.js new file mode 100644 index 0000000..a0b8776 --- /dev/null +++ b/performance-tests/long-perf-test.js @@ -0,0 +1,20 @@ +import http from "k6/http"; +import { check, sleep } from 'k6'; + +export let options = { + stages: [ + { duration: '5s', target: 200}, + { duration: '1h', target: 300}, + { duration: '1h', target: 100}, + ], +}; + +let url = "http://localhost:80"; +let i = 0; + +export default async function() { + let res = http.get(url + "/modtest", { + headers: { Host: 'dgate.dev' }, + }); + check(res, { 'status: 204': (r) => r.status == 204 }); +}; diff --git a/performance-tests/perf-test.js b/performance-tests/perf-test.js new file mode 100644 index 0000000..6c4e801 --- /dev/null +++ b/performance-tests/perf-test.js @@ -0,0 +1,47 @@ +import http from "k6/http"; +import { check } from 'k6'; + +const n = 10; +export let options = { + scenarios: { + modtest: { + executor: 'constant-vus', + vus: n, + duration: '20s', + // same function as the scenario above, but with different env vars + exec: 'dgatePath', + env: { DGATE_PATH: 'modtest' }, + // startTime: '25s', + gracefulStop: '5s', + }, + // svctest: { + // executor: 'constant-vus', + // vus: n, + // duration: '20s', + // exec: 'dgatePath', // same function as the scenario above, but with different env vars + // env: { DGATE_PATH: "svctest" }, + // // startTime: '25s', + // gracefulStop: '5s', + // }, + // blank: { + // executor: 'constant-vus', + // vus: n, + // duration: '20s', + // exec: 'dgatePath', // same function as the scenario above, but with different env vars + // env: { DGATE_PATH: "blank" }, + // // startTime: '50s', + // gracefulStop: '5s', + // }, + }, + discardResponseBodies: true, +}; + +export function dgatePath() { + const path = __ENV.DGATE_PATH; + let res = http.get("http://localhost/" + path, { + headers: { Host: 'dgate.dev' }, + }); + let results = {}; + results[path + ': status is ' + res.status] = (r) => r.status < 400; + check(res, results); +}; \ No newline at end of file diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go new file mode 100644 index 0000000..0a0e87a --- /dev/null +++ b/pkg/cache/cache.go @@ -0,0 +1,228 @@ +package cache + +import ( + "context" + "errors" + "sync" + "time" + + "github.com/dgate-io/dgate/pkg/scheduler" + "github.com/dgate-io/dgate/pkg/util/heap" + "github.com/rs/zerolog" +) + +type TCache interface { + Bucket(string) Bucket + BucketWithOpts(string, BucketOptions) Bucket +} + +type Bucket interface { + Get(string) (any, bool) + Set(string, any) + Len() int + SetWithTTL(string, any, time.Duration) + Delete(string) bool +} + +type BucketOptions struct { + // TTL is the time after which the key will be deleted from the cache. + DefaultTTL time.Duration + // MaxItems is the maximum number of items that can be stored in the cache. + // If set to 0, there is no limit. + MaxItems int +} + +type cacheImpl struct { + mutex *sync.RWMutex + buckets map[string]Bucket + sch scheduler.Scheduler + interval time.Duration +} + +type bucketImpl struct { + name string + opts *BucketOptions + mutex *sync.RWMutex + + items map[string]*cacheEntry + ttlQueue *heap.Heap[int64, *cacheEntry] + limitQueue *heap.Heap[int64, *cacheEntry] + // limitQueue queue.Queue[*cacheEntry] +} + +type cacheEntry struct { + key string + value any + exp time.Time +} + +type CacheOptions struct { + CheckInterval time.Duration + Logger *zerolog.Logger +} + +var ( + ErrNotFound = errors.New("key not found") + ErrMaxItems = errors.New("max items reached") +) + +func NewWithOpts(opts CacheOptions) TCache { + sch := scheduler.New(scheduler.Options{ + Logger: opts.Logger, + Interval: opts.CheckInterval, + AutoRun: true, + }) + + if opts.CheckInterval == 0 { + opts.CheckInterval = time.Second * 5 + } + + return &cacheImpl{ + sch: sch, + mutex: &sync.RWMutex{}, + buckets: make(map[string]Bucket), + interval: opts.CheckInterval, + } +} + +func New() TCache { + return NewWithOpts(CacheOptions{}) +} + +func (cache *cacheImpl) newBucket( + name string, + opts BucketOptions, +) Bucket { + cache.sch.ScheduleTask(name, scheduler.TaskOptions{ + Interval: cache.interval, + TaskFunc: func(_ context.Context) { + cache.mutex.RLock() + b := cache.buckets[name].(*bucketImpl) + cache.mutex.RUnlock() + + b.mutex.Lock() + defer b.mutex.Unlock() + for { + t, v, ok := b.ttlQueue.Peak() + if !ok { + break + } + + if t != v.exp.UnixMilli() { + // TODO: test set TTL high, then set low + b.ttlQueue.Pop() + continue + } + + if v.exp.After(time.Now()) { + break + } + b.ttlQueue.Pop() + delete(b.items, v.key) + } + }, + }) + + return &bucketImpl{ + name: name, + opts: &opts, + mutex: &sync.RWMutex{}, + items: make(map[string]*cacheEntry), + ttlQueue: heap.NewHeap[int64, *cacheEntry](heap.MinHeapType), + limitQueue: heap.NewHeap[int64, *cacheEntry](heap.MinHeapType), + } +} + +func (c *cacheImpl) BucketWithOpts(name string, opts BucketOptions) Bucket { + c.mutex.Lock() + defer c.mutex.Unlock() + if b, ok := c.buckets[name]; ok { + return b + } + b := c.newBucket(name, opts) + c.buckets[name] = b + return b +} + +func (c *cacheImpl) Bucket(name string) Bucket { + return c.BucketWithOpts(name, BucketOptions{}) +} + +func (b *bucketImpl) Get(key string) (any, bool) { + b.mutex.RLock() + defer b.mutex.RUnlock() + if v, ok := b.items[key]; ok { + if !v.exp.IsZero() && !v.exp.After(time.Now()) { + return nil, false + } + return v.value, true + } + return nil, false +} + +func (b *bucketImpl) Set(key string, value any) { + b.SetWithTTL(key, value, b.opts.DefaultTTL) +} + +func (b *bucketImpl) Len() int { + b.mutex.RLock() + defer b.mutex.RUnlock() + return len(b.items) +} + +func (b *bucketImpl) SetWithTTL(key string, value any, ttl time.Duration) { + b.mutex.Lock() + defer b.mutex.Unlock() + if v, ok := b.items[key]; !ok { + if b.opts.MaxItems > 0 && len(b.items) >= b.opts.MaxItems { + // remove items with TTLs first + _, ce, ok := b.ttlQueue.Pop() + if !ok { + // if no items with TTLs, remove items from with no TTLs + if _, ce, ok = b.limitQueue.Pop(); !ok { + panic("inconsistent state: no items in limit or ttl queue") + } + } + delete(b.items, ce.key) + } + } else { + v.value = value + if ttl > 0 { + v.exp = time.Now().Add(ttl) + b.ttlQueue.Push(v.exp.UnixMilli(), v) + } else { + v.exp = time.Time{} + b.limitQueue.Push(time.Now().UnixMilli(), v) + } + return + } + e := &cacheEntry{ + key: key, + value: value, + } + e.exp = time.Time{} + if ttl > 0 { + e.exp = time.Now().Add(ttl) + } + + if ttl > 0 { + b.ttlQueue.Push(e.exp.UnixMilli(), e) + } else if b.opts.MaxItems > 0 { + b.limitQueue.Push(time.Now().UnixMilli(), e) + } + b.items[key] = e +} + +func (b *bucketImpl) Delete(key string) bool { + b.mutex.Lock() + defer b.mutex.Unlock() + return b.delete(key) +} + +func (b *bucketImpl) delete(key string) bool { + if _, ok := b.items[key]; !ok { + return false + } + delete(b.items, key) + return true +} diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go new file mode 100644 index 0000000..196b62d --- /dev/null +++ b/pkg/cache/cache_test.go @@ -0,0 +1,120 @@ +package cache_test + +import ( + "testing" + "time" + + "github.com/dgate-io/dgate/pkg/cache" + "github.com/stretchr/testify/assert" +) + +func TestCache_GetSet(t *testing.T) { + c := cache.New() + num := 5 + c.Bucket("test").Set("key", num) + n, ok := c.Bucket("test").Get("key") + assert.True(t, ok, "expected key to be found") + assert.Equal(t, num, n, "expected value to be %d, got %d", num, n) +} + +func TestCache_Delete(t *testing.T) { + c := cache.New() + num := 5 + c.Bucket("test").Set("key", num) + c.Bucket("test").Delete("key") + _, ok := c.Bucket("test").Get("key") + assert.False(t, ok, "expected key to be deleted") +} + +func TestCache_SetWithTTL(t *testing.T) { + c := cache.NewWithOpts(cache.CacheOptions{ + CheckInterval: time.Millisecond * 100, + }) + num := 5 + c.Bucket("test").SetWithTTL("key", num, time.Millisecond*200) + n, ok := c.Bucket("test").Get("key") + assert.True(t, ok, "expected key to be found") + assert.Equal(t, num, n, "expected value to be %d, got %d", num, n) + time.Sleep(time.Millisecond * 300) + _, ok = c.Bucket("test").Get("key") + assert.False(t, ok, "expected key to be deleted") +} + +func TestCache_MaxItems(t *testing.T) { + c := cache.NewWithOpts(cache.CacheOptions{ + CheckInterval: time.Millisecond * 100, + }) + c.BucketWithOpts("test", cache.BucketOptions{ + MaxItems: 2, + }) + c.Bucket("test").Set("key1", 1) + c.Bucket("test").Set("key2", 2) + c.Bucket("test").Set("key3", 3) + _, ok := c.Bucket("test").Get("key1") + assert.False(t, ok, "expected key1 to be deleted") + _, ok = c.Bucket("test").Get("key2") + assert.True(t, ok, "expected key2 to be found") + _, ok = c.Bucket("test").Get("key3") + assert.True(t, ok, "expected key3 to be found") +} + +func TestCache_MaxItems_TTL(t *testing.T) { + c := cache.NewWithOpts(cache.CacheOptions{ + CheckInterval: time.Millisecond * 10, + }) + c.BucketWithOpts("test", cache.BucketOptions{ + MaxItems: 2, + }) + c.Bucket("test").SetWithTTL("key1", 1, time.Millisecond*10) + c.Bucket("test").SetWithTTL("key2", 2, time.Millisecond*10) + c.Bucket("test").SetWithTTL("key3", 3, time.Millisecond*100) + + var ok bool + _, ok = c.Bucket("test").Get("key1") + assert.False(t, ok, "expected key1 to be found") + _, ok = c.Bucket("test").Get("key2") + assert.True(t, ok, "expected key2 to be found") + _, ok = c.Bucket("test").Get("key3") + assert.True(t, ok, "expected key3 to be found") + assert.Equal(t, 2, c.Bucket("test").Len(), "expected cache to be empty") + + time.Sleep(time.Millisecond * 50) + _, ok = c.Bucket("test").Get("key2") + assert.False(t, ok, "expected key2 to be deleted") + _, ok = c.Bucket("test").Get("key3") + assert.True(t, ok, "expected key3 to be found") + assert.Equal(t, 1, c.Bucket("test").Len(), "expected cache to be empty") + + time.Sleep(time.Millisecond * 200) + _, ok = c.Bucket("test").Get("key3") + assert.False(t, ok, "expected key3 to be deleted") + assert.Zero(t, c.Bucket("test").Len(), "expected cache to be empty") +} + +func TestCache_MaxItems_Overwrite(t *testing.T) { + c := cache.NewWithOpts(cache.CacheOptions{ + CheckInterval: time.Millisecond * 10, + }) + c.BucketWithOpts("test", cache.BucketOptions{ + MaxItems: 2, + }) + c.Bucket("test").SetWithTTL("key", 1, time.Millisecond*10) + n, ok := c.Bucket("test").Get("key") + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 1, n, "expected value to be 1, got %d", n) + + + c.Bucket("test").SetWithTTL("key", 2, time.Millisecond*100) + n, ok = c.Bucket("test").Get("key") + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 2, n, "expected value to be 2, got %d", n) + + time.Sleep(time.Millisecond * 50) + _, ok = c.Bucket("test").Get("key") + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 2, n, "expected value to be 2, got %d", n) + + time.Sleep(time.Millisecond * 100) + _, ok = c.Bucket("test").Get("key") + assert.False(t, ok, "expected key to be deleted") +} diff --git a/pkg/eventloop/eventloop.go b/pkg/eventloop/eventloop.go new file mode 100644 index 0000000..20652b6 --- /dev/null +++ b/pkg/eventloop/eventloop.go @@ -0,0 +1,425 @@ +package eventloop + +import ( + "sync" + "sync/atomic" + "time" + + "github.com/dop251/goja" + "github.com/dop251/goja_nodejs/require" +) + +type job struct { + cancelled bool + fn func() +} + +type Timer struct { + job + timer *time.Timer +} + +type Interval struct { + job + ticker *time.Ticker + stopChan chan struct{} +} + +type Immediate struct { + job +} + +type EventLoop struct { + vm *goja.Runtime + + // eventChan chan any + + jobChan chan func() + jobCount int32 + canRun int32 + + auxJobsLock sync.Mutex + wakeupChan chan struct{} + + auxJobsSpare, auxJobs []func() + + stopLock sync.Mutex + stopCond *sync.Cond + running bool + + registry *require.Registry +} + +func NewEventLoop(opts ...Option) *EventLoop { + loop := &EventLoop{ + jobChan: make(chan func()), + // eventChan: make(chan any), + wakeupChan: make(chan struct{}, 1), + } + loop.stopCond = sync.NewCond(&loop.stopLock) + + for _, opt := range opts { + opt(loop) + } + if loop.vm == nil { + loop.vm = goja.New() + } + if loop.registry == nil { + loop.registry = new(require.Registry) + } + + loop.registry.Enable(loop.vm) + + loop.vm.Set("setTimeout", loop.setTimeout) + loop.vm.Set("setInterval", loop.setInterval) + loop.vm.Set("setImmediate", loop.setImmediate) + loop.vm.Set("clearTimeout", loop.clearTimeout) + loop.vm.Set("clearInterval", loop.clearInterval) + loop.vm.Set("clearImmediate", loop.clearImmediate) + + // loop.vm.SetMaxCallStackSize(2 ^ 16) + // loop.vm.SetAsyncContextTracker(newAsyncTracker(loop.eventChan)) + // loop.vm.SetPromiseRejectionTracker(func(p *goja.Promise, operation goja.PromiseRejectionOperation) { + // if operation == goja.PromiseRejectionHandle { + // loop.eventChan <- "handled" + // return + // } + // loop.eventChan <- "rejected" + // }) + + return loop +} + +type Option func(*EventLoop) + +func WithRegistry(registry *require.Registry) Option { + return func(loop *EventLoop) { + loop.registry = registry + } +} + +func WithRuntime(vm *goja.Runtime) Option { + return func(loop *EventLoop) { + loop.vm = vm + } +} + +func (loop *EventLoop) Registry() *require.Registry { + return loop.registry +} + +func (loop *EventLoop) schedule(call goja.FunctionCall, repeating bool) goja.Value { + if fn, ok := goja.AssertFunction(call.Argument(0)); ok { + delay := call.Argument(1).ToInteger() + var args []goja.Value + if len(call.Arguments) > 2 { + args = append(args, call.Arguments[2:]...) + } + f := func() { fn(nil, args...) } + loop.jobCount++ + if repeating { + return loop.vm.ToValue(loop.addInterval(f, time.Duration(delay)*time.Millisecond)) + } else { + return loop.vm.ToValue(loop.addTimeout(f, time.Duration(delay)*time.Millisecond)) + } + } + return nil +} + +func (loop *EventLoop) setTimeout(call goja.FunctionCall) goja.Value { + return loop.schedule(call, false) +} + +func (loop *EventLoop) setInterval(call goja.FunctionCall) goja.Value { + return loop.schedule(call, true) +} + +func (loop *EventLoop) setImmediate(call goja.FunctionCall) goja.Value { + if fn, ok := goja.AssertFunction(call.Argument(0)); ok { + var args []goja.Value + if len(call.Arguments) > 1 { + args = append(args, call.Arguments[1:]...) + } + f := func() { fn(nil, args...) } + loop.jobCount++ + return loop.vm.ToValue(loop.addImmediate(f)) + } + return nil +} + +// SetTimeout schedules to run the specified function in the context +// of the loop as soon as possible after the specified timeout period. +// SetTimeout returns a Timer which can be passed to ClearTimeout. +// The instance of goja.Runtime that is passed to the function and any Values derived +// from it must not be used outside the function. SetTimeout is +// safe to call inside or outside the loop. +func (loop *EventLoop) SetTimeout(fn func(*goja.Runtime), timeout time.Duration) *Timer { + t := loop.addTimeout(func() { fn(loop.vm) }, timeout) + loop.addAuxJob(func() { + loop.jobCount++ + }) + return t +} + +// ClearTimeout cancels a Timer returned by SetTimeout if it has not run yet. +// ClearTimeout is safe to call inside or outside the loop. +func (loop *EventLoop) ClearTimeout(t *Timer) { + loop.addAuxJob(func() { + loop.clearTimeout(t) + }) +} + +// SetInterval schedules to repeatedly run the specified function in +// the context of the loop as soon as possible after every specified +// timeout period. SetInterval returns an Interval which can be +// passed to ClearInterval. The instance of goja.Runtime that is passed to the +// function and any Values derived from it must not be used outside +// the function. SetInterval is safe to call inside or outside the +// loop. +func (loop *EventLoop) SetInterval(fn func(*goja.Runtime), timeout time.Duration) *Interval { + i := loop.addInterval(func() { fn(loop.vm) }, timeout) + loop.addAuxJob(func() { + loop.jobCount++ + }) + return i +} + +// ClearInterval cancels an Interval returned by SetInterval. +// ClearInterval is safe to call inside or outside the loop. +func (loop *EventLoop) ClearInterval(i *Interval) { + loop.addAuxJob(func() { + loop.clearInterval(i) + }) +} + +func (loop *EventLoop) setRunning() { + loop.stopLock.Lock() + defer loop.stopLock.Unlock() + if loop.running { + panic("Loop is already started") + } + loop.running = true + atomic.StoreInt32(&loop.canRun, 1) +} + +// Run calls the specified function, starts the event loop and waits until there are no more delayed jobs to run +// after which it stops the loop and returns. +// The instance of goja.Runtime that is passed to the function and any Values derived from it must not be used +// outside the function. +// Do NOT use this function while the loop is already running. Use RunOnLoop() instead. +// If the loop is already started it will panic. +func (loop *EventLoop) Run(fn func(*goja.Runtime)) { + loop.setRunning() + fn(loop.vm) + loop.run(false) +} + +func (loop *EventLoop) Wait() { + if !loop.running { + panic("loop is not running") + } + loop.run(false) +} + +// Start the event loop in the background. The loop continues to run until Stop() is called. +// If the loop is already started it will panic. +func (loop *EventLoop) Start() *goja.Runtime { + loop.setRunning() + go loop.run(true) + return loop.vm +} + +// Runtime returns the goja.Runtime instance associated with the loop. +func (loop *EventLoop) Runtime() *goja.Runtime { + return loop.vm +} + +// Stop the loop that was started with Start(). After this function returns there will be no more jobs executed +// by the loop. It is possible to call Start() or Run() again after this to resume the execution. +// Note, it does not cancel active timeouts. +// It is not allowed to run Start() (or Run()) and Stop() concurrently. +// Calling Stop() on a non-running loop has no effect. +// It is not allowed to call Stop() from the loop, because it is synchronous and cannot complete until the loop +// is not running any jobs. Use StopNoWait() instead. +// return number of jobs remaining +func (loop *EventLoop) Stop() int { + loop.stopLock.Lock() + for loop.running { + atomic.StoreInt32(&loop.canRun, 0) + loop.wakeup() + loop.stopCond.Wait() + } + loop.stopLock.Unlock() + return int(loop.jobCount) +} + +// StopNoWait tells the loop to stop and returns immediately. Can be used inside the loop. Calling it on a +// non-running loop has no effect. +func (loop *EventLoop) StopNoWait() { + loop.stopLock.Lock() + if loop.running { + atomic.StoreInt32(&loop.canRun, 0) + loop.wakeup() + } + loop.stopLock.Unlock() +} + +// RunOnLoop schedules to run the specified function in the context of the loop as soon as possible. +// The order of the runs is preserved (i.e. the functions will be called in the same order as calls to RunOnLoop()) +// The instance of goja.Runtime that is passed to the function and any Values derived from it must not be used +// outside the function. It is safe to call inside or outside the loop. +func (loop *EventLoop) RunOnLoop(fn func(*goja.Runtime)) { + loop.addAuxJob(func() { fn(loop.vm) }) +} + +func (loop *EventLoop) runAux() { + loop.auxJobsLock.Lock() + jobs := loop.auxJobs + loop.auxJobs = loop.auxJobsSpare + loop.auxJobsLock.Unlock() + for i, job := range jobs { + job() + jobs[i] = nil + } + loop.auxJobsSpare = jobs[:0] +} + +func (loop *EventLoop) run(inBackground bool) { + loop.runAux() + if inBackground { + loop.jobCount++ + } +LOOP: + for loop.jobCount > 0 { + select { + case job := <-loop.jobChan: + job() + case <-loop.wakeupChan: + loop.runAux() + if atomic.LoadInt32(&loop.canRun) == 0 { + break LOOP + } + } + } + if inBackground { + loop.jobCount-- + } + + loop.stopLock.Lock() + loop.running = false + loop.stopLock.Unlock() + loop.stopCond.Broadcast() +} + +func (loop *EventLoop) wakeup() { + select { + case loop.wakeupChan <- struct{}{}: + default: + } +} + +func (loop *EventLoop) addAuxJob(fn func()) { + loop.auxJobsLock.Lock() + loop.auxJobs = append(loop.auxJobs, fn) + loop.auxJobsLock.Unlock() + loop.wakeup() +} + +func (loop *EventLoop) addTimeout(f func(), timeout time.Duration) *Timer { + t := &Timer{ + job: job{fn: f}, + } + t.timer = time.AfterFunc(timeout, func() { + loop.jobChan <- func() { + loop.doTimeout(t) + } + }) + + return t +} + +func (loop *EventLoop) addInterval(f func(), timeout time.Duration) *Interval { + // https://nodejs.org/api/timers.html#timers_setinterval_callback_delay_args + if timeout <= 0 { + timeout = time.Millisecond + } + + i := &Interval{ + job: job{fn: f}, + ticker: time.NewTicker(timeout), + stopChan: make(chan struct{}), + } + + go i.run(loop) + return i +} + +func (loop *EventLoop) addImmediate(f func()) *Immediate { + i := &Immediate{ + job: job{fn: f}, + } + loop.addAuxJob(func() { + loop.doImmediate(i) + }) + return i +} + +func (loop *EventLoop) doTimeout(t *Timer) { + if !t.cancelled { + t.fn() + t.cancelled = true + loop.jobCount-- + } +} + +func (loop *EventLoop) doInterval(i *Interval) { + if !i.cancelled { + i.fn() + } +} + +func (loop *EventLoop) doImmediate(i *Immediate) { + if !i.cancelled { + i.fn() + i.cancelled = true + loop.jobCount-- + } +} + +func (loop *EventLoop) clearTimeout(t *Timer) { + if t != nil && !t.cancelled { + t.timer.Stop() + t.cancelled = true + loop.jobCount-- + } +} + +func (loop *EventLoop) clearInterval(i *Interval) { + if i != nil && !i.cancelled { + i.cancelled = true + close(i.stopChan) + loop.jobCount-- + } +} + +func (loop *EventLoop) clearImmediate(i *Immediate) { + if i != nil && !i.cancelled { + i.cancelled = true + loop.jobCount-- + } +} + +func (i *Interval) run(loop *EventLoop) { +L: + for { + select { + case <-i.stopChan: + i.ticker.Stop() + break L + case <-i.ticker.C: + loop.jobChan <- func() { + loop.doInterval(i) + } + } + } +} diff --git a/pkg/modules/README.md b/pkg/modules/README.md new file mode 100644 index 0000000..ce9e702 --- /dev/null +++ b/pkg/modules/README.md @@ -0,0 +1,41 @@ +# DGate Module Specification + +## Module Types + +### Request + +Request +- functions + - body() + - returns the request body +- properties + - status + +```ts +// this keyword has the same type for each module/function, which is the ModuleContext, this contains a snapshot of any metadata information that is available to the module. +interface ModuleContext { + // this is the request object (requires request permission/minimal) + request: Request; + // this is the response object, this may not available for all modules (requires response permission/minimal) + response: Response; + + // this is the namespace object (requires namespace permission/basic) + namespace: Namespace; + // this is the service object (requires service permission/basic) + service: Service; + // this is the route object (requires route permission/basic) + route: Route; + // this is the module object (requires module permission/basic) + module: Module; + + // this is the node object (requires node permission/advanced) + node: Node; + // this is the cluster object (requires cluster permission/advanced) + cluster: Cluster; +} + +function exampleModule(): string { + const tags = this.node.tags; + const version = this.node.version; +} +``` \ No newline at end of file diff --git a/pkg/modules/dgate/crypto/crypto_mod.go b/pkg/modules/dgate/crypto/crypto_mod.go new file mode 100644 index 0000000..e774101 --- /dev/null +++ b/pkg/modules/dgate/crypto/crypto_mod.go @@ -0,0 +1,241 @@ +package crypto + +import ( + "crypto/hmac" + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" + "encoding/base64" + "encoding/hex" + "errors" + "fmt" + "hash" + "math/big" + + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/util" + "github.com/dop251/goja" + "github.com/google/uuid" +) + +type CryptoModule struct { + modCtx modules.RuntimeContext +} + +var _ modules.GoModule = &CryptoModule{} + +func New(modCtx modules.RuntimeContext) modules.GoModule { + return &CryptoModule{modCtx} +} + +func (c *CryptoModule) Exports() *modules.Exports { + return &modules.Exports{ + Named: map[string]any{ + "createHash": c.createHash, + "createHmac": c.createHmac, + "createSign": nil, // TODO: not implemented + "createVerify": nil, // TODO: not implemented + "hmac": c.hmac, + "md5": c.md5, + "randomBytes": c.randomBytes, + "randomInt": c.randomInt, // + "sha1": c.sha1, + "sha256": c.sha256, + "sha384": c.sha384, + "sha512": c.sha512, + "sha512_224": c.sha512_224, + "sha512_256": c.sha512_256, + "getHashes": func() []string { + return []string{ + // TODO: add more hashes + "md5", "sha1", "sha256", "sha384", "sha512", "sha512-224", "sha512-256", + } + }, + "hexEncode": c.hexEncode, + }, + } +} + +func (c *CryptoModule) randomBytes(size int) (*goja.ArrayBuffer, error) { + if size < 1 { + return nil, errors.New("invalid size") + } + bytes := make([]byte, size) + _, err := rand.Read(bytes) + if err != nil { + return nil, err + } + ab := c.modCtx.Runtime().NewArrayBuffer(bytes) + return &ab, nil +} + +func (c *CryptoModule) randomInt(call goja.FunctionCall) (int64, error) { + argLen := len(call.Arguments) + if argLen <= 0 || argLen >= 3 { + return 0, errors.New("invalid number of arguments") + } else if argLen == 1 { + nBig, err := rand.Int(rand.Reader, big.NewInt(call.Argument(0).ToInteger())) + if err != nil { + return 0, err + } + return nBig.Int64(), nil + } else { + min := call.Argument(0).ToInteger() + max := call.Argument(1).ToInteger() + if min > max { + return 0, errors.New("min must be less than or equal to max") + } + nBig, err := rand.Int(rand.Reader, big.NewInt(max-min)) + if err != nil { + return 0, err + } + return min + nBig.Int64(), nil + } +} + +func (c *CryptoModule) randomUUID() string { + return uuid.New().String() +} + +func (c *CryptoModule) md5(data any, encoding string) (any, error) { + return c.update("md5", data, encoding) +} + +func (c *CryptoModule) sha1(data any, encoding string) (any, error) { + return c.update("sha1", data, encoding) +} + +func (c *CryptoModule) sha256(data any, encoding string) (any, error) { + return c.update("sha256", data, encoding) +} + +func (c *CryptoModule) sha384(data any, encoding string) (any, error) { + return c.update("sha384", data, encoding) +} + +func (c *CryptoModule) sha512(data any, encoding string) (any, error) { + return c.update("sha512", data, encoding) +} + +func (c *CryptoModule) sha512_224(data any, encoding string) (any, error) { + return c.update("sha512_224", data, encoding) +} + +func (c *CryptoModule) sha512_256(data any, encoding string) (any, error) { + return c.update("sha512_256", data, encoding) +} + +func (c *CryptoModule) createHash(algorithm string) (*GojaHash, error) { + h, err := c.getHash(algorithm) + if err != nil { + return nil, err + } + return &GojaHash{h, c.modCtx.Runtime()}, nil +} + +func (c *CryptoModule) update(alg string, data any, encoding string) (any, error) { + hash, err := c.createHash(alg) + if err != nil { + return nil, err + } + if _, err := hash.Update(data); err != nil { + return nil, fmt.Errorf("%s failed: %w", alg, err) + } + + return hash.Digest(encoding) +} + +func (c *CryptoModule) hexEncode(data any) (string, error) { + d, err := util.ToBytes(data) + if err != nil { + return "", err + } + return hex.EncodeToString(d), nil +} + +func (c *CryptoModule) createHmac(algorithm string, key any) (*GojaHash, error) { + h, err := c.getHash(algorithm) + if err != nil { + return nil, err + } + + kb, err := util.ToBytes(key) + if err != nil { + return nil, err + } + hashFunc := func() hash.Hash { return h } + return &GojaHash{hmac.New(hashFunc, kb), c.modCtx.Runtime()}, nil +} + +func (c *CryptoModule) hmac(algorithm string, key, data any, encoding string) (any, error) { + hash, err := c.createHmac(algorithm, key) + if err != nil { + return nil, err + } + _, err = hash.Update(data) + if err != nil { + return nil, err + } + return hash.Digest(encoding) +} + +func (c *CryptoModule) getHash(enc string) (hash.Hash, error) { + switch enc { + case "md5": + return md5.New(), nil + case "sha1": + return sha1.New(), nil + case "sha256": + return sha256.New(), nil + case "sha384": + return sha512.New384(), nil + case "sha512_224": + return sha512.New512_224(), nil + case "sha512_256": + return sha512.New512_256(), nil + case "sha512": + return sha512.New(), nil + default: + return nil, errors.New("invalid hash algorithm") + } +} + +type GojaHash struct { + hash hash.Hash + rt *goja.Runtime +} + +func (h *GojaHash) Update(data any) (*GojaHash, error) { + d, err := util.ToBytes(data) + if err != nil { + return h, err + } + _, err = h.hash.Write(d) + return h, err +} + +func (h *GojaHash) Digest(enc string) (any, error) { + sum := h.hash.Sum(nil) + + switch enc { + case "hex": + return hex.EncodeToString(sum), nil + case "base64", "b64": + return base64.StdEncoding. + EncodeToString(sum), nil + case "base64raw", "b64raw": + return base64.RawStdEncoding. + EncodeToString(sum), nil + case "base64url", "b64url": + return base64.URLEncoding. + EncodeToString(sum), nil + case "base64rawurl", "b64rawurl": + return base64.RawURLEncoding. + EncodeToString(sum), nil + default: // default to 'binary' (same behavior as Node.js) + ab := h.rt.NewArrayBuffer(sum) + return &ab, nil + } +} diff --git a/pkg/modules/dgate/dgate_mod.go b/pkg/modules/dgate/dgate_mod.go new file mode 100644 index 0000000..939d0d9 --- /dev/null +++ b/pkg/modules/dgate/dgate_mod.go @@ -0,0 +1,76 @@ +package dgate + +import ( + "errors" + "time" + + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/modules/dgate/crypto" + "github.com/dgate-io/dgate/pkg/modules/dgate/exp" + "github.com/dgate-io/dgate/pkg/modules/dgate/http" + "github.com/dgate-io/dgate/pkg/modules/dgate/state" + "github.com/dgate-io/dgate/pkg/modules/dgate/storage" + "github.com/dgate-io/dgate/pkg/modules/dgate/util" + "github.com/dop251/goja" +) + +type DGateModule struct { + modCtx modules.RuntimeContext +} + +// New implements the modules.Module interface to return +// a new instance for each ModuleContext. +func New(modCtx modules.RuntimeContext) *DGateModule { + return &DGateModule{modCtx} +} + +// Children returns the exports of the k6 module. +func (x *DGateModule) Exports() *modules.Exports { + return &modules.Exports{ + Named: map[string]any{ + // Functions + "fail": x.Fail, + "retry": x.Retry, + "sleep": x.Sleep, + + // Submodules + "x": exp.New(x.modCtx), + "http": http.New(x.modCtx), + "util": util.New(x.modCtx), + "state": state.New(x.modCtx), + "crypto": crypto.New(x.modCtx), + "storage": storage.New(x.modCtx), + }, + } +} + +func (*DGateModule) Fail(msg string) (goja.Value, error) { + return goja.Undefined(), errors.New(msg) +} + +func (x *DGateModule) Sleep(secs float64) { + ctx := x.modCtx.Context() + select { + case <-time.After(time.Duration(secs * float64(time.Second))): + case <-ctx.Done(): + } +} + +func (x *DGateModule) Retry(num int, fn goja.Callable) (v goja.Value, err error) { + if num <= 0 { + return nil, errors.New("num must be greater than 0") + } + if fn == nil { + return nil, errors.New("retry() requires a callback as a second argument") + } + loop := x.modCtx.EventLoop() + loop.RunOnLoop(func(rt *goja.Runtime) { + for i := 0; i < num; i++ { + v, err = fn(goja.Undefined(), rt.ToValue(i)) + if v.ToBoolean() { + return + } + } + }) + return v, err +} diff --git a/pkg/modules/dgate/exp/exp_mod.go b/pkg/modules/dgate/exp/exp_mod.go new file mode 100644 index 0000000..a7e376b --- /dev/null +++ b/pkg/modules/dgate/exp/exp_mod.go @@ -0,0 +1,21 @@ +package exp + +import ( + "github.com/dgate-io/dgate/pkg/modules" +) + +type ExperimentalModule struct { + modCtx modules.RuntimeContext +} + +var _ modules.GoModule = &ExperimentalModule{} + +func New(modCtx modules.RuntimeContext) modules.GoModule { + return &ExperimentalModule{modCtx} +} + +func (hp *ExperimentalModule) Exports() *modules.Exports { + return &modules.Exports{ + Named: map[string]any{}, + } +} diff --git a/pkg/modules/dgate/http/http_mod.go b/pkg/modules/dgate/http/http_mod.go new file mode 100644 index 0000000..2bdf74b --- /dev/null +++ b/pkg/modules/dgate/http/http_mod.go @@ -0,0 +1,185 @@ +package http + +import ( + "bytes" + "encoding/json" + "errors" + "io" + "net/http" + "time" + + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dop251/goja" +) + +type HttpModule struct { + modCtx modules.RuntimeContext +} + +var _ modules.GoModule = &HttpModule{} + +func New(modCtx modules.RuntimeContext) modules.GoModule { + return &HttpModule{ + modCtx, + } +} + +func (hp *HttpModule) Exports() *modules.Exports { + return &modules.Exports{ + Named: map[string]any{ + "fetch": hp.FetchAsync, + }, + } +} + +type FetchOptionsRedirect string + +const ( + Follow FetchOptionsRedirect = "follow" + Error FetchOptionsRedirect = "error" + Manual FetchOptionsRedirect = "manual" +) + +type FetchOptions struct { + Method string `json:"method"` + Body string `json:"body"` + Headers map[string]string `json:"headers"` + Redirect FetchOptionsRedirect `json:"redirects"` + Follow int `json:"follow"` + Compress bool `json:"compress"` + Size int `json:"size"` + Agent string `json:"agent"` + HighWaterMark int `json:"highWaterMark"` + InsecureHTTPParser bool `json:"insecureHTTPParser"` + // TODO: add options for timeout (signal which would require AbortController support) +} + +func (hp *HttpModule) FetchAsync(url string, fetchOpts FetchOptions) (*goja.Promise, error) { + loop := hp.modCtx.EventLoop() + promise, resolve, reject := loop.Runtime().NewPromise() + redirected := false + var reader io.Reader + client := http.Client{ + CheckRedirect: func(req *http.Request, via []*http.Request) error { + if fetchOpts.Redirect == Manual { + return http.ErrUseLastResponse + } else if fetchOpts.Redirect == Error { + return errors.New("redirects not allowed") + } + redirected = true + return nil + }, + } + if fetchOpts.Body != "" { + reader = bytes.NewReader([]byte(fetchOpts.Body)) + } + req, err := http.NewRequest(fetchOpts.Method, url, reader) + if err != nil { + return nil, err + } else { + req.Header.Set("User-Agent", "DGate-Client/1.0") + for k, v := range fetchOpts.Headers { + req.Header.Set(k, v) + } + } + resultsChan := asyncDo(client, req) + bodyUsed := false + loop.RunOnLoop(func(rt *goja.Runtime) { + results := <-resultsChan + if results.Error != nil { + reject(rt.NewGoError(results.Error)) + return + } + resp := results.Data + resolve(map[string]any{ + "_debug_time": results.Time.Seconds(), + "status": resp.StatusCode, + "statusText": resp.Status, + "headers": resp.Header, + "body": resp.Body, + "bodyUsed": &bodyUsed, + "ok": resp.StatusCode >= 200 && resp.StatusCode < 300, + "url": resp.Request.URL.String(), + "redirected": redirected, + "json": func() (*goja.Promise, error) { + bodyPromise, bodyResolve, bodyReject := rt.NewPromise() + loop.RunOnLoop(func(_ *goja.Runtime) { + if bodyUsed { + bodyReject(rt.NewGoError(errors.New("body already used"))) + return + } + defer resp.Body.Close() + var jsonData interface{} + err := json.NewDecoder(resp.Body).Decode(&jsonData) + if err != nil { + bodyReject(err) + return + } + bodyUsed = true + bodyResolve(jsonData) + }) + return bodyPromise, nil + }, + "text": func() (*goja.Promise, error) { + bodyPromise, bodyResolve, bodyReject := rt.NewPromise() + loop.RunOnLoop(func(_ *goja.Runtime) { + if bodyUsed { + bodyReject(rt.NewGoError(errors.New("body already used"))) + return + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + bodyReject(err) + return + } + bodyResolve(string(body)) + }) + return bodyPromise, nil + }, + "arrayBuffer": func() (*goja.Promise, error) { + bodyPromise, bodyResolve, bodyReject := rt.NewPromise() + loop.RunOnLoop(func(_ *goja.Runtime) { + if bodyUsed { + bodyReject(rt.NewGoError(errors.New("body already used"))) + return + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + bodyReject(err) + return + } + bodyUsed = true + bodyResolve(rt.NewArrayBuffer(body)) + }) + return bodyPromise, nil + }, + }) + }) + return promise, nil +} + +type AsyncResults[T any] struct { + Data T + Error error + Time time.Duration +} + +func asyncDo(client http.Client, req *http.Request) chan AsyncResults[*http.Response] { + ch := make(chan AsyncResults[*http.Response], 1) + go func() { + start := time.Now() + resp, err := client.Do(req) + if err != nil { + ch <- AsyncResults[*http.Response]{Error: err} + return + } + elapsed := time.Since(start) + ch <- AsyncResults[*http.Response]{ + Data: resp, + Time: elapsed, + } + }() + return ch +} diff --git a/pkg/modules/dgate/state/state_mod.go b/pkg/modules/dgate/state/state_mod.go new file mode 100644 index 0000000..53b3735 --- /dev/null +++ b/pkg/modules/dgate/state/state_mod.go @@ -0,0 +1,167 @@ +package state + +import ( + "encoding/json" + "errors" + + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dop251/goja" +) + +type ResourcesModule struct { + modCtx modules.RuntimeContext +} + +var _ modules.GoModule = &ResourcesModule{} + +func New(modCtx modules.RuntimeContext) modules.GoModule { + return &ResourcesModule{modCtx} +} + +func (hp *ResourcesModule) Exports() *modules.Exports { + return &modules.Exports{ + Named: map[string]any{ + "getCollection": hp.fetchCollection, + "getDocument": hp.fetchDocument, + "getDocuments": hp.fetchDocuments, + "addCollection": writeFunc[*spec.Collection](hp, spec.AddCollectionCommand), + "addDocument": writeFunc[*spec.Document](hp, spec.AddDocumentCommand), + "deleteCollection": writeFunc[*spec.Collection](hp, spec.DeleteCollectionCommand), + "deleteDocument": writeFunc[*spec.Document](hp, spec.DeleteDocumentCommand), + }, + } +} + +func (hp *ResourcesModule) fetchCollection(name string) *goja.Promise { + ctx := hp.modCtx.Context() + state := hp.modCtx.State() + loop := hp.modCtx.EventLoop() + rt := hp.modCtx.Runtime() + rm := state.ResourceManager() + docPromise, resolve, reject := rt.NewPromise() + loop.RunOnLoop(func(rt *goja.Runtime) { + namespace := ctx.Value(spec.Name("namespace")) + if namespace == nil { + reject(rt.NewGoError( + errors.New("namespace not found in context"), + )) + return + } + collection, ok := rm.GetCollection(namespace.(string), name) + if !ok { + reject(goja.Null()) + return + } + resolve(rt.ToValue(collection)) + }) + return docPromise +} + +func (hp *ResourcesModule) fetchDocument(collection, id string) *goja.Promise { + ctx := hp.modCtx.Context() + state := hp.modCtx.State() + loop := hp.modCtx.EventLoop() + rt := loop.Runtime() + docPromise, resolve, reject := rt.NewPromise() + loop.RunOnLoop(func(rt *goja.Runtime) { + namespace := ctx.Value(spec.Name("namespace")) + if namespace == nil { + reject(rt.NewGoError(errors.New("namespace not found in context"))) + return + } + doc, err := state.DocumentManager(). + GetDocumentByID(namespace.(string), collection, id) + if err != nil { + reject(rt.NewGoError(err)) + return + } + resolve(rt.ToValue(doc)) + }) + return docPromise +} + +func (hp *ResourcesModule) fetchDocuments(args goja.FunctionCall) (*goja.Promise, error) { + ctx := hp.modCtx.Context() + state := hp.modCtx.State() + loop := hp.modCtx.EventLoop() + rt := hp.modCtx.Runtime() + + collection_name := "" + if args.Argument(0) == goja.Undefined() { + return nil, errors.New("collection name is required") + } else { + collection_name = args.Argument(0).String() + } + limit := 0 + if args.Argument(1) != goja.Undefined() { + limit = int(args.Argument(1).ToInteger()) + } + offset := 0 + if args.Argument(2) != goja.Undefined() { + offset = int(args.Argument(2).ToInteger()) + } + + namespaceVal := ctx.Value(spec.Name("namespace")) + if namespaceVal == nil { + return nil, errors.New("namespace not found in context") + } + namespace := namespaceVal.(string) + + docPromise, resolve, reject := rt.NewPromise() + loop.RunOnLoop(func(rt *goja.Runtime) { + doc, err := state.DocumentManager(). + GetDocuments(namespace, collection_name, limit, offset) + if err != nil { + reject(rt.NewGoError(err)) + return + } + resolve(rt.ToValue(doc)) + }) + return docPromise, nil +} + +func writeFunc[T spec.Named](hp *ResourcesModule, cmd spec.Command) func(map[string]any) (*goja.Promise, error) { + return func(item map[string]any) (*goja.Promise, error) { + if item == nil { + return nil, errors.New("item is nil") + } + ctx := hp.modCtx.Context() + state := hp.modCtx.State() + loop := hp.modCtx.EventLoop() + rt := hp.modCtx.Runtime() + docPromise, resolve, reject := rt.NewPromise() + loop.RunOnLoop(func(rt *goja.Runtime) { + rs, err := remarshalNamed[T](item) + if err != nil { + reject(rt.NewGoError(err)) + return + } + + namespaceVal := ctx.Value(spec.Name("namespace")) + if namespaceVal == nil { + reject(rt.NewGoError(errors.New("namespace not found in context"))) + return + } + namespace := namespaceVal.(string) + + err = state.ApplyChangeLog(spec.NewChangeLog(rs, namespace, cmd)) + if err != nil { + reject(rt.NewGoError(err)) + return + } + resolve(rt.ToValue(rs)) + }) + return docPromise, nil + } +} + +func remarshalNamed[T spec.Named](obj map[string]any) (T, error) { + var str T + objBytes, err := json.Marshal(obj) + if err != nil { + return str, err + } + err = json.Unmarshal(objBytes, &str) + return str, err +} diff --git a/pkg/modules/dgate/storage/storage_mod.go b/pkg/modules/dgate/storage/storage_mod.go new file mode 100644 index 0000000..7b68854 --- /dev/null +++ b/pkg/modules/dgate/storage/storage_mod.go @@ -0,0 +1,142 @@ +package storage + +import ( + "bytes" + "errors" + "io" + "net/http" + "strconv" + "time" + + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/spec" +) + +type StorageModule struct { + modCtx modules.RuntimeContext +} + +var _ modules.GoModule = &StorageModule{} + +func New(modCtx modules.RuntimeContext) modules.GoModule { + return &StorageModule{modCtx} +} + +func (sm *StorageModule) Exports() *modules.Exports { + return &modules.Exports{ + Named: map[string]any{ + "useCache": sm.UseCache, + "getCache": sm.GetCache, + "setCache": sm.SetCache, + }, + } +} + +type UpdateFunc func(any, any) any + +type CacheOptions struct { + InitialValue any `json:"initialValue"` + Callback UpdateFunc `json:"updateCallback"` + TTL time.Duration `json:"ttl"` +} + +func (sm *StorageModule) UseCache(cacheId string, opts CacheOptions) (arr [2]any, err error) { + if cacheId == "" { + err = errors.New("cache id cannot be empty") + return + } + nsValue := sm.modCtx.Context(). + Value(spec.Name("namespace")) + if nsValue == nil || nsValue.(string) == "" { + err = errors.New("namespace is not set") + return + } + namespace := nsValue.(string) + + if opts.TTL < 0 { + err = errors.New("TTL cannot be negative") + return + } + + bucket := sm.modCtx.State().SharedCache(). + Bucket("storage:cache:" + namespace) + + val, ok := bucket.Get(cacheId) + if !ok && opts.InitialValue != nil { + val = opts.InitialValue + } + + return [2]any{ + val, func(newVal any) { + bucket.SetWithTTL(cacheId, newVal, opts.TTL) + if opts.Callback != nil { + newVal = opts.Callback(val, newVal) + // change val to newVal in case + // this function is called multiple times + val = newVal + } + }, + }, nil +} + +func (sm *StorageModule) SetCache(cacheId string, val any, opts CacheOptions) error { + if cacheId == "" { + return errors.New("cache id cannot be empty") + } + namespace := sm.modCtx.Context(). + Value(spec.Name("namespace")) + if namespace == nil || namespace.(string) == "" { + return errors.New("namespace is not set") + } + uniqueId := "storage:cache:" + namespace.(string) + ":" + cacheId + bucket := sm.modCtx.State().SharedCache().Bucket(uniqueId) + if opts.TTL < 0 { + return errors.New("TTL cannot be negative") + } + bucket.SetWithTTL(uniqueId, val, opts.TTL) + return nil +} + +func (sm *StorageModule) GetCache(cacheId string) (any, error) { + if cacheId == "" { + return nil, errors.New("cache id cannot be empty") + } + namespace := sm.modCtx.Context(). + Value(spec.Name("namespace")) + if namespace == nil || namespace.(string) == "" { + return nil, errors.New("namespace is not set") + } + bucket := sm.modCtx.State().SharedCache(). + Bucket("storage:cache:" + namespace.(string)) + + if val, ok := bucket.Get(cacheId); ok { + return val, nil + } + return nil, errors.New("cache not found") +} + +func (sm *StorageModule) ReadWriteBody(res *http.Response, callback func(string) string) string { + if callback == nil { + return "" + } + body, err := io.ReadAll(res.Body) + if err != nil { + panic(err) + } + err = res.Body.Close() + if err != nil { + panic(err) + } + newBody := callback(string(body)) + res.Body = io.NopCloser(bytes.NewReader([]byte(newBody))) + res.ContentLength = int64(len(newBody)) + res.Header.Set("Content-Length", strconv.Itoa(len(newBody))) + return string(newBody) +} + +func (sm *StorageModule) GetCollection(collectionName string) *spec.Collection { + if collectionName == "" { + return nil + } + return nil +} diff --git a/pkg/modules/dgate/util/util_mod.go b/pkg/modules/dgate/util/util_mod.go new file mode 100644 index 0000000..6ae7b28 --- /dev/null +++ b/pkg/modules/dgate/util/util_mod.go @@ -0,0 +1,47 @@ +package util + +import ( + "bytes" + "io" + "net/http" + "strconv" + + "github.com/dgate-io/dgate/pkg/modules" +) + +type UtilModule struct { + modCtx modules.RuntimeContext +} + +var _ modules.GoModule = &UtilModule{} + +func New(modCtx modules.RuntimeContext) modules.GoModule { + return &UtilModule{modCtx} +} + +func (um *UtilModule) Exports() *modules.Exports { + return &modules.Exports{ + Named: map[string]any{ + "readWriteBody": um.ReadWriteBody, + }, + } +} + +func (um *UtilModule) ReadWriteBody(res *http.Response, callback func(string) string) string { + if callback == nil { + return "" + } + body, err := io.ReadAll(res.Body) + if err != nil { + panic(err) + } + err = res.Body.Close() + if err != nil { + panic(err) + } + newBody := callback(string(body)) + res.Body = io.NopCloser(bytes.NewReader([]byte(newBody))) + res.ContentLength = int64(len(newBody)) + res.Header.Set("Content-Length", strconv.Itoa(len(newBody))) + return string(newBody) +} diff --git a/pkg/modules/extractors/extractors.go b/pkg/modules/extractors/extractors.go new file mode 100644 index 0000000..1d3abb4 --- /dev/null +++ b/pkg/modules/extractors/extractors.go @@ -0,0 +1,306 @@ +package extractors + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "sync/atomic" + "time" + + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dgate-io/dgate/pkg/modules/types" + "github.com/dop251/goja" +) + +type ( + // this can be used to create custom load balancing strategies, by default it uses round robin + FetchUpstreamUrlFunc func(*types.ModuleContext) (*url.URL, error) + RequestModifierFunc func(*types.ModuleContext) error + ResponseModifierFunc func(*types.ModuleContext, *http.Response) error + ErrorHandlerFunc func(*types.ModuleContext, error) error + RequestHandlerFunc func(*types.ModuleContext) error +) + +type Results struct { + Result goja.Value + IsError bool +} + +var _ goja.AsyncContextTracker = &asyncTracker{} + +type asyncTracker struct { + count atomic.Int32 +} + +type TrackerEvent int + +const ( + Exited TrackerEvent = iota + Resumed +) + +func newAsyncTracker() *asyncTracker { + return &asyncTracker{ + count: atomic.Int32{}, + } +} + +// Exited is called when an async function is done +func (t *asyncTracker) Exited() { + t.count.Add(-1) +} + +// Grab is called when an async function is scheduled +func (t *asyncTracker) Grab() any { + t.count.Add(1) + return nil +} + +// Resumed is called when an async function is executed (ignore) +func (t *asyncTracker) Resumed(any) {} + +func (t *asyncTracker) waitTimeout(ctx context.Context) error { + ticker := time.NewTicker(500 * time.Microsecond) + for { + select { + case <-ctx.Done(): + return fmt.Errorf("timeout: %s", ctx.Err()) + case <-ticker.C: + if t.count.Load() == 0 { + return nil + } + } + } +} + +// runAndWaitForResult can execute a goja function and wait for the result +// if the result is a promise, it will wait for the promise to resolve +func runAndWaitForResult( + rt *goja.Runtime, + fn goja.Callable, + args ...goja.Value, +) (res goja.Value, err error) { + tracker := newAsyncTracker() + rt.SetAsyncContextTracker(tracker) + defer rt.SetAsyncContextTracker(nil) + + if res, err = fn(nil, args...); err != nil { + return nil, err + } else if prom, ok := res.Export().(*goja.Promise); ok { + // return waitForPromise(rt, prom, res) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err := tracker.waitTimeout(ctx) + if err != nil { + return nil, errors.New("promise timed out: " + err.Error()) + } + if prom.State() == goja.PromiseStateRejected { + return nil, errors.New(prom.Result().String()) + } + results := prom.Result() + if nully(results) { + return nil, nil + } + return results, nil + } else { + return res, nil + } +} + +func waitForPromise( + rt *goja.Runtime, + prom *goja.Promise, + promVal goja.Value, +) (goja.Value, error) { + results := make(chan Results, 1) + promObj := promVal.ToObject(rt) + + if then, ok := goja.AssertFunction(promObj.Get("then")); !ok { + return nil, errors.New("promise does not have a then function") + } else { + val := rt.ToValue(func(call goja.FunctionCall) { + result := goja.Undefined() + if len(call.Arguments) > 0 { + result = call.Arguments[0] + } + results <- Results{result, false} + }) + if _, err := then(promObj, val); err != nil { + return nil, err + } + } + + if catch, ok := goja.AssertFunction(promObj.Get("catch")); !ok { + return nil, errors.New("promise does not have a then function") + } else { + val := rt.ToValue(func(call goja.FunctionCall) { + var result goja.Value + if len(call.Arguments) > 0 { + result = call.Arguments[0] + } + results <- Results{result, true} + }) + if _, err := catch(promObj, val); err != nil { + return nil, err + } + } + + select { + case res := <-results: + if res.IsError { + if !nully(prom.Result()) { + return nil, errors.New(prom.Result().String()) + } + if !nully(res.Result) { + return nil, errors.New(res.Result.String()) + } + return nil, errors.New("promise rejected: unknown reason") + } + if prom.Result() != nil { + return prom.Result(), nil + } + return res.Result, nil + case <-time.After(30 * time.Second): + return nil, errors.New("promise timed out") + } +} + +func nully(val goja.Value) bool { + return val == nil || goja.IsUndefined(val) || goja.IsNull(val) +} + +func DefaultFetchUpstreamFunction() FetchUpstreamUrlFunc { + roundRobinIndex := 0 + return func(ctx *types.ModuleContext) (*url.URL, error) { + svc := ctx.Service() + if svc.URLs == nil || len(svc.URLs) == 0 { + return nil, errors.New("service has no URLs") + } + roundRobinIndex = (roundRobinIndex + 1) % len(svc.URLs) + curUrl, err := url.Parse(svc.URLs[roundRobinIndex]) + if err != nil { + return nil, err + } + return curUrl, nil + } +} + +// const _ goja.AsyncContextTracker = ExtractorContextTracker{""} +func ExtractFetchUpstreamFunction( + loop *eventloop.EventLoop, +) (fetchUpstream FetchUpstreamUrlFunc, err error) { + rt := loop.Runtime() + fetchUpstreamRaw := rt.Get("fetchUpstream") + if call, ok := goja.AssertFunction(fetchUpstreamRaw); ok { + fetchUpstream = func(modCtx *types.ModuleContext) (*url.URL, error) { + res, err := runAndWaitForResult( + rt, call, rt.ToValue(modCtx), + ) + if err != nil { + return nil, err + } + upstreamUrlString := res.String() + if goja.IsUndefined(res) || goja.IsNull(res) || upstreamUrlString == "" { + return nil, errors.New("fetchUpstream returned an invalid URL") + } + upstreamUrl, err := url.Parse(upstreamUrlString) + if err != nil { + return nil, err + } + // perhaps add default scheme if not present + return upstreamUrl, err + } + } else { + fetchUpstream = DefaultFetchUpstreamFunction() + } + return fetchUpstream, nil +} + +func ExtractRequestModifierFunction( + loop *eventloop.EventLoop, +) (requestModifier RequestModifierFunc, err error) { + rt := loop.Runtime() + if call, ok := goja.AssertFunction(rt.Get("requestModifier")); ok { + requestModifier = func(modCtx *types.ModuleContext) error { + _, err := runAndWaitForResult( + rt, call, types.ToValue(rt, modCtx), + ) + return err + } + } + return requestModifier, nil +} + +func ExtractResponseModifierFunction( + loop *eventloop.EventLoop, +) (responseModifier ResponseModifierFunc, err error) { + rt := loop.Runtime() + if call, ok := goja.AssertFunction(rt.Get("responseModifier")); ok { + responseModifier = func(modCtx *types.ModuleContext, res *http.Response) error { + modCtx = types.ModuleContextWithResponse(modCtx, res) + _, err := runAndWaitForResult( + rt, call, types.ToValue(rt, modCtx), + ) + return err + } + } + return responseModifier, nil +} + +func DefaultErrorHandlerFunction() ErrorHandlerFunc { + return func(modCtx *types.ModuleContext, err error) error { + rwt := types.GetModuleContextResponseWriterTracker(modCtx) + if rwt.HeadersSent() { + return nil + } + status := http.StatusBadGateway + var text string + switch err { + case context.Canceled, io.ErrUnexpectedEOF: + status = 499 + text = "Client Closed Request" + default: + text = http.StatusText(status) + } + rwt.WriteHeader(status) + rwt.Write([]byte(text)) + return nil + } +} + +func ExtractErrorHandlerFunction( + loop *eventloop.EventLoop, +) (errorHandler ErrorHandlerFunc, err error) { + rt := loop.Runtime() + if call, ok := goja.AssertFunction(rt.Get("errorHandler")); ok { + errorHandler = func(modCtx *types.ModuleContext, upstreamErr error) error { + modCtx = types.ModuleContextWithError(modCtx, upstreamErr) + _, err := runAndWaitForResult( + rt, call, rt.ToValue(modCtx), + rt.ToValue(rt.NewGoError(upstreamErr)), + ) + return err + } + } else { + errorHandler = DefaultErrorHandlerFunction() + } + return errorHandler, nil +} + +func ExtractRequestHandlerFunction( + loop *eventloop.EventLoop, +) (requestHandler RequestHandlerFunc, err error) { + rt := loop.Runtime() + if call, ok := goja.AssertFunction(rt.Get("requestHandler")); ok { + requestHandler = func(modCtx *types.ModuleContext) error { + _, err := runAndWaitForResult( + rt, call, rt.ToValue(modCtx), + ) + return err + } + } + return requestHandler, nil +} diff --git a/pkg/modules/extractors/extractors_test.go b/pkg/modules/extractors/extractors_test.go new file mode 100644 index 0000000..69fe0d3 --- /dev/null +++ b/pkg/modules/extractors/extractors_test.go @@ -0,0 +1,218 @@ +package extractors + +import ( + "strconv" + "testing" + + "github.com/dgate-io/dgate/pkg/modules/testutil" + "github.com/dgate-io/dgate/pkg/typescript" + "github.com/dop251/goja" + "github.com/stretchr/testify/assert" +) + +const TS_PAYLOAD = ` +import { print } from "test" +let numCalls = 0 +const customFunc = (req: any, upstream: any) => { + print() + numCalls++ + return 0.01 +} +function customFunc2(req: any, upstream: any) { + print() + numCalls++ + return 0.01 +} +const customFunc3 = async (req: any, upstream: any) => { + await print() + numCalls++ + return 0.01 +} +const customFunc4 = (req: any, upstream: any): Promise => { + return print().then(() => { + numCalls++ + return 0.01 + }) +} +async function print() {console.log("log")} +` + +func Test_executeAndWaitForResult(t *testing.T) { + src, err := typescript.Transpile(TS_PAYLOAD) + if err != nil { + t.Fatal(err) + } + program, err := goja.Compile("test", src, false) + if err != nil { + t.Fatal(err) + } + printer := testutil.NewMockPrinter() + modCtx := testutil.NewMockRuntimeContext() + loop, err := NewModuleEventLoop( + printer, modCtx, program, + ) + if err != nil { + t.Fatal(err) + } + rt := loop.Start() + defer loop.Stop() + funcs := []string{"customFunc", "customFunc2", "customFunc3", "customFunc4"} + printer.On("Log", "log").Times(len(funcs)) + for _, fn := range funcs { + val := rt.Get(fn) + if val == nil || goja.IsUndefined(val) || goja.IsNull(val) { + t.Fatalf("%s not found", fn) + } + customFunc, ok := goja.AssertFunction(val) + if !ok { + t.Fatalf("%s is not a function", fn) + } + val, err := runAndWaitForResult(rt, customFunc, nil, nil, nil) + if err != nil { + t.Fatal(err) + } + if val.ToFloat() != 0.01 { + t.Errorf("%s should return return 0.01", fn) + } + } + numCalls := rt.Get("numCalls").ToInteger() + if numCalls != 4 { + t.Fatalf("numCalls should be 4, got %d", numCalls) + } +} + +const TS_PAYLOAD_EXPORTED = ` +import { test } from "test" + +export default function named_func() { + console.log(test) + return [1, 2, 3] +} + +export async function named_func_async() { + console.log(test) + return { x: 1 } +} +` + +func TestExportedInformation(t *testing.T) { + src, err := typescript.Transpile(TS_PAYLOAD_EXPORTED) + if err != nil { + t.Fatal(err) + } + program, err := goja.Compile("", src, true) + if err != nil { + t.Fatal(err) + } + printer := testutil.NewMockPrinter() + printer.On("Log", "testing").Twice() + modCtx := testutil.NewMockRuntimeContext() + modCtx.On("func1", "node_modules/test"). + Return([]byte("exports.test = 'testing';"), nil). + Once() + loop, err := NewModuleEventLoop(printer, modCtx, program) + if err != nil { + t.Fatal(err) + } + rt := loop.Runtime() + defer loop.Stop() + v, err := rt.RunString("exports.default") + if err != nil { + t.Fatal(err) + } + callable, ok := goja.AssertFunction(v) + if !assert.True(t, ok) { + return + } + v, err = runAndWaitForResult(rt, callable) + if err != nil { + t.Fatal(err) + } + for i := range 3 { + vv := v.ToObject(rt).Get(strconv.Itoa(i)) + if vv.ToInteger() != int64(i+1) { + t.Fatalf("named_func should return [1, 2, 3]; ~[%d] => %v", i, vv) + } + } + + v, err = rt.RunString("exports.named_func_async") + if err != nil { + t.Fatal(err) + } + callable, ok = goja.AssertFunction(v) + assert.True(t, ok) + + v, err = runAndWaitForResult(rt, callable) + if err != nil { + t.Fatal(err) + } + if v.ToObject(rt).Get("x").ToInteger() != 1 { + t.Fatal("named_func_async should return {x: 1}") + } +} + +const TS_PAYLOAD_PROMISE = ` +// function delay(ms: number) { +// return new Promise(resolve => setTimeout(resolve, ms) ); +// } +function delay(ms: number) { + return new Promise( resolve => resolve() ); +} + +export async function test1() { + await delay(500) + return 1 +} + +export async function test2() { + await delay(500) + throw new Error("test2 failed successfully") +} +` + +func TestExportedPromiseErrors(t *testing.T) { + src, err := typescript.Transpile(TS_PAYLOAD_PROMISE) + if err != nil { + t.Fatal(err) + } + program, err := goja.Compile("", src, true) + if err != nil { + t.Fatal(err) + } + printer := testutil.NewMockPrinter() + modCtx := testutil.NewMockRuntimeContext() + loop, err := NewModuleEventLoop(printer, modCtx, program) + if err != nil { + t.Fatal(err) + } + + rt := loop.Start() + defer loop.Stop() + + v, err := rt.RunString("exports.test1") + if err != nil { + t.Fatal(err) + } + callable, ok := goja.AssertFunction(v) + if !assert.True(t, ok) { + return + } + v, err = runAndWaitForResult(rt, callable, nil) + if err != nil { + t.Fatal(err) + } + if v.ToInteger() != 1 { + t.Fatal("test1 should return 1") + } + v, err = rt.RunString("exports.test2") + if err != nil { + t.Fatal(err) + } + + callable, ok = goja.AssertFunction(v) + if !assert.True(t, ok) { + return + } + _, err = runAndWaitForResult(rt, callable, nil, nil, nil) + assert.Error(t, err, "Error: test2 failed successfully") +} diff --git a/pkg/modules/extractors/runtime.go b/pkg/modules/extractors/runtime.go new file mode 100644 index 0000000..fdc9522 --- /dev/null +++ b/pkg/modules/extractors/runtime.go @@ -0,0 +1,148 @@ +package extractors + +import ( + "errors" + "reflect" + + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/modules/dgate" + "github.com/dop251/goja" + "github.com/dop251/goja_nodejs/buffer" + "github.com/dop251/goja_nodejs/console" + "github.com/dop251/goja_nodejs/require" + "github.com/dop251/goja_nodejs/url" + "github.com/stoewer/go-strcase" +) + +var _ console.Printer = &NoopPrinter{} + +type NoopPrinter struct{} + +func (p *NoopPrinter) Log(string) {} +func (p *NoopPrinter) Warn(string) {} +func (p *NoopPrinter) Error(string) {} + +type RuntimeOptions struct { + Env map[string]string +} + +func prepareRuntime(rt *goja.Runtime) { + rt.SetFieldNameMapper(&smartFieldNameMapper{}) + + exports := rt.NewObject() + module := rt.NewObject() + module.Set("exports", exports) + rt.Set("exports", exports) + rt.GlobalObject().Set("process", processObject(rt)) + rt.Set("module", module) +} + +func processObject(rt *goja.Runtime) *goja.Object { + obj := rt.NewObject() + obj.Set("env", rt.NewObject()) + obj.Set("args", rt.NewObject()) + return obj +} + +func NewModuleEventLoop( + printer console.Printer, + modCtx modules.RuntimeContext, + programs ...*goja.Program, +) (*eventloop.EventLoop, error) { + loop := modCtx.EventLoop() + + rt := loop.Runtime() + prepareRuntime(rt) + + registry := loop.Registry() + + if registerModules("dgate", rt, + registry, modCtx, dgate.New(modCtx), + ); printer == nil { + printer = &NoopPrinter{} + } + + registry.RegisterNativeModule( + "dgate_internal:console", + console.RequireWithPrinter(printer), + ) + + url.Enable(rt) + buffer.Enable(rt) + console.Enable(rt) + + rt.Set("console", require.Require(rt, "dgate_internal:console").ToObject(rt)) + rt.Set("fetch", require.Require(rt, "dgate/http").ToObject(rt).Get("fetch")) + rt.Set("disableSetInterval", disableSetInterval) + + for _, program := range programs { + _, err := rt.RunProgram(program) + if err != nil { + return nil, err + } + } + + return loop, nil +} + +// registerModules registers a module and its children with the registry (recursively) +func registerModules( + modName string, + rt *goja.Runtime, + reg *require.Registry, + modCtx modules.RuntimeContext, + mod modules.GoModule, +) *goja.Object { + exports := rt.NewObject() + // defaultExports := rt.NewObject() + // TODO: Default exports are being ignore, check to see how we can use both named and default together + + if exportsRaw := mod.Exports(); exportsRaw != nil { + for childName, childMod := range exportsRaw.Named { + if inst, ok := childMod.(modules.GoModule); ok { + // only register children if they are modules + m := registerModules( + modName+"/"+childName, + rt, reg, modCtx, inst, + ) + exports.Set(childName, m) + // defaultExports.Set(childName, childMod) + continue + } + exports.Set(childName, childMod) + // defaultExports.Set(childName, childMod) + + reg.RegisterNativeModule(modName, func(runtime *goja.Runtime, module *goja.Object) { + if exportsRaw.Default != nil { + exports.Set("default", exportsRaw.Default) + } + module.Set("exports", exports) + }) + } + } + // reg.RegisterNativeModule(modName, func(runtime *goja.Runtime, module *goja.Object) { + // exports.Set("default", defaultExports) + // module.Set("exports", exports) + // }) + return exports +} + +type smartFieldNameMapper struct{} + +var _ goja.FieldNameMapper = &smartFieldNameMapper{} + +func (*smartFieldNameMapper) FieldName(_ reflect.Type, f reflect.StructField) string { + if f.Tag.Get("json") != "" { + return f.Tag.Get("json") + } + return strcase.LowerCamelCase(f.Name) +} + +func (*smartFieldNameMapper) MethodName(_ reflect.Type, m reflect.Method) string { + return strcase.LowerCamelCase(m.Name) +} + +func disableSetInterval(fc *goja.FunctionCall) (goja.Value, error) { + return nil, errors.New("setInterval is disabled") +} diff --git a/pkg/modules/extractors/runtime_test.go b/pkg/modules/extractors/runtime_test.go new file mode 100644 index 0000000..3beb516 --- /dev/null +++ b/pkg/modules/extractors/runtime_test.go @@ -0,0 +1,164 @@ +package extractors_test + +import ( + "testing" + + "github.com/dgate-io/dgate/internal/proxy" + "github.com/dgate-io/dgate/pkg/modules/extractors" + "github.com/dgate-io/dgate/pkg/modules/testutil" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/typescript" + "github.com/dop251/goja" + "github.com/dop251/goja_nodejs/console" +) + +const TS_PAYLOAD = ` +let customFunc = (req: any, upstream: any) => { + console.log("log 1") + console.warn("log 2") + console.error("log 3") +} +export { customFunc } +` + +const JS_PAYLOAD = ` +let customFunc = (req, upstream) => { + console.log("log 1") + console.warn("log 2") + console.error("log 3") +} +module.exports = { customFunc } +` + +type consolePrinter struct { + calls map[string]int +} + +var _ console.Printer = &consolePrinter{} + +func (cp *consolePrinter) Log(string) { + if _, ok := cp.calls["Log"]; !ok { + cp.calls["Log"] = 1 + } else { + cp.calls["Log"]++ + } +} + +func (cp *consolePrinter) Warn(string) { + if _, ok := cp.calls["Warn"]; !ok { + cp.calls["Warn"] = 1 + } else { + cp.calls["Warn"]++ + } +} + +func (cp *consolePrinter) Error(string) { + if _, ok := cp.calls["Error"]; !ok { + cp.calls["Error"] = 1 + } else { + cp.calls["Error"]++ + } +} + +func TestNewModuleRuntimeJS(t *testing.T) { + programs := map[string]*goja.Program{ + "javascript": testutil.CreateJSProgram(t, JS_PAYLOAD), + "typescript": testutil.CreateTSProgram(t, TS_PAYLOAD), + } + for testName, program := range programs { + t.Run(testName, func(t *testing.T) { + printer := testutil.NewMockPrinter() + printer.On("Log", "log 1").Return().Once() + printer.On("Warn", "log 2").Return().Once() + printer.On("Error", "log 3").Return().Once() + modCtx := testutil.NewMockRuntimeContext() + loop, err := extractors.NewModuleEventLoop( + printer, modCtx, program, + ) + if err != nil { + t.Fatal(err) + } + rt := loop.Start() + defer loop.Stop() + val := rt.Get("customFunc") + if val == nil || goja.IsUndefined(val) || goja.IsNull(val) { + t.Fatal("customFunc not found") + } + customFunc, ok := goja.AssertFunction(val) + if !ok { + t.Fatal("customFunc is not a function") + } + _, err = customFunc(nil, nil) + if err != nil { + t.Fatal(err) + } + printer.AssertExpectations(t) + }) + } +} + +func TestPrinter(t *testing.T) { + program := testutil.CreateJSProgram(t, JS_PAYLOAD) + cp := &consolePrinter{make(map[string]int)} + rt := &spec.DGateRoute{Namespace: &spec.DGateNamespace{}} + rtCtx := proxy.NewRuntimeContext(nil, rt) + loop, err := extractors.NewModuleEventLoop( + cp, rtCtx, program, + ) + if err != nil { + t.Fatal(err) + } + loop.RunOnLoop(func(rt *goja.Runtime) { + val := rt.Get("customFunc") + if val == nil || goja.IsUndefined(val) || goja.IsNull(val) { + t.Fatal("customFunc not found") + } + }) +} + +func BenchmarkNewModuleRuntime(b *testing.B) { + program := testutil.CreateTSProgram(b, TS_PAYLOAD) + + b.ResetTimer() + b.Run("CreateModuleRuntime", func(b *testing.B) { + for i := 0; i < b.N; i++ { + b.StartTimer() + rt := &spec.DGateRoute{Namespace: &spec.DGateNamespace{}} + rtCtx := proxy.NewRuntimeContext(nil, rt) + _, err := extractors.NewModuleEventLoop(nil, rtCtx, program) + b.StopTimer() + if err != nil { + b.Fatal(err) + } + } + }) + + b.Run("Transpile-TS", func(b *testing.B) { + for i := 0; i < b.N; i++ { + b.StartTimer() + _, err := typescript.Transpile(TS_PAYLOAD) + if err != nil { + b.Fatal(err) + } + + b.StopTimer() + } + }) + + b.Run("CreateNewProgram-TS", func(b *testing.B) { + for i := 0; i < b.N; i++ { + b.StartTimer() + testutil.CreateTSProgram(b, TS_PAYLOAD) + b.StopTimer() + } + }) + + b.Run("CreateNewProgram-JS", func(b *testing.B) { + for i := 0; i < b.N; i++ { + b.StartTimer() + testutil.CreateJSProgram(b, JS_PAYLOAD) + b.StopTimer() + } + }) + +} diff --git a/pkg/modules/mods.go b/pkg/modules/mods.go new file mode 100644 index 0000000..bb1a8a4 --- /dev/null +++ b/pkg/modules/mods.go @@ -0,0 +1,42 @@ +package modules + +import ( + "context" + + "github.com/dgate-io/dgate/pkg/cache" + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dgate-io/dgate/pkg/resources" + "github.com/dgate-io/dgate/pkg/scheduler" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dop251/goja" +) + +type Module interface { + New(RuntimeContext) GoModule +} + +type GoModule interface { + Exports() *Exports +} + +type Exports struct { + // Default is what will be the `default` export of a module + Default any + // Named is the named exports of a module + Named map[string]any +} + +type StateManager interface { + ApplyChangeLog(*spec.ChangeLog) error + ResourceManager() *resources.ResourceManager + DocumentManager() resources.DocumentManager + Scheduler() scheduler.Scheduler + SharedCache() cache.TCache +} + +type RuntimeContext interface { + Context() context.Context + EventLoop() *eventloop.EventLoop + Runtime() *goja.Runtime + State() StateManager +} diff --git a/pkg/modules/mods_test.go b/pkg/modules/mods_test.go new file mode 100644 index 0000000..7d84ff8 --- /dev/null +++ b/pkg/modules/mods_test.go @@ -0,0 +1,8 @@ +package modules_test + +import ( + "testing" +) + +func TestModules(t *testing.T) { +} diff --git a/pkg/modules/testutil/testutil.go b/pkg/modules/testutil/testutil.go new file mode 100644 index 0000000..a0addf3 --- /dev/null +++ b/pkg/modules/testutil/testutil.go @@ -0,0 +1,147 @@ +package testutil + +import ( + "context" + "sync" + + "github.com/dgate-io/dgate/pkg/cache" + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dgate-io/dgate/pkg/modules" + "github.com/dgate-io/dgate/pkg/resources" + "github.com/dgate-io/dgate/pkg/scheduler" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/typescript" + "github.com/dop251/goja" + "github.com/dop251/goja_nodejs/console" + "github.com/dop251/goja_nodejs/require" + "github.com/stretchr/testify/mock" +) + +type mockRuntimeContext struct { + mock.Mock + smap *sync.Map + ctx context.Context + req *require.Registry + loop *eventloop.EventLoop + data any + state modules.StateManager +} + +type mockState struct { + mock.Mock +} + +func (m *mockState) ApplyChangeLog(*spec.ChangeLog) error { + args := m.Called() + return args.Error(0) +} + +func (m *mockState) ResourceManager() *resources.ResourceManager { + args := m.Called() + return args.Get(0).(*resources.ResourceManager) +} + +func (m *mockState) DocumentManager() resources.DocumentManager { + args := m.Called() + return args.Get(0).(resources.DocumentManager) +} + +func (m *mockState) Scheduler() scheduler.Scheduler { + args := m.Called() + return args.Get(0).(scheduler.Scheduler) +} + +func (m *mockState) SharedCache() cache.TCache { + args := m.Called() + return args.Get(0).(cache.TCache) +} + +var _ modules.RuntimeContext = &mockRuntimeContext{} + +func NewMockRuntimeContext() *mockRuntimeContext { + modCtx := &mockRuntimeContext{ + ctx: context.Background(), + smap: &sync.Map{}, + data: make(map[string]any), + state: &mockState{}, + } + mockRequireFunc := func(path string) ([]byte, error) { + args := modCtx.Called(path) + return args.Get(0).([]byte), args.Error(1) + } + modCtx.req = require.NewRegistry(require.WithLoader(mockRequireFunc)) + modCtx.loop = eventloop.NewEventLoop(eventloop.WithRegistry(modCtx.req)) + return modCtx +} + +func (m *mockRuntimeContext) Context() context.Context { + return m.ctx +} + +func (m *mockRuntimeContext) EventLoop() *eventloop.EventLoop { + return m.loop +} + +func (m *mockRuntimeContext) Runtime() *goja.Runtime { + return m.loop.Runtime() +} +func (m *mockRuntimeContext) State() modules.StateManager { + return m.state +} + +func (m *mockRuntimeContext) Registry() *require.Registry { + return m.req +} + +type mockPrinter struct { + mock.Mock + logs map[string][]string +} + +var _ console.Printer = &mockPrinter{} + +func NewMockPrinter() *mockPrinter { + return &mockPrinter{ + logs: make(map[string][]string), + } +} + +func (m *mockPrinter) log(l, s string) { + m.MethodCalled(l, s) +} + +func (mp *mockPrinter) Error(s string) { + mp.log("Error", s) +} + +func (mp *mockPrinter) Log(s string) { + mp.log("Log", s) +} + +func (mp *mockPrinter) Warn(s string) { + mp.log("Warn", s) +} + +type Crashable interface { + Fatal(...any) +} + +func CreateTSProgram(c Crashable, payload string) *goja.Program { + src, err := typescript.Transpile(payload) + if err != nil { + c.Fatal(err) + } + program, err := goja.Compile("test", src, false) + if err != nil { + c.Fatal(err) + } + return program +} + +func CreateJSProgram(c Crashable, payload string) *goja.Program { + program, err := goja.Compile("test", payload, false) + if err != nil { + c.Fatal(err) + } + return program +} diff --git a/pkg/modules/types/generator.go b/pkg/modules/types/generator.go new file mode 100644 index 0000000..c7de7eb --- /dev/null +++ b/pkg/modules/types/generator.go @@ -0,0 +1,47 @@ +package types + +import ( + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dop251/goja" +) + +type generatorFunc[T any] func(rt *goja.Runtime) (T, bool, error) + +func asyncGenerator[T any](loop *eventloop.EventLoop, fn generatorFunc[T]) goja.Value { + rt := loop.Runtime() + return rt.ToValue(map[string]any{ + "next": func() (*goja.Promise, error) { + prom, resolve, reject := rt.NewPromise() + loop.RunOnLoop(func(rt *goja.Runtime) { + result, done, err := fn(rt) + if err != nil { + reject(rt.NewGoError(err)) + return + } + resultObject := map[string]any{"done": done} + if !done { + resultObject["value"] = result + } + resolve(rt.ToValue(resultObject)) + }) + return prom, nil + }, + }) +} + +func generator[T any](loop *eventloop.EventLoop, fn generatorFunc[T]) goja.Value { + rt := loop.Runtime() + return rt.ToValue(map[string]any{ + "next": func() (goja.Value, error) { + result, done, err := fn(rt) + if err != nil { + return nil, err + } + resultObject := map[string]any{"done": done} + if !done { + resultObject["value"] = result + } + return rt.ToValue(result), nil + }, + }) +} diff --git a/pkg/modules/types/goja_value.go b/pkg/modules/types/goja_value.go new file mode 100644 index 0000000..13e448f --- /dev/null +++ b/pkg/modules/types/goja_value.go @@ -0,0 +1,19 @@ +package types + +import "github.com/dop251/goja" + +type Symbolic interface { + symbols(rt *goja.Runtime) map[string]goja.Value +} + +func ToValue(rt *goja.Runtime, v any) goja.Value { + val := rt.ToValue(v) + if obj, ok := val.(*goja.Object); ok { + if sym, ok := v.(Symbolic); ok { + for name, value := range sym.symbols(rt) { + obj.SetSymbol(goja.NewSymbol(name), value) + } + } + } + return val +} diff --git a/pkg/modules/types/module_context.go b/pkg/modules/types/module_context.go new file mode 100644 index 0000000..413b21c --- /dev/null +++ b/pkg/modules/types/module_context.go @@ -0,0 +1,127 @@ +package types + +import ( + "net/http" + "net/url" + "strconv" + "time" + + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dgate-io/dgate/pkg/spec" +) + +type ModuleContext struct { + ID string `json:"id"` + + ns *spec.Namespace + svc *spec.Service + route *spec.Route + params map[string]string + loop *eventloop.EventLoop + req *RequestWrapper + rwt *ResponseWriterWrapper + resp *ResponseWrapper + cache map[string]interface{} +} + +func NewModuleContext( + loop *eventloop.EventLoop, + rw http.ResponseWriter, + req *http.Request, + route *spec.DGateRoute, + params map[string]string, +) *ModuleContext { + t := time.Now().UnixNano() + id := strconv.FormatUint(uint64(t), 36) + return &ModuleContext{ + ID: id, + loop: loop, + req: NewRequestWrapper(req, loop), + rwt: NewResponseWriterWrapper(rw, req), + route: spec.TransformDGateRoute(route), + svc: spec.TransformDGateService(route.Service), + ns: spec.TransformDGateNamespace(route.Namespace), + params: params, + } +} + +func (modCtx *ModuleContext) Set(key string, value any) { + modCtx.cache[key] = value +} + +func (modCtx *ModuleContext) Get(key string) any { + return modCtx.cache[key] +} + +func (modCtx *ModuleContext) Query() url.Values { + return modCtx.req.Query +} + +func (modCtx *ModuleContext) Params() map[string]string { + return modCtx.params +} + +func (modCtx *ModuleContext) Route() spec.Route { + return *modCtx.route +} + +func (modCtx *ModuleContext) Service() spec.Service { + return *modCtx.svc +} + +func (modCtx *ModuleContext) Namespace() spec.Namespace { + return *modCtx.ns +} + +func (modCtx *ModuleContext) Request() *RequestWrapper { + return modCtx.req +} + +func (modCtx *ModuleContext) Upstream() *ResponseWrapper { + return modCtx.resp +} + +func (modCtx *ModuleContext) Response() *ResponseWriterWrapper { + return modCtx.rwt +} + +func ModuleContextWithResponse( + modCtx *ModuleContext, + resp *http.Response, +) *ModuleContext { + modCtx.resp = NewResponseWrapper(resp, modCtx.loop) + return modCtx +} + +func ModuleContextWithError( + modCtx *ModuleContext, err error, +) *ModuleContext { + modCtx.resp = nil + return modCtx +} + +// Helper functions to expose private fields + +func GetModuleContextRoute(modCtx *ModuleContext) *spec.Route { + return modCtx.route +} + +func GetModuleContextService(modCtx *ModuleContext) *spec.Service { + return modCtx.svc +} + +func GetModuleContextNamespace(modCtx *ModuleContext) *spec.Namespace { + return modCtx.ns +} + +func GetModuleContextRequest(modCtx *ModuleContext) *RequestWrapper { + return modCtx.req +} + +func GetModuleContextResponse(modCtx *ModuleContext) *ResponseWrapper { + return modCtx.resp +} + +func GetModuleContextResponseWriterTracker(modCtx *ModuleContext) spec.ResponseWriterTracker { + return modCtx.rwt.rw +} diff --git a/pkg/modules/types/request.go b/pkg/modules/types/request.go new file mode 100644 index 0000000..87f346e --- /dev/null +++ b/pkg/modules/types/request.go @@ -0,0 +1,64 @@ +package types + +import ( + "errors" + "io" + "net" + "net/http" + "net/url" + + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dop251/goja" +) + +type RequestWrapper struct { + req *http.Request + loop *eventloop.EventLoop + + Body io.ReadCloser + Method string + URL string + Headers http.Header + Query url.Values + Host string + RemoteAddress string + Proto string + ContentLength int64 +} + +func NewRequestWrapper( + req *http.Request, + loop *eventloop.EventLoop, +) *RequestWrapper { + ip, _, err := net.SplitHostPort(req.RemoteAddr) + if err != nil { + ip = req.RemoteAddr + } + return &RequestWrapper{ + loop: loop, + req: req, + Query: req.URL.Query(), + URL: req.URL.String(), + + Host: req.Host, + Proto: req.Proto, + Headers: req.Header, + Body: req.Body, + Method: req.Method, + RemoteAddress: ip, + ContentLength: req.ContentLength, + } +} + +func (g *RequestWrapper) GetBody() (*goja.ArrayBuffer, error) { + if g.Body == nil { + return nil, errors.New("body is not set") + } + buf, err := io.ReadAll(g.Body) + if err != nil { + return nil, err + } + defer g.Body.Close() + arrBuf := g.loop.Runtime().NewArrayBuffer(buf) + return &arrBuf, nil +} diff --git a/pkg/modules/types/response_writer.go b/pkg/modules/types/response_writer.go new file mode 100644 index 0000000..8e8c5ba --- /dev/null +++ b/pkg/modules/types/response_writer.go @@ -0,0 +1,140 @@ +package types + +import ( + "encoding/json" + "errors" + "net/http" + "time" + + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util" +) + +type ResponseWriterWrapper struct { + rw spec.ResponseWriterTracker + req *http.Request + status int + + Headers http.Header + HeadersSent bool + Locals map[string]any +} + +func NewResponseWriterWrapper( + rw http.ResponseWriter, + req *http.Request, +) *ResponseWriterWrapper { + rwt := spec.NewResponseWriterTracker(rw) + return &ResponseWriterWrapper{ + rw: rwt, + req: req, + Headers: rw.Header(), + HeadersSent: rwt.HeadersSent(), + Locals: make(map[string]any), + } +} + +type CookieOptions struct { + Domain string `json:"domain"` + Expires time.Time `json:"expires"` + HttpOnly bool `json:"httpOnly"` + MaxAge int `json:"maxAge"` + Path string `json:"path"` + Priority string `json:"priority"` + Secure bool `json:"secure"` + Signed bool `json:"signed"` + SameSite string `json:"sameSite"` +} + +func (g *ResponseWriterWrapper) SetCookie(name string, value string, opts ...*CookieOptions) (*ResponseWriterWrapper, error) { + if len(opts) > 1 { + return nil, errors.New("too many auguments") + } + cookie := &http.Cookie{ + Name: name, + Value: value, + } + if len(opts) == 1 { + opt := opts[0] + sameSite := http.SameSiteDefaultMode + switch opt.SameSite { + case "lax": + sameSite = http.SameSiteLaxMode + case "strict": + sameSite = http.SameSiteStrictMode + case "none": + sameSite = http.SameSiteNoneMode + } + cookie = &http.Cookie{ + Name: name, + Value: value, + Domain: opt.Domain, + Expires: opt.Expires, + HttpOnly: opt.HttpOnly, + MaxAge: opt.MaxAge, + Path: opt.Path, + Secure: opt.Secure, + SameSite: sameSite, + } + } + http.SetCookie(g.rw, cookie) + return g, nil +} + +func (g *ResponseWriterWrapper) Send(data any) error { + return g.End(data) +} + +// Json sends a JSON response. +func (g *ResponseWriterWrapper) Json(data any) error { + g.rw.Header().Set("Content-Type", "application/json") + b, err := json.Marshal(data) + if err != nil { + return err + } + return g.End(b) +} + +// End sends the response. +func (g *ResponseWriterWrapper) End(data any) error { + if !g.rw.HeadersSent() { + if g.status <= 0 { + g.status = http.StatusOK + } + g.rw.WriteHeader(g.status) + g.HeadersSent = true + } + buf, err := util.ToBytes(data) + if err != nil { + return err + } + _, err = g.rw.Write(buf) + return err +} + +func (g *ResponseWriterWrapper) Redirect(url string) { + http.Redirect(g.rw, g.req, url, http.StatusTemporaryRedirect) +} + +func (g *ResponseWriterWrapper) RedirectPermanent(url string) { + http.Redirect(g.rw, g.req, url, http.StatusMovedPermanently) +} + +func (g *ResponseWriterWrapper) Status(status int) *ResponseWriterWrapper { + g.status = status + return g +} + +func (g *ResponseWriterWrapper) Location(url string) *ResponseWriterWrapper { + g.rw.Header().Set("Location", url) + return g +} + +func (g *ResponseWriterWrapper) Cookie() []*http.Cookie { + return g.req.Cookies() +} + +func (g *ResponseWriterWrapper) Header() http.Header { + return g.rw.Header() +} + diff --git a/pkg/modules/types/upstream_response.go b/pkg/modules/types/upstream_response.go new file mode 100644 index 0000000..377bb7a --- /dev/null +++ b/pkg/modules/types/upstream_response.go @@ -0,0 +1,141 @@ +package types + +import ( + "bytes" + "encoding/json" + "errors" + "io" + "net/http" + "net/url" + "strconv" + + "github.com/dgate-io/dgate/pkg/eventloop" + "github.com/dgate-io/dgate/pkg/util" + "github.com/dop251/goja" +) + +type ResponseWrapper struct { + response *http.Response + loop *eventloop.EventLoop + + StatusCode int `json:"statusCode"` + StatusText string `json:"statusText"` + Trailer http.Header `json:"trailer"` + Protocol string `json:"protocol"` + Uncompressed bool `json:"uncompressed"` + ContentLength int64 `json:"contentLength"` + TransferEncoding []string `json:"transferEncoding"` +} + +func NewResponseWrapper( + resp *http.Response, + loop *eventloop.EventLoop, +) *ResponseWrapper { + return &ResponseWrapper{ + response: resp, + loop: loop, + Protocol: resp.Proto, + StatusText: resp.Status, + Trailer: resp.Trailer, + StatusCode: resp.StatusCode, + Uncompressed: resp.Uncompressed, + ContentLength: resp.ContentLength, + TransferEncoding: resp.TransferEncoding, + } +} + +func (rw *ResponseWrapper) GetBody() *goja.Promise { + prom, res, rej := rw.loop.Runtime().NewPromise() + rw.loop.RunOnLoop(func(r *goja.Runtime) { + buf, err := io.ReadAll(rw.response.Body) + if err != nil { + rej(r.ToValue(errors.New(err.Error()))) + return + } + defer rw.response.Body.Close() + res(r.ToValue(r.NewArrayBuffer(buf))) + }) + return prom +} + +func (rw *ResponseWrapper) GetJson() *goja.Promise { + prom, res, rej := rw.loop.Runtime().NewPromise() + rw.loop.RunOnLoop(func(r *goja.Runtime) { + var data any + buf, err := io.ReadAll(rw.response.Body) + if err != nil { + rej(r.ToValue(errors.New(err.Error()))) + return + } + rw.response.Body.Close() + err = json.Unmarshal(buf, &data) + if err != nil { + rej(r.ToValue(errors.New(err.Error()))) + return + } + res(r.ToValue(data)) + }) + return prom +} + +func (rw *ResponseWrapper) SetJson(data any) error { + rw.Header().Set("Content-Type", "application/json") + b, err := json.Marshal(data) + if err != nil { + return err + } + return rw.SetBody(b) +} + +func (rw *ResponseWrapper) SetBody(data any) error { + if rw.StatusCode <= 0 { + rw.StatusCode = http.StatusOK + rw.response.Status = rw.StatusText + if rw.response.Status == "" { + rw.response.Status = http.StatusText(rw.StatusCode) + } + } + rw.response.StatusCode = rw.StatusCode + buf, err := util.ToBytes(data) + if err != nil { + return err + } + rw.response.Body.Close() + rw.response.ContentLength = int64(len(buf)) + rw.response.Header.Set("Content-Length", strconv.FormatInt(rw.response.ContentLength, 10)) + rw.response.Body = io.NopCloser(bytes.NewReader(buf)) + return nil +} + +func (rw *ResponseWrapper) SetStatus(status int) *ResponseWrapper { + rw.response.StatusCode = status + rw.StatusCode = rw.response.StatusCode + rw.response.Status = http.StatusText(status) + rw.StatusText = http.StatusText(status) + return rw +} + +func (rw *ResponseWrapper) SetRedirect(url string) { + rw.response.Body = nil + rw.Header().Set("Location", url) + rw.SetStatus(http.StatusTemporaryRedirect) +} + +func (rw *ResponseWrapper) SetRedirectPermanent(url string) { + rw.response.Body.Close() + rw.response.Body = nil + rw.Header().Set("Location", url) + rw.SetStatus(http.StatusMovedPermanently) +} + +func (rw *ResponseWrapper) Query() url.Values { + return rw.response.Request.URL.Query() +} + +func (rw *ResponseWrapper) Cookie() []*http.Cookie { + return rw.response.Cookies() +} + +func (rw *ResponseWrapper) Header() http.Header { + return rw.response.Header +} diff --git a/pkg/modules/types/wrapper_test.go b/pkg/modules/types/wrapper_test.go new file mode 100644 index 0000000..7e38793 --- /dev/null +++ b/pkg/modules/types/wrapper_test.go @@ -0,0 +1,38 @@ +package types_test + +import ( + "bytes" + "net/http" + "testing" + + "github.com/dgate-io/dgate/pkg/modules/types" + "github.com/dop251/goja" + "github.com/stretchr/testify/assert" +) + +// TODO: test all methods and fields +func TestHttpRequestWrapper(t *testing.T) { + req, err := http.NewRequest("GET", "http://localhost", bytes.NewReader(nil)) + if err != nil { + t.Fatal(err) + } + reqWrapper := types.NewRequestWrapper(req, nil) + if reqWrapper == nil { + t.Fatal("NewGojaRequestWrapper failed") + } + + rt := goja.New() + + rt.Set("req", reqWrapper) + v, err := rt.RunString(`req.Method`) + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "GET", v.Export()) + + v, err = rt.RunString(`req.Body`) + if err != nil { + t.Fatal(err) + } + assert.NotNil(t, v.Export()) +} diff --git a/pkg/raftadmin/raftadmin.go b/pkg/raftadmin/raftadmin.go new file mode 100644 index 0000000..c90449e --- /dev/null +++ b/pkg/raftadmin/raftadmin.go @@ -0,0 +1,493 @@ +package raftadmin + +import ( + "context" + "crypto/sha1" + "encoding/json" + "fmt" + "io" + "math/rand" + "net/http" + "path" + "sync" + "time" + + "github.com/hashicorp/raft" + "github.com/rs/zerolog" +) + +// RaftAdminHTTPServer provides a HTTP-based transport that can be used to +// communicate with Raft on remote machines. It is convenient to use if your +// application is an HTTP server already and you do not want to use multiple +// different transports (if not, you can use raft.NetworkTransport). +type RaftAdminHTTPServer struct { + logger zerolog.Logger + r *raft.Raft + // addrs map[raft.ServerID]raft.ServerAddress + addrs []raft.ServerAddress +} + +// NewRaftAdminHTTPServer creates a new HTTP transport on the given addr. +func NewRaftAdminHTTPServer(r *raft.Raft, logger zerolog.Logger, addrs []raft.ServerAddress) *RaftAdminHTTPServer { + return &RaftAdminHTTPServer{ + logger: logger, + r: r, + addrs: addrs, + } +} + +func unmarshalBody[T any](req *http.Request, out T) error { + buf, err := io.ReadAll(req.Body) + if err != nil { + return err + } + return json.Unmarshal(buf, out) +} + +func timeout(ctx context.Context) time.Duration { + if dl, ok := ctx.Deadline(); ok { + return time.Until(dl) + } + return 0 +} + +var ( + mtx sync.Mutex + operations = map[string]*future{} +) + +type future struct { + rf raft.Future + mtx sync.Mutex +} + +func toFuture(f raft.Future) (*Future, error) { + token := fmt.Sprintf("%x", sha1.Sum([]byte(fmt.Sprintf("%d", rand.Uint64())))) + mtx.Lock() + operations[token] = &future{rf: f} + mtx.Unlock() + return &Future{ + OperationToken: token, + }, nil +} + +func (a *RaftAdminHTTPServer) Await(ctx context.Context, req *Future) (*AwaitResponse, error) { + mtx.Lock() + f, ok := operations[req.OperationToken] + defer func() { + mtx.Lock() + delete(operations, req.OperationToken) + mtx.Unlock() + }() + mtx.Unlock() + if !ok { + return nil, fmt.Errorf("token %q unknown", req.OperationToken) + } + f.mtx.Lock() + errChan := make(chan error, 1) + go func() { + errChan <- f.rf.Error() + }() + select { + case <-ctx.Done(): + f.mtx.Unlock() + return nil, ctx.Err() + case err := <-errChan: + f.mtx.Unlock() + if err != nil { + return &AwaitResponse{ + Error: err.Error(), + }, nil + } + } + r := &AwaitResponse{} + if ifx, ok := f.rf.(raft.IndexFuture); ok { + r.Index = ifx.Index() + } + return r, nil +} + +func (a *RaftAdminHTTPServer) Forget(ctx context.Context, req *Future) (*ForgetResponse, error) { + mtx.Lock() + delete(operations, req.OperationToken) + mtx.Unlock() + return &ForgetResponse{ + OperationToken: req.OperationToken, + }, nil +} + +func (a *RaftAdminHTTPServer) AddNonvoter(ctx context.Context, req *AddNonvoterRequest) (*Future, error) { + return toFuture(a.r.AddNonvoter(raft.ServerID(req.ID), raft.ServerAddress(req.Address), uint64(req.PrevIndex), timeout(ctx))) +} + +func (a *RaftAdminHTTPServer) AddVoter(ctx context.Context, req *AddVoterRequest) (*Future, error) { + return toFuture(a.r.AddVoter(raft.ServerID(req.ID), raft.ServerAddress(req.Address), uint64(req.PrevIndex), timeout(ctx))) +} + +func (a *RaftAdminHTTPServer) AppliedIndex(ctx context.Context) (*AppliedIndexResponse, error) { + return &AppliedIndexResponse{ + Index: a.r.AppliedIndex(), + }, nil +} + +func (a *RaftAdminHTTPServer) Barrier(ctx context.Context) (*Future, error) { + return toFuture(a.r.Barrier(timeout(ctx))) +} + +func (a *RaftAdminHTTPServer) DemoteVoter(ctx context.Context, req *DemoteVoterRequest) (*Future, error) { + return toFuture(a.r.DemoteVoter(raft.ServerID(req.ID), req.PrevIndex, timeout(ctx))) +} + +func (a *RaftAdminHTTPServer) GetConfiguration(ctx context.Context) (*GetConfigurationResponse, error) { + f := a.r.GetConfiguration() + if err := f.Error(); err != nil { + return nil, err + } + resp := &GetConfigurationResponse{} + for _, s := range f.Configuration().Servers { + cs := &GetConfigurationServer{ + ID: string(s.ID), + Address: string(s.Address), + } + switch s.Suffrage { + case raft.Voter: + cs.Suffrage = RaftSuffrageVoter + case raft.Nonvoter, raft.Staging: + cs.Suffrage = RaftSuffrageNonvoter + default: + return nil, fmt.Errorf("unknown server suffrage %v for server %q", s.Suffrage, s.ID) + } + resp.Servers = append(resp.Servers, cs) + } + return resp, nil +} + +func (a *RaftAdminHTTPServer) LastContact(ctx context.Context) (*LastContactResponse, error) { + t := a.r.LastContact() + return &LastContactResponse{ + UnixNano: t.UnixNano(), + }, nil +} + +func (a *RaftAdminHTTPServer) LastIndex(ctx context.Context) (*LastIndexResponse, error) { + return &LastIndexResponse{ + Index: a.r.LastIndex(), + }, nil +} + +func (a *RaftAdminHTTPServer) CurrentNodeIsLeader(ctx context.Context) bool { + return a.r.State() == raft.Leader +} + +func (a *RaftAdminHTTPServer) Leader(ctx context.Context) (*LeaderResponse, error) { + for _, s := range a.r.GetConfiguration().Configuration().Servers { + if s.Suffrage == raft.Voter && s.Address == a.r.Leader() { + return &LeaderResponse{ + ID: string(s.ID), + Address: string(s.Address), + }, nil + } + } + return &LeaderResponse{ + Address: string(a.r.Leader()), + }, nil +} + +func (a *RaftAdminHTTPServer) LeadershipTransfer(ctx context.Context) (*Future, error) { + return toFuture(a.r.LeadershipTransfer()) +} + +func (a *RaftAdminHTTPServer) LeadershipTransferToServer(ctx context.Context, req *LeadershipTransferToServerRequest) (*Future, error) { + return toFuture(a.r.LeadershipTransferToServer(raft.ServerID(req.ID), raft.ServerAddress(req.Address))) +} + +func (a *RaftAdminHTTPServer) RemoveServer(ctx context.Context, req *RemoveServerRequest) (*Future, error) { + return toFuture(a.r.RemoveServer(raft.ServerID(req.ID), req.PrevIndex, timeout(ctx))) +} + +func (a *RaftAdminHTTPServer) Shutdown(ctx context.Context) (*Future, error) { + return toFuture(a.r.Shutdown()) +} + +func (a *RaftAdminHTTPServer) Snapshot(ctx context.Context) (*Future, error) { + return toFuture(a.r.Snapshot()) +} + +func (a *RaftAdminHTTPServer) State(ctx context.Context) (*StateResponse, error) { + switch s := a.r.State(); s { + case raft.Follower: + return &StateResponse{State: RaftStateFollower}, nil + case raft.Candidate: + return &StateResponse{State: RaftStateCandidate}, nil + case raft.Leader: + return &StateResponse{State: RaftStateLeader}, nil + case raft.Shutdown: + return &StateResponse{State: RaftStateShutdown}, nil + default: + return nil, fmt.Errorf("unknown raft state %v", s) + } +} + +func (a *RaftAdminHTTPServer) Stats(ctx context.Context) (*StatsResponse, error) { + ret := &StatsResponse{} + ret.Stats = map[string]string{} + for k, v := range a.r.Stats() { + ret.Stats[k] = v + } + return ret, nil +} + +func (a *RaftAdminHTTPServer) VerifyLeader(ctx context.Context) (*Future, error) { + return toFuture(a.r.VerifyLeader()) +} + +// ServeHTTP implements the net/http.Handler interface, so that you can use +func (t *RaftAdminHTTPServer) ServeHTTP(res http.ResponseWriter, req *http.Request) { + cmd := path.Base(req.URL.Path) + + if cmdRequiresLeader(cmd) && t.r.State() != raft.Leader { + leaderAddr, _ := t.r.LeaderWithID() + if leaderAddr == "" { + http.Error(res, "no leader", http.StatusServiceUnavailable) + return + } + req.URL.Host = string(leaderAddr) + http.Redirect(res, req, req.URL.String(), + http.StatusTemporaryRedirect) + return + } + + switch cmd { + case "AddNonvoter": + var body AddNonvoterRequest + err := unmarshalBody(req, &body) + if err != nil { + http.Error(res, err.Error(), http.StatusBadRequest) + return + } + f, err := t.AddNonvoter(req.Context(), &body) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "AddVoter": + var body AddVoterRequest + err := unmarshalBody(req, &body) + if err != nil { + http.Error(res, err.Error(), http.StatusBadRequest) + return + } + f, err := t.AddVoter(req.Context(), &body) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "AppliedIndex": + resp, err := t.AppliedIndex(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "Barrier": + f, err := t.Barrier(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + resp, err := t.Await(req.Context(), f) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + if resp.Error != "" { + http.Error(res, resp.Error, http.StatusBadRequest) + return + } + res.Header().Set("X-Raft-Index", fmt.Sprintf("%d", resp.Index)) + res.WriteHeader(http.StatusAccepted) + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "DemoteVoter": + var body DemoteVoterRequest + err := unmarshalBody(req, &body) + if err != nil { + http.Error(res, err.Error(), http.StatusBadRequest) + return + } + f, err := t.DemoteVoter(req.Context(), &body) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "GetConfiguration": + resp, err := t.GetConfiguration(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "LastContact": + resp, err := t.LastContact(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "LastIndex": + resp, err := t.LastIndex(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "Leader": + resp, err := t.Leader(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "LeadershipTransfer": + f, err := t.LeadershipTransfer(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "LeadershipTransferToServer": + var body LeadershipTransferToServerRequest + err := unmarshalBody(req, &body) + if err != nil { + http.Error(res, err.Error(), http.StatusBadRequest) + return + } + f, err := t.LeadershipTransferToServer(req.Context(), &body) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "RemoveServer": + var body RemoveServerRequest + err := unmarshalBody(req, &body) + if err != nil { + http.Error(res, err.Error(), http.StatusBadRequest) + return + } + f, err := t.RemoveServer(req.Context(), &body) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "Shutdown": + f, err := t.Shutdown(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "Snapshot": + f, err := t.Snapshot(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + case "State": + resp, err := t.State(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "Stats": + resp, err := t.Stats(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } + return + case "VerifyLeader": + f, err := t.VerifyLeader(req.Context()) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + t.genericResponse(req, res, f, cmd) + return + default: + http.Error(res, fmt.Sprintf("unknown command %q", cmd), http.StatusBadRequest) + return + } +} + +func cmdRequiresLeader(cmd string) bool { + switch cmd { + case "GetConfiguration", "AppliedIndex", "LastContact", "LastIndex", "Leader", "State", "Stats": + return false + default: + return true + } +} + +func (t *RaftAdminHTTPServer) genericResponse(req *http.Request, res http.ResponseWriter, f *Future, cmd string) { + resp, err := t.Await(req.Context(), f) + if err != nil { + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + if resp.Error != "" { + http.Error(res, resp.Error, http.StatusBadRequest) + return + } + res.Header().Set("X-Raft-Index", fmt.Sprintf("%d", resp.Index)) + res.WriteHeader(http.StatusAccepted) + err = json.NewEncoder(res).Encode(resp) + if err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } +} diff --git a/pkg/raftadmin/raftadmin_client.go b/pkg/raftadmin/raftadmin_client.go new file mode 100644 index 0000000..6c8d1ef --- /dev/null +++ b/pkg/raftadmin/raftadmin_client.go @@ -0,0 +1,465 @@ +package raftadmin + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + "time" + + "github.com/hashicorp/raft" + "github.com/rs/zerolog" +) + +type Doer func(*http.Request) (*http.Response, error) + +type HTTPAdminClient struct { + do Doer + urlFmt string + logger zerolog.Logger +} + +func NewHTTPAdminClient(doer Doer, urlFmt string, logger zerolog.Logger) *HTTPAdminClient { + if doer == nil { + doer = http.DefaultClient.Do + } + if urlFmt == "" { + urlFmt = "http://(address)/raftadmin/" + } else { + if !strings.Contains(urlFmt, "(address)") { + panic("urlFmt must contain the string '(address)'") + } + if !strings.HasSuffix(urlFmt, "/") { + urlFmt += "/" + } + } + return &HTTPAdminClient{ + do: doer, + urlFmt: urlFmt, + logger: logger, + } +} + +func (c *HTTPAdminClient) generateUrl(target raft.ServerAddress, action string) string { + return strings.ReplaceAll(c.urlFmt+action, + "(address)", string(target)) +} + +func (c *HTTPAdminClient) AddNonvoter(ctx context.Context, target raft.ServerAddress, req *AddNonvoterRequest) (*AwaitResponse, error) { + url := c.generateUrl(target, "AddNonvoter") + buf, err := json.Marshal(req) + if err != nil { + return nil, err + } + r, err := http.NewRequest("POST", url, bytes.NewReader(buf)) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusAccepted { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) AddVoter(ctx context.Context, target raft.ServerAddress, req *AddVoterRequest) (*AwaitResponse, error) { + url := c.generateUrl(target, "AddVoter") + buf, err := json.Marshal(req) + if err != nil { + return nil, err + } + r, err := http.NewRequest("POST", url, bytes.NewReader(buf)) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusAccepted { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) AppliedIndex(ctx context.Context, target raft.ServerAddress) (*AppliedIndexResponse, error) { + url := c.generateUrl(target, "AppliedIndex") + r, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out AppliedIndexResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) ApplyLog(ctx context.Context, target raft.ServerAddress, req *ApplyLogRequest) (*AwaitResponse, error) { + url := c.generateUrl(target, "ApplyLog") + buf, err := json.Marshal(req) + if err != nil { + return nil, err + } + r, err := http.NewRequest("POST", url, bytes.NewReader(buf)) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusAccepted { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) Barrier(ctx context.Context, target raft.ServerAddress) (*AwaitResponse, error) { + url := c.generateUrl(target, "Barrier") + r, err := http.NewRequest("POST", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusAccepted { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) DemoteVoter(ctx context.Context, target raft.ServerAddress, req *DemoteVoterRequest) (*AwaitResponse, error) { + url := c.generateUrl(target, "DemoteVoter") + buf, err := json.Marshal(req) + if err != nil { + return nil, err + } + r, err := http.NewRequest("POST", url, bytes.NewReader(buf)) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusAccepted { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) GetConfiguration(ctx context.Context, target raft.ServerAddress) (*GetConfigurationResponse, error) { + url := c.generateUrl(target, "GetConfiguration") + r, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out GetConfigurationResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) LastContact(ctx context.Context, target raft.ServerAddress) (*LastContactResponse, error) { + url := c.generateUrl(target, "LastContact") + r, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out LastContactResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +func (c *HTTPAdminClient) LastIndex(ctx context.Context, target raft.ServerAddress) (*LastIndexResponse, error) { + url := c.generateUrl(target, "LastIndex") + r, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + var out LastIndexResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil +} + +var ErrNotLeader = errors.New("not leader") + +func (c *HTTPAdminClient) Leader(ctx context.Context, target raft.ServerAddress) (*LeaderResponse, error) { + url := c.generateUrl(target, "Leader") + r, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + switch res.StatusCode { + case http.StatusOK: + var out LeaderResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil + case http.StatusTemporaryRedirect: + return nil, ErrNotLeader + default: + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } +} + +func (c *HTTPAdminClient) LeadershipTransfer(ctx context.Context, target raft.ServerAddress, req *LeadershipTransferToServerRequest) (*AwaitResponse, error) { + url := c.generateUrl(target, "LeadershipTransfer") + buf, err := json.Marshal(req) + if err != nil { + return nil, err + } + r, err := http.NewRequest("POST", url, bytes.NewReader(buf)) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + switch res.StatusCode { + case http.StatusAccepted: + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil + case http.StatusTemporaryRedirect: + return nil, ErrNotLeader + default: + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } +} + +func (c *HTTPAdminClient) RemoveServer(ctx context.Context, target raft.ServerAddress, req *RemoveServerRequest) (*AwaitResponse, error) { + url := c.generateUrl(target, "RemoveServer") + buf, err := json.Marshal(req) + if err != nil { + return nil, err + } + r, err := http.NewRequest("POST", url, bytes.NewReader(buf)) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + switch res.StatusCode { + case http.StatusAccepted: + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil + case http.StatusTemporaryRedirect: + return nil, ErrNotLeader + default: + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } +} + +func (c *HTTPAdminClient) Shutdown(ctx context.Context, target raft.ServerAddress) (*AwaitResponse, error) { + url := c.generateUrl(target, "Shutdown") + r, err := http.NewRequest("POST", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + switch res.StatusCode { + case http.StatusAccepted: + var out AwaitResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil + case http.StatusTemporaryRedirect: + return nil, ErrNotLeader + default: + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } +} + +func (c *HTTPAdminClient) State(ctx context.Context, target raft.ServerAddress) (*StateResponse, error) { + url := c.generateUrl(target, "State") + r, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + switch res.StatusCode { + case http.StatusOK: + var out StateResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil + case http.StatusTemporaryRedirect: + return nil, ErrNotLeader + default: + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } +} + +func (c *HTTPAdminClient) Stats(ctx context.Context, target raft.ServerAddress) (*StatsResponse, error) { + url := c.generateUrl(target, "Stats") + r, err := http.NewRequest("POST", url, nil) + if err != nil { + return nil, err + } + res, err := c.clientRetry(r) + if err != nil { + return nil, err + } + defer res.Body.Close() + switch res.StatusCode { + case http.StatusOK: + var out StatsResponse + err = json.NewDecoder(res.Body).Decode(&out) + if err != nil { + return nil, err + } + return &out, nil + case http.StatusTemporaryRedirect: + return nil, ErrNotLeader + default: + return nil, fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } +} + +func (c *HTTPAdminClient) VerifyLeader(ctx context.Context, target raft.ServerAddress) error { + url := c.generateUrl(target, "VerifyLeader") + r, err := http.NewRequest("POST", url, nil) + if err != nil { + return err + } + res, err := c.clientRetry(r) + if err != nil { + return err + } + defer res.Body.Close() + switch res.StatusCode { + case http.StatusOK, http.StatusAccepted: + return nil + case http.StatusTemporaryRedirect: + return ErrNotLeader + default: + return fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } +} + +func (c *HTTPAdminClient) clientRetry(r *http.Request) (*http.Response, error) { + retries := 0 +RETRY: + res, err := c.do(r) + if err != nil { + if retries > 5 { + return nil, err + } + <-time.After(1 * time.Second) + retries++ + goto RETRY + } + return res, nil +} diff --git a/pkg/raftadmin/raftadmin_test.go b/pkg/raftadmin/raftadmin_test.go new file mode 100644 index 0000000..43ed7e7 --- /dev/null +++ b/pkg/raftadmin/raftadmin_test.go @@ -0,0 +1,188 @@ +package raftadmin + +import ( + "context" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/dgate-io/dgate/pkg/util/logger" + "github.com/hashicorp/raft" + "github.com/rs/zerolog" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +type MockTransport struct { + mock.Mock +} + +var _ raft.Transport = (*MockTransport)(nil) + +func (m *MockTransport) Consumer() <-chan raft.RPC { + args := m.Called() + return args.Get(0).(chan raft.RPC) +} + +func (m *MockTransport) LocalAddr() raft.ServerAddress { + args := m.Called() + return args.Get(0).(raft.ServerAddress) +} + +func (m *MockTransport) AppendEntries(id raft.ServerID, target raft.ServerAddress, args *raft.AppendEntriesRequest, resp *raft.AppendEntriesResponse) error { + args2 := m.Called(id, target, args, resp) + return args2.Error(0) +} + +func (m *MockTransport) RequestVote(id raft.ServerID, target raft.ServerAddress, args *raft.RequestVoteRequest, resp *raft.RequestVoteResponse) error { + args2 := m.Called(id, target, args, resp) + return args2.Error(0) +} + +func (m *MockTransport) InstallSnapshot(id raft.ServerID, target raft.ServerAddress, args *raft.InstallSnapshotRequest, resp *raft.InstallSnapshotResponse, rdr io.Reader) error { + args2 := m.Called(id, target, args, resp, rdr) + return args2.Error(0) +} + +func (m *MockTransport) AppendEntriesPipeline(id raft.ServerID, target raft.ServerAddress) (raft.AppendPipeline, error) { + args := m.Called(id, target) + return args.Get(0).(raft.AppendPipeline), args.Error(1) +} + +func (m *MockTransport) EncodePeer(id raft.ServerID, addr raft.ServerAddress) []byte { + args := m.Called(id, addr) + return args.Get(0).([]byte) +} + +func (m *MockTransport) DecodePeer(b []byte) raft.ServerAddress { + args := m.Called(b) + return args.Get(0).(raft.ServerAddress) +} + +func (m *MockTransport) SetHeartbeatHandler(h func(raft.RPC)) { + m.Called(h) +} + +func (m *MockTransport) TimeoutNow(id raft.ServerID, target raft.ServerAddress, args *raft.TimeoutNowRequest, resp *raft.TimeoutNowResponse) error { + args2 := m.Called(id, target, args, resp) + return args2.Error(0) +} + +type MockFSM struct { + mock.Mock +} + +var _ raft.FSM = (*MockFSM)(nil) + +func (m *MockFSM) Apply(l *raft.Log) interface{} { + args := m.Called(l) + return args.Get(0) +} + +func (m *MockFSM) Snapshot() (raft.FSMSnapshot, error) { + args := m.Called() + return args.Get(0).(raft.FSMSnapshot), args.Error(1) +} + +func (m *MockFSM) Restore(io.ReadCloser) error { + args := m.Called() + return args.Error(0) +} + +func setupRaftAdmin(t *testing.T) *httptest.Server { + lgr := zerolog.New(io.Discard) + + raftConfig := raft.DefaultConfig() + raftConfig.LocalID = "1" + raftConfig.Logger = logger.NewNopHCLogger() + + mockFSM := &MockFSM{} + mockFSM.On("Apply", mock.Anything).Return(nil) + + logStore := raft.NewInmemStore() + stableStore := raft.NewInmemStore() + snapStore := raft.NewInmemSnapshotStore() + + mocktp := new(MockTransport) + mocktp.On("LocalAddr").Return(raft.ServerAddress("localhost:9090")) + mocktp.On("Consumer").Return(make(chan raft.RPC)) + mocktp.On("SetHeartbeatHandler", mock.Anything).Return() + mocktp.On("EncodePeer", mock.Anything, mock.Anything).Return([]byte{}) + mocktp.On("EncodePeer", mock.Anything).Return(raft.ServerAddress("localhost:9090")) + + raftNode, err := raft.NewRaft( + raftConfig, mockFSM, logStore, + stableStore, snapStore, mocktp, + ) + if err != nil { + t.Fatal(err) + } + err = raftNode.BootstrapCluster(raft.Configuration{ + Servers: []raft.Server{{ + Suffrage: raft.Voter, + ID: "1", + Address: raft.ServerAddress("localhost:9090"), + }}, + }).Error() + if err != nil { + t.Fatal(err) + } + <-time.After(time.Second * 5) + + raftAdmin := NewRaftAdminHTTPServer( + raftNode, lgr, + []raft.ServerAddress{ + "localhost:9090", + }, + ) + mux := http.NewServeMux() + mux.Handle("/raftadmin/", raftAdmin) + server := httptest.NewServer(mux) + return server +} + +type raftAdminMockClient struct { + mock.Mock + t *testing.T + res *http.Response + Doer +} + +func (m *raftAdminMockClient) Do(req *http.Request) (*http.Response, error) { + m.Called(req) + return m.res, nil +} + +func TestRaft(t *testing.T) { + server := setupRaftAdmin(t) + + // mock raft.Raft + mockClient := &raftAdminMockClient{ + t: t, res: &http.Response{ + StatusCode: http.StatusAccepted, + Body: io.NopCloser(strings.NewReader( + `{"index": 1}`, + )), + }, + } + mockClient.On("Do", mock.Anything). + Return(mockClient.res, nil) + + ctx := context.Background() + client := NewHTTPAdminClient( + server.Client().Do, + "http://(address)/raftadmin", + zerolog.New(nil), + ) + serverAddr := raft.ServerAddress(server.Listener.Addr().String()) + leader, err := client.Leader(ctx, serverAddr) + if err != nil { + t.Error(err) + return + } + assert.Equal(t, leader.Address, "localhost:9090") + assert.Equal(t, leader.ID, "1") +} diff --git a/pkg/raftadmin/types.go b/pkg/raftadmin/types.go new file mode 100644 index 0000000..be8ab7c --- /dev/null +++ b/pkg/raftadmin/types.go @@ -0,0 +1,98 @@ +package raftadmin + +type Future struct { + OperationToken string +} + +type AwaitResponse struct { + Index uint64 `json:"index"` + Error string `json:"error"` +} + +type ForgetResponse struct { + OperationToken string `json:"operation_token"` +} + +type AddNonvoterRequest struct { + ID string `json:"id"` + Address string `json:"address"` + PrevIndex int64 `json:"prev_index"` +} + +type AddVoterRequest struct { + ID string `json:"id"` + Address string `json:"address"` + PrevIndex int64 `json:"prev_index"` +} + +type AppliedIndexResponse struct { + Index uint64 `json:"index"` +} + +type ApplyLogRequest struct { + Data []byte `json:"data"` + Extensions []byte `json:"extensions"` +} + +type DemoteVoterRequest struct { + ID string `json:"id"` + PrevIndex uint64 `json:"prev_index"` +} + +type RaftSuffrage string + +const ( + RaftSuffrageVoter RaftSuffrage = "voter" + RaftSuffrageNonvoter RaftSuffrage = "nonvoter" +) + +type GetConfigurationResponse struct { + Servers []*GetConfigurationServer `json:"servers"` +} + +type GetConfigurationServer struct { + Suffrage RaftSuffrage `json:"suffrage"` + ID string `json:"id"` + Address string `json:"address"` +} + +type LastContactResponse struct { + UnixNano int64 `json:"unix_nano"` +} + +type LastIndexResponse struct { + Index uint64 `json:"index"` +} + +type LeaderResponse struct { + ID string `json:"id"` + Address string `json:"address"` +} + +type LeadershipTransferToServerRequest struct { + ID string `json:"id"` + Address string `json:"address"` +} + +type RemoveServerRequest struct { + ID string `json:"id"` + PrevIndex uint64 `json:"prev_index"` +} + +type RaftState string + +const ( + RaftStateLeader RaftState = "leader" + RaftStateFollower RaftState = "follower" + RaftStateCandidate RaftState = "candidate" + RaftStateShutdown RaftState = "shutdown" +) + +type StateResponse struct { + Index int64 `json:"index"` + State RaftState +} + +type StatsResponse struct { + Stats map[string]string `json:"stats"` +} diff --git a/pkg/rafthttp/rafthttp.go b/pkg/rafthttp/rafthttp.go new file mode 100644 index 0000000..a7ed0ce --- /dev/null +++ b/pkg/rafthttp/rafthttp.go @@ -0,0 +1,304 @@ +package rafthttp + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "path" + "strings" + "time" + + "github.com/hashicorp/raft" + "github.com/rs/zerolog" +) + +// Doer provides the Do() method, as found in net/http.Client. +// +// Using this interface instead of net/http.Client directly is useful so that +// users of the HTTPTransport can wrap requests to, for example, call +// req.SetBasicAuth. +type Doer interface { + Do(*http.Request) (*http.Response, error) +} + +// HTTPTransport provides a HTTP-based transport that can be used to +// communicate with Raft on remote machines. It is convenient to use if your +// application is an HTTP server already and you do not want to use multiple +// different transports (if not, you can use raft.NetworkTransport). +type HTTPTransport struct { + logger zerolog.Logger + consumer chan raft.RPC + addr raft.ServerAddress + client Doer + urlFmt string +} + +var _ raft.Transport = (*HTTPTransport)(nil) + +func NewHTTPTransport(addr raft.ServerAddress, client Doer, logger zerolog.Logger, urlFmt string) *HTTPTransport { + if client == nil { + client = http.DefaultClient + } + if !strings.Contains(urlFmt, "(address)") { + panic("urlFmt must contain the string '(address)'") + } + if !strings.HasSuffix(urlFmt, "/") { + urlFmt += "/" + } + return &HTTPTransport{ + logger: logger, + consumer: make(chan raft.RPC), + addr: addr, + client: client, + urlFmt: urlFmt, + } +} + +type installSnapshotRequest struct { + Args *raft.InstallSnapshotRequest + Data []byte +} + +func (t *HTTPTransport) send(url string, in, out interface{}) error { + buf, err := json.Marshal(in) + if err != nil { + return fmt.Errorf("could not serialize request: %v", err) + } + + req, err := http.NewRequest("POST", url, bytes.NewReader(buf)) + if err != nil { + return err + } + + retries := 0 +RETRY: + res, err := t.client.Do(req) + if err != nil { + if retries > 10 { + return fmt.Errorf("could not send request: %v", err) + } + <-time.After(3 * time.Second) + retries++ + goto RETRY + } + + defer func() { + // Make sure to read the entire body and close the connection, + // otherwise net/http cannot re-use the connection. + io.ReadAll(res.Body) + res.Body.Close() + }() + + if res.StatusCode != http.StatusOK { + return fmt.Errorf("unexpected HTTP status code: %v", res.Status) + } + + return json.NewDecoder(res.Body).Decode(out) +} + +func (t *HTTPTransport) generateUrl(target raft.ServerAddress, action string) string { + return strings.ReplaceAll(t.urlFmt+action, + "(address)", string(target)) +} + +// Consumer implements the raft.Transport interface. +func (t *HTTPTransport) Consumer() <-chan raft.RPC { + return t.consumer +} + +// LocalAddr implements the raft.Transport interface. +func (t *HTTPTransport) LocalAddr() raft.ServerAddress { + return t.addr +} + +// AppendEntriesPipeline implements the raft.Transport interface. +func (t *HTTPTransport) AppendEntriesPipeline(_ raft.ServerID, target raft.ServerAddress) (raft.AppendPipeline, error) { + // This transport does not support pipelining in the hashicorp/raft sense. + // The underlying net/http reuses connections (keep-alive) and that is good + // enough. We are talking about differences in the microsecond range, which + // becomes irrelevant as soon as the raft nodes run on different computers. + return nil, raft.ErrPipelineReplicationNotSupported +} + +// AppendEntries implements the raft.Transport interface. +func (t *HTTPTransport) AppendEntries(_ raft.ServerID, target raft.ServerAddress, args *raft.AppendEntriesRequest, resp *raft.AppendEntriesResponse) error { + return t.send(t.generateUrl(target, "AppendEntries"), args, resp) +} + +// RequestVote implements the raft.Transport interface. +func (t *HTTPTransport) RequestVote(_ raft.ServerID, target raft.ServerAddress, args *raft.RequestVoteRequest, resp *raft.RequestVoteResponse) error { + return t.send(t.generateUrl(target, "RequestVote"), args, resp) +} + +// InstallSnapshot implements the raft.Transport interface. +func (t *HTTPTransport) InstallSnapshot(_ raft.ServerID, target raft.ServerAddress, args *raft.InstallSnapshotRequest, resp *raft.InstallSnapshotResponse, data io.Reader) error { + // Send a dummy request to see if the remote host supports + // InstallSnapshotStreaming after all. We need to know whether we can use + // InstallSnapshotStreaming or whether we need to fall back to + // InstallSnapshot beforehand, because we cannot seek in |data|. + url := t.generateUrl(target, "InstallSnapshotStreaming") + probeReq, err := http.NewRequest("POST", url, nil) + if err != nil { + return err + } + probeRes, err := t.client.Do(probeReq) + if err != nil { + return err + } + io.ReadAll(probeRes.Body) + probeRes.Body.Close() + if probeRes.StatusCode == http.StatusNotFound { + // Possibly the remote host runs an older version of the code + // without the InstallSnapshotStreaming handler. Try the old + // version. + buf := make([]byte, 0, args.Size+bytes.MinRead) + b := bytes.NewBuffer(buf) + if _, err := io.CopyN(b, data, args.Size); err != nil { + return fmt.Errorf("could not read data: %v", err) + } + buf = b.Bytes() + return t.send(t.generateUrl(target, "InstallSnapshot"), installSnapshotRequest{args, buf}, resp) + } + + req, err := http.NewRequest("POST", url, data) + if err != nil { + return err + } + buf, err := json.Marshal(args) + if err != nil { + return err + } + req.Header.Set("X-InstallSnapshotRequest", string(buf)) + res, err := t.client.Do(req) + if err != nil { + return fmt.Errorf("could not send request: %v", err) + } + + defer func() { + // Make sure to read the entire body and close the connection, + // otherwise net/http cannot re-use the connection. + io.ReadAll(res.Body) + res.Body.Close() + }() + + if res.StatusCode != http.StatusOK { + b, _ := io.ReadAll(res.Body) + return fmt.Errorf("unexpected HTTP status code: %v (body: %s)", res.Status, strings.TrimSpace(string(b))) + } + + return json.NewDecoder(res.Body).Decode(resp) +} + +// EncodePeer implements the raft.Transport interface. +func (t *HTTPTransport) EncodePeer(_ raft.ServerID, a raft.ServerAddress) []byte { + return []byte(a) +} + +// DecodePeer implements the raft.Transport interface. +func (t *HTTPTransport) DecodePeer(b []byte) raft.ServerAddress { + return raft.ServerAddress(string(b)) +} + +func (t *HTTPTransport) handle(res http.ResponseWriter, req *http.Request, rpc raft.RPC) error { + if err := json.NewDecoder(req.Body).Decode(&rpc.Command); err != nil { + err := fmt.Errorf("could not parse request: %v", err) + http.Error(res, err.Error(), http.StatusBadRequest) + return err + } + + if r, ok := rpc.Command.(*installSnapshotRequest); ok { + rpc.Command = r.Args + rpc.Reader = bytes.NewReader(r.Data) + } + + respChan := make(chan raft.RPCResponse) + rpc.RespChan = respChan + + t.consumer <- rpc + + resp := <-respChan + + if resp.Error != nil { + err := fmt.Errorf("could not run RPC: %v", resp.Error) + http.Error(res, err.Error(), http.StatusBadRequest) + return err + } + + res.Header().Set("Content-Type", "application/json") + if err := json.NewEncoder(res).Encode(resp.Response); err != nil { + err := fmt.Errorf("could not encode response: %v", err) + http.Error(res, err.Error(), http.StatusInternalServerError) + return err + } + + return nil +} + +// ServeHTTP implements the net/http.Handler interface, so that you can use +// +// http.Handle("/raft/", transport) +func (t *HTTPTransport) ServeHTTP(res http.ResponseWriter, req *http.Request) { + cmd := path.Base(req.URL.Path) + + var rpc raft.RPC + + switch cmd { + case "InstallSnapshot": + rpc.Command = &installSnapshotRequest{} + case "InstallSnapshotStreaming": + var isr raft.InstallSnapshotRequest + if err := json.Unmarshal([]byte(req.Header.Get("X-InstallSnapshotRequest")), &isr); err != nil { + err := fmt.Errorf("could not parse request: %v", err) + http.Error(res, err.Error(), http.StatusBadRequest) + return + } + rpc.Command = &isr + rpc.Reader = req.Body + respChan := make(chan raft.RPCResponse) + rpc.RespChan = respChan + + t.consumer <- rpc + + resp := <-respChan + + if resp.Error != nil { + err := fmt.Errorf("could not run RPC: %v", resp.Error) + http.Error(res, err.Error(), http.StatusBadRequest) + return + } + + res.Header().Set("Content-Type", "application/json") + if err := json.NewEncoder(res).Encode(resp.Response); err != nil { + err := fmt.Errorf("could not encode response: %v", err) + http.Error(res, err.Error(), http.StatusInternalServerError) + return + } + + return + case "RequestVote": + rpc.Command = &raft.RequestVoteRequest{} + case "AppendEntries": + rpc.Command = &raft.AppendEntriesRequest{} + case "TimeoutNow": + rpc.Command = &raft.TimeoutNowRequest{} + default: + http.Error(res, fmt.Sprintf("No RPC %q", cmd), 404) + return + } + + if err := t.handle(res, req, rpc); err != nil { + t.logger.Printf("[%s, %s] %v\n", req.RemoteAddr, cmd, err) + } +} + +// SetHeartbeatHandler implements the raft.Transport interface. +func (t *HTTPTransport) SetHeartbeatHandler(cb func(rpc raft.RPC)) { + // Not supported +} + +// TimeoutNow implements the raft.Transport interface. +func (t *HTTPTransport) TimeoutNow(_ raft.ServerID, target raft.ServerAddress, args *raft.TimeoutNowRequest, resp *raft.TimeoutNowResponse) error { + return t.send(t.generateUrl(target, "TimeoutNow"), args, resp) +} diff --git a/pkg/rafthttp/rafthttp_test.go b/pkg/rafthttp/rafthttp_test.go new file mode 100644 index 0000000..8b2ff53 --- /dev/null +++ b/pkg/rafthttp/rafthttp_test.go @@ -0,0 +1,73 @@ +package rafthttp_test + +import ( + "io" + "log" + "net" + "net/http" + "testing" + "time" + + "github.com/dgate-io/dgate/pkg/rafthttp" + "github.com/dgate-io/dgate/pkg/util/logger" + "github.com/hashicorp/raft" + "github.com/rs/zerolog" + "github.com/stretchr/testify/mock" +) + +type MockFSM struct { + mock.Mock +} + +var _ raft.FSM = (*MockFSM)(nil) + +func (m *MockFSM) Apply(l *raft.Log) interface{} { + args := m.Called(l) + return args.Get(0) +} + +func (m *MockFSM) Snapshot() (raft.FSMSnapshot, error) { + args := m.Called() + return args.Get(0).(raft.FSMSnapshot), args.Error(1) +} + +func (m *MockFSM) Restore(io.ReadCloser) error { + args := m.Called() + return args.Error(0) +} + +func TestExample(t *testing.T) { + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatal(err) + } + log.Printf("Listening on %s", ln.Addr().String()) + srvAddr := raft.ServerAddress(ln.Addr().String()) + transport := rafthttp.NewHTTPTransport( + srvAddr, http.DefaultClient, + zerolog.Logger{}, "http://(address)/raft") + srv := &http.Server{ + Handler: transport, + } + go srv.Serve(ln) + + raftConfig := raft.DefaultConfig() + raftConfig.LocalID = "1" + raftConfig.Logger = logger.NewNopHCLogger() + + mockFSM := &MockFSM{} + logStore := raft.NewInmemStore() + stableStore := raft.NewInmemStore() + snapStore := raft.NewInmemSnapshotStore() + + raftNode, err := raft.NewRaft( + raftConfig, mockFSM, + logStore, stableStore, snapStore, + transport, + ) + if err != nil { + t.Fatal(err) + } + + raftNode.Apply([]byte("foo"), time.Duration(0)) +} diff --git a/pkg/resources/document_manager.go b/pkg/resources/document_manager.go new file mode 100644 index 0000000..c765215 --- /dev/null +++ b/pkg/resources/document_manager.go @@ -0,0 +1,10 @@ +package resources + +import ( + "github.com/dgate-io/dgate/pkg/spec" +) + +type DocumentManager interface { + GetDocumentByID(namespace, collection, id string) (*spec.Document, error) + GetDocuments(collection, namespace string, limit, offset int) ([]*spec.Document, error) +} diff --git a/pkg/resources/resource_manager.go b/pkg/resources/resource_manager.go new file mode 100644 index 0000000..0376a4d --- /dev/null +++ b/pkg/resources/resource_manager.go @@ -0,0 +1,843 @@ +package resources + +import ( + "crypto/tls" + "encoding/json" + "errors" + "sync" + + "github.com/dgate-io/dgate/pkg/spec" + "github.com/dgate-io/dgate/pkg/util/linker" + "github.com/dgate-io/dgate/pkg/util/safe" + "github.com/dgate-io/dgate/pkg/util/sliceutil" + "github.com/dgate-io/dgate/pkg/util/tree/avl" +) + +type avlTreeLinker[T any] avl.Tree[string, *linker.Link[string, safe.Ref[T]]] + +// ResourceManager is a struct that handles all resources and their links between each other +type ResourceManager struct { + namespaces avlTreeLinker[spec.DGateNamespace] + services avlTreeLinker[spec.DGateService] + domains avlTreeLinker[spec.DGateDomain] + modules avlTreeLinker[spec.DGateModule] + routes avlTreeLinker[spec.DGateRoute] + collections avlTreeLinker[spec.DGateCollection] + mutex *sync.RWMutex +} + +type Options func(*ResourceManager) + +func NewManager(opts ...Options) *ResourceManager { + rm := &ResourceManager{ + namespaces: avl.NewTree[string, *linker.Link[string, safe.Ref[spec.DGateNamespace]]](), + services: avl.NewTree[string, *linker.Link[string, safe.Ref[spec.DGateService]]](), + domains: avl.NewTree[string, *linker.Link[string, safe.Ref[spec.DGateDomain]]](), + modules: avl.NewTree[string, *linker.Link[string, safe.Ref[spec.DGateModule]]](), + routes: avl.NewTree[string, *linker.Link[string, safe.Ref[spec.DGateRoute]]](), + collections: avl.NewTree[string, *linker.Link[string, safe.Ref[spec.DGateCollection]]](), + mutex: &sync.RWMutex{}, + } + for _, opt := range opts { + if opt != nil { + opt(rm) + } + } + return rm +} + +func WithDefaultNamespace(ns *spec.Namespace) Options { + return func(rm *ResourceManager) { + rm.AddNamespace(ns) + } +} + +/* + Namespace functions +*/ + +func (rm *ResourceManager) GetNamespace(namespace string) (*spec.DGateNamespace, bool) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return rm.getNamespace(namespace) +} + +func (rm *ResourceManager) getNamespace(namespace string) (*spec.DGateNamespace, bool) { + if lk, ok := rm.namespaces.Find(namespace); !ok { + return nil, false + } else { + return lk.Item().Read(), true + } +} + +// GetNamespaces returns a list of all namespaces +func (rm *ResourceManager) GetNamespaces() []*spec.DGateNamespace { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var namespaces []*spec.DGateNamespace + rm.namespaces.Each(func(_ string, lk *linker.Link[string, safe.Ref[spec.DGateNamespace]]) bool { + namespaces = append(namespaces, lk.Item().Read()) + return true + }) + return namespaces +} + +func (rm *ResourceManager) transformNamespace(ns *spec.Namespace) *spec.DGateNamespace { + return &spec.DGateNamespace{ + Name: ns.Name, + Tags: ns.Tags, + } +} + +func (rm *ResourceManager) AddNamespace(ns *spec.Namespace) *spec.DGateNamespace { + rm.mutex.Lock() + defer rm.mutex.Unlock() + namespace := rm.transformNamespace(ns) + if nsLk, ok := rm.namespaces.Find(ns.Name); ok { + nsLk.Item().Replace(namespace) + } else { + lk := linker.NewNamedVertexWithValue( + safe.NewRef(namespace), + "routes", "services", + "modules", "domains", + "collections", + ) + rm.namespaces.Insert(ns.Name, lk) + } + return namespace +} + +func (rm *ResourceManager) RemoveNamespace(namespace string) error { + rm.mutex.Lock() + defer rm.mutex.Unlock() + if nsLk, ok := rm.namespaces.Find(namespace); ok { + if nsLk.Len("routes") > 0 { + return ErrCannotDeleteNamespace(namespace, "routes still linked") + } + if nsLk.Len("services") > 0 { + return ErrCannotDeleteNamespace(namespace, "services still linked") + } + if nsLk.Len("modules") > 0 { + return ErrCannotDeleteNamespace(namespace, "modules still linked") + } + if nsLk.Len("domains") > 0 { + return ErrCannotDeleteNamespace(namespace, "domains still linked") + } + if nsLk.Len("collections") > 0 { + return ErrCannotDeleteNamespace(namespace, "collections still linked") + } + if !rm.namespaces.Delete(namespace) { + panic("failed to delete namespace") + } + return nil + } else { + return ErrNamespaceNotFound(namespace) + } +} + +/* Route functions */ +func (rm *ResourceManager) GetRoute(name, namespace string) (*spec.DGateRoute, bool) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return rm.getRoute(name, namespace) +} + +func (rm *ResourceManager) getRoute(name, namespace string) (*spec.DGateRoute, bool) { + if lk, ok := rm.routes.Find(name + "/" + namespace); ok { + return lk.Item().Read(), true + } + return nil, false +} + +// GetRoutes returns a list of all routes +func (rm *ResourceManager) GetRoutes() []*spec.DGateRoute { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var routes []*spec.DGateRoute + rm.routes.Each(func(_ string, rtlk *linker.Link[string, safe.Ref[spec.DGateRoute]]) bool { + routes = append(routes, rtlk.Item().Read()) + return true + }) + return routes +} + +// GetRoutesByNamespace returns a list of all routes in a namespace +func (rm *ResourceManager) GetRoutesByNamespace(namespace string) []*spec.DGateRoute { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var routes []*spec.DGateRoute + if nsLk, ok := rm.namespaces.Find(namespace); ok { + nsLk.Each("routes", func(_ string, lk linker.Linker[string]) { + rtLk := linker.NamedVertexWithVertex[string, safe.Ref[spec.DGateRoute]](lk) + routes = append(routes, rtLk.Item().Read()) + }) + } + return routes +} + +// GetRouteNamespaceMap returns a map of all routes and their namespaces as the key +func (rm *ResourceManager) GetRouteNamespaceMap() map[string][]*spec.DGateRoute { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + routeMap := make(map[string][]*spec.DGateRoute) + rm.namespaces.Each(func(ns string, lk *linker.Link[string, safe.Ref[spec.DGateNamespace]]) bool { + routes := []*spec.DGateRoute{} + lk.Each("routes", func(_ string, lk linker.Linker[string]) { + rtLk := linker.NamedVertexWithVertex[string, safe.Ref[spec.DGateRoute]](lk) + routes = append(routes, rtLk.Item().Read()) + }) + if len(routes) > 0 { + routeMap[ns] = routes + } + return true + }) + return routeMap +} + +func (rm *ResourceManager) AddRoute(route *spec.Route) (rt *spec.DGateRoute, err error) { + rm.mutex.Lock() + defer rm.mutex.Unlock() + if rt, err = rm.transformRoute(route); err != nil { + return nil, err + } else if nsLk, ok := rm.namespaces.Find(route.NamespaceName); !ok { + return nil, ErrNamespaceNotFound(route.NamespaceName) + } else if rtLk, ok := rm.routes.Find(route.Name + "/" + route.NamespaceName); ok { + rtLk.Item().Replace(rt) + err = rm.relinkRoute(rtLk, nsLk, route, route.Name, route.NamespaceName, true) + if err != nil { + return nil, err + } + return rt, nil + } else { + rtLk := linker.NewNamedVertexWithValue( + safe.NewRef(rt), "namespace", "service", "modules") + err = rm.relinkRoute(rtLk, nsLk, route, route.Name, route.NamespaceName, false) + if err != nil { + return nil, err + } + rm.routes.Insert(route.Name+"/"+route.NamespaceName, rtLk) + return rt, nil + } +} + +func (rm *ResourceManager) transformRoute(route *spec.Route) (*spec.DGateRoute, error) { + if ns, ok := rm.getNamespace(route.NamespaceName); !ok { + return nil, ErrNamespaceNotFound(route.NamespaceName) + } else { + var svc *spec.DGateService + if route.ServiceName != "" { + if svc, ok = rm.getService(route.ServiceName, route.NamespaceName); !ok { + return nil, ErrServiceNotFound(route.ServiceName) + } + } + mods := make([]*spec.DGateModule, len(route.Modules)) + for i, modName := range route.Modules { + if mod, ok := rm.getModule(modName, route.NamespaceName); ok { + mods[i] = mod + } else { + return nil, ErrModuleNotFound(modName) + } + } + + return &spec.DGateRoute{ + Name: route.Name, + Namespace: ns, + Paths: route.Paths, + Methods: route.Methods, + Service: svc, + Modules: mods, + StripPath: route.StripPath, + PreserveHost: route.PreserveHost, + Tags: route.Tags, + }, nil + } +} + +// RemoveRoute removes a route from the resource manager +func (rm *ResourceManager) RemoveRoute(name, namespace string) error { + // TODO: this function can be improved by checking if + // the links are valid before unlinking them + rm.mutex.Lock() + defer rm.mutex.Unlock() + if nsLk, ok := rm.namespaces.Find(namespace); !ok { + return ErrNamespaceNotFound(namespace) + } else if lk, ok := rm.routes.Find(name + "/" + namespace); ok { + rm.unlinkRoute(lk, nsLk, name, namespace) + if !rm.routes.Delete(name + "/" + namespace) { + panic("failed to delete route") + } + return nil + } else { + return ErrRouteNotFound(name) + } +} + +func (rm *ResourceManager) unlinkRoute( + rtLk *linker.Link[string, safe.Ref[spec.DGateRoute]], + nsLk *linker.Link[string, safe.Ref[spec.DGateNamespace]], + name, namespace string, +) { + nsLk.UnlinkOneMany("routes", name) + rtLk.UnlinkOneOneByKey("namespace", namespace) + if svcLk := rtLk.Get("service"); svcLk != nil { + svcLk.UnlinkOneMany("routes", name) + rtLk.UnlinkOneOne("service") + } + rtLk.Each("modules", func(_ string, modLk linker.Linker[string]) { + modLk.UnlinkOneMany("routes", name) + }) +} + +func (rm *ResourceManager) relinkRoute( + rtLk *linker.Link[string, safe.Ref[spec.DGateRoute]], + nsLk *linker.Link[string, safe.Ref[spec.DGateNamespace]], + route *spec.Route, name, namespace string, exists bool, +) error { + modLks := make(map[string]linker.Linker[string], len(route.Modules)) + for _, modName := range route.Modules { + if modLk, ok := rm.modules.Find(modName + "/" + route.NamespaceName); ok { + modLks[modName] = modLk + } else { + return ErrModuleNotFound(modName) + } + } + + if route.ServiceName != "" { + if svcLk, ok := rm.services.Find(route.ServiceName + "/" + route.NamespaceName); ok { + if exists { + rm.unlinkRoute(rtLk, nsLk, name, namespace) + } + rtLk.LinkOneOne("service", route.ServiceName, svcLk) + svcLk.LinkOneMany("routes", route.Name, rtLk) + } else { + return ErrServiceNotFound(route.ServiceName) + } + } + + rtLk.LinkOneOne("namespace", route.NamespaceName, nsLk) + nsLk.LinkOneMany("routes", route.Name, rtLk) + + for modName, modLk := range modLks { + modLk.LinkOneMany("routes", route.Name, rtLk) + rtLk.LinkOneMany("modules", modName, modLk) + } + return nil +} + +/* Service functions */ + +func (rm *ResourceManager) GetService(name, namespace string) (*spec.DGateService, bool) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return rm.getService(name, namespace) +} + +func (rm *ResourceManager) getService(name, namespace string) (*spec.DGateService, bool) { + if lk, ok := rm.services.Find(name + "/" + namespace); ok { + return lk.Item().Read(), true + } + return nil, false +} + +// GetServicesByNamespace returns a list of all services in a namespace +func (rm *ResourceManager) GetServicesByNamespace(namespace string) []*spec.DGateService { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var services []*spec.DGateService + if nsLk, ok := rm.namespaces.Find(namespace); ok { + nsLk.Each("services", func(_ string, lk linker.Linker[string]) { + svcLk := linker.NamedVertexWithVertex[string, safe.Ref[spec.DGateService]](lk) + services = append(services, svcLk.Item().Read()) + }) + } + return services +} + +// GetServices returns a list of all services +func (rm *ResourceManager) GetServices() []*spec.DGateService { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var services []*spec.DGateService + rm.services.Each(func(_ string, lk *linker.Link[string, safe.Ref[spec.DGateService]]) bool { + services = append(services, lk.Item().Read()) + return true + }) + return services +} + +func (rm *ResourceManager) AddService(service *spec.Service) (*spec.DGateService, error) { + rm.mutex.Lock() + defer rm.mutex.Unlock() + svc, err := rm.transformService(service) + if err != nil { + return nil, err + } + rw := safe.NewRef(svc) + svcLk := linker.NewNamedVertexWithValue(rw, "routes", "namespaces") + if nsLk, ok := rm.namespaces.Find(service.NamespaceName); ok { + svcLk.LinkOneMany("namespaces", service.NamespaceName, nsLk) + nsLk.LinkOneMany("services", service.Name, svcLk) + rm.services.Insert(service.Name+"/"+service.NamespaceName, svcLk) + return rw.Read(), nil + } else { + return nil, ErrNamespaceNotFound(service.NamespaceName) + } +} + +func (rm *ResourceManager) transformService(service *spec.Service) (*spec.DGateService, error) { + if ns, ok := rm.getNamespace(service.NamespaceName); !ok { + return nil, ErrNamespaceNotFound(service.NamespaceName) + } else { + return spec.TransformService(ns, service), nil + } +} + +func (rm *ResourceManager) RemoveService(name, namespace string) error { + rm.mutex.Lock() + defer rm.mutex.Unlock() + if lk, ok := rm.services.Find(name + "/" + namespace); ok { + if nsLk, ok := rm.namespaces.Find(namespace); ok { + if rtsLk := lk.Get("routes"); rtsLk != nil { + return ErrCannotDeleteService(name, "routes still linked") + } + nsLk.UnlinkOneMany("services", name) + lk.UnlinkOneMany("namespaces", namespace) + } else { + return ErrNamespaceNotFound(namespace) + } + if !rm.services.Delete(name + "/" + namespace) { + panic("failed to delete service") + } + return nil + } else { + return ErrServiceNotFound(name) + } +} + +/* Domain functions */ + +func (rm *ResourceManager) GetDomain(name, namespace string) (*spec.DGateDomain, bool) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return rm.getDomain(name, namespace) +} + +func (rm *ResourceManager) getDomain(name, namespace string) (*spec.DGateDomain, bool) { + if lk, ok := rm.domains.Find(name + "/" + namespace); ok { + return lk.Item().Read(), true + } + return nil, false +} + +// GetDomains returns a list of all domains +func (rm *ResourceManager) GetDomains() []*spec.DGateDomain { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var domains []*spec.DGateDomain + rm.domains.Each(func(_ string, lk *linker.Link[string, safe.Ref[spec.DGateDomain]]) bool { + domains = append(domains, lk.Item().Read()) + return true + }) + return domains +} + +// GetDomainsByNamespace returns a list of all domains in a namespace +func (rm *ResourceManager) GetDomainsByNamespace(namespace string) []*spec.DGateDomain { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var domains []*spec.DGateDomain + if nsLk, ok := rm.namespaces.Find(namespace); ok { + nsLk.Each("domains", func(_ string, lk linker.Linker[string]) { + dmLk := linker.NamedVertexWithVertex[string, safe.Ref[spec.DGateDomain]](lk) + domains = append(domains, dmLk.Item().Read()) + }) + } + return domains +} + +// AddDomain adds a domain to the resource manager + +func (rm *ResourceManager) AddDomain(domain *spec.Domain) (*spec.DGateDomain, error) { + rm.mutex.Lock() + defer rm.mutex.Unlock() + dm, err := rm.transformDomain(domain) + if err != nil { + return nil, err + } + rw := safe.NewRef(dm) + dmLk := linker.NewNamedVertexWithValue(rw, "namespace") + if nsLk, ok := rm.namespaces.Find(domain.NamespaceName); ok { + nsLk.LinkOneMany("domains", domain.Name, dmLk) + dmLk.LinkOneOne("namespace", domain.NamespaceName, nsLk) + rm.domains.Insert(domain.Name+"/"+domain.NamespaceName, dmLk) + return rw.Read(), nil + } + return nil, ErrNamespaceNotFound(domain.NamespaceName) +} + +func (rm *ResourceManager) transformDomain(domain *spec.Domain) (*spec.DGateDomain, error) { + if ns, ok := rm.getNamespace(domain.NamespaceName); !ok { + return nil, ErrNamespaceNotFound(domain.NamespaceName) + } else { + var ( + serverCert tls.Certificate + err error + ) + if domain.Key != "" && domain.Cert != "" { + certBytes, keyBytes := []byte(domain.Key), []byte(domain.Cert) + serverCert, err = tls.X509KeyPair(certBytes, keyBytes) + if err != nil { + return nil, err + } + } + return &spec.DGateDomain{ + Name: domain.Name, + Namespace: ns, + Patterns: domain.Patterns, + TLSCert: &serverCert, + Priority: domain.Priority, + Cert: domain.Cert, + Key: domain.Key, + Tags: domain.Tags, + }, nil + } +} + +func (rm *ResourceManager) RemoveDomain(name, namespace string) error { + rm.mutex.Lock() + defer rm.mutex.Unlock() + if dmLk, ok := rm.domains.Find(name + "/" + namespace); ok { + if nsLk, ok := rm.namespaces.Find(namespace); ok { + nsLk.UnlinkOneMany("domains", name) + dmLk.UnlinkOneOneByKey("namespace", namespace) + if !rm.domains.Delete(name + "/" + namespace) { + panic("failed to delete domain") + } + } else { + return ErrNamespaceNotFound(namespace) + } + } else { + return ErrDomainNotFound(name) + } + return nil +} + +/* Module functions */ + +func (rm *ResourceManager) GetModule(name, namespace string) (*spec.DGateModule, bool) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return rm.getModule(name, namespace) +} + +func (rm *ResourceManager) getModule(name, namespace string) (*spec.DGateModule, bool) { + if lk, ok := rm.modules.Find(name + "/" + namespace); ok { + return lk.Item().Read(), true + } + return nil, false +} + +// GetModules returns a list of all modules +func (rm *ResourceManager) GetModules() []*spec.DGateModule { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var modules []*spec.DGateModule + rm.modules.Each(func(_ string, lk *linker.Link[string, safe.Ref[spec.DGateModule]]) bool { + modules = append(modules, lk.Item().Read()) + return true + }) + return modules +} + +// GetRouteModules returns a list of all modules in a route +func (rm *ResourceManager) GetRouteModules(name, namespace string) ([]*spec.DGateModule, bool) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + route, ok := rm.getRoute(name, namespace) + if !ok { + return nil, false + } + var modules []*spec.DGateModule + if rtLk, ok := rm.routes.Find(route.Name + "/" + route.Namespace.Name); ok { + rtLk.Each("modules", func(_ string, lk linker.Linker[string]) { + mdLk := linker.NamedVertexWithVertex[string, safe.Ref[spec.DGateModule]](lk) + modules = append(modules, mdLk.Item().Read()) + }) + } + return modules, true +} + +// GetModulesByNamespace returns a list of all modules in a namespace +func (rm *ResourceManager) GetModulesByNamespace(namespace string) []*spec.DGateModule { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var modules []*spec.DGateModule + if nsLk, ok := rm.namespaces.Find(namespace); ok { + nsLk.Each("modules", func(_ string, lk linker.Linker[string]) { + mdLk := linker.NamedVertexWithVertex[string, safe.Ref[spec.DGateModule]](lk) + modules = append(modules, mdLk.Item().Read()) + }) + } + return modules +} + +func (rm *ResourceManager) AddModule(module *spec.Module) (*spec.DGateModule, error) { + rm.mutex.Lock() + defer rm.mutex.Unlock() + md, err := rm.transformModule(module) + if err != nil { + return nil, err + } + rw := safe.NewRef(md) + modLk := linker.NewNamedVertexWithValue(rw, "namespace", "routes") + if nsLk, ok := rm.namespaces.Find(module.NamespaceName); ok { + nsLk.LinkOneMany("modules", module.Name, modLk) + modLk.LinkOneOne("namespace", module.NamespaceName, nsLk) + rm.modules.Insert(module.Name+"/"+module.NamespaceName, modLk) + return rw.Read(), nil + } else { + return nil, ErrNamespaceNotFound(module.NamespaceName) + } +} + +func (rm *ResourceManager) transformModule(module *spec.Module) (*spec.DGateModule, error) { + if ns, ok := rm.getNamespace(module.NamespaceName); !ok { + return nil, ErrNamespaceNotFound(module.NamespaceName) + } else { + return spec.TransformModule(ns, module) + } +} + +func (rm *ResourceManager) RemoveModule(name, namespace string) error { + rm.mutex.Lock() + defer rm.mutex.Unlock() + if modLink, ok := rm.modules.Find(name + "/" + namespace); ok { + if modLink.Len("routes") > 0 { + return ErrCannotDeleteModule(name, "routes still linked") + } + if nsLk, ok := rm.namespaces.Find(namespace); !ok { + return ErrNamespaceNotFound(namespace) + } else { + nsLk.UnlinkOneMany("modules", name) + modLink.UnlinkOneOne("namespace") + } + if !rm.modules.Delete(name + "/" + namespace) { + panic("failed to delete module") + } + return nil + } else { + return ErrModuleNotFound(name) + } +} + +/* Collection functions */ + +func (rm *ResourceManager) GetCollection(name, namespace string) (*spec.DGateCollection, bool) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return getCollection(rm, name, namespace) +} + +func getCollection(rm *ResourceManager, name, namespace string) (*spec.DGateCollection, bool) { + if lk, ok := rm.collections.Find(name + "/" + namespace); ok { + return lk.Item().Read(), true + } + return nil, false +} + +func (rm *ResourceManager) GetCollectionsByNamespace(namespace string) []*spec.DGateCollection { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var collections []*spec.DGateCollection + if nsLk, ok := rm.namespaces.Find(namespace); ok { + nsLk.Each("collections", func(_ string, lk linker.Linker[string]) { + clLk := linker.NamedVertexWithVertex[string, safe.Ref[spec.DGateCollection]](lk) + collections = append(collections, clLk.Item().Read()) + }) + } + return collections +} + +// GetCollections returns a list of all collections +func (rm *ResourceManager) GetCollections() []*spec.DGateCollection { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var collections []*spec.DGateCollection + rm.collections.Each(func(_ string, lk *linker.Link[string, safe.Ref[spec.DGateCollection]]) bool { + collections = append(collections, lk.Item().Read()) + return true + }) + return collections +} + +func (rm *ResourceManager) AddCollection(collection *spec.Collection) (*spec.DGateCollection, error) { + rm.mutex.Lock() + defer rm.mutex.Unlock() + cl, err := rm.transformCollection(collection) + if err != nil { + return nil, err + } + rw := safe.NewRef(cl) + colLk := linker.NewNamedVertexWithValue(rw, "namespace") + if nsLk, ok := rm.namespaces.Find(collection.NamespaceName); ok { + nsLk.LinkOneMany("collections", collection.Name, colLk) + colLk.LinkOneOne("namespace", collection.NamespaceName, nsLk) + rm.collections.Insert(collection.Name+"/"+collection.NamespaceName, colLk) + return rw.Read(), nil + } else { + return nil, ErrNamespaceNotFound(collection.NamespaceName) + } +} + +func (rm *ResourceManager) transformCollection(collection *spec.Collection) (*spec.DGateCollection, error) { + if ns, ok := rm.getNamespace(collection.NamespaceName); !ok { + return nil, ErrNamespaceNotFound(collection.NamespaceName) + } else { + if mods, err := sliceutil.SliceMapperError(collection.Modules, func(modName string) (*spec.DGateModule, error) { + if mod, ok := rm.getModule(modName, collection.NamespaceName); ok { + return mod, nil + } + return nil, ErrModuleNotFound(collection.NamespaceName) + }); err != nil { + return nil, err + } else { + return spec.TransformCollection(ns, mods, collection), nil + } + } +} + +func (rm *ResourceManager) RemoveCollection(name, namespace string) error { + rm.mutex.Lock() + defer rm.mutex.Unlock() + if colLk, ok := rm.collections.Find(name + "/" + namespace); ok { + if nsLk, ok := rm.namespaces.Find(namespace); ok { + // unlink namespace to collection + nsLk.UnlinkOneMany("collections", name) + // unlink collection to namespace + colLk.UnlinkOneOne("namespace") + if !rm.collections.Delete(name + "/" + namespace) { + panic("failed to delete collection") + } + } else { + return ErrNamespaceNotFound(namespace) + } + } else { + return ErrCollectionNotFound(name) + } + return nil +} + +// MarshalJSON marshals the resource manager to json +func (rm *ResourceManager) MarshalJSON() ([]byte, error) { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return json.Marshal(map[string]interface{}{ + "namespaces": rm.namespaces, + "services": rm.services, + "domains": rm.domains, + "modules": rm.modules, + "routes": rm.routes, + "collections": rm.collections, + }) +} + +// UnmarshalJSON unmarshals the resource manager from json +func (rm *ResourceManager) UnmarshalJSON(data []byte) error { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + var obj map[string]json.RawMessage + if err := json.Unmarshal(data, &obj); err != nil { + return err + } + if collections, ok := obj["collections"]; ok { + if err := json.Unmarshal(collections, &rm.collections); err != nil { + return err + } + } + if routes, ok := obj["routes"]; ok { + if err := json.Unmarshal(routes, &rm.routes); err != nil { + return err + } + } + if modules, ok := obj["modules"]; ok { + if err := json.Unmarshal(modules, &rm.modules); err != nil { + return err + } + } + if domains, ok := obj["domains"]; ok { + if err := json.Unmarshal(domains, &rm.domains); err != nil { + return err + } + } + if services, ok := obj["services"]; ok { + if err := json.Unmarshal(services, &rm.services); err != nil { + return err + } + } + if namespaces, ok := obj["namespaces"]; ok { + if err := json.Unmarshal(namespaces, &rm.namespaces); err != nil { + return err + } + } + return nil +} + +func (rm *ResourceManager) Empty() bool { + rm.mutex.RLock() + defer rm.mutex.RUnlock() + return rm.namespaces.Empty() && + rm.services.Empty() && + rm.domains.Empty() && + rm.modules.Empty() && + rm.routes.Empty() && + rm.collections.Empty() + +} + +func ErrCollectionNotFound(name string) error { + return errors.New("collection not found: " + name) +} + +func ErrDomainNotFound(name string) error { + return errors.New("domain not found: " + name) +} + +func ErrNamespaceNotFound(name string) error { + return errors.New("namespace not found: " + name) +} + +func ErrServiceNotFound(name string) error { + return errors.New("service not found: " + name) +} + +func ErrModuleNotFound(name string) error { + return errors.New("module not found: " + name) +} + +func ErrRouteNotFound(name string) error { + return errors.New("route not found: " + name) +} + +func ErrCannotDeleteModule(name, reason string) error { + return errors.New("cannot delete module: " + name + ": " + reason) +} + +func ErrCannotDeleteService(name, reason string) error { + return errors.New("cannot delete service: " + name + ": " + reason) +} + +func ErrCannotDeleteNamespace(name, reason string) error { + return errors.New("cannot delete namespace: " + name + ": " + reason) +} + +func ErrCannotDeleteRoute(name, reason string) error { + return errors.New("cannot delete route: " + name + ": " + reason) +} + +func ErrCannotDeleteDomain(name, reason string) error { + return errors.New("cannot delete domain: " + name + ": " + reason) +} + +func ErrCannotDeleteCollection(name, reason string) error { + return errors.New("cannot delete collection: " + name + ": " + reason) +} diff --git a/pkg/resources/resource_manager_test.go b/pkg/resources/resource_manager_test.go new file mode 100644 index 0000000..125d929 --- /dev/null +++ b/pkg/resources/resource_manager_test.go @@ -0,0 +1,645 @@ +package resources_test + +import ( + "encoding/base64" + "strconv" + "testing" + + "github.com/dgate-io/dgate/pkg/resources" + "github.com/dgate-io/dgate/pkg/spec" + "github.com/stretchr/testify/assert" +) + +func TestResourceManager(t *testing.T) { + rm := resources.NewManager() + + rm.AddNamespace(&spec.Namespace{ + Name: "test", + Tags: []string{"test"}, + }) + + _, err := rm.AddService(&spec.Service{ + Name: "test", + URLs: []string{ + "http://localhost:8080", + }, + NamespaceName: "test", + Tags: []string{"test"}, + }) + assert.True(t, err == nil, err) + + _, err = rm.AddModule(&spec.Module{ + Name: "test", + Payload: base64.StdEncoding.EncodeToString( + []byte(`export const onRequest = (ctx, req, res) => { + res.send('Hello, World!'); + }`)), + NamespaceName: "test", + Tags: []string{"test"}, + }) + assert.True(t, err == nil, err) + + routeCount := 10 + for i := 0; i < routeCount; i++ { + _, err = rm.AddRoute(&spec.Route{ + Name: "test" + strconv.Itoa(i), + Paths: []string{"/", "/test"}, + Methods: []string{"GET", "PUT"}, + Modules: []string{"test"}, + ServiceName: "test", + NamespaceName: "test", + Tags: []string{"test"}, + }) + assert.True(t, err == nil, err) + } + + { + routes := rm.GetRoutesByNamespace("test") + if len(routes) != routeCount { + t.Errorf("Expected 1 route, got %d", len(routes)) + } + for i, route := range routes { + if route.Name != "test"+strconv.Itoa(i) { + t.Errorf("Expected route name 'test%d', got %s", i, route.Name) + } + } + } + + { + routeMap := rm.GetRouteNamespaceMap() + if len(routeMap) != 1 { + t.Errorf("Expected 1 route namespace, got %d", len(routeMap)) + } + routes, ok := routeMap["test"] + if !ok { + t.Error("Expected route namespace 'test', got none") + } + if len(routes) != routeCount { + t.Errorf("Expected 1 route, got %d", len(routes)) + } + for i, route := range routes { + if route.Name != "test"+strconv.Itoa(i) { + t.Errorf("Expected route name 'test%d', got %s", i, route.Name) + } + } + } +} + +func TestResourceManagerNamespaceScope(t *testing.T) { + rm := resources.NewManager() + + rm.AddNamespace(&spec.Namespace{ + Name: "test1", + Tags: []string{"test"}, + }) + rm.AddNamespace(&spec.Namespace{ + Name: "test2", + Tags: []string{"test"}, + }) + + _, err := rm.AddService(&spec.Service{ + Name: "test2", + URLs: []string{"http://localhost:8080"}, + NamespaceName: "test2", + Tags: []string{"test"}, + }) + assert.True(t, err == nil, err) + + _, err = rm.AddRoute(&spec.Route{ + Name: "test1", + Paths: []string{"/", "/test"}, + Methods: []string{"GET", "PUT"}, + ServiceName: "test2", + NamespaceName: "test1", + Tags: []string{"test"}, + }) + assert.EqualError(t, err, resources.ErrServiceNotFound("test2").Error()) + + if routes := rm.GetRoutesByNamespace("test"); len(routes) != 0 { + t.Errorf("Expected 1 route, got %d", len(routes)) + } + + if routeMap := rm.GetRouteNamespaceMap(); len(routeMap) != 0 { + t.Errorf("Expected 1 route namespace, got %d", len(routeMap)) + } +} + +func makeCommonResources( + t *testing.T, + rm *resources.ResourceManager, + nsid, id string, + deleteNamespace bool, +) func() { + t.Logf("Creating resources with nsid: %s, id: %s", nsid, id) + ns := rm.AddNamespace(&spec.Namespace{ + Name: "test_ns" + nsid, + Tags: []string{"test", nsid}, + }) + + svc, err := rm.AddService(&spec.Service{ + Name: "test_svc" + id, + URLs: []string{"http://localhost:8080"}, + NamespaceName: ns.Name, + Tags: []string{"test", id}, + }) + if !assert.True(t, err == nil, err) { + t.FailNow() + } + + mod, err := rm.AddModule(&spec.Module{ + Name: "test_mod" + id, + Payload: base64.StdEncoding.EncodeToString( + []byte(`export const onRequest = (ctx, req, res) => { + res.send('Hello, World!'); + }`)), + NamespaceName: ns.Name, + Tags: []string{"test", id}, + }) + if !assert.True(t, err == nil, err) { + t.FailNow() + } + + rt, err := rm.AddRoute(&spec.Route{ + Name: "test_rt" + id, + Paths: []string{"/"}, + Methods: []string{"GET"}, + ServiceName: svc.Name, + Modules: []string{mod.Name}, + NamespaceName: ns.Name, + Tags: []string{"test", id}, + }) + if !assert.True(t, err == nil, err) { + t.FailNow() + } + + dm, err := rm.AddDomain(&spec.Domain{ + Name: "test_dm" + id, + NamespaceName: ns.Name, + Tags: []string{"test", id}, + }) + if !assert.True(t, err == nil, err) { + t.FailNow() + } + + col, err := rm.AddCollection(&spec.Collection{ + Name: "test_col" + id, + NamespaceName: ns.Name, + Tags: []string{"test", id}, + }) + if !assert.True(t, err == nil, err) { + t.FailNow() + } + + return func() { + t.Logf("Removing resources with nsid: %s, id: %s", nsid, id) + err = rm.RemoveModule(mod.Name, ns.Name) + if assert.NotNil(t, err) { + expErr := resources.ErrCannotDeleteModule(mod.Name, "routes still linked") + assert.EqualError(t, expErr, err.Error()) + } else { + t.FailNow() + } + + err = rm.RemoveService(svc.Name, ns.Name) + if assert.NotNil(t, err) { + expErr := resources.ErrCannotDeleteService(svc.Name, "routes still linked") + assert.EqualError(t, err, expErr.Error()) + } else { + t.FailNow() + } + + if deleteNamespace { + err = rm.RemoveNamespace(ns.Name) + if assert.NotNil(t, err) { + expErr := resources.ErrCannotDeleteNamespace(ns.Name, "routes still linked") + assert.EqualError(t, err, expErr.Error()) + + } else { + t.FailNow() + } + } + + err = rm.RemoveRoute(rt.Name, ns.Name) + if assert.Nil(t, err) { + if deleteNamespace { + err = rm.RemoveNamespace(ns.Name) + assert.EqualError(t, err, resources.ErrCannotDeleteNamespace(ns.Name, "services still linked").Error()) + } + } else { + t.FailNow() + } + + err = rm.RemoveService(svc.Name, ns.Name) + if assert.Nil(t, err) { + if deleteNamespace { + err = rm.RemoveNamespace(ns.Name) + assert.EqualError(t, err, resources.ErrCannotDeleteNamespace(ns.Name, "modules still linked").Error()) + } + } else { + t.FailNow() + } + + err = rm.RemoveModule(mod.Name, ns.Name) + if assert.Nil(t, err) { + if deleteNamespace { + err = rm.RemoveNamespace(ns.Name) + assert.EqualError(t, err, resources.ErrCannotDeleteNamespace(ns.Name, "domains still linked").Error()) + } + } else { + t.FailNow() + } + + err = rm.RemoveDomain(dm.Name, ns.Name) + if assert.Nil(t, err) { + if deleteNamespace { + err = rm.RemoveNamespace(ns.Name) + assert.EqualError(t, err, resources.ErrCannotDeleteNamespace(ns.Name, "collections still linked").Error()) + } + } else { + t.FailNow() + } + + err = rm.RemoveCollection(col.Name, ns.Name) + if assert.Nil(t, err) { + if deleteNamespace { + err = rm.RemoveNamespace(ns.Name) + assert.Nil(t, err) + } + } else { + t.FailNow() + } + } +} + +func TestResourceManagerDependency_ForwardNamespaceClear(t *testing.T) { + rm := resources.NewManager() + makeCommonResources(t, rm, "1", "1", true)() + makeCommonResources(t, rm, "2", "1", true)() + makeCommonResources(t, rm, "3", "1", true)() + makeCommonResources(t, rm, "4", "1", true)() + makeCommonResources(t, rm, "5", "1", true)() + assert.True(t, rm.Empty(), "expected resources to be empty") +} + +func TestResourceManagerDependency_ForwardResourceClear(t *testing.T) { + rm := resources.NewManager() + func() { + defer makeCommonResources(t, rm, "1", "1", true)() + defer makeCommonResources(t, rm, "1", "2", false)() + defer makeCommonResources(t, rm, "1", "3", false)() + defer makeCommonResources(t, rm, "1", "4", false)() + defer makeCommonResources(t, rm, "1", "5", false)() + }() + assert.True(t, rm.Empty(), "expected resources to be empty") +} + +func TestResourceManagerDependency_BackwardsNamespaceClear(t *testing.T) { + rm := resources.NewManager() + func() { + defer makeCommonResources(t, rm, "1", "1", true)() + defer makeCommonResources(t, rm, "2", "1", true)() + defer makeCommonResources(t, rm, "3", "1", true)() + defer makeCommonResources(t, rm, "4", "1", true)() + defer makeCommonResources(t, rm, "5", "1", true)() + }() + assert.True(t, rm.Empty(), "expected resources to be empty") +} + +func TestResourceManagerDependency_BackwardsResourceClear(t *testing.T) { // flawed test: won't be able to delete the resource because of deps + rm := resources.NewManager() + func() { + defer makeCommonResources(t, rm, "1", "1", true)() + defer makeCommonResources(t, rm, "1", "2", false)() + defer makeCommonResources(t, rm, "1", "3", false)() + defer makeCommonResources(t, rm, "1", "4", false)() + defer makeCommonResources(t, rm, "1", "5", false)() + }() + assert.True(t, rm.Empty(), "expected resources to be empty") +} + +// TODO: Add dependency test to ensure child/parent +func TestResourceManagerDependency_(t *testing.T) { + rm := resources.NewManager() + + func() { + defer makeCommonResources(t, rm, "1", "1", true)() + defer makeCommonResources(t, rm, "1", "2", false)() + + _, ok := rm.GetRouteModules("test_rt1", "test_ns1") + assert.True(t, ok, "expected route to exist") + + routes := rm.GetRoutesByNamespace("test_ns1") + if assert.True(t, ok) { + assert.Equal(t, 2, len(routes)) + } + + services := rm.GetServicesByNamespace("test_ns1") + if assert.True(t, ok) { + assert.Equal(t, 2, len(services)) + } + + modules := rm.GetModulesByNamespace("test_ns1") + if assert.True(t, ok) { + assert.Equal(t, 2, len(modules)) + } + + collections := rm.GetCollectionsByNamespace("test_ns1") + if assert.True(t, ok) { + assert.Equal(t, 2, len(collections)) + } + + domains := rm.GetDomainsByNamespace("test_ns1") + if assert.True(t, ok) { + assert.Equal(t, 2, len(domains)) + } + }() + assert.True(t, rm.Empty(), "expected resources to be empty") +} + +func TestResourceManagerDependency__(t *testing.T) { + rm := resources.NewManager() + + func() { + defer makeCommonResources(t, rm, "1", "1", true)() + defer makeCommonResources(t, rm, "1", "2", false)() + + _, ok := rm.GetRouteModules("test_rt1", "test_ns1") + assert.True(t, ok, "expected route to exist") + + routeMap := rm.GetRouteNamespaceMap() + if assert.True(t, ok) { + assert.Equal(t, 1, len(routeMap)) + assert.Equal(t, 2, len(routeMap["test_ns1"])) + } + + if mod, ok := rm.GetRouteModules("test_rt1", "test_ns1"); assert.True(t, ok) { + assert.Equal(t, 1, len(mod)) + } + + if mod, ok := rm.GetRouteModules("test_rt2", "test_ns1"); assert.True(t, ok) { + assert.Equal(t, 1, len(mod)) + } + }() + assert.True(t, rm.Empty(), "expected resources to be empty") +} + +// TODO: AtomicityTest to check that the state hasn't changed, in the event of an error. + +func BenchmarkRM_ParallelRouteReading(b *testing.B) { + rm := resources.NewManager() + + rm.AddNamespace(&spec.Namespace{ + Name: "test", + Tags: []string{"test"}, + }) + + _, err := rm.AddService(&spec.Service{ + Name: "test", + URLs: []string{"http://localhost:8080"}, + NamespaceName: "test", + Tags: []string{"test"}, + }) + assert.True(b, err == nil, err) + + _, err = rm.AddModule(&spec.Module{ + Name: "test", + Payload: base64.StdEncoding.EncodeToString( + []byte(`export const onRequest = (ctx, req, res) => { + res.send('Hello, World!'); + }`)), + NamespaceName: "test", + Tags: []string{"test"}, + }) + assert.True(b, err == nil, err) + + rt, err := rm.AddRoute(&spec.Route{ + Name: "test1", + Paths: []string{"/", "/test"}, + Methods: []string{"GET", "PUT"}, + Modules: []string{"test"}, + ServiceName: "test", + NamespaceName: "test", + Tags: []string{"test"}, + }) + assert.True(b, err == nil, err) + b.SetParallelism(10) + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + route, ok := rm.GetRoute("test1", "test") + if assert.True(b, ok) { + assert.Equal(b, rt, route) + } + } + }) +} + +func BenchmarkRM_ParallelReadWrite(b *testing.B) { + rm := resources.NewManager() + + rm.AddNamespace(&spec.Namespace{ + Name: "test", + Tags: []string{"test"}, + }) + + _, err := rm.AddService(&spec.Service{ + Name: "test", + URLs: []string{"http://localhost:8080"}, + NamespaceName: "test", + Tags: []string{"test"}, + }) + if !assert.True(b, err == nil, err) { + b.FailNow() + } + + _, err = rm.AddModule(&spec.Module{ + Name: "test", + Payload: base64.StdEncoding.EncodeToString( + []byte(`export const onRequest = (ctx, req, res) => { + res.send('Hello, World!'); + }`)), + NamespaceName: "test", + Tags: []string{"test"}, + }) + if !assert.True(b, err == nil, err) { + b.FailNow() + } + + _, err = rm.AddRoute(&spec.Route{ + Name: "test1", + Paths: []string{"/"}, + Methods: []string{"GET"}, + Modules: []string{"test"}, + ServiceName: "test", + NamespaceName: "test", + }) + if !assert.True(b, err == nil, err) { + b.FailNow() + } + + b.RunParallel(func(p *testing.PB) { + for p.Next() { + _, err := rm.AddRoute(&spec.Route{ + Name: "test1", + Paths: []string{"/"}, + Methods: []string{"GET"}, + Modules: []string{"test"}, + ServiceName: "test", + NamespaceName: "test", + }) + if err != nil { + b.FailNow() + } + } + }) + + b.RunParallel(func(p *testing.PB) { + for p.Next() { + if _, ok := rm.GetRoute("test1", "test"); !ok { + b.FailNow() + } + } + }) +} + +func BenchmarkRM_ReadingWriting(b *testing.B) { + rm := resources.NewManager() + routeSize := 100 + modSvcSize := 10 + nsSize := 10 + + for i := 0; i < nsSize; i++ { + nsName := "test" + strconv.Itoa(i) + rm.AddNamespace(&spec.Namespace{ + Name: nsName, + Tags: []string{"test"}, + }) + for j := 0; j < modSvcSize; j++ { + svcModName := "test" + strconv.Itoa(j) + _, err := rm.AddService(&spec.Service{ + Name: svcModName, + URLs: []string{"http://localhost:8080"}, + NamespaceName: nsName, + Tags: []string{"test"}, + }) + assert.Nil(b, err) + + _, err = rm.AddModule(&spec.Module{ + Name: svcModName, + Payload: base64.StdEncoding.EncodeToString( + []byte(``)), + NamespaceName: nsName, + Tags: []string{"test"}, + }) + assert.Nil(b, err) + + for k := 0; k < routeSize; k++ { + _, err = rm.AddRoute(&spec.Route{ + Name: "test" + strconv.Itoa(j*modSvcSize+k), + Paths: []string{"/", "/test"}, + Methods: []string{"GET", "PUT"}, + Modules: []string{svcModName}, + ServiceName: svcModName, + NamespaceName: nsName, + Tags: []string{"test"}, + }) + assert.Nil(b, err) + } + } + } + b.ResetTimer() + + b.Run("GetRoute", func(b *testing.B) { + b.RunParallel(func(pb *testing.PB) { + for i := 0; pb.Next(); i++ { + _, ok := rm.GetRoute( + "test"+strconv.Itoa(i%routeSize), + "test"+strconv.Itoa(i%nsSize), + ) + if !ok { + b.FailNow() + } + } + }) + }) + + b.Run("GetRouteModules", func(b *testing.B) { + b.RunParallel(func(pb *testing.PB) { + for i := 0; pb.Next(); i++ { + _, ok := rm.GetRouteModules( + "test"+strconv.Itoa(i%routeSize), + "test"+strconv.Itoa(i%nsSize), + ) + if !assert.True(b, ok) { + b.FailNow() + } + } + }) + }) + + b.Run("AddRoute", func(b *testing.B) { + b.RunParallel(func(pb *testing.PB) { + rt := &spec.Route{ + Paths: []string{"/"}, + Methods: []string{"GET"}, + Modules: []string{""}, + Tags: []string{"test"}, + } + for i := 0; pb.Next(); i++ { + rt.Name = "test" + strconv.Itoa(i%routeSize) + rt.Modules[0] = "test" + strconv.Itoa(i%modSvcSize) + rt.ServiceName = "test" + strconv.Itoa(i%modSvcSize) + rt.NamespaceName = "test" + strconv.Itoa(i%nsSize) + _, err := rm.AddRoute(rt) + if !assert.True(b, err == nil, err) { + b.FailNow() + } + } + }) + }) + + b.Run("AddModule", func(b *testing.B) { + b.RunParallel(func(pb *testing.PB) { + for i := 0; pb.Next(); i++ { + _, err := rm.AddModule(&spec.Module{ + Name: "test" + strconv.Itoa(i%modSvcSize), + Payload: base64.StdEncoding.EncodeToString([]byte(``)), + NamespaceName: "test" + strconv.Itoa(i%nsSize), + Tags: []string{"test"}, + }) + if !assert.True(b, err == nil, err) { + b.FailNow() + } + } + }) + }) + + b.Run("AddService", func(b *testing.B) { + b.RunParallel(func(pb *testing.PB) { + for i := 0; pb.Next(); i++ { + _, err := rm.AddService(&spec.Service{ + Name: "test" + strconv.Itoa(i%modSvcSize), + NamespaceName: "test" + strconv.Itoa(i%nsSize), + URLs: []string{"http://localhost:8080"}, + Tags: []string{"test"}, + }) + if !assert.True(b, err == nil, err) { + b.FailNow() + } + } + }) + }) + + b.Run("AddNamespace", func(b *testing.B) { + b.RunParallel(func(pb *testing.PB) { + for i := 0; pb.Next(); i++ { + ns := rm.AddNamespace(&spec.Namespace{ + Name: "test" + strconv.Itoa(i%100), + Tags: []string{"test"}, + }) + if !assert.True(b, ns != nil) { + b.FailNow() + } + } + }) + }) +} diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go new file mode 100644 index 0000000..716540d --- /dev/null +++ b/pkg/scheduler/scheduler.go @@ -0,0 +1,254 @@ +package scheduler + +import ( + "context" + "errors" + "sync" + "time" + + "github.com/dgate-io/dgate/pkg/util/heap" + "github.com/rs/zerolog" +) + +type ( + TaskFunc func(context.Context) + priorityQueue = *heap.Heap[int64, *TaskDefinition] +) + +type TaskOptions struct { + // Interval is the time between each task run. + // Timeout OR Interval must be set. + Interval time.Duration + // Timeout is the maximum time the task is allowed to run + // before it is forcefully stopped. + // Timeout OR Interval must be set. + Timeout time.Duration + // Overwrite indicates whether to overwrite the task if it already exists. + // If set to false, an error will be returned if the task already exists. + // If set to true, the task will be overwritten with the new task and any existing timers will be reset. + Overwrite bool + // TaskFunc is the function to run when the task is scheduled. + TaskFunc TaskFunc +} + +type Scheduler interface { + Start() error + Stop() + Running() bool + GetTask(string) (TaskDefinition, bool) + ScheduleTask(string, TaskOptions) error + StopTask(string) error + TotalTasks() int +} + +type scheduler struct { + opts Options + logger *zerolog.Logger + tasks map[string]*TaskDefinition + pendingJobs priorityQueue + mutex *sync.RWMutex + running bool + end chan struct{} +} + +type TaskDefinition struct { + Name string + Func TaskFunc + interval time.Duration + ctx context.Context + cancel context.CancelFunc +} + +var ( + ErrTaskAlreadyExists = errors.New("task already exists") + ErrTaskNotFound = errors.New("task not found") + ErrIntervalTimeoutBothSet = errors.New("only one of Interval or Timeout must be set") + ErrIntervalTimeoutNoneSet = errors.New("either Interval or Timeout must be set") + ErrTaskFuncNotSet = errors.New("TaskFunc must be set") + ErrIntervalDurationTooShort = errors.New("interval duration must be greater than 1 second") + ErrTimeoutDurationTooShort = errors.New("timeout duration must be greater than 1 second") + ErrSchedulerRunning = errors.New("scheduler is already running") + ErrSchedulerNotRunning = errors.New("scheduler is not running") +) + +type Options struct { + Interval time.Duration + Logger *zerolog.Logger + AutoRun bool +} + +func New(opts Options) Scheduler { + if opts.Interval <= 0 { + opts.Interval = time.Second + } + return &scheduler{ + opts: opts, + logger: opts.Logger, + mutex: &sync.RWMutex{}, + end: make(chan struct{}, 1), + pendingJobs: heap.NewHeap[int64, *TaskDefinition](heap.MinHeapType), + tasks: make(map[string]*TaskDefinition), + } +} + +func (s *scheduler) Start() error { + s.mutex.Lock() + defer s.mutex.Unlock() + if s.running { + return ErrSchedulerRunning + } + s.start() + return nil +} + +func (s *scheduler) start() { + s.running = true + // replace the end channel to allow for multiple starts + s.end = make(chan struct{}, 1) + go func() { + ticker := time.NewTicker(s.opts.Interval) + defer ticker.Stop() + for range ticker.C { + if func() (done bool) { + s.mutex.Lock() + defer s.mutex.Unlock() + START: + now := time.Now() + taskDefTime, taskDef, ok := s.pendingJobs.Peak() + if !ok { + return + } + select { + case <-s.end: + s.running = false + done = true + return + case <-taskDef.ctx.Done(): + delete(s.tasks, taskDef.Name) + s.pendingJobs.Pop() + goto START + default: + tdt := time.UnixMicro(taskDefTime) + if !tdt.After(now) { + // Run the task + s.pendingJobs.Pop() + s.executeTask(tdt, taskDef) + // Go to the start of the loop to check if there are any more tasks + goto START + } + } + return + }() { + break + } + } + }() +} + +func (s *scheduler) Running() bool { + s.mutex.RLock() + defer s.mutex.RUnlock() + return s.running +} + +func (s *scheduler) executeTask(tdt time.Time, taskDef *TaskDefinition) { + defer func() { + if taskDef.interval <= 0 { + taskDef.cancel() + delete(s.tasks, taskDef.Name) + } else { + µs := tdt.Add(taskDef.interval).UnixMicro() + s.pendingJobs.Push(µs, taskDef) + } + if r := recover(); r != nil { + if s.logger != nil { + s.logger.Error().Msgf("panic occurred while executing task %s: %v", taskDef.Name, r) + } + } + }() + taskDef.Func(taskDef.ctx) +} + +func (s *scheduler) Stop() { + s.mutex.Lock() + defer s.mutex.Unlock() + close(s.end) +} + +func (s *scheduler) GetTask(taskId string) (TaskDefinition, bool) { + s.mutex.RLock() + defer s.mutex.RUnlock() + td, ok := s.tasks[taskId] + return *td, ok +} + +func (s *scheduler) ScheduleTask(name string, opts TaskOptions) error { + s.mutex.Lock() + defer s.mutex.Unlock() + + if !s.running { + if !s.opts.AutoRun { + return ErrSchedulerNotRunning + } + s.start() + } + + if _, ok := s.tasks[name]; ok { + if !opts.Overwrite { + return ErrTaskAlreadyExists + } else { + s.stopTask(name) + } + } + + if opts.Interval == 0 && opts.Timeout == 0 { + return ErrIntervalTimeoutNoneSet + } else if opts.Interval != 0 && opts.Timeout != 0 { + return ErrIntervalTimeoutBothSet + } else if opts.Interval > 0 && opts.Interval < s.opts.Interval { + return ErrIntervalDurationTooShort + } else if opts.Timeout > 0 && opts.Timeout < s.opts.Interval { + return ErrTimeoutDurationTooShort + } + + if opts.TaskFunc == nil { + return ErrTaskFuncNotSet + } + + ctx, cancel := context.WithCancel(context.Background()) + s.tasks[name] = &TaskDefinition{ + Name: name, + Func: opts.TaskFunc, + ctx: ctx, + cancel: cancel, + interval: opts.Interval, + } + µs := time.Now().Add(opts.Interval).UnixMicro() + if opts.Timeout > 0 { + µs = time.Now().Add(opts.Timeout).UnixMicro() + } + s.pendingJobs.Push(µs, s.tasks[name]) + return nil +} + +func (s *scheduler) StopTask(name string) error { + s.mutex.Lock() + defer s.mutex.Unlock() + return s.stopTask(name) +} + +func (s *scheduler) stopTask(name string) error { + if taskDef, ok := s.tasks[name]; !ok { + return ErrTaskNotFound + } else { + taskDef.cancel() + } + delete(s.tasks, name) + return nil +} + +func (s *scheduler) TotalTasks() int { + s.mutex.RLock() + defer s.mutex.RUnlock() + return len(s.tasks) +} diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go new file mode 100644 index 0000000..e9f2e45 --- /dev/null +++ b/pkg/scheduler/scheduler_test.go @@ -0,0 +1,156 @@ +package scheduler_test + +import ( + "context" + "strconv" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/dgate-io/dgate/pkg/scheduler" + "github.com/stretchr/testify/assert" +) + +func TestScheduleTask_Timeout(t *testing.T) { + wg := sync.WaitGroup{} + exeCount := atomic.Int32{} + sch := scheduler.New(scheduler.Options{ + Interval: time.Millisecond * 20, + AutoRun: true, + }) + + for i := 0; i < 10; i++ { + wg.Add(1) + err := sch.ScheduleTask(strconv.Itoa(i), scheduler.TaskOptions{ + Timeout: time.Millisecond * 200, + TaskFunc: func(_ context.Context) { + exeCount.Add(1) + wg.Done() + }, + }) + if err != nil { + t.Fail() + } + } + + assert.Equal(t, 0, int(exeCount.Load())) + assert.Equal(t, 10, sch.TotalTasks()) + wg.Wait() + assert.Equal(t, 10, int(exeCount.Load())) + assert.Equal(t, 0, sch.TotalTasks()) +} + +func TestScheduleTask_Interval(t *testing.T) { + exeCount := atomic.Int32{} + sch := scheduler.New(scheduler.Options{ + Interval: time.Millisecond * 5, + AutoRun: true, + }) + for i := 0; i < 10; i++ { + err := sch.ScheduleTask(strconv.Itoa(i), scheduler.TaskOptions{ + Interval: time.Millisecond * 100, + TaskFunc: func(_ context.Context) { exeCount.Add(1) }, + }) + if err != nil { + t.Fail() + } + assert.Equal(t, i+1, sch.TotalTasks()) + } + assert.Equal(t, 10, sch.TotalTasks()) + + time.Sleep(time.Millisecond * 105) + assert.Equal(t, 10, int(exeCount.Load())) + + time.Sleep(time.Millisecond * 105) + assert.Equal(t, 20, int(exeCount.Load())) + + time.Sleep(time.Millisecond * 105) + assert.Equal(t, 30, int(exeCount.Load())) + + for i := 0; i < 10; i++ { + assert.Equal(t, 10-i, sch.TotalTasks()) + err := sch.StopTask(strconv.Itoa(i)) + if err != nil { + t.Fail() + } + } + + time.Sleep(time.Millisecond * 105) + assert.Equal(t, 0, sch.TotalTasks()) + assert.Equal(t, 30, int(exeCount.Load())) +} + +func TestScheduleTask_Overwrite(t *testing.T) { + sch := scheduler.New(scheduler.Options{ + Interval: time.Millisecond * 50, + AutoRun: true, + }) + test1Flag := atomic.Bool{} + test2Flag := atomic.Bool{} + // ensure that test1Flag is not set + err := sch.ScheduleTask("task1", scheduler.TaskOptions{ + Timeout: time.Millisecond * 50, + TaskFunc: func(_ context.Context) { + test1Flag.Store(true) + }, + }) + assert.Nil(t, err) + + // ensure that ScheduleTask fails unless Overwrite is set + err = sch.ScheduleTask("task1", scheduler.TaskOptions{}) + assert.ErrorIs(t, err, scheduler.ErrTaskAlreadyExists) + + // ensure that test2Flag is set + err = sch.ScheduleTask("task1", scheduler.TaskOptions{ + Timeout: time.Millisecond * 50, + TaskFunc: func(_ context.Context) { + test2Flag.Store(true) + }, + Overwrite: true, + }) + assert.Nil(t, err) + time.Sleep(time.Millisecond * 100) + assert.False(t, test1Flag.Load()) + assert.True(t, test2Flag.Load()) +} + +func TestScheduleTask_TimeoutIntervalFail(t *testing.T) { + sch := scheduler.New(scheduler.Options{ + Interval: time.Millisecond * 10, + AutoRun: true, + }) + err := sch.ScheduleTask("task1", scheduler.TaskOptions{ + Timeout: time.Millisecond * 10, + Interval: time.Millisecond * 10, + }) + assert.ErrorIs(t, err, scheduler.ErrIntervalTimeoutBothSet) + + err = sch.ScheduleTask("task1", scheduler.TaskOptions{}) + assert.ErrorIs(t, err, scheduler.ErrIntervalTimeoutNoneSet) + + err = sch.ScheduleTask("task1", scheduler.TaskOptions{ + Timeout: time.Millisecond * 10, + }) + assert.ErrorIs(t, err, scheduler.ErrTaskFuncNotSet) +} + +func TestStopTask(t *testing.T) { + sch := scheduler.New(scheduler.Options{}) + + err := sch.ScheduleTask("task1", scheduler.TaskOptions{}) + assert.ErrorIs(t, err, scheduler.ErrSchedulerNotRunning) + + assert.Nil(t, sch.Start()) + + err = sch.ScheduleTask("task1", scheduler.TaskOptions{ + Timeout: time.Second, TaskFunc: func(_ context.Context) {}, + }) + assert.Nil(t, err) + + err = sch.StopTask("task1") + assert.Nil(t, err) + + err = sch.StopTask("task1") + assert.ErrorIs(t, err, scheduler.ErrTaskNotFound) +} diff --git a/pkg/spec/change_log.go b/pkg/spec/change_log.go new file mode 100644 index 0000000..d54409d --- /dev/null +++ b/pkg/spec/change_log.go @@ -0,0 +1,162 @@ +package spec + +import ( + "strconv" + "strings" + "time" +) + +type ChangeLog struct { + ID string `json:"id"` + Cmd Command `json:"cmd"` + Name string `json:"name"` + Namespace string `json:"namespace"` + Item any `json:"item"` + Version int `json:"version"` + errChan chan error +} + +func NewChangeLog(item Named, namespace string, cmd Command) *ChangeLog { + if item == nil { + panic("item cannot be nil") + } + if namespace == "" { + panic("namespace cannot be empty") + } + if cmd.String() == "" { + panic("cmd cannot be empty") + } + return &ChangeLog{ + Version: 1, + ID: strconv.FormatInt(time.Now().UnixNano(), 36), + Cmd: cmd, + Item: item, + Name: item.GetName(), + Namespace: namespace, + } +} + +func (cl *ChangeLog) SetErrorChan(errChan chan error) { + cl.errChan = errChan +} + +func (cl *ChangeLog) PushError(err error) { + if cl.errChan != nil { + cl.errChan <- err + } +} + +type Command string + +type Action string +type Resource string + +const ( + Add Action = "add" + Delete Action = "delete" + + Routes Resource = "route" + Services Resource = "service" + Namespaces Resource = "namespace" + Modules Resource = "module" + Domains Resource = "domain" + Collections Resource = "collection" + Documents Resource = "document" +) + +var ( + AddRouteCommand Command = newCommand(Add, Routes) + AddServiceCommand Command = newCommand(Add, Services) + AddNamespaceCommand Command = newCommand(Add, Namespaces) + AddModuleCommand Command = newCommand(Add, Modules) + AddDomainCommand Command = newCommand(Add, Domains) + AddCollectionCommand Command = newCommand(Add, Collections) + AddDocumentCommand Command = newCommand(Add, Documents) + DeleteRouteCommand Command = newCommand(Delete, Routes) + DeleteServiceCommand Command = newCommand(Delete, Services) + DeleteNamespaceCommand Command = newCommand(Delete, Namespaces) + DeleteModuleCommand Command = newCommand(Delete, Modules) + DeleteDomainCommand Command = newCommand(Delete, Domains) + DeleteCollectionCommand Command = newCommand(Delete, Collections) + DeleteDocumentCommand Command = newCommand(Delete, Documents) + NoopCommand Command = Command("noop") +) + +func newCommand(action Action, resource Resource) Command { + return Command(action.String() + "_" + resource.String()) +} + +func (act Action) String() string { + return string(act) +} + +func (rt Resource) String() string { + return string(rt) +} + +func (clc Command) String() string { + if clc.IsNoop() { + return "noop" + } + return string(clc) +} + +func (clc Command) IsNoop() bool { + return string(clc) == "noop" +} + +func (resource1 Resource) IsRelatedTo(resource2 Resource) bool { + if resource1 == resource2 || resource1 == Namespaces || resource2 == Namespaces { + return true + } + switch resource1 { + case Routes: + return resource2 == Services || resource2 == Modules + case Services: + return resource2 == Routes + case Modules: + return resource2 == Namespaces + case Collections: + return resource2 == Documents + case Documents: + return resource2 == Collections + default: + return false + } +} + +func (clc Command) Action() Action { + if strings.HasPrefix(string(clc), "add_") { + return Add + } else if strings.HasPrefix(string(clc), "delete_") { + return Delete + } else if clc.IsNoop() { + return "noop" + } + panic("change log: invalid command") +} + +func (clc Command) Resource() Resource { + if clc.IsNoop() { + return "noop" + } + cmdString := string(clc) + switch { + case strings.HasSuffix(cmdString, "_route"): + return Routes + case strings.HasSuffix(cmdString, "_service"): + return Services + case strings.HasSuffix(cmdString, "_namespace"): + return Namespaces + case strings.HasSuffix(cmdString, "_module"): + return Modules + case strings.HasSuffix(cmdString, "_domain"): + return Domains + case strings.HasSuffix(cmdString, "_collection"): + return Collections + case strings.HasSuffix(cmdString, "_document"): + return Documents + default: + panic("change log: invalid command") + } +} diff --git a/pkg/spec/resources.go b/pkg/spec/resources.go new file mode 100644 index 0000000..8615c43 --- /dev/null +++ b/pkg/spec/resources.go @@ -0,0 +1,167 @@ +package spec + +import ( + "crypto/tls" + "errors" + "net/url" + "time" + + "github.com/santhosh-tekuri/jsonschema/v5" +) + +type Name string + +type Named interface { + GetName() string +} + +type DGateRoute struct { + Name string `json:"name"` + Paths []string `json:"paths"` + Methods []string `json:"methods"` + StripPath bool `json:"stripPath"` + PreserveHost bool `json:"preserveHost"` + Service *DGateService `json:"service"` + Namespace *DGateNamespace `json:"namespace"` + Modules []*DGateModule `json:"modules"` + Tags []string `json:"tags,omitempty"` +} + +func (r *DGateRoute) GetName() string { + return r.Name +} + +type DGateService struct { + Name string `json:"name"` + URLs []*url.URL `json:"urls"` + Tags []string `json:"tags,omitempty"` + Namespace *DGateNamespace `json:"namespace"` + + DisableQueryParams bool `json:"disableQueryParams,omitempty"` + Retries int `json:"retries,omitempty"` + RetryTimeout time.Duration `json:"retryTimeout,omitempty"` + ConnectTimeout time.Duration `json:"connectTimeout,omitempty"` + RequestTimeout time.Duration `json:"requestTimeout,omitempty"` + TLSSkipVerify bool `json:"tlsSkipVerify,omitempty"` + HTTP2Only bool `json:"http2_only,omitempty"` + HideDGateHeaders bool `json:"hideDGateHeaders,omitempty"` +} + +func (s *DGateService) GetName() string { + return s.Name +} + +type DGateNamespace struct { + Name string `json:"name"` + Tags []string `json:"tags,omitempty"` +} + +func (ns *DGateNamespace) GetName() string { + return ns.Name +} + +type DGateDomain struct { + Name string `json:"name"` + Namespace *DGateNamespace `json:"namespace"` + Patterns []string `json:"pattern"` + TLSCert *tls.Certificate `json:"tls_config"` + Priority uint `json:"priority"` + Cert string `json:"cert"` + Key string `json:"key"` + Tags []string `json:"tags,omitempty"` +} + +var DefaultNamespace = &Namespace{ + Name: "default", + Tags: []string{"default"}, +} + +type ModuleType string + +const ( + ModuleTypeJavascript ModuleType = "javascript" + ModuleTypeTypescript ModuleType = "typescript" + // ModuleTypeWasm ModuleType = "wasm" +) + +func (m ModuleType) Valid() bool { + switch m { + case ModuleTypeJavascript, ModuleTypeTypescript: + return true + default: + return false + } +} + +func (m ModuleType) String() string { + return string(m) +} + +type DGateModule struct { + Name string `json:"name"` + Namespace *DGateNamespace `json:"namespace"` + Payload string `json:"payload"` + Type ModuleType `json:"module_type"` + Permissions []string `json:"permissions,omitempty"` + Tags []string `json:"tags,omitempty"` +} + +func (m *DGateModule) GetName() string { + return m.Name +} + +type DGateCollection struct { + Name string `json:"name"` + Namespace *DGateNamespace `json:"namespace"` + Schema *jsonschema.Schema `json:"schema"` + SchemaPayload string `json:"schema_payload"` + Type CollectionType `json:"type"` + Visibility CollectionVisibility `json:"visibility"` + Modules []*DGateModule `json:"modules"` + Tags []string `json:"tags,omitempty"` +} + +func (n *DGateCollection) GetName() string { + return n.Name +} + +type DGateDocument struct { + ID string `json:"id"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + Namespace *DGateNamespace `json:"namespace"` + Collection *DGateCollection `json:"collection"` + Data string `json:"data"` +} + +func (n *DGateDocument) GetName() string { + return n.ID +} + +func ErrNamespaceNotFound(ns string) error { + return errors.New("namespace not found: " + ns) +} + +func ErrCollectionNotFound(col string) error { + return errors.New("collection not found: " + col) +} + +func ErrDocumentNotFound(doc string) error { + return errors.New("document not found: " + doc) +} + +func ErrModuleNotFound(mod string) error { + return errors.New("module not found: " + mod) +} + +func ErrServiceNotFound(svc string) error { + return errors.New("service not found: " + svc) +} + +func ErrRouteNotFound(route string) error { + return errors.New("route not found: " + route) +} + +func ErrDomainNotFound(domain string) error { + return errors.New("domain not found: " + domain) +} diff --git a/pkg/spec/resources_ext.go b/pkg/spec/resources_ext.go new file mode 100644 index 0000000..d651307 --- /dev/null +++ b/pkg/spec/resources_ext.go @@ -0,0 +1,143 @@ +package spec + +import ( + "encoding/json" + "time" +) + +type Namespace struct { + Name string `json:"name" koanf:"name"` + Tags []string `json:"tags,omitempty" koanf:"tags"` +} + +func (n *Namespace) GetName() string { + return n.Name +} + +type Service struct { + Name string `json:"name" koanf:"name"` + URLs []string `json:"urls" koanf:"urls"` + NamespaceName string `json:"namespace" koanf:"namespace"` + Tags []string `json:"tags,omitempty" koanf:"tags"` + + Retries *int `json:"retries" koanf:"retries"` + RetryTimeout *time.Duration `json:"retryTimeout" koanf:"retryTimeout"` + ConnectTimeout *time.Duration `json:"connectTimeout" koanf:"connectTimeout"` + RequestTimeout *time.Duration `json:"requestTimeout" koanf:"requestTimeout"` + TLSSkipVerify *bool `json:"tlsSkipVerify" koanf:"tlsSkipVerify"` + HTTP2Only *bool `json:"http2Only" koanf:"http2Only"` + HideDGateHeaders *bool `json:"hideDGateHeaders" koanf:"hideDGateHeaders"` + DisableQueryParams *bool `json:"disableQueryParams" koanf:"disableQueryParams"` +} + +func (s *Service) GetName() string { + return s.Name +} + +type Route struct { + Name string `json:"name" koanf:"name"` + Paths []string `json:"paths" koanf:"paths"` + Methods []string `json:"methods" koanf:"methods"` + Schemes []string `json:"schemes" koanf:"schemes"` + PreserveHost bool `json:"preserveHost" koanf:"preserveHost"` + StripPath bool `json:"stripPath" koanf:"stripPath"` + ServiceName string `json:"service" koanf:"service"` + NamespaceName string `json:"namespace,omitempty" koanf:"namespace"` + Modules []string `json:"modules,omitempty" koanf:"modules"` + Tags []string `json:"tags,omitempty" koanf:"tags"` +} + +func (m *Route) GetName() string { + return m.Name +} + +type Module struct { + Name string `json:"name" koanf:"name"` + NamespaceName string `json:"namespace" koanf:"namespace"` + Payload string `json:"payload" koanf:"payload"` + Type ModuleType `json:"moduleType,omitempty" koanf:"moduleType"` + Permissions []string `json:"permissions,omitempty" koanf:"permissions"` + Tags []string `json:"tags,omitempty" koanf:"tags"` +} + +func (m *Module) GetName() string { + return m.Name +} + +type Domain struct { + Name string `json:"name" koanf:"name"` + NamespaceName string `json:"namespace" koanf:"namespace"` + Patterns []string `json:"patterns" koanf:"patterns"` + Priority uint `json:"priority" koanf:"priority"` + Cert string `json:"cert" koanf:"cert"` + Key string `json:"key" koanf:"key"` + Tags []string `json:"tags,omitempty" koanf:"tags"` +} + +func (n *Domain) GetName() string { + return n.Name +} + +type Collection struct { + Name string `json:"name" koanf:"name"` + NamespaceName string `json:"namespace" koanf:"namespace"` + Schema any `json:"schema" koanf:"schema"` + Type CollectionType `json:"type" koanf:"type"` + Visibility CollectionVisibility `json:"visibility" koanf:"visibility"` + Modules []string `json:"modules,omitempty" koanf:"modules"` + Tags []string `json:"tags,omitempty" koanf:"tags"` +} + +type CollectionType string + +const ( + CollectionTypeDocument CollectionType = "document" + CollectionTypeFetcher CollectionType = "fetcher" +) + +type CollectionVisibility string + +const ( + CollectionVisibilityPublic CollectionVisibility = "public" + CollectionVisibilityPrivate CollectionVisibility = "private" +) + +func (n *Collection) GetName() string { + return n.Name +} + +type Document struct { + ID string `json:"id"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + NamespaceName string `json:"namespace"` + CollectionName string `json:"collection"` + Data any `json:"data"` +} + +type RFC3339Time time.Time + +func (t RFC3339Time) MarshalJSON() ([]byte, error) { + return json.Marshal(time.Time(t).Format(time.RFC3339)) +} + +func (t *RFC3339Time) UnmarshalJSON(data []byte) error { + var str string + if err := json.Unmarshal(data, &str); err != nil { + return err + } + if str == "" { + return nil + } + parsed, err := time.Parse(time.RFC3339, str) + if err != nil { + return err + } + + *t = RFC3339Time(parsed) + return nil +} + +func (n *Document) GetName() string { + return n.ID +} diff --git a/pkg/spec/response_writer_tracker.go b/pkg/spec/response_writer_tracker.go new file mode 100644 index 0000000..2cb622a --- /dev/null +++ b/pkg/spec/response_writer_tracker.go @@ -0,0 +1,62 @@ +package spec + +import ( + "net/http" +) + +type ResponseWriterTracker interface { + http.ResponseWriter + Status() int + HeadersSent() bool + BytesWritten() int64 +} + +type rwTracker struct { + rw http.ResponseWriter + status int + bytesWritten int64 +} + +var _ ResponseWriterTracker = (*rwTracker)(nil) + +func NewResponseWriterTracker(rw http.ResponseWriter) ResponseWriterTracker { + if rwt, ok := rw.(ResponseWriterTracker); ok { + return rwt + } + return &rwTracker{ + rw: rw, + } +} + +func (t *rwTracker) Header() http.Header { + // if t.HeadersSent() { + // panic("headers already sent") + // } + return t.rw.Header() +} + +func (t *rwTracker) Write(b []byte) (int, error) { + n, err := t.rw.Write(b) + t.bytesWritten += int64(n) + return n, err +} + +func (t *rwTracker) WriteHeader(statusCode int) { + if statusCode == 0 { + panic("rwTracker.WriteHeader: statusCode cannot be 0") + } + t.status = statusCode + t.rw.WriteHeader(statusCode) +} + +func (t *rwTracker) Status() int { + return t.status +} + +func (t *rwTracker) HeadersSent() bool { + return t.status != 0 +} + +func (t *rwTracker) BytesWritten() int64 { + return t.bytesWritten +} diff --git a/pkg/spec/transformers.go b/pkg/spec/transformers.go new file mode 100644 index 0000000..f1a0144 --- /dev/null +++ b/pkg/spec/transformers.go @@ -0,0 +1,353 @@ +package spec + +import ( + "encoding/base64" + "encoding/json" + "net/url" + + "github.com/dgate-io/dgate/pkg/util/sliceutil" + "github.com/santhosh-tekuri/jsonschema/v5" +) + +func TransformDGateRoutes(routes ...*DGateRoute) []*Route { + rts := make([]*Route, len(routes)) + for i, r := range routes { + rts[i] = TransformDGateRoute(r) + } + return rts +} + +func TransformDGateRoute(r *DGateRoute) *Route { + svcName := "" + if r.Service != nil { + svcName = r.Service.Name + } + if r.Namespace == nil { + panic("route namespace is nil") + } + return &Route{ + Name: r.Name, + Paths: r.Paths, + Methods: r.Methods, + PreserveHost: r.PreserveHost, + StripPath: r.StripPath, + ServiceName: svcName, + NamespaceName: r.Namespace.Name, + Modules: sliceutil.SliceMapper(r.Modules, func(m *DGateModule) string { return m.Name }), + Tags: r.Tags, + } +} + +func TransformDGateModules(modules ...*DGateModule) []*Module { + mods := make([]*Module, len(modules)) + for i, m := range modules { + mods[i] = TransformDGateModule(m) + } + return mods +} + +func TransformDGateModule(m *DGateModule) *Module { + payload := "" + if m.Payload != "" { + payload = base64.StdEncoding.EncodeToString([]byte(m.Payload)) + } + return &Module{ + Name: m.Name, + Payload: payload, + NamespaceName: m.Namespace.Name, + Tags: m.Tags, + } +} + +func TransformDGateServices(services ...*DGateService) []*Service { + svcs := make([]*Service, len(services)) + for i, s := range services { + svcs[i] = TransformDGateService(s) + } + return svcs +} + +func TransformDGateService(s *DGateService) *Service { + if s == nil { + return nil + } + return &Service{ + Name: s.Name, + Tags: s.Tags, + NamespaceName: s.Namespace.Name, + URLs: sliceutil.SliceMapper(s.URLs, + func(u *url.URL) string { return u.String() }), + Retries: &s.Retries, + HTTP2Only: &s.HTTP2Only, + RetryTimeout: &s.RetryTimeout, + TLSSkipVerify: &s.TLSSkipVerify, + ConnectTimeout: &s.ConnectTimeout, + RequestTimeout: &s.RequestTimeout, + } +} + +func TransformDGateNamespaces(namespaces ...*DGateNamespace) []*Namespace { + nss := make([]*Namespace, len(namespaces)) + for i, ns := range namespaces { + nss[i] = TransformDGateNamespace(ns) + } + return nss +} + +func TransformDGateNamespace(ns *DGateNamespace) *Namespace { + return &Namespace{ + Name: ns.Name, + Tags: ns.Tags, + } +} +func TransformDGateDomains(domains ...*DGateDomain) []*Domain { + doms := make([]*Domain, len(domains)) + for i, dom := range domains { + doms[i] = TransformDGateDomain(dom) + } + return doms +} + +func TransformDGateDomain(dom *DGateDomain) *Domain { + return &Domain{ + Name: dom.Name, + NamespaceName: dom.Namespace.Name, + Patterns: dom.Patterns, + // set as empty string to avoid sending cert/key to client + Cert: dom.Cert, + Key: dom.Key, + Tags: dom.Tags, + } +} + +func TransformDGateCollections(collections ...*DGateCollection) []*Collection { + cols := make([]*Collection, len(collections)) + for i, col := range collections { + cols[i] = TransformDGateCollection(col) + } + return cols +} + +func TransformDGateCollection(col *DGateCollection) *Collection { + var schema any + if len(col.SchemaPayload) > 0 { + err := json.Unmarshal([]byte(col.SchemaPayload), &schema) + if err != nil { + panic(err) + } + } + return &Collection{ + Name: col.Name, + NamespaceName: col.Namespace.Name, + Schema: schema, + Type: col.Type, + Visibility: col.Visibility, + Tags: col.Tags, + } +} + +func TransformDGateDocuments(documents ...*DGateDocument) []*Document { + docs := make([]*Document, len(documents)) + for i, doc := range documents { + docs[i] = TransformDGateDocument(doc) + } + return docs +} + +func TransformDGateDocument(document *DGateDocument) *Document { + var payloadStruct any + if document.Data != "" { + err := json.Unmarshal([]byte(document.Data), &payloadStruct) + if err != nil { + // this should never happen, + panic(err) + } + } + return &Document{ + ID: document.ID, + NamespaceName: document.Namespace.Name, + CollectionName: document.Collection.Name, + Data: payloadStruct, + } +} + +func TransformRoutes(routes ...Route) []*DGateRoute { + rts := make([]*DGateRoute, len(routes)) + for i, r := range routes { + rts[i] = TransformRoute(r) + } + return rts +} + +func TransformRoute(r Route) *DGateRoute { + svc := &DGateService{} + if r.ServiceName != "" { + svc.Name = r.ServiceName + } + return &DGateRoute{ + Name: r.Name, + Paths: r.Paths, + Methods: r.Methods, + PreserveHost: r.PreserveHost, + StripPath: r.StripPath, + Service: svc, + Namespace: &DGateNamespace{Name: r.NamespaceName}, + Modules: sliceutil.SliceMapper(r.Modules, func(m string) *DGateModule { return &DGateModule{Name: m} }), + Tags: r.Tags, + } +} + +func TransformModules(ns *DGateNamespace, modules ...*Module) ([]*DGateModule, error) { + mods := make([]*DGateModule, len(modules)) + var err error + for i, m := range modules { + mods[i], err = TransformModule(ns, m) + if err != nil { + panic(err) + } + } + return mods, nil +} + +func TransformModule(ns *DGateNamespace, m *Module) (*DGateModule, error) { + payload, err := base64.StdEncoding.DecodeString(m.Payload) + if err != nil { + return nil, err + } + return &DGateModule{ + Name: m.Name, + Namespace: ns, + Payload: string(payload), + Tags: m.Tags, + Permissions: m.Permissions, + Type: m.Type, + }, nil +} + +func TransformServices(ns *DGateNamespace, services ...*Service) []*DGateService { + svcs := make([]*DGateService, len(services)) + for i, s := range services { + svcs[i] = TransformService(ns, s) + } + return svcs +} + +func TransformService(ns *DGateNamespace, s *Service) *DGateService { + return &DGateService{ + Name: s.Name, + Tags: s.Tags, + Namespace: ns, + URLs: sliceutil.SliceMapper(s.URLs, func(u string) *url.URL { + url, _ := url.Parse(u) + return url + }), + Retries: or(s.Retries, 3), + HTTP2Only: or(s.HTTP2Only, false), + RetryTimeout: or(s.RetryTimeout, 0), + TLSSkipVerify: or(s.TLSSkipVerify, false), + ConnectTimeout: or(s.ConnectTimeout, 0), + RequestTimeout: or(s.RequestTimeout, 0), + } +} + +func TransformNamespaces(namespaces ...*Namespace) []*DGateNamespace { + nss := make([]*DGateNamespace, len(namespaces)) + for i, ns := range namespaces { + nss[i] = TransformNamespace(ns) + } + return nss +} + +func TransformNamespace(ns *Namespace) *DGateNamespace { + return &DGateNamespace{ + Name: ns.Name, + Tags: ns.Tags, + } +} + +func TransformDomains(ns *DGateNamespace, domains ...*Domain) []*DGateDomain { + doms := make([]*DGateDomain, len(domains)) + for i, dom := range domains { + doms[i] = TransformDomain(ns, dom) + } + return doms +} + +func TransformDomain(ns *DGateNamespace, dom *Domain) *DGateDomain { + return &DGateDomain{ + Name: dom.Name, + Namespace: ns, + Patterns: dom.Patterns, + Cert: dom.Cert, + Key: dom.Key, + Tags: dom.Tags, + } +} + +func TransformCollections(ns *DGateNamespace, mods []*DGateModule, collections ...*Collection) []*DGateCollection { + cols := make([]*DGateCollection, len(collections)) + for i, col := range collections { + cols[i] = TransformCollection(ns, mods, col) + } + return cols +} + +func TransformCollection(ns *DGateNamespace, mods []*DGateModule, col *Collection) *DGateCollection { + var schema *jsonschema.Schema + var schemaData []byte + if col.Schema != nil { + var err error + schemaData, err = json.Marshal(col.Schema) + if err != nil { + panic(err) + } + err = json.Unmarshal(schemaData, &schema) + if err != nil { + panic(err) + } + schema = jsonschema.MustCompileString( + col.Name+".json", string(schemaData)) + } + return &DGateCollection{ + Name: col.Name, + Namespace: ns, + Schema: schema, + SchemaPayload: string(schemaData), + Type: col.Type, + Modules: mods, + Visibility: col.Visibility, + Tags: col.Tags, + } +} + +func TransformDocuments(ns *DGateNamespace, col *DGateCollection, documents ...*Document) []*DGateDocument { + docs := make([]*DGateDocument, len(documents)) + for i, doc := range documents { + docs[i] = TransformDocument(ns, col, doc) + } + return docs +} + +func TransformDocument(ns *DGateNamespace, col *DGateCollection, document *Document) *DGateDocument { + var payload string + if document.Data != nil { + payloadBytes, err := json.Marshal(document.Data) + if err != nil { + panic(err) + } + payload = string(payloadBytes) + } + return &DGateDocument{ + ID: document.ID, + Namespace: ns, + Collection: col, + Data: payload, + } +} + +func or[T any](v *T, def T) T { + if v == nil { + return def + } + return *v +} diff --git a/pkg/storage/badger_logger.go b/pkg/storage/badger_logger.go new file mode 100644 index 0000000..42ac1ab --- /dev/null +++ b/pkg/storage/badger_logger.go @@ -0,0 +1,33 @@ +package storage + +import ( + "github.com/dgraph-io/badger/v4" + "github.com/rs/zerolog" +) + +type badgerLoggerAdapter struct { + logger zerolog.Logger +} + +func (b *badgerLoggerAdapter) Errorf(format string, args ...any) { + b.logger.Error().Msgf(format, args...) +} + +func (b *badgerLoggerAdapter) Warningf(format string, args ...any) { + b.logger.Warn().Msgf(format, args...) +} + +func (b *badgerLoggerAdapter) Infof(format string, args ...any) { + b.logger.Info().Msgf(format, args...) +} + +func (b *badgerLoggerAdapter) Debugf(format string, args ...any) { + b.logger.Debug().Msgf(format, args...) +} + +func newBadgerLoggerAdapter(component string, logger zerolog.Logger) badger.Logger { + logger = logger.With().Str("component", component).Logger() + return &badgerLoggerAdapter{ + logger: logger, + } +} diff --git a/pkg/storage/file_storage.go b/pkg/storage/file_storage.go new file mode 100644 index 0000000..80b854b --- /dev/null +++ b/pkg/storage/file_storage.go @@ -0,0 +1,260 @@ +package storage + +import ( + "errors" + "fmt" + "os" + "strings" + + "github.com/dgraph-io/badger/v4" + "github.com/dgraph-io/badger/v4/options" + "github.com/rs/zerolog" +) + +type FileStoreConfig struct { + Directory string `koanf:"dir"` + Logger zerolog.Logger + + inMemory bool +} + +type FileStore struct { + directory string + inMemory bool + logger badger.Logger + db *badger.DB +} + +type FileStoreTxn struct { + txn *badger.Txn + ro bool +} + +var _ Storage = &FileStore{} +var _ StorageTxn = &FileStoreTxn{} + +var ( + // ErrStoreLocked is returned when the storage is locked. + ErrStoreLocked error = errors.New("storage is locked") + // ErrKeyNotFound is returned when the key is not found. + ErrKeyNotFound error = errors.New("key not found") + // ErrTxnReadOnly is returned when the transaction is read only. + ErrTxnReadOnly error = errors.New("transaction is read only") +) + +func NewFileStore(fsConfig *FileStoreConfig) *FileStore { + if fsConfig == nil { + fsConfig = &FileStoreConfig{} + } + if fsConfig.Directory == "" { + panic("directory is required") + } else { + // Remove trailing slash if it exists. + fsConfig.Directory = strings.TrimSuffix(fsConfig.Directory, "/") + } + + logger := fsConfig.Logger.Hook(zerolog.HookFunc(func(e *zerolog.Event, level zerolog.Level, msg string) { + e.Str("storage", "filestore::badger") + })) + + return &FileStore{ + directory: fsConfig.Directory, + logger: newBadgerLoggerAdapter( + "filestore::badger", + logger.Level(zerolog.InfoLevel), + ), + inMemory: fsConfig.inMemory, + } +} + +func newFileStoreTxn(txn *badger.Txn) *FileStoreTxn { + return &FileStoreTxn{ + txn: txn, + } +} + +func (s *FileStore) Connect() error { + var opts badger.Options + var err error + if s.inMemory { + opts = badger.DefaultOptions(""). + WithCompression(options.Snappy). + WithInMemory(true). + WithLogger(s.logger) + } else { + // Create the directory if it does not exist. + if _, err := os.Stat(s.directory); os.IsNotExist(err) { + err := os.MkdirAll(s.directory, 0755) + if err != nil { + return errors.New("failed to create directory - " + s.directory + ": " + err.Error()) + } + } + + opts = badger.DefaultOptions(s.directory). + WithReadOnly(false). + WithInMemory(s.inMemory). + WithCompression(options.Snappy). + WithLogger(s.logger) + } + s.db, err = badger.Open(opts) + if err != nil { + return err + } + return nil +} + +func (s *FileStore) Get(key string) ([]byte, error) { + var value []byte + err := s.db.View(func(txn *badger.Txn) error { + val, err := newFileStoreTxn(txn).Get(key) + if err != nil { + if err == badger.ErrKeyNotFound { + return ErrKeyNotFound + } + return err + } + value = val + return nil + }) + return value, err +} + +func (s *FileStore) Set(key string, value []byte) error { + return s.db.Update(func(txn *badger.Txn) error { + return newFileStoreTxn(txn).Set(key, value) + }) +} + +func (s *FileStore) IterateValuesPrefix(prefix string, fn func(string, []byte) error) error { + return s.db.View(func(txn *badger.Txn) error { + return newFileStoreTxn(txn).IterateValuesPrefix(prefix, fn) + }) +} + +func (s *FileStore) IterateTxnPrefix(prefix string, fn func(StorageTxn, string) error) error { + return s.db.View(func(txn *badger.Txn) error { + return newFileStoreTxn(txn).IterateTxnPrefix(prefix, fn) + }) +} + +func (s *FileStore) GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error) { + var return_list []*KeyValue + err := s.db.View(func(txn *badger.Txn) error { + val, err := newFileStoreTxn(txn).GetPrefix(prefix, offset, limit) + if err != nil { + return fmt.Errorf("failed to get prefix: %w", err) + } + return_list = val + return nil + }) + return return_list, err +} + +func (s *FileStore) Delete(key string) error { + return s.db.Update(func(txn *badger.Txn) error { + return txn.Delete([]byte(key)) + }) +} + +func (s *FileStore) Txn(readOnly bool, fn func(StorageTxn) error) error { + txFunc := s.db.View + if !readOnly { + txFunc = s.db.Update + } + return txFunc(func(txn *badger.Txn) error { + return fn(&FileStoreTxn{ + txn: txn, + ro: readOnly, + }) + }) +} + +func (s *FileStore) Close() error { + return s.db.Close() +} + +func (tx *FileStoreTxn) Get(key string) ([]byte, error) { + item, err := tx.txn.Get([]byte(key)) + if err != nil { + return nil, err + } + val, err := item.ValueCopy(nil) + if err != nil { + return nil, err + } + return val, nil +} + +func (tx *FileStoreTxn) Set(key string, value []byte) error { + if tx.ro { + return ErrTxnReadOnly + } + return tx.txn.Set([]byte(key), value) +} + +func (tx *FileStoreTxn) Delete(key string) error { + if tx.ro { + return ErrTxnReadOnly + } + return tx.txn.Delete([]byte(key)) +} + +func (tx *FileStoreTxn) IterateValuesPrefix(prefix string, fn func(string, []byte) error) error { + iter := tx.txn.NewIterator(badger.IteratorOptions{ + Prefix: []byte(prefix), + }) + defer iter.Close() + for iter.Rewind(); iter.Valid(); iter.Next() { + item := iter.Item() + val, err := item.ValueCopy(nil) + if err != nil { + return err + } + if err := fn(string(item.Key()), val); err != nil { + return err + } + } + return nil +} + +func (tx *FileStoreTxn) IterateTxnPrefix(prefix string, fn func(StorageTxn, string) error) error { + iter := tx.txn.NewIterator(badger.IteratorOptions{ + Prefix: []byte(prefix), + }) + defer iter.Close() + for iter.Rewind(); iter.Valid(); iter.Next() { + item := iter.Item() + if err := fn(tx, string(item.Key())); err != nil { + return err + } + } + return nil +} + +func (s *FileStoreTxn) GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error) { + return_list := make([]*KeyValue, 0) + iter := s.txn.NewIterator(badger.IteratorOptions{ + Prefix: []byte(prefix), + }) + defer iter.Close() + for iter.Rewind(); iter.Valid(); iter.Next() { + if offset > 0 { + offset -= 1 + continue + } + item := iter.Item() + val, err := item.ValueCopy(nil) + if err != nil { + return nil, fmt.Errorf("error copying value: %v", err) + } + return_list = append(return_list, &KeyValue{ + Key: string(item.Key()), + Value: val, + }) + if limit -= 1; limit == 0 { + break + } + } + + return return_list, nil +} diff --git a/pkg/storage/memory_storage.go b/pkg/storage/memory_storage.go new file mode 100644 index 0000000..448a826 --- /dev/null +++ b/pkg/storage/memory_storage.go @@ -0,0 +1,31 @@ +package storage + +import ( + "github.com/rs/zerolog" +) + +type MemoryStoreConfig struct { + // Path to the directory where the files will be stored. + // If the directory does not exist, it will be created. + // If the directory exists, it will be used. + Logger zerolog.Logger +} + +type MemoryStore struct { + *FileStore +} + +var _ Storage = &MemoryStore{} + +func NewMemoryStore(cfg *MemoryStoreConfig) *MemoryStore { + return &MemoryStore{ + FileStore: &FileStore{ + directory: "", + inMemory: true, + logger: newBadgerLoggerAdapter( + "filestore::badger", + cfg.Logger.Level(zerolog.InfoLevel), + ), + }, + } +} diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go new file mode 100644 index 0000000..b93380f --- /dev/null +++ b/pkg/storage/storage.go @@ -0,0 +1,22 @@ +package storage + +type Storage interface { + StorageTxn + Txn(bool, func(StorageTxn) error) error + Connect() error + Close() error +} + +type StorageTxn interface { + Get(string) ([]byte, error) + Set(string, []byte) error + IterateValuesPrefix(prefix string, fn func(key string, val []byte) error) error + IterateTxnPrefix(prefix string, fn func(txn StorageTxn, key string) error) error + GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error) + Delete(string) error +} + +type KeyValue struct { + Key string + Value []byte +} diff --git a/pkg/typescript/typescript.go b/pkg/typescript/typescript.go new file mode 100644 index 0000000..f549ae1 --- /dev/null +++ b/pkg/typescript/typescript.go @@ -0,0 +1,31 @@ +package typescript + +import ( + _ "embed" + + "github.com/clarkmcc/go-typescript" + "github.com/dop251/goja" +) + +// typescript v5.3.3 +//go:embed typescript.min.js +var tscSource string + +func Transpile(src string) (string, error) { + // transpiles TS into JS with commonjs module and targets es5 + return typescript.TranspileString(src, + WithCachedTypescriptSource(), + typescript.WithCompileOptions(map[string]any{ + "module": "commonjs", + "target": "es5", + }), + ) +} + +var tsSrcProgram = goja.MustCompile("", tscSource, true) + +func WithCachedTypescriptSource() typescript.TranspileOptionFunc { + return func(config *typescript.Config) { + config.TypescriptSource = tsSrcProgram + } +} diff --git a/pkg/typescript/typescript.min.js b/pkg/typescript/typescript.min.js new file mode 100644 index 0000000..69ab93a --- /dev/null +++ b/pkg/typescript/typescript.min.js @@ -0,0 +1,386 @@ +"use strict";var ts=(()=>{var dIe=Object.defineProperty,she=Object.getOwnPropertyNames,Nt=(e,t)=>function(){return e&&(t=(0,e[she(e)[0]])(e=0)),t},mIe=(e,t)=>function(){return t||(0,e[she(e)[0]])((t={exports:{}}).exports,t),t.exports},jl=(e,t)=>{for(var r in t)dIe(e,r,{get:t[r],enumerable:!0})},rk,Qm,aj,gIe=Nt({"src/compiler/corePublic.ts"(){"use strict";rk="5.3",Qm="5.3.3",aj=(e=>(e[e.LessThan=-1]="LessThan",e[e.EqualTo=0]="EqualTo",e[e.GreaterThan=1]="GreaterThan",e))(aj||{})}});function Ir(e){return e?e.length:0}function Zt(e,t){if(e)for(let r=0;r=0;r--){const i=t(e[r],r);if(i)return i}}function ic(e,t){if(e!==void 0)for(let r=0;r=0;i--){const s=e[i];if(t(s,i))return s}}function Dc(e,t,r){if(e===void 0)return-1;for(let i=r??0;i=0;i--)if(t(e[i],i))return i;return-1}function ohe(e,t){for(let r=0;rr(i,t[s]))}function FZ(e,t,r){for(let i=r||0;i{const o=t(s,i);if(o!==void 0){const[c,u]=o;c!==void 0&&u!==void 0&&r.set(c,u)}}),r}function u4(e,t,r){if(e.has(t))return e.get(t);const i=r();return e.set(t,i),i}function zy(e,t){return e.has(t)?!1:(e.add(t),!0)}function*MZ(e){yield e}function fj(e,t,r){let i;if(e){i=[];const s=e.length;let o,c,u=0,f=0;for(;u{const[o,c]=t(s,i);r.set(o,c)}),r}function ut(e,t){if(e)if(t){for(const r of e)if(t(r))return!0}else return e.length>0;return!1}function pj(e,t,r){let i;for(let s=0;se[c])}function vIe(e,t){const r=[];for(const i of e)tp(r,i,t);return r}function VS(e,t,r){return e.length===0?[]:e.length===1?e.slice():r?yIe(e,t,r):vIe(e,t)}function bIe(e,t){if(e.length===0)return ze;let r=e[0];const i=[r];for(let s=1;s0&&(s&=-2),s&2&&i(o,f)>0&&(s&=-3),o=f}return s}function Zp(e,t,r=w0){if(!e||!t)return e===t;if(e.length!==t.length)return!1;for(let i=0;i0&&E.assertGreaterThanOrEqual(r(t[o],t[o-1]),0);t:for(const c=s;sc&&E.assertGreaterThanOrEqual(r(e[s],e[s-1]),0),r(t[o],e[s])){case-1:i.push(t[o]);continue e;case 0:continue e;case 1:continue t}}return i}function lr(e,t){return t===void 0?e:e===void 0?[t]:(e.push(t),e)}function ik(e,t){return e===void 0?t:t===void 0?e:es(e)?es(t)?Xi(e,t):lr(e,t):es(t)?lr(t,e):[e,t]}function JZ(e,t){return t<0?e.length+t:t}function Dn(e,t,r,i){if(t===void 0||t.length===0)return e;if(e===void 0)return t.slice(r,i);r=r===void 0?0:JZ(t,r),i=i===void 0?t.length:JZ(t,i);for(let s=r;sr(e[i],e[s])||xo(i,s))}function qS(e,t){return e.length===0?e:e.slice().sort(t)}function*mj(e){for(let t=e.length-1;t>=0;t--)yield e[t]}function Eh(e,t){const r=WD(e);return che(e,r,t),r.map(i=>e[i])}function gj(e,t,r,i){for(;r>1),f=r(e[u],u);switch(i(f,t)){case-1:o=u+1;break;case 0:return u;case 1:c=u-1;break}}return~o}function Eu(e,t,r,i,s){if(e&&e.length>0){const o=e.length;if(o>0){let c=i===void 0||i<0?0:i;const u=s===void 0||c+s>o-1?o-1:c+s;let f;for(arguments.length<=2?(f=e[c],c++):f=r;c<=u;)f=t(f,e[c],c),c++;return f}}return r}function Ya(e,t){return A0.call(e,t)}function x7(e,t){return A0.call(e,t)?e[t]:void 0}function Jg(e){const t=[];for(const r in e)A0.call(e,r)&&t.push(r);return t}function lhe(e){const t=[];do{const r=Object.getOwnPropertyNames(e);for(const i of r)tp(t,i)}while(e=Object.getPrototypeOf(e));return t}function GS(e){const t=[];for(const r in e)A0.call(e,r)&&t.push(e[r]);return t}function zZ(e,t){const r=new Array(e);for(let i=0;i100&&r>t.length>>1){const u=t.length-r;t.copyWithin(0,r),t.length=u,r=0}return c}return{enqueue:s,dequeue:o,isEmpty:i}}function Tj(e,t){const r=new Map;let i=0;function*s(){for(const c of r.values())es(c)?yield*c:yield c}const o={has(c){const u=e(c);if(!r.has(u))return!1;const f=r.get(u);if(!es(f))return t(f,c);for(const g of f)if(t(g,c))return!0;return!1},add(c){const u=e(c);if(r.has(u)){const f=r.get(u);if(es(f))_s(f,c,t)||(f.push(c),i++);else{const g=f;t(g,c)||(r.set(u,[g,c]),i++)}}else r.set(u,c),i++;return this},delete(c){const u=e(c);if(!r.has(u))return!1;const f=r.get(u);if(es(f)){for(let g=0;gs(),[Symbol.toStringTag]:r[Symbol.toStringTag]};return o}function es(e){return Array.isArray(e)}function $S(e){return es(e)?e:[e]}function ns(e){return typeof e=="string"}function wh(e){return typeof e=="number"}function Jn(e,t){return e!==void 0&&t(e)?e:void 0}function Ms(e,t){return e!==void 0&&t(e)?e:E.fail(`Invalid cast. The supplied value ${e} did not pass the test '${E.getFunctionName(t)}'.`)}function Ca(e){}function Kp(){return!1}function zg(){return!0}function Wy(){}function To(e){return e}function qZ(e){return e.toLowerCase()}function xd(e){return nK.test(e)?e.replace(nK,qZ):e}function ys(){throw new Error("Not implemented")}function Vu(e){let t;return()=>(e&&(t=e(),e=void 0),t)}function _m(e){const t=new Map;return r=>{const i=`${typeof r}:${r}`;let s=t.get(i);return s===void 0&&!t.has(i)&&(s=e(r),t.set(i,s)),s}}function uhe(e){const t=new WeakMap;return r=>{let i=t.get(r);return i===void 0&&!t.has(r)&&(i=e(r),t.set(r,i)),i}}function HZ(e,t){return(...r)=>{let i=t.get(r);return i===void 0&&!t.has(r)&&(i=e(...r),t.set(r,i)),i}}function _he(e,t,r,i,s){if(s){const o=[];for(let c=0;cEu(o,(u,f)=>f(u),c)}else return i?o=>i(r(t(e(o)))):r?o=>r(t(e(o))):t?o=>t(e(o)):e?o=>e(o):o=>o}function w0(e,t){return e===t}function XS(e,t){return e===t||e!==void 0&&t!==void 0&&e.toUpperCase()===t.toUpperCase()}function QS(e,t){return w0(e,t)}function fhe(e,t){return e===t?0:e===void 0?-1:t===void 0?1:et(r,i)===-1?r:i)}function D7(e,t){return e===t?0:e===void 0?-1:t===void 0?1:(e=e.toUpperCase(),t=t.toUpperCase(),et?1:0)}function GZ(e,t){return e===t?0:e===void 0?-1:t===void 0?1:(e=e.toLowerCase(),t=t.toLowerCase(),et?1:0)}function Du(e,t){return fhe(e,t)}function d4(e){return e?D7:Du}function $Z(){return Nj}function XZ(e){Nj!==e&&(Nj=e,iK=void 0)}function qD(e,t){return(iK||(iK=mhe(Nj)))(e,t)}function QZ(e,t,r,i){return e===t?0:e===void 0?-1:t===void 0?1:i(e[r],t[r])}function pv(e,t){return xo(e?1:0,t?1:0)}function m4(e,t,r){const i=Math.max(2,Math.floor(e.length*.34));let s=Math.floor(e.length*.4)+1,o;for(const c of t){const u=r(c);if(u!==void 0&&Math.abs(u.length-e.length)<=i){if(u===e||u.length<3&&u.toLowerCase()!==e.toLowerCase())continue;const f=xIe(e,u,s-.1);if(f===void 0)continue;E.assert(fr?u-r:1),p=Math.floor(t.length>r+u?r+u:t.length);s[0]=u;let y=u;for(let T=1;Tr)return;const S=i;i=s,s=S}const c=i[t.length];return c>r?void 0:c}function fc(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function sk(e,t){return fc(e,t)?e.slice(0,e.length-t.length):e}function YZ(e,t){return fc(e,t)?e.slice(0,e.length-t.length):void 0}function kj(e){let t=e.length;for(let r=t-1;r>0;r--){let i=e.charCodeAt(r);if(i>=48&&i<=57)do--r,i=e.charCodeAt(r);while(r>0&&i>=48&&i<=57);else if(r>4&&(i===110||i===78)){if(--r,i=e.charCodeAt(r),i!==105&&i!==73||(--r,i=e.charCodeAt(r),i!==109&&i!==77))break;--r,i=e.charCodeAt(r)}else break;if(i!==45&&i!==46)break;t=r}return t===e.length?e:e.slice(0,t)}function HD(e,t){for(let r=0;rr===t)}function kIe(e,t){for(let r=0;rs&&(s=c.prefix.length,i=o)}return i}function Qi(e,t){return e.lastIndexOf(t,0)===0}function g4(e,t){return Qi(e,t)?e.substr(t.length):e}function Dj(e,t,r=To){return Qi(r(e),r(t))?e.substring(t.length):void 0}function P7({prefix:e,suffix:t},r){return r.length>=e.length+t.length&&Qi(r,e)&&fc(r,t)}function w7(e,t){return r=>e(r)&&t(r)}function ed(...e){return(...t)=>{let r;for(const i of e)if(r=i(...t),r)return r;return r}}function A7(e){return(...t)=>!e(...t)}function phe(e){}function Q2(e){return e===void 0?void 0:[e]}function N7(e,t,r,i,s,o){o=o||Ca;let c=0,u=0;const f=e.length,g=t.length;let p=!1;for(;c(e[e.None=0]="None",e[e.CaseSensitive=1]="CaseSensitive",e[e.CaseInsensitive=2]="CaseInsensitive",e[e.Both=3]="Both",e))(wj||{}),Ah=Array.prototype.at?(e,t)=>e?.at(t):(e,t)=>{if(e&&(t=JZ(e,t),t(e[e.None=0]="None",e[e.Normal=1]="Normal",e[e.Aggressive=2]="Aggressive",e[e.VeryAggressive=3]="VeryAggressive",e))(Aj||{}),mhe=(()=>{return t;function e(r,i,s){if(r===i)return 0;if(r===void 0)return-1;if(i===void 0)return 1;const o=s(r,i);return o<0?-1:o>0?1:0}function t(r){const i=new Intl.Collator(r,{usage:"sort",sensitivity:"variant"}).compare;return(s,o)=>e(s,o,i)}})()}}),Ij,E,EIe=Nt({"src/compiler/debug.ts"(){"use strict";Ns(),Ns(),Ij=(e=>(e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose",e))(Ij||{}),(e=>{let t=0;e.currentLogLevel=2,e.isDebugging=!1;function r(Ft){return e.currentLogLevel<=Ft}e.shouldLog=r;function i(Ft,yr){e.loggingHost&&r(Ft)&&e.loggingHost.log(Ft,yr)}function s(Ft){i(3,Ft)}e.log=s,(Ft=>{function yr(ji){i(1,ji)}Ft.error=yr;function Tr(ji){i(2,ji)}Ft.warn=Tr;function Xr(ji){i(3,ji)}Ft.log=Xr;function Pi(ji){i(4,ji)}Ft.trace=Pi})(s=e.log||(e.log={}));const o={};function c(){return t}e.getAssertionLevel=c;function u(Ft){const yr=t;if(t=Ft,Ft>yr)for(const Tr of Jg(o)){const Xr=o[Tr];Xr!==void 0&&e[Tr]!==Xr.assertion&&Ft>=Xr.level&&(e[Tr]=Xr,o[Tr]=void 0)}}e.setAssertionLevel=u;function f(Ft){return t>=Ft}e.shouldAssert=f;function g(Ft,yr){return f(Ft)?!0:(o[yr]={level:Ft,assertion:e[yr]},e[yr]=Ca,!1)}function p(Ft,yr){debugger;const Tr=new Error(Ft?`Debug Failure. ${Ft}`:"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(Tr,yr||p),Tr}e.fail=p;function y(Ft,yr,Tr){return p(`${yr||"Unexpected node."}\r +Node ${ve(Ft.kind)} was unexpected.`,Tr||y)}e.failBadSyntaxKind=y;function S(Ft,yr,Tr,Xr){Ft||(yr=yr?`False expression: ${yr}`:"False expression.",Tr&&(yr+=`\r +Verbose Debug Information: `+(typeof Tr=="string"?Tr:Tr())),p(yr,Xr||S))}e.assert=S;function T(Ft,yr,Tr,Xr,Pi){if(Ft!==yr){const ji=Tr?Xr?`${Tr} ${Xr}`:Tr:"";p(`Expected ${Ft} === ${yr}. ${ji}`,Pi||T)}}e.assertEqual=T;function C(Ft,yr,Tr,Xr){Ft>=yr&&p(`Expected ${Ft} < ${yr}. ${Tr||""}`,Xr||C)}e.assertLessThan=C;function w(Ft,yr,Tr){Ft>yr&&p(`Expected ${Ft} <= ${yr}`,Tr||w)}e.assertLessThanOrEqual=w;function D(Ft,yr,Tr){Ft= ${yr}`,Tr||D)}e.assertGreaterThanOrEqual=D;function O(Ft,yr,Tr){Ft==null&&p(yr,Tr||O)}e.assertIsDefined=O;function z(Ft,yr,Tr){return O(Ft,yr,Tr||z),Ft}e.checkDefined=z;function W(Ft,yr,Tr){for(const Xr of Ft)O(Xr,yr,Tr||W)}e.assertEachIsDefined=W;function X(Ft,yr,Tr){return W(Ft,yr,Tr||X),Ft}e.checkEachDefined=X;function J(Ft,yr="Illegal value:",Tr){const Xr=typeof Ft=="object"&&Ya(Ft,"kind")&&Ya(Ft,"pos")?"SyntaxKind: "+ve(Ft.kind):JSON.stringify(Ft);return p(`${yr} ${Xr}`,Tr||J)}e.assertNever=J;function ie(Ft,yr,Tr,Xr){g(1,"assertEachNode")&&S(yr===void 0||qi(Ft,yr),Tr||"Unexpected node.",()=>`Node array did not pass test '${K(yr)}'.`,Xr||ie)}e.assertEachNode=ie;function B(Ft,yr,Tr,Xr){g(1,"assertNode")&&S(Ft!==void 0&&(yr===void 0||yr(Ft)),Tr||"Unexpected node.",()=>`Node ${ve(Ft?.kind)} did not pass test '${K(yr)}'.`,Xr||B)}e.assertNode=B;function Y(Ft,yr,Tr,Xr){g(1,"assertNotNode")&&S(Ft===void 0||yr===void 0||!yr(Ft),Tr||"Unexpected node.",()=>`Node ${ve(Ft.kind)} should not have passed test '${K(yr)}'.`,Xr||Y)}e.assertNotNode=Y;function ae(Ft,yr,Tr,Xr){g(1,"assertOptionalNode")&&S(yr===void 0||Ft===void 0||yr(Ft),Tr||"Unexpected node.",()=>`Node ${ve(Ft?.kind)} did not pass test '${K(yr)}'.`,Xr||ae)}e.assertOptionalNode=ae;function _e(Ft,yr,Tr,Xr){g(1,"assertOptionalToken")&&S(yr===void 0||Ft===void 0||Ft.kind===yr,Tr||"Unexpected node.",()=>`Node ${ve(Ft?.kind)} was not a '${ve(yr)}' token.`,Xr||_e)}e.assertOptionalToken=_e;function $(Ft,yr,Tr){g(1,"assertMissingNode")&&S(Ft===void 0,yr||"Unexpected node.",()=>`Node ${ve(Ft.kind)} was unexpected'.`,Tr||$)}e.assertMissingNode=$;function H(Ft){}e.type=H;function K(Ft){if(typeof Ft!="function")return"";if(Ya(Ft,"name"))return Ft.name;{const yr=Function.prototype.toString.call(Ft),Tr=/^function\s+([\w$]+)\s*\(/.exec(yr);return Tr?Tr[1]:""}}e.getFunctionName=K;function oe(Ft){return`{ name: ${bi(Ft.escapedName)}; flags: ${pt(Ft.flags)}; declarations: ${Yt(Ft.declarations,yr=>ve(yr.kind))} }`}e.formatSymbol=oe;function Se(Ft=0,yr,Tr){const Xr=Z(yr);if(Ft===0)return Xr.length>0&&Xr[0][0]===0?Xr[0][1]:"0";if(Tr){const Pi=[];let ji=Ft;for(const[Di,$i]of Xr){if(Di>Ft)break;Di!==0&&Di&Ft&&(Pi.push($i),ji&=~Di)}if(ji===0)return Pi.join("|")}else for(const[Pi,ji]of Xr)if(Pi===Ft)return ji;return Ft.toString()}e.formatEnum=Se;const se=new Map;function Z(Ft){const yr=se.get(Ft);if(yr)return yr;const Tr=[];for(const Pi in Ft){const ji=Ft[Pi];typeof ji=="number"&&Tr.push([ji,Pi])}const Xr=Eh(Tr,(Pi,ji)=>xo(Pi[0],ji[0]));return se.set(Ft,Xr),Xr}function ve(Ft){return Se(Ft,L7,!1)}e.formatSyntaxKind=ve;function Te(Ft){return Se(Ft,$7,!1)}e.formatSnippetKind=Te;function Me(Ft){return Se(Ft,H7,!1)}e.formatScriptKind=Me;function ke(Ft){return Se(Ft,M7,!0)}e.formatNodeFlags=ke;function he(Ft){return Se(Ft,R7,!0)}e.formatModifierFlags=he;function be(Ft){return Se(Ft,G7,!0)}e.formatTransformFlags=be;function lt(Ft){return Se(Ft,X7,!0)}e.formatEmitFlags=lt;function pt(Ft){return Se(Ft,W7,!0)}e.formatSymbolFlags=pt;function me(Ft){return Se(Ft,U7,!0)}e.formatTypeFlags=me;function Oe(Ft){return Se(Ft,q7,!0)}e.formatSignatureFlags=Oe;function Xe(Ft){return Se(Ft,V7,!0)}e.formatObjectFlags=Xe;function it(Ft){return Se(Ft,QD,!0)}e.formatFlowFlags=it;function mt(Ft){return Se(Ft,j7,!0)}e.formatRelationComparisonResult=mt;function Je(Ft){return Se(Ft,AO,!0)}e.formatCheckMode=Je;function ot(Ft){return Se(Ft,NO,!0)}e.formatSignatureCheckMode=ot;function Bt(Ft){return Se(Ft,wO,!0)}e.formatTypeFacts=Bt;let Ht=!1,br;function zr(Ft){"__debugFlowFlags"in Ft||Object.defineProperties(Ft,{__tsDebuggerDisplay:{value(){const yr=this.flags&2?"FlowStart":this.flags&4?"FlowBranchLabel":this.flags&8?"FlowLoopLabel":this.flags&16?"FlowAssignment":this.flags&32?"FlowTrueCondition":this.flags&64?"FlowFalseCondition":this.flags&128?"FlowSwitchClause":this.flags&256?"FlowArrayMutation":this.flags&512?"FlowCall":this.flags&1024?"FlowReduceLabel":this.flags&1?"FlowUnreachable":"UnknownFlow",Tr=this.flags&-2048;return`${yr}${Tr?` (${it(Tr)})`:""}`}},__debugFlowFlags:{get(){return Se(this.flags,QD,!0)}},__debugToString:{value(){return Dr(this)}}})}function ar(Ft){Ht&&(typeof Object.setPrototypeOf=="function"?(br||(br=Object.create(Object.prototype),zr(br)),Object.setPrototypeOf(Ft,br)):zr(Ft))}e.attachFlowNodeDebugInfo=ar;let Jt;function It(Ft){"__tsDebuggerDisplay"in Ft||Object.defineProperties(Ft,{__tsDebuggerDisplay:{value(yr){return yr=String(yr).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/,"]"),`NodeArray ${yr}`}}})}function Nn(Ft){Ht&&(typeof Object.setPrototypeOf=="function"?(Jt||(Jt=Object.create(Array.prototype),It(Jt)),Object.setPrototypeOf(Ft,Jt)):It(Ft))}e.attachNodeArrayDebugInfo=Nn;function Fi(){if(Ht)return;const Ft=new WeakMap,yr=new WeakMap;Object.defineProperties(Al.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value(){const Xr=this.flags&33554432?"TransientSymbol":"Symbol",Pi=this.flags&-33554433;return`${Xr} '${pc(this)}'${Pi?` (${pt(Pi)})`:""}`}},__debugFlags:{get(){return pt(this.flags)}}}),Object.defineProperties(Al.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value(){const Xr=this.flags&67359327?`IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName?` (${this.debugIntrinsicName})`:""}`:this.flags&98304?"NullableType":this.flags&384?`LiteralType ${JSON.stringify(this.value)}`:this.flags&2048?`LiteralType ${this.value.negative?"-":""}${this.value.base10Value}n`:this.flags&8192?"UniqueESSymbolType":this.flags&32?"EnumType":this.flags&1048576?"UnionType":this.flags&2097152?"IntersectionType":this.flags&4194304?"IndexType":this.flags&8388608?"IndexedAccessType":this.flags&16777216?"ConditionalType":this.flags&33554432?"SubstitutionType":this.flags&262144?"TypeParameter":this.flags&524288?this.objectFlags&3?"InterfaceType":this.objectFlags&4?"TypeReference":this.objectFlags&8?"TupleType":this.objectFlags&16?"AnonymousType":this.objectFlags&32?"MappedType":this.objectFlags&1024?"ReverseMappedType":this.objectFlags&256?"EvolvingArrayType":"ObjectType":"Type",Pi=this.flags&524288?this.objectFlags&-1344:0;return`${Xr}${this.symbol?` '${pc(this.symbol)}'`:""}${Pi?` (${Xe(Pi)})`:""}`}},__debugFlags:{get(){return me(this.flags)}},__debugObjectFlags:{get(){return this.flags&524288?Xe(this.objectFlags):""}},__debugTypeToString:{value(){let Xr=Ft.get(this);return Xr===void 0&&(Xr=this.checker.typeToString(this),Ft.set(this,Xr)),Xr}}}),Object.defineProperties(Al.getSignatureConstructor().prototype,{__debugFlags:{get(){return Oe(this.flags)}},__debugSignatureToString:{value(){var Xr;return(Xr=this.checker)==null?void 0:Xr.signatureToString(this)}}});const Tr=[Al.getNodeConstructor(),Al.getIdentifierConstructor(),Al.getTokenConstructor(),Al.getSourceFileConstructor()];for(const Xr of Tr)Ya(Xr.prototype,"__debugKind")||Object.defineProperties(Xr.prototype,{__tsDebuggerDisplay:{value(){return`${Eo(this)?"GeneratedIdentifier":Ie(this)?`Identifier '${an(this)}'`:Ti(this)?`PrivateIdentifier '${an(this)}'`:ra(this)?`StringLiteral ${JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")}`:A_(this)?`NumericLiteral ${this.text}`:FF(this)?`BigIntLiteral ${this.text}n`:Uo(this)?"TypeParameterDeclaration":us(this)?"ParameterDeclaration":gc(this)?"ConstructorDeclaration":pf(this)?"GetAccessorDeclaration":N_(this)?"SetAccessorDeclaration":cC(this)?"CallSignatureDeclaration":rw(this)?"ConstructSignatureDeclaration":Cb(this)?"IndexSignatureDeclaration":RF(this)?"TypePredicateNode":mp(this)?"TypeReferenceNode":pg(this)?"FunctionTypeNode":ME(this)?"ConstructorTypeNode":lC(this)?"TypeQueryNode":X_(this)?"TypeLiteralNode":jF(this)?"ArrayTypeNode":uC(this)?"TupleTypeNode":LW(this)?"OptionalTypeNode":MW(this)?"RestTypeNode":u1(this)?"UnionTypeNode":_C(this)?"IntersectionTypeNode":fC(this)?"ConditionalTypeNode":NT(this)?"InferTypeNode":IT(this)?"ParenthesizedTypeNode":BF(this)?"ThisTypeNode":FT(this)?"TypeOperatorNode":OT(this)?"IndexedAccessTypeNode":jE(this)?"MappedTypeNode":_1(this)?"LiteralTypeNode":RE(this)?"NamedTupleMember":Zg(this)?"ImportTypeNode":ve(this.kind)}${this.flags?` (${ke(this.flags)})`:""}`}},__debugKind:{get(){return ve(this.kind)}},__debugNodeFlags:{get(){return ke(this.flags)}},__debugModifierFlags:{get(){return he(Nte(this))}},__debugTransformFlags:{get(){return be(this.transformFlags)}},__debugIsParseTreeNode:{get(){return P4(this)}},__debugEmitFlags:{get(){return lt(da(this))}},__debugGetText:{value(Pi){if(Po(this))return"";let ji=yr.get(this);if(ji===void 0){const Di=ss(this),$i=Di&&Or(Di);ji=$i?Tv($i,Di,Pi):"",yr.set(this,ji)}return ji}}});Ht=!0}e.enableDebugInfo=Fi;function ei(Ft){const yr=Ft&7;let Tr=yr===0?"in out":yr===3?"[bivariant]":yr===2?"in":yr===1?"out":yr===4?"[independent]":"";return Ft&8?Tr+=" (unmeasurable)":Ft&16&&(Tr+=" (unreliable)"),Tr}e.formatVariance=ei;class zi{__debugToString(){var yr;switch(this.kind){case 3:return((yr=this.debugInfo)==null?void 0:yr.call(this))||"(function mapper)";case 0:return`${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;case 1:return oj(this.sources,this.targets||Yt(this.sources,()=>"any"),(Tr,Xr)=>`${Tr.__debugTypeToString()} -> ${typeof Xr=="string"?Xr:Xr.__debugTypeToString()}`).join(", ");case 2:return oj(this.sources,this.targets,(Tr,Xr)=>`${Tr.__debugTypeToString()} -> ${Xr().__debugTypeToString()}`).join(", ");case 5:case 4:return`m1: ${this.mapper1.__debugToString().split(` +`).join(` + `)} +m2: ${this.mapper2.__debugToString().split(` +`).join(` + `)}`;default:return J(this)}}}e.DebugTypeMapper=zi;function Qe(Ft){return e.isDebugging?Object.setPrototypeOf(Ft,zi.prototype):Ft}e.attachDebugPrototypeIfDebug=Qe;function ur(Ft){return console.log(Dr(Ft))}e.printControlFlowGraph=ur;function Dr(Ft){let yr=-1;function Tr(ue){return ue.id||(ue.id=yr,yr--),ue.id}let Xr;(ue=>{ue.lr="\u2500",ue.ud="\u2502",ue.dr="\u256D",ue.dl="\u256E",ue.ul="\u256F",ue.ur="\u2570",ue.udr="\u251C",ue.udl="\u2524",ue.dlr="\u252C",ue.ulr="\u2534",ue.udlr="\u256B"})(Xr||(Xr={}));let Pi;(ue=>{ue[ue.None=0]="None",ue[ue.Up=1]="Up",ue[ue.Down=2]="Down",ue[ue.Left=4]="Left",ue[ue.Right=8]="Right",ue[ue.UpDown=3]="UpDown",ue[ue.LeftRight=12]="LeftRight",ue[ue.UpLeft=5]="UpLeft",ue[ue.UpRight=9]="UpRight",ue[ue.DownLeft=6]="DownLeft",ue[ue.DownRight=10]="DownRight",ue[ue.UpDownLeft=7]="UpDownLeft",ue[ue.UpDownRight=11]="UpDownRight",ue[ue.UpLeftRight=13]="UpLeftRight",ue[ue.DownLeftRight=14]="DownLeftRight",ue[ue.UpDownLeftRight=15]="UpDownLeftRight",ue[ue.NoChildren=16]="NoChildren"})(Pi||(Pi={}));const ji=2032,Di=882,$i=Object.create(null),Qs=[],Ds=[],Ce=G(Ft,new Set);for(const ue of Qs)ue.text=or(ue.flowNode,ue.circular),Dt(ue);const Ue=Re(Ce),rt=st(Ue);return Ct(Ce,0),U();function ft(ue){return!!(ue.flags&128)}function dt(ue){return!!(ue.flags&12)&&!!ue.antecedents}function fe(ue){return!!(ue.flags&ji)}function we(ue){return!!(ue.flags&Di)}function Be(ue){const M=[];for(const De of ue.edges)De.source===ue&&M.push(De.target);return M}function gt(ue){const M=[];for(const De of ue.edges)De.target===ue&&M.push(De.source);return M}function G(ue,M){const De=Tr(ue);let Ve=$i[De];if(Ve&&M.has(ue))return Ve.circular=!0,Ve={id:-1,flowNode:ue,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:"circularity"},Qs.push(Ve),Ve;if(M.add(ue),!Ve)if($i[De]=Ve={id:De,flowNode:ue,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:!1},Qs.push(Ve),dt(ue))for(const Fe of ue.antecedents)ht(Ve,Fe,M);else fe(ue)&&ht(Ve,ue.antecedent,M);return M.delete(ue),Ve}function ht(ue,M,De){const Ve=G(M,De),Fe={source:ue,target:Ve};Ds.push(Fe),ue.edges.push(Fe),Ve.edges.push(Fe)}function Dt(ue){if(ue.level!==-1)return ue.level;let M=0;for(const De of gt(ue))M=Math.max(M,Dt(De)+1);return ue.level=M}function Re(ue){let M=0;for(const De of Be(ue))M=Math.max(M,Re(De));return M+1}function st(ue){const M=ce(Array(ue),0);for(const De of Qs)M[De.level]=Math.max(M[De.level],De.text.length);return M}function Ct(ue,M){if(ue.lane===-1){ue.lane=M,ue.endLane=M;const De=Be(ue);for(let Ve=0;Ve0&&M++;const Fe=De[Ve];Ct(Fe,M),Fe.endLane>ue.endLane&&(M=Fe.endLane)}ue.endLane=M}}function Qt(ue){if(ue&2)return"Start";if(ue&4)return"Branch";if(ue&8)return"Loop";if(ue&16)return"Assignment";if(ue&32)return"True";if(ue&64)return"False";if(ue&128)return"SwitchClause";if(ue&256)return"ArrayMutation";if(ue&512)return"Call";if(ue&1024)return"ReduceLabel";if(ue&1)return"Unreachable";throw new Error}function er(ue){const M=Or(ue);return Tv(M,ue,!1)}function or(ue,M){let De=Qt(ue.flags);if(M&&(De=`${De}#${Tr(ue)}`),we(ue))ue.node&&(De+=` (${er(ue.node)})`);else if(ft(ue)){const Ve=[];for(let Fe=ue.clauseStart;FeMath.max(Lt,Wt.lane),0)+1,De=ce(Array(M),""),Ve=rt.map(()=>Array(M)),Fe=rt.map(()=>ce(Array(M),0));for(const Lt of Qs){Ve[Lt.level][Lt.lane]=Lt;const Wt=Be(Lt);for(let Zr=0;Zr0&&(On|=1),Zr0&&(On|=1),Zr0?Fe[Lt-1][Wt]:0,Zr=Wt>0?Fe[Lt][Wt-1]:0;let gn=Fe[Lt][Wt];gn||(Lr&8&&(gn|=12),Zr&2&&(gn|=3),Fe[Lt][Wt]=gn)}for(let Lt=0;Lt0?ue.repeat(M):"";let De="";for(;De.length=",i.version)),rp(s.major)||r.push(rp(s.minor)?fm("<",s.version.increment("major")):rp(s.patch)?fm("<",s.version.increment("minor")):fm("<=",s.version)),!0):!1}function wIe(e,t,r){const i=sK(t);if(!i)return!1;const{version:s,major:o,minor:c,patch:u}=i;if(rp(o))(e==="<"||e===">")&&r.push(fm("<",Ip.zero));else switch(e){case"~":r.push(fm(">=",s)),r.push(fm("<",s.increment(rp(c)?"major":"minor")));break;case"^":r.push(fm(">=",s)),r.push(fm("<",s.increment(s.major>0||rp(c)?"major":s.minor>0||rp(u)?"minor":"patch")));break;case"<":case">=":r.push(rp(c)||rp(u)?fm(e,s.with({prerelease:"0"})):fm(e,s));break;case"<=":case">":r.push(rp(c)?fm(e==="<="?"<":">=",s.increment("major").with({prerelease:"0"})):rp(u)?fm(e==="<="?"<":">=",s.increment("minor").with({prerelease:"0"})):fm(e,s));break;case"=":case void 0:rp(c)||rp(u)?(r.push(fm(">=",s.with({prerelease:"0"}))),r.push(fm("<",s.increment(rp(c)?"major":"minor").with({prerelease:"0"})))):r.push(fm("=",s));break;default:return!1}return!0}function rp(e){return e==="*"||e==="x"||e==="X"}function fm(e,t){return{operator:e,operand:t}}function AIe(e,t){if(t.length===0)return!0;for(const r of t)if(NIe(e,r))return!0;return!1}function NIe(e,t){for(const r of t)if(!IIe(e,r.operator,r.operand))return!1;return!0}function IIe(e,t,r){const i=e.compareTo(r);switch(t){case"<":return i<0;case"<=":return i<=0;case">":return i>0;case">=":return i>=0;case"=":return i===0;default:return E.assertNever(t)}}function FIe(e){return Yt(e,OIe).join(" || ")||"*"}function OIe(e){return Yt(e,LIe).join(" ")}function LIe(e){return`${e.operator}${e.operand}`}var yhe,vhe,bhe,She,The,aK,Fj,Ip,GD,xhe,khe,Che,Ehe,Dhe,MIe=Nt({"src/compiler/semver.ts"(){"use strict";Ns(),yhe=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,vhe=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i,bhe=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i,She=/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i,The=/^[a-z0-9-]+$/i,aK=/^(0|[1-9]\d*)$/,Fj=class v7{constructor(t,r=0,i=0,s="",o=""){typeof t=="string"&&({major:t,minor:r,patch:i,prerelease:s,build:o}=E.checkDefined(ghe(t),"Invalid version")),E.assert(t>=0,"Invalid argument: major"),E.assert(r>=0,"Invalid argument: minor"),E.assert(i>=0,"Invalid argument: patch");const c=s?es(s)?s:s.split("."):ze,u=o?es(o)?o:o.split("."):ze;E.assert(qi(c,f=>bhe.test(f)),"Invalid argument: prerelease"),E.assert(qi(u,f=>The.test(f)),"Invalid argument: build"),this.major=t,this.minor=r,this.patch=i,this.prerelease=c,this.build=u}static tryParse(t){const r=ghe(t);if(!r)return;const{major:i,minor:s,patch:o,prerelease:c,build:u}=r;return new v7(i,s,o,c,u)}compareTo(t){return this===t?0:t===void 0?1:xo(this.major,t.major)||xo(this.minor,t.minor)||xo(this.patch,t.patch)||DIe(this.prerelease,t.prerelease)}increment(t){switch(t){case"major":return new v7(this.major+1,0,0);case"minor":return new v7(this.major,this.minor+1,0);case"patch":return new v7(this.major,this.minor,this.patch+1);default:return E.assertNever(t)}}with(t){const{major:r=this.major,minor:i=this.minor,patch:s=this.patch,prerelease:o=this.prerelease,build:c=this.build}=t;return new v7(r,i,s,o,c)}toString(){let t=`${this.major}.${this.minor}.${this.patch}`;return ut(this.prerelease)&&(t+=`-${this.prerelease.join(".")}`),ut(this.build)&&(t+=`+${this.build.join(".")}`),t}},Fj.zero=new Fj(0,0,0,["0"]),Ip=Fj,GD=class cIe{constructor(t){this._alternatives=t?E.checkDefined(hhe(t),"Invalid range spec."):ze}static tryParse(t){const r=hhe(t);if(r){const i=new cIe("");return i._alternatives=r,i}}test(t){return typeof t=="string"&&(t=new Ip(t)),AIe(t,this._alternatives)}toString(){return FIe(this._alternatives)}},xhe=/\|\|/g,khe=/\s+/g,Che=/^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,Ehe=/^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i,Dhe=/^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i}});function Phe(e,t){return typeof e=="object"&&typeof e.timeOrigin=="number"&&typeof e.mark=="function"&&typeof e.measure=="function"&&typeof e.now=="function"&&typeof e.clearMarks=="function"&&typeof e.clearMeasures=="function"&&typeof t=="function"}function RIe(){if(typeof performance=="object"&&typeof PerformanceObserver=="function"&&Phe(performance,PerformanceObserver))return{shouldWriteNativeEvents:!0,performance,PerformanceObserver}}function jIe(){if(Pj())try{const{performance:e,PerformanceObserver:t}=require("perf_hooks");if(Phe(e,t))return{shouldWriteNativeEvents:!1,performance:e,PerformanceObserver:t}}catch{}}function oK(){return Oj}var Oj,cK,_o,BIe=Nt({"src/compiler/performanceCore.ts"(){"use strict";Ns(),Oj=RIe()||jIe(),cK=Oj?.performance,_o=cK?()=>cK.now():Date.now?Date.now:()=>+new Date}}),O7,Pu,JIe=Nt({"src/compiler/perfLogger.ts"(){"use strict";try{const e=process.env.TS_ETW_MODULE_PATH??"./node_modules/@microsoft/typescript-etw";O7=require(e)}catch{O7=void 0}Pu=O7?.logEvent?O7:void 0}});function whe(e,t,r,i){return e?Lj(t,r,i):Mj}function Lj(e,t,r){let i=0;return{enter:s,exit:o};function s(){++i===1&&ko(t)}function o(){--i===0?(ko(r),cf(e,t,r)):i<0&&E.fail("enter/exit count does not match.")}}function ko(e){if(ak){const t=h4.get(e)??0;h4.set(e,t+1),ok.set(e,_o()),Y2?.mark(e),typeof onProfilerEvent=="function"&&onProfilerEvent(e)}}function cf(e,t,r){if(ak){const i=(r!==void 0?ok.get(r):void 0)??_o(),s=(t!==void 0?ok.get(t):void 0)??lK,o=ck.get(e)||0;ck.set(e,o+(i-s)),Y2?.measure(e,t,r)}}function zIe(e){return h4.get(e)||0}function WIe(e){return ck.get(e)||0}function UIe(e){ck.forEach((t,r)=>e(r,t))}function VIe(e){ok.forEach((t,r)=>e(r))}function qIe(e){e!==void 0?ck.delete(e):ck.clear(),Y2?.clearMeasures(e)}function HIe(e){e!==void 0?(h4.delete(e),ok.delete(e)):(h4.clear(),ok.clear()),Y2?.clearMarks(e)}function GIe(){return ak}function $Ie(e=Bl){var t;return ak||(ak=!0,$D||($D=oK()),$D&&(lK=$D.performance.timeOrigin,($D.shouldWriteNativeEvents||(t=e?.cpuProfilingEnabled)!=null&&t.call(e)||e?.debugMode)&&(Y2=$D.performance))),!0}function XIe(){ak&&(ok.clear(),h4.clear(),ck.clear(),Y2=void 0,ak=!1)}var $D,Y2,Mj,ak,lK,ok,h4,ck,QIe=Nt({"src/compiler/performance.ts"(){"use strict";Ns(),Mj={enter:Ca,exit:Ca},ak=!1,lK=_o(),ok=new Map,h4=new Map,ck=new Map}}),uK={};jl(uK,{clearMarks:()=>HIe,clearMeasures:()=>qIe,createTimer:()=>Lj,createTimerIf:()=>whe,disable:()=>XIe,enable:()=>$Ie,forEachMark:()=>VIe,forEachMeasure:()=>UIe,getCount:()=>zIe,getDuration:()=>WIe,isEnabled:()=>GIe,mark:()=>ko,measure:()=>cf,nullTimer:()=>Mj});var Z2=Nt({"src/compiler/_namespaces/ts.performance.ts"(){"use strict";QIe()}}),Jr,XD,_K,fK,YIe=Nt({"src/compiler/tracing.ts"(){"use strict";Ns(),Z2(),(e=>{let t,r=0,i=0,s;const o=[];let c;const u=[];function f(B,Y,ae){if(E.assert(!Jr,"Tracing already started"),t===void 0)try{t=require("fs")}catch(oe){throw new Error(`tracing requires having fs +(original error: ${oe.message||oe})`)}s=B,o.length=0,c===void 0&&(c=Hn(Y,"legend.json")),t.existsSync(Y)||t.mkdirSync(Y,{recursive:!0});const _e=s==="build"?`.${process.pid}-${++r}`:s==="server"?`.${process.pid}`:"",$=Hn(Y,`trace${_e}.json`),H=Hn(Y,`types${_e}.json`);u.push({configFilePath:ae,tracePath:$,typesPath:H}),i=t.openSync($,"w"),Jr=e;const K={cat:"__metadata",ph:"M",ts:1e3*_o(),pid:1,tid:1};t.writeSync(i,`[ +`+[{name:"process_name",args:{name:"tsc"},...K},{name:"thread_name",args:{name:"Main"},...K},{name:"TracingStartedInBrowser",...K,cat:"disabled-by-default-devtools.timeline"}].map(oe=>JSON.stringify(oe)).join(`, +`))}e.startTracing=f;function g(){E.assert(Jr,"Tracing is not in progress"),E.assert(!!o.length==(s!=="server")),t.writeSync(i,` +] +`),t.closeSync(i),Jr=void 0,o.length?J(o):u[u.length-1].typesPath=void 0}e.stopTracing=g;function p(B){s!=="server"&&o.push(B)}e.recordType=p;let y;(B=>{B.Parse="parse",B.Program="program",B.Bind="bind",B.Check="check",B.CheckTypes="checkTypes",B.Emit="emit",B.Session="session"})(y=e.Phase||(e.Phase={}));function S(B,Y,ae){W("I",B,Y,ae,'"s":"g"')}e.instant=S;const T=[];function C(B,Y,ae,_e=!1){_e&&W("B",B,Y,ae),T.push({phase:B,name:Y,args:ae,time:1e3*_o(),separateBeginAndEnd:_e})}e.push=C;function w(B){E.assert(T.length>0),z(T.length-1,1e3*_o(),B),T.length--}e.pop=w;function D(){const B=1e3*_o();for(let Y=T.length-1;Y>=0;Y--)z(Y,B);T.length=0}e.popAll=D;const O=1e3*10;function z(B,Y,ae){const{phase:_e,name:$,args:H,time:K,separateBeginAndEnd:oe}=T[B];oe?(E.assert(!ae,"`results` are not supported for events with `separateBeginAndEnd`"),W("E",_e,$,H,void 0,Y)):O-K%O<=Y-K&&W("X",_e,$,{...H,results:ae},`"dur":${Y-K}`,K)}function W(B,Y,ae,_e,$,H=1e3*_o()){s==="server"&&Y==="checkTypes"||(ko("beginTracing"),t.writeSync(i,`, +{"pid":1,"tid":1,"ph":"${B}","cat":"${Y}","ts":${H},"name":"${ae}"`),$&&t.writeSync(i,`,${$}`),_e&&t.writeSync(i,`,"args":${JSON.stringify(_e)}`),t.writeSync(i,"}"),ko("endTracing"),cf("Tracing","beginTracing","endTracing"))}function X(B){const Y=Or(B);return Y?{path:Y.path,start:ae(qa(Y,B.pos)),end:ae(qa(Y,B.end))}:void 0;function ae(_e){return{line:_e.line+1,character:_e.character+1}}}function J(B){var Y,ae,_e,$,H,K,oe,Se,se,Z,ve,Te,Me,ke,he,be,lt,pt,me;ko("beginDumpTypes");const Oe=u[u.length-1].typesPath,Xe=t.openSync(Oe,"w"),it=new Map;t.writeSync(Xe,"[");const mt=B.length;for(let Je=0;JeDr.id),referenceLocation:X(ur.node)}}let Jt={};if(ot.flags&16777216){const ur=ot;Jt={conditionalCheckType:(K=ur.checkType)==null?void 0:K.id,conditionalExtendsType:(oe=ur.extendsType)==null?void 0:oe.id,conditionalTrueType:((Se=ur.resolvedTrueType)==null?void 0:Se.id)??-1,conditionalFalseType:((se=ur.resolvedFalseType)==null?void 0:se.id)??-1}}let It={};if(ot.flags&33554432){const ur=ot;It={substitutionBaseType:(Z=ur.baseType)==null?void 0:Z.id,constraintType:(ve=ur.constraint)==null?void 0:ve.id}}let Nn={};if(Bt&1024){const ur=ot;Nn={reverseMappedSourceType:(Te=ur.source)==null?void 0:Te.id,reverseMappedMappedType:(Me=ur.mappedType)==null?void 0:Me.id,reverseMappedConstraintType:(ke=ur.constraintType)==null?void 0:ke.id}}let Fi={};if(Bt&256){const ur=ot;Fi={evolvingArrayElementType:ur.elementType.id,evolvingArrayFinalType:(he=ur.finalArrayType)==null?void 0:he.id}}let ei;const zi=ot.checker.getRecursionIdentity(ot);zi&&(ei=it.get(zi),ei||(ei=it.size,it.set(zi,ei)));const Qe={id:ot.id,intrinsicName:ot.intrinsicName,symbolName:Ht?.escapedName&&bi(Ht.escapedName),recursionId:ei,isTuple:Bt&8?!0:void 0,unionTypes:ot.flags&1048576?(be=ot.types)==null?void 0:be.map(ur=>ur.id):void 0,intersectionTypes:ot.flags&2097152?ot.types.map(ur=>ur.id):void 0,aliasTypeArguments:(lt=ot.aliasTypeArguments)==null?void 0:lt.map(ur=>ur.id),keyofType:ot.flags&4194304?(pt=ot.type)==null?void 0:pt.id:void 0,...zr,...ar,...Jt,...It,...Nn,...Fi,destructuringPattern:X(ot.pattern),firstDeclaration:X((me=Ht?.declarations)==null?void 0:me[0]),flags:E.formatTypeFlags(ot.flags).split("|"),display:br};t.writeSync(Xe,JSON.stringify(Qe)),Je(e[e.Unknown=0]="Unknown",e[e.EndOfFileToken=1]="EndOfFileToken",e[e.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",e[e.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",e[e.NewLineTrivia=4]="NewLineTrivia",e[e.WhitespaceTrivia=5]="WhitespaceTrivia",e[e.ShebangTrivia=6]="ShebangTrivia",e[e.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",e[e.NonTextFileMarkerTrivia=8]="NonTextFileMarkerTrivia",e[e.NumericLiteral=9]="NumericLiteral",e[e.BigIntLiteral=10]="BigIntLiteral",e[e.StringLiteral=11]="StringLiteral",e[e.JsxText=12]="JsxText",e[e.JsxTextAllWhiteSpaces=13]="JsxTextAllWhiteSpaces",e[e.RegularExpressionLiteral=14]="RegularExpressionLiteral",e[e.NoSubstitutionTemplateLiteral=15]="NoSubstitutionTemplateLiteral",e[e.TemplateHead=16]="TemplateHead",e[e.TemplateMiddle=17]="TemplateMiddle",e[e.TemplateTail=18]="TemplateTail",e[e.OpenBraceToken=19]="OpenBraceToken",e[e.CloseBraceToken=20]="CloseBraceToken",e[e.OpenParenToken=21]="OpenParenToken",e[e.CloseParenToken=22]="CloseParenToken",e[e.OpenBracketToken=23]="OpenBracketToken",e[e.CloseBracketToken=24]="CloseBracketToken",e[e.DotToken=25]="DotToken",e[e.DotDotDotToken=26]="DotDotDotToken",e[e.SemicolonToken=27]="SemicolonToken",e[e.CommaToken=28]="CommaToken",e[e.QuestionDotToken=29]="QuestionDotToken",e[e.LessThanToken=30]="LessThanToken",e[e.LessThanSlashToken=31]="LessThanSlashToken",e[e.GreaterThanToken=32]="GreaterThanToken",e[e.LessThanEqualsToken=33]="LessThanEqualsToken",e[e.GreaterThanEqualsToken=34]="GreaterThanEqualsToken",e[e.EqualsEqualsToken=35]="EqualsEqualsToken",e[e.ExclamationEqualsToken=36]="ExclamationEqualsToken",e[e.EqualsEqualsEqualsToken=37]="EqualsEqualsEqualsToken",e[e.ExclamationEqualsEqualsToken=38]="ExclamationEqualsEqualsToken",e[e.EqualsGreaterThanToken=39]="EqualsGreaterThanToken",e[e.PlusToken=40]="PlusToken",e[e.MinusToken=41]="MinusToken",e[e.AsteriskToken=42]="AsteriskToken",e[e.AsteriskAsteriskToken=43]="AsteriskAsteriskToken",e[e.SlashToken=44]="SlashToken",e[e.PercentToken=45]="PercentToken",e[e.PlusPlusToken=46]="PlusPlusToken",e[e.MinusMinusToken=47]="MinusMinusToken",e[e.LessThanLessThanToken=48]="LessThanLessThanToken",e[e.GreaterThanGreaterThanToken=49]="GreaterThanGreaterThanToken",e[e.GreaterThanGreaterThanGreaterThanToken=50]="GreaterThanGreaterThanGreaterThanToken",e[e.AmpersandToken=51]="AmpersandToken",e[e.BarToken=52]="BarToken",e[e.CaretToken=53]="CaretToken",e[e.ExclamationToken=54]="ExclamationToken",e[e.TildeToken=55]="TildeToken",e[e.AmpersandAmpersandToken=56]="AmpersandAmpersandToken",e[e.BarBarToken=57]="BarBarToken",e[e.QuestionToken=58]="QuestionToken",e[e.ColonToken=59]="ColonToken",e[e.AtToken=60]="AtToken",e[e.QuestionQuestionToken=61]="QuestionQuestionToken",e[e.BacktickToken=62]="BacktickToken",e[e.HashToken=63]="HashToken",e[e.EqualsToken=64]="EqualsToken",e[e.PlusEqualsToken=65]="PlusEqualsToken",e[e.MinusEqualsToken=66]="MinusEqualsToken",e[e.AsteriskEqualsToken=67]="AsteriskEqualsToken",e[e.AsteriskAsteriskEqualsToken=68]="AsteriskAsteriskEqualsToken",e[e.SlashEqualsToken=69]="SlashEqualsToken",e[e.PercentEqualsToken=70]="PercentEqualsToken",e[e.LessThanLessThanEqualsToken=71]="LessThanLessThanEqualsToken",e[e.GreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanEqualsToken",e[e.GreaterThanGreaterThanGreaterThanEqualsToken=73]="GreaterThanGreaterThanGreaterThanEqualsToken",e[e.AmpersandEqualsToken=74]="AmpersandEqualsToken",e[e.BarEqualsToken=75]="BarEqualsToken",e[e.BarBarEqualsToken=76]="BarBarEqualsToken",e[e.AmpersandAmpersandEqualsToken=77]="AmpersandAmpersandEqualsToken",e[e.QuestionQuestionEqualsToken=78]="QuestionQuestionEqualsToken",e[e.CaretEqualsToken=79]="CaretEqualsToken",e[e.Identifier=80]="Identifier",e[e.PrivateIdentifier=81]="PrivateIdentifier",e[e.JSDocCommentTextToken=82]="JSDocCommentTextToken",e[e.BreakKeyword=83]="BreakKeyword",e[e.CaseKeyword=84]="CaseKeyword",e[e.CatchKeyword=85]="CatchKeyword",e[e.ClassKeyword=86]="ClassKeyword",e[e.ConstKeyword=87]="ConstKeyword",e[e.ContinueKeyword=88]="ContinueKeyword",e[e.DebuggerKeyword=89]="DebuggerKeyword",e[e.DefaultKeyword=90]="DefaultKeyword",e[e.DeleteKeyword=91]="DeleteKeyword",e[e.DoKeyword=92]="DoKeyword",e[e.ElseKeyword=93]="ElseKeyword",e[e.EnumKeyword=94]="EnumKeyword",e[e.ExportKeyword=95]="ExportKeyword",e[e.ExtendsKeyword=96]="ExtendsKeyword",e[e.FalseKeyword=97]="FalseKeyword",e[e.FinallyKeyword=98]="FinallyKeyword",e[e.ForKeyword=99]="ForKeyword",e[e.FunctionKeyword=100]="FunctionKeyword",e[e.IfKeyword=101]="IfKeyword",e[e.ImportKeyword=102]="ImportKeyword",e[e.InKeyword=103]="InKeyword",e[e.InstanceOfKeyword=104]="InstanceOfKeyword",e[e.NewKeyword=105]="NewKeyword",e[e.NullKeyword=106]="NullKeyword",e[e.ReturnKeyword=107]="ReturnKeyword",e[e.SuperKeyword=108]="SuperKeyword",e[e.SwitchKeyword=109]="SwitchKeyword",e[e.ThisKeyword=110]="ThisKeyword",e[e.ThrowKeyword=111]="ThrowKeyword",e[e.TrueKeyword=112]="TrueKeyword",e[e.TryKeyword=113]="TryKeyword",e[e.TypeOfKeyword=114]="TypeOfKeyword",e[e.VarKeyword=115]="VarKeyword",e[e.VoidKeyword=116]="VoidKeyword",e[e.WhileKeyword=117]="WhileKeyword",e[e.WithKeyword=118]="WithKeyword",e[e.ImplementsKeyword=119]="ImplementsKeyword",e[e.InterfaceKeyword=120]="InterfaceKeyword",e[e.LetKeyword=121]="LetKeyword",e[e.PackageKeyword=122]="PackageKeyword",e[e.PrivateKeyword=123]="PrivateKeyword",e[e.ProtectedKeyword=124]="ProtectedKeyword",e[e.PublicKeyword=125]="PublicKeyword",e[e.StaticKeyword=126]="StaticKeyword",e[e.YieldKeyword=127]="YieldKeyword",e[e.AbstractKeyword=128]="AbstractKeyword",e[e.AccessorKeyword=129]="AccessorKeyword",e[e.AsKeyword=130]="AsKeyword",e[e.AssertsKeyword=131]="AssertsKeyword",e[e.AssertKeyword=132]="AssertKeyword",e[e.AnyKeyword=133]="AnyKeyword",e[e.AsyncKeyword=134]="AsyncKeyword",e[e.AwaitKeyword=135]="AwaitKeyword",e[e.BooleanKeyword=136]="BooleanKeyword",e[e.ConstructorKeyword=137]="ConstructorKeyword",e[e.DeclareKeyword=138]="DeclareKeyword",e[e.GetKeyword=139]="GetKeyword",e[e.InferKeyword=140]="InferKeyword",e[e.IntrinsicKeyword=141]="IntrinsicKeyword",e[e.IsKeyword=142]="IsKeyword",e[e.KeyOfKeyword=143]="KeyOfKeyword",e[e.ModuleKeyword=144]="ModuleKeyword",e[e.NamespaceKeyword=145]="NamespaceKeyword",e[e.NeverKeyword=146]="NeverKeyword",e[e.OutKeyword=147]="OutKeyword",e[e.ReadonlyKeyword=148]="ReadonlyKeyword",e[e.RequireKeyword=149]="RequireKeyword",e[e.NumberKeyword=150]="NumberKeyword",e[e.ObjectKeyword=151]="ObjectKeyword",e[e.SatisfiesKeyword=152]="SatisfiesKeyword",e[e.SetKeyword=153]="SetKeyword",e[e.StringKeyword=154]="StringKeyword",e[e.SymbolKeyword=155]="SymbolKeyword",e[e.TypeKeyword=156]="TypeKeyword",e[e.UndefinedKeyword=157]="UndefinedKeyword",e[e.UniqueKeyword=158]="UniqueKeyword",e[e.UnknownKeyword=159]="UnknownKeyword",e[e.UsingKeyword=160]="UsingKeyword",e[e.FromKeyword=161]="FromKeyword",e[e.GlobalKeyword=162]="GlobalKeyword",e[e.BigIntKeyword=163]="BigIntKeyword",e[e.OverrideKeyword=164]="OverrideKeyword",e[e.OfKeyword=165]="OfKeyword",e[e.QualifiedName=166]="QualifiedName",e[e.ComputedPropertyName=167]="ComputedPropertyName",e[e.TypeParameter=168]="TypeParameter",e[e.Parameter=169]="Parameter",e[e.Decorator=170]="Decorator",e[e.PropertySignature=171]="PropertySignature",e[e.PropertyDeclaration=172]="PropertyDeclaration",e[e.MethodSignature=173]="MethodSignature",e[e.MethodDeclaration=174]="MethodDeclaration",e[e.ClassStaticBlockDeclaration=175]="ClassStaticBlockDeclaration",e[e.Constructor=176]="Constructor",e[e.GetAccessor=177]="GetAccessor",e[e.SetAccessor=178]="SetAccessor",e[e.CallSignature=179]="CallSignature",e[e.ConstructSignature=180]="ConstructSignature",e[e.IndexSignature=181]="IndexSignature",e[e.TypePredicate=182]="TypePredicate",e[e.TypeReference=183]="TypeReference",e[e.FunctionType=184]="FunctionType",e[e.ConstructorType=185]="ConstructorType",e[e.TypeQuery=186]="TypeQuery",e[e.TypeLiteral=187]="TypeLiteral",e[e.ArrayType=188]="ArrayType",e[e.TupleType=189]="TupleType",e[e.OptionalType=190]="OptionalType",e[e.RestType=191]="RestType",e[e.UnionType=192]="UnionType",e[e.IntersectionType=193]="IntersectionType",e[e.ConditionalType=194]="ConditionalType",e[e.InferType=195]="InferType",e[e.ParenthesizedType=196]="ParenthesizedType",e[e.ThisType=197]="ThisType",e[e.TypeOperator=198]="TypeOperator",e[e.IndexedAccessType=199]="IndexedAccessType",e[e.MappedType=200]="MappedType",e[e.LiteralType=201]="LiteralType",e[e.NamedTupleMember=202]="NamedTupleMember",e[e.TemplateLiteralType=203]="TemplateLiteralType",e[e.TemplateLiteralTypeSpan=204]="TemplateLiteralTypeSpan",e[e.ImportType=205]="ImportType",e[e.ObjectBindingPattern=206]="ObjectBindingPattern",e[e.ArrayBindingPattern=207]="ArrayBindingPattern",e[e.BindingElement=208]="BindingElement",e[e.ArrayLiteralExpression=209]="ArrayLiteralExpression",e[e.ObjectLiteralExpression=210]="ObjectLiteralExpression",e[e.PropertyAccessExpression=211]="PropertyAccessExpression",e[e.ElementAccessExpression=212]="ElementAccessExpression",e[e.CallExpression=213]="CallExpression",e[e.NewExpression=214]="NewExpression",e[e.TaggedTemplateExpression=215]="TaggedTemplateExpression",e[e.TypeAssertionExpression=216]="TypeAssertionExpression",e[e.ParenthesizedExpression=217]="ParenthesizedExpression",e[e.FunctionExpression=218]="FunctionExpression",e[e.ArrowFunction=219]="ArrowFunction",e[e.DeleteExpression=220]="DeleteExpression",e[e.TypeOfExpression=221]="TypeOfExpression",e[e.VoidExpression=222]="VoidExpression",e[e.AwaitExpression=223]="AwaitExpression",e[e.PrefixUnaryExpression=224]="PrefixUnaryExpression",e[e.PostfixUnaryExpression=225]="PostfixUnaryExpression",e[e.BinaryExpression=226]="BinaryExpression",e[e.ConditionalExpression=227]="ConditionalExpression",e[e.TemplateExpression=228]="TemplateExpression",e[e.YieldExpression=229]="YieldExpression",e[e.SpreadElement=230]="SpreadElement",e[e.ClassExpression=231]="ClassExpression",e[e.OmittedExpression=232]="OmittedExpression",e[e.ExpressionWithTypeArguments=233]="ExpressionWithTypeArguments",e[e.AsExpression=234]="AsExpression",e[e.NonNullExpression=235]="NonNullExpression",e[e.MetaProperty=236]="MetaProperty",e[e.SyntheticExpression=237]="SyntheticExpression",e[e.SatisfiesExpression=238]="SatisfiesExpression",e[e.TemplateSpan=239]="TemplateSpan",e[e.SemicolonClassElement=240]="SemicolonClassElement",e[e.Block=241]="Block",e[e.EmptyStatement=242]="EmptyStatement",e[e.VariableStatement=243]="VariableStatement",e[e.ExpressionStatement=244]="ExpressionStatement",e[e.IfStatement=245]="IfStatement",e[e.DoStatement=246]="DoStatement",e[e.WhileStatement=247]="WhileStatement",e[e.ForStatement=248]="ForStatement",e[e.ForInStatement=249]="ForInStatement",e[e.ForOfStatement=250]="ForOfStatement",e[e.ContinueStatement=251]="ContinueStatement",e[e.BreakStatement=252]="BreakStatement",e[e.ReturnStatement=253]="ReturnStatement",e[e.WithStatement=254]="WithStatement",e[e.SwitchStatement=255]="SwitchStatement",e[e.LabeledStatement=256]="LabeledStatement",e[e.ThrowStatement=257]="ThrowStatement",e[e.TryStatement=258]="TryStatement",e[e.DebuggerStatement=259]="DebuggerStatement",e[e.VariableDeclaration=260]="VariableDeclaration",e[e.VariableDeclarationList=261]="VariableDeclarationList",e[e.FunctionDeclaration=262]="FunctionDeclaration",e[e.ClassDeclaration=263]="ClassDeclaration",e[e.InterfaceDeclaration=264]="InterfaceDeclaration",e[e.TypeAliasDeclaration=265]="TypeAliasDeclaration",e[e.EnumDeclaration=266]="EnumDeclaration",e[e.ModuleDeclaration=267]="ModuleDeclaration",e[e.ModuleBlock=268]="ModuleBlock",e[e.CaseBlock=269]="CaseBlock",e[e.NamespaceExportDeclaration=270]="NamespaceExportDeclaration",e[e.ImportEqualsDeclaration=271]="ImportEqualsDeclaration",e[e.ImportDeclaration=272]="ImportDeclaration",e[e.ImportClause=273]="ImportClause",e[e.NamespaceImport=274]="NamespaceImport",e[e.NamedImports=275]="NamedImports",e[e.ImportSpecifier=276]="ImportSpecifier",e[e.ExportAssignment=277]="ExportAssignment",e[e.ExportDeclaration=278]="ExportDeclaration",e[e.NamedExports=279]="NamedExports",e[e.NamespaceExport=280]="NamespaceExport",e[e.ExportSpecifier=281]="ExportSpecifier",e[e.MissingDeclaration=282]="MissingDeclaration",e[e.ExternalModuleReference=283]="ExternalModuleReference",e[e.JsxElement=284]="JsxElement",e[e.JsxSelfClosingElement=285]="JsxSelfClosingElement",e[e.JsxOpeningElement=286]="JsxOpeningElement",e[e.JsxClosingElement=287]="JsxClosingElement",e[e.JsxFragment=288]="JsxFragment",e[e.JsxOpeningFragment=289]="JsxOpeningFragment",e[e.JsxClosingFragment=290]="JsxClosingFragment",e[e.JsxAttribute=291]="JsxAttribute",e[e.JsxAttributes=292]="JsxAttributes",e[e.JsxSpreadAttribute=293]="JsxSpreadAttribute",e[e.JsxExpression=294]="JsxExpression",e[e.JsxNamespacedName=295]="JsxNamespacedName",e[e.CaseClause=296]="CaseClause",e[e.DefaultClause=297]="DefaultClause",e[e.HeritageClause=298]="HeritageClause",e[e.CatchClause=299]="CatchClause",e[e.ImportAttributes=300]="ImportAttributes",e[e.ImportAttribute=301]="ImportAttribute",e[e.AssertClause=300]="AssertClause",e[e.AssertEntry=301]="AssertEntry",e[e.ImportTypeAssertionContainer=302]="ImportTypeAssertionContainer",e[e.PropertyAssignment=303]="PropertyAssignment",e[e.ShorthandPropertyAssignment=304]="ShorthandPropertyAssignment",e[e.SpreadAssignment=305]="SpreadAssignment",e[e.EnumMember=306]="EnumMember",e[e.UnparsedPrologue=307]="UnparsedPrologue",e[e.UnparsedPrepend=308]="UnparsedPrepend",e[e.UnparsedText=309]="UnparsedText",e[e.UnparsedInternalText=310]="UnparsedInternalText",e[e.UnparsedSyntheticReference=311]="UnparsedSyntheticReference",e[e.SourceFile=312]="SourceFile",e[e.Bundle=313]="Bundle",e[e.UnparsedSource=314]="UnparsedSource",e[e.InputFiles=315]="InputFiles",e[e.JSDocTypeExpression=316]="JSDocTypeExpression",e[e.JSDocNameReference=317]="JSDocNameReference",e[e.JSDocMemberName=318]="JSDocMemberName",e[e.JSDocAllType=319]="JSDocAllType",e[e.JSDocUnknownType=320]="JSDocUnknownType",e[e.JSDocNullableType=321]="JSDocNullableType",e[e.JSDocNonNullableType=322]="JSDocNonNullableType",e[e.JSDocOptionalType=323]="JSDocOptionalType",e[e.JSDocFunctionType=324]="JSDocFunctionType",e[e.JSDocVariadicType=325]="JSDocVariadicType",e[e.JSDocNamepathType=326]="JSDocNamepathType",e[e.JSDoc=327]="JSDoc",e[e.JSDocComment=327]="JSDocComment",e[e.JSDocText=328]="JSDocText",e[e.JSDocTypeLiteral=329]="JSDocTypeLiteral",e[e.JSDocSignature=330]="JSDocSignature",e[e.JSDocLink=331]="JSDocLink",e[e.JSDocLinkCode=332]="JSDocLinkCode",e[e.JSDocLinkPlain=333]="JSDocLinkPlain",e[e.JSDocTag=334]="JSDocTag",e[e.JSDocAugmentsTag=335]="JSDocAugmentsTag",e[e.JSDocImplementsTag=336]="JSDocImplementsTag",e[e.JSDocAuthorTag=337]="JSDocAuthorTag",e[e.JSDocDeprecatedTag=338]="JSDocDeprecatedTag",e[e.JSDocClassTag=339]="JSDocClassTag",e[e.JSDocPublicTag=340]="JSDocPublicTag",e[e.JSDocPrivateTag=341]="JSDocPrivateTag",e[e.JSDocProtectedTag=342]="JSDocProtectedTag",e[e.JSDocReadonlyTag=343]="JSDocReadonlyTag",e[e.JSDocOverrideTag=344]="JSDocOverrideTag",e[e.JSDocCallbackTag=345]="JSDocCallbackTag",e[e.JSDocOverloadTag=346]="JSDocOverloadTag",e[e.JSDocEnumTag=347]="JSDocEnumTag",e[e.JSDocParameterTag=348]="JSDocParameterTag",e[e.JSDocReturnTag=349]="JSDocReturnTag",e[e.JSDocThisTag=350]="JSDocThisTag",e[e.JSDocTypeTag=351]="JSDocTypeTag",e[e.JSDocTemplateTag=352]="JSDocTemplateTag",e[e.JSDocTypedefTag=353]="JSDocTypedefTag",e[e.JSDocSeeTag=354]="JSDocSeeTag",e[e.JSDocPropertyTag=355]="JSDocPropertyTag",e[e.JSDocThrowsTag=356]="JSDocThrowsTag",e[e.JSDocSatisfiesTag=357]="JSDocSatisfiesTag",e[e.SyntaxList=358]="SyntaxList",e[e.NotEmittedStatement=359]="NotEmittedStatement",e[e.PartiallyEmittedExpression=360]="PartiallyEmittedExpression",e[e.CommaListExpression=361]="CommaListExpression",e[e.SyntheticReferenceExpression=362]="SyntheticReferenceExpression",e[e.Count=363]="Count",e[e.FirstAssignment=64]="FirstAssignment",e[e.LastAssignment=79]="LastAssignment",e[e.FirstCompoundAssignment=65]="FirstCompoundAssignment",e[e.LastCompoundAssignment=79]="LastCompoundAssignment",e[e.FirstReservedWord=83]="FirstReservedWord",e[e.LastReservedWord=118]="LastReservedWord",e[e.FirstKeyword=83]="FirstKeyword",e[e.LastKeyword=165]="LastKeyword",e[e.FirstFutureReservedWord=119]="FirstFutureReservedWord",e[e.LastFutureReservedWord=127]="LastFutureReservedWord",e[e.FirstTypeNode=182]="FirstTypeNode",e[e.LastTypeNode=205]="LastTypeNode",e[e.FirstPunctuation=19]="FirstPunctuation",e[e.LastPunctuation=79]="LastPunctuation",e[e.FirstToken=0]="FirstToken",e[e.LastToken=165]="LastToken",e[e.FirstTriviaToken=2]="FirstTriviaToken",e[e.LastTriviaToken=7]="LastTriviaToken",e[e.FirstLiteralToken=9]="FirstLiteralToken",e[e.LastLiteralToken=15]="LastLiteralToken",e[e.FirstTemplateToken=15]="FirstTemplateToken",e[e.LastTemplateToken=18]="LastTemplateToken",e[e.FirstBinaryOperator=30]="FirstBinaryOperator",e[e.LastBinaryOperator=79]="LastBinaryOperator",e[e.FirstStatement=243]="FirstStatement",e[e.LastStatement=259]="LastStatement",e[e.FirstNode=166]="FirstNode",e[e.FirstJSDocNode=316]="FirstJSDocNode",e[e.LastJSDocNode=357]="LastJSDocNode",e[e.FirstJSDocTagNode=334]="FirstJSDocTagNode",e[e.LastJSDocTagNode=357]="LastJSDocTagNode",e[e.FirstContextualKeyword=128]="FirstContextualKeyword",e[e.LastContextualKeyword=165]="LastContextualKeyword",e))(L7||{}),M7=(e=>(e[e.None=0]="None",e[e.Let=1]="Let",e[e.Const=2]="Const",e[e.Using=4]="Using",e[e.AwaitUsing=6]="AwaitUsing",e[e.NestedNamespace=8]="NestedNamespace",e[e.Synthesized=16]="Synthesized",e[e.Namespace=32]="Namespace",e[e.OptionalChain=64]="OptionalChain",e[e.ExportContext=128]="ExportContext",e[e.ContainsThis=256]="ContainsThis",e[e.HasImplicitReturn=512]="HasImplicitReturn",e[e.HasExplicitReturn=1024]="HasExplicitReturn",e[e.GlobalAugmentation=2048]="GlobalAugmentation",e[e.HasAsyncFunctions=4096]="HasAsyncFunctions",e[e.DisallowInContext=8192]="DisallowInContext",e[e.YieldContext=16384]="YieldContext",e[e.DecoratorContext=32768]="DecoratorContext",e[e.AwaitContext=65536]="AwaitContext",e[e.DisallowConditionalTypesContext=131072]="DisallowConditionalTypesContext",e[e.ThisNodeHasError=262144]="ThisNodeHasError",e[e.JavaScriptFile=524288]="JavaScriptFile",e[e.ThisNodeOrAnySubNodesHasError=1048576]="ThisNodeOrAnySubNodesHasError",e[e.HasAggregatedChildData=2097152]="HasAggregatedChildData",e[e.PossiblyContainsDynamicImport=4194304]="PossiblyContainsDynamicImport",e[e.PossiblyContainsImportMeta=8388608]="PossiblyContainsImportMeta",e[e.JSDoc=16777216]="JSDoc",e[e.Ambient=33554432]="Ambient",e[e.InWithStatement=67108864]="InWithStatement",e[e.JsonFile=134217728]="JsonFile",e[e.TypeCached=268435456]="TypeCached",e[e.Deprecated=536870912]="Deprecated",e[e.BlockScoped=7]="BlockScoped",e[e.Constant=6]="Constant",e[e.ReachabilityCheckFlags=1536]="ReachabilityCheckFlags",e[e.ReachabilityAndEmitFlags=5632]="ReachabilityAndEmitFlags",e[e.ContextFlags=101441536]="ContextFlags",e[e.TypeExcludesFlags=81920]="TypeExcludesFlags",e[e.PermanentlySetIncrementalFlags=12582912]="PermanentlySetIncrementalFlags",e[e.IdentifierHasExtendedUnicodeEscape=256]="IdentifierHasExtendedUnicodeEscape",e[e.IdentifierIsInJSDocNamespace=4096]="IdentifierIsInJSDocNamespace",e))(M7||{}),R7=(e=>(e[e.None=0]="None",e[e.Public=1]="Public",e[e.Private=2]="Private",e[e.Protected=4]="Protected",e[e.Readonly=8]="Readonly",e[e.Override=16]="Override",e[e.Export=32]="Export",e[e.Abstract=64]="Abstract",e[e.Ambient=128]="Ambient",e[e.Static=256]="Static",e[e.Accessor=512]="Accessor",e[e.Async=1024]="Async",e[e.Default=2048]="Default",e[e.Const=4096]="Const",e[e.In=8192]="In",e[e.Out=16384]="Out",e[e.Decorator=32768]="Decorator",e[e.Deprecated=65536]="Deprecated",e[e.JSDocPublic=8388608]="JSDocPublic",e[e.JSDocPrivate=16777216]="JSDocPrivate",e[e.JSDocProtected=33554432]="JSDocProtected",e[e.JSDocReadonly=67108864]="JSDocReadonly",e[e.JSDocOverride=134217728]="JSDocOverride",e[e.SyntacticOrJSDocModifiers=31]="SyntacticOrJSDocModifiers",e[e.SyntacticOnlyModifiers=65504]="SyntacticOnlyModifiers",e[e.SyntacticModifiers=65535]="SyntacticModifiers",e[e.JSDocCacheOnlyModifiers=260046848]="JSDocCacheOnlyModifiers",e[e.JSDocOnlyModifiers=65536]="JSDocOnlyModifiers",e[e.NonCacheOnlyModifiers=131071]="NonCacheOnlyModifiers",e[e.HasComputedJSDocModifiers=268435456]="HasComputedJSDocModifiers",e[e.HasComputedFlags=536870912]="HasComputedFlags",e[e.AccessibilityModifier=7]="AccessibilityModifier",e[e.ParameterPropertyModifier=31]="ParameterPropertyModifier",e[e.NonPublicAccessibilityModifier=6]="NonPublicAccessibilityModifier",e[e.TypeScriptModifier=28895]="TypeScriptModifier",e[e.ExportDefault=2080]="ExportDefault",e[e.All=131071]="All",e[e.Modifier=98303]="Modifier",e))(R7||{}),Rj=(e=>(e[e.None=0]="None",e[e.IntrinsicNamedElement=1]="IntrinsicNamedElement",e[e.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",e[e.IntrinsicElement=3]="IntrinsicElement",e))(Rj||{}),j7=(e=>(e[e.Succeeded=1]="Succeeded",e[e.Failed=2]="Failed",e[e.Reported=4]="Reported",e[e.ReportsUnmeasurable=8]="ReportsUnmeasurable",e[e.ReportsUnreliable=16]="ReportsUnreliable",e[e.ReportsMask=24]="ReportsMask",e))(j7||{}),B7=(e=>(e[e.None=0]="None",e[e.Auto=1]="Auto",e[e.Loop=2]="Loop",e[e.Unique=3]="Unique",e[e.Node=4]="Node",e[e.KindMask=7]="KindMask",e[e.ReservedInNestedScopes=8]="ReservedInNestedScopes",e[e.Optimistic=16]="Optimistic",e[e.FileLevel=32]="FileLevel",e[e.AllowNameSubstitution=64]="AllowNameSubstitution",e))(B7||{}),jj=(e=>(e[e.None=0]="None",e[e.PrecedingLineBreak=1]="PrecedingLineBreak",e[e.PrecedingJSDocComment=2]="PrecedingJSDocComment",e[e.Unterminated=4]="Unterminated",e[e.ExtendedUnicodeEscape=8]="ExtendedUnicodeEscape",e[e.Scientific=16]="Scientific",e[e.Octal=32]="Octal",e[e.HexSpecifier=64]="HexSpecifier",e[e.BinarySpecifier=128]="BinarySpecifier",e[e.OctalSpecifier=256]="OctalSpecifier",e[e.ContainsSeparator=512]="ContainsSeparator",e[e.UnicodeEscape=1024]="UnicodeEscape",e[e.ContainsInvalidEscape=2048]="ContainsInvalidEscape",e[e.HexEscape=4096]="HexEscape",e[e.ContainsLeadingZero=8192]="ContainsLeadingZero",e[e.ContainsInvalidSeparator=16384]="ContainsInvalidSeparator",e[e.BinaryOrOctalSpecifier=384]="BinaryOrOctalSpecifier",e[e.WithSpecifier=448]="WithSpecifier",e[e.StringLiteralFlags=7176]="StringLiteralFlags",e[e.NumericLiteralFlags=25584]="NumericLiteralFlags",e[e.TemplateLiteralLikeFlags=7176]="TemplateLiteralLikeFlags",e[e.IsInvalid=26656]="IsInvalid",e))(jj||{}),QD=(e=>(e[e.Unreachable=1]="Unreachable",e[e.Start=2]="Start",e[e.BranchLabel=4]="BranchLabel",e[e.LoopLabel=8]="LoopLabel",e[e.Assignment=16]="Assignment",e[e.TrueCondition=32]="TrueCondition",e[e.FalseCondition=64]="FalseCondition",e[e.SwitchClause=128]="SwitchClause",e[e.ArrayMutation=256]="ArrayMutation",e[e.Call=512]="Call",e[e.ReduceLabel=1024]="ReduceLabel",e[e.Referenced=2048]="Referenced",e[e.Shared=4096]="Shared",e[e.Label=12]="Label",e[e.Condition=96]="Condition",e))(QD||{}),Bj=(e=>(e[e.ExpectError=0]="ExpectError",e[e.Ignore=1]="Ignore",e))(Bj||{}),lk=class{},J7=(e=>(e[e.RootFile=0]="RootFile",e[e.SourceFromProjectReference=1]="SourceFromProjectReference",e[e.OutputFromProjectReference=2]="OutputFromProjectReference",e[e.Import=3]="Import",e[e.ReferenceFile=4]="ReferenceFile",e[e.TypeReferenceDirective=5]="TypeReferenceDirective",e[e.LibFile=6]="LibFile",e[e.LibReferenceDirective=7]="LibReferenceDirective",e[e.AutomaticTypeDirectiveFile=8]="AutomaticTypeDirectiveFile",e))(J7||{}),Jj=(e=>(e[e.FilePreprocessingReferencedDiagnostic=0]="FilePreprocessingReferencedDiagnostic",e[e.FilePreprocessingFileExplainingDiagnostic=1]="FilePreprocessingFileExplainingDiagnostic",e[e.ResolutionDiagnostics=2]="ResolutionDiagnostics",e))(Jj||{}),zj=(e=>(e[e.Js=0]="Js",e[e.Dts=1]="Dts",e))(zj||{}),z7=(e=>(e[e.Not=0]="Not",e[e.SafeModules=1]="SafeModules",e[e.Completely=2]="Completely",e))(z7||{}),Wj=(e=>(e[e.Success=0]="Success",e[e.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",e[e.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated",e[e.InvalidProject_OutputsSkipped=3]="InvalidProject_OutputsSkipped",e[e.ProjectReferenceCycle_OutputsSkipped=4]="ProjectReferenceCycle_OutputsSkipped",e))(Wj||{}),Uj=(e=>(e[e.Ok=0]="Ok",e[e.NeedsOverride=1]="NeedsOverride",e[e.HasInvalidOverride=2]="HasInvalidOverride",e))(Uj||{}),Vj=(e=>(e[e.None=0]="None",e[e.Literal=1]="Literal",e[e.Subtype=2]="Subtype",e))(Vj||{}),qj=(e=>(e[e.None=0]="None",e[e.Signature=1]="Signature",e[e.NoConstraints=2]="NoConstraints",e[e.Completions=4]="Completions",e[e.SkipBindingPatterns=8]="SkipBindingPatterns",e))(qj||{}),Hj=(e=>(e[e.None=0]="None",e[e.NoTruncation=1]="NoTruncation",e[e.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",e[e.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",e[e.UseStructuralFallback=8]="UseStructuralFallback",e[e.ForbidIndexedAccessSymbolReferences=16]="ForbidIndexedAccessSymbolReferences",e[e.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",e[e.UseFullyQualifiedType=64]="UseFullyQualifiedType",e[e.UseOnlyExternalAliasing=128]="UseOnlyExternalAliasing",e[e.SuppressAnyReturnType=256]="SuppressAnyReturnType",e[e.WriteTypeParametersInQualifiedName=512]="WriteTypeParametersInQualifiedName",e[e.MultilineObjectLiterals=1024]="MultilineObjectLiterals",e[e.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",e[e.UseTypeOfFunction=4096]="UseTypeOfFunction",e[e.OmitParameterModifiers=8192]="OmitParameterModifiers",e[e.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",e[e.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",e[e.NoTypeReduction=536870912]="NoTypeReduction",e[e.OmitThisParameter=33554432]="OmitThisParameter",e[e.AllowThisInObjectLiteral=32768]="AllowThisInObjectLiteral",e[e.AllowQualifiedNameInPlaceOfIdentifier=65536]="AllowQualifiedNameInPlaceOfIdentifier",e[e.AllowAnonymousIdentifier=131072]="AllowAnonymousIdentifier",e[e.AllowEmptyUnionOrIntersection=262144]="AllowEmptyUnionOrIntersection",e[e.AllowEmptyTuple=524288]="AllowEmptyTuple",e[e.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",e[e.AllowEmptyIndexInfoType=2097152]="AllowEmptyIndexInfoType",e[e.WriteComputedProps=1073741824]="WriteComputedProps",e[e.AllowNodeModulesRelativePaths=67108864]="AllowNodeModulesRelativePaths",e[e.DoNotIncludeSymbolChain=134217728]="DoNotIncludeSymbolChain",e[e.IgnoreErrors=70221824]="IgnoreErrors",e[e.InObjectTypeLiteral=4194304]="InObjectTypeLiteral",e[e.InTypeAlias=8388608]="InTypeAlias",e[e.InInitialEntityName=16777216]="InInitialEntityName",e))(Hj||{}),Gj=(e=>(e[e.None=0]="None",e[e.NoTruncation=1]="NoTruncation",e[e.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",e[e.UseStructuralFallback=8]="UseStructuralFallback",e[e.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",e[e.UseFullyQualifiedType=64]="UseFullyQualifiedType",e[e.SuppressAnyReturnType=256]="SuppressAnyReturnType",e[e.MultilineObjectLiterals=1024]="MultilineObjectLiterals",e[e.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",e[e.UseTypeOfFunction=4096]="UseTypeOfFunction",e[e.OmitParameterModifiers=8192]="OmitParameterModifiers",e[e.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",e[e.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",e[e.NoTypeReduction=536870912]="NoTypeReduction",e[e.OmitThisParameter=33554432]="OmitThisParameter",e[e.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",e[e.AddUndefined=131072]="AddUndefined",e[e.WriteArrowStyleSignature=262144]="WriteArrowStyleSignature",e[e.InArrayType=524288]="InArrayType",e[e.InElementType=2097152]="InElementType",e[e.InFirstTypeArgument=4194304]="InFirstTypeArgument",e[e.InTypeAlias=8388608]="InTypeAlias",e[e.NodeBuilderFlagsMask=848330091]="NodeBuilderFlagsMask",e))(Gj||{}),$j=(e=>(e[e.None=0]="None",e[e.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",e[e.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing",e[e.AllowAnyNodeKind=4]="AllowAnyNodeKind",e[e.UseAliasDefinedOutsideCurrentScope=8]="UseAliasDefinedOutsideCurrentScope",e[e.WriteComputedProps=16]="WriteComputedProps",e[e.DoNotIncludeSymbolChain=32]="DoNotIncludeSymbolChain",e))($j||{}),Xj=(e=>(e[e.Accessible=0]="Accessible",e[e.NotAccessible=1]="NotAccessible",e[e.CannotBeNamed=2]="CannotBeNamed",e))(Xj||{}),Qj=(e=>(e[e.UnionOrIntersection=0]="UnionOrIntersection",e[e.Spread=1]="Spread",e))(Qj||{}),Yj=(e=>(e[e.This=0]="This",e[e.Identifier=1]="Identifier",e[e.AssertsThis=2]="AssertsThis",e[e.AssertsIdentifier=3]="AssertsIdentifier",e))(Yj||{}),Zj=(e=>(e[e.Unknown=0]="Unknown",e[e.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",e[e.VoidNullableOrNeverType=2]="VoidNullableOrNeverType",e[e.NumberLikeType=3]="NumberLikeType",e[e.BigIntLikeType=4]="BigIntLikeType",e[e.StringLikeType=5]="StringLikeType",e[e.BooleanType=6]="BooleanType",e[e.ArrayLikeType=7]="ArrayLikeType",e[e.ESSymbolType=8]="ESSymbolType",e[e.Promise=9]="Promise",e[e.TypeWithCallSignature=10]="TypeWithCallSignature",e[e.ObjectType=11]="ObjectType",e))(Zj||{}),W7=(e=>(e[e.None=0]="None",e[e.FunctionScopedVariable=1]="FunctionScopedVariable",e[e.BlockScopedVariable=2]="BlockScopedVariable",e[e.Property=4]="Property",e[e.EnumMember=8]="EnumMember",e[e.Function=16]="Function",e[e.Class=32]="Class",e[e.Interface=64]="Interface",e[e.ConstEnum=128]="ConstEnum",e[e.RegularEnum=256]="RegularEnum",e[e.ValueModule=512]="ValueModule",e[e.NamespaceModule=1024]="NamespaceModule",e[e.TypeLiteral=2048]="TypeLiteral",e[e.ObjectLiteral=4096]="ObjectLiteral",e[e.Method=8192]="Method",e[e.Constructor=16384]="Constructor",e[e.GetAccessor=32768]="GetAccessor",e[e.SetAccessor=65536]="SetAccessor",e[e.Signature=131072]="Signature",e[e.TypeParameter=262144]="TypeParameter",e[e.TypeAlias=524288]="TypeAlias",e[e.ExportValue=1048576]="ExportValue",e[e.Alias=2097152]="Alias",e[e.Prototype=4194304]="Prototype",e[e.ExportStar=8388608]="ExportStar",e[e.Optional=16777216]="Optional",e[e.Transient=33554432]="Transient",e[e.Assignment=67108864]="Assignment",e[e.ModuleExports=134217728]="ModuleExports",e[e.All=67108863]="All",e[e.Enum=384]="Enum",e[e.Variable=3]="Variable",e[e.Value=111551]="Value",e[e.Type=788968]="Type",e[e.Namespace=1920]="Namespace",e[e.Module=1536]="Module",e[e.Accessor=98304]="Accessor",e[e.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",e[e.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",e[e.ParameterExcludes=111551]="ParameterExcludes",e[e.PropertyExcludes=0]="PropertyExcludes",e[e.EnumMemberExcludes=900095]="EnumMemberExcludes",e[e.FunctionExcludes=110991]="FunctionExcludes",e[e.ClassExcludes=899503]="ClassExcludes",e[e.InterfaceExcludes=788872]="InterfaceExcludes",e[e.RegularEnumExcludes=899327]="RegularEnumExcludes",e[e.ConstEnumExcludes=899967]="ConstEnumExcludes",e[e.ValueModuleExcludes=110735]="ValueModuleExcludes",e[e.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",e[e.MethodExcludes=103359]="MethodExcludes",e[e.GetAccessorExcludes=46015]="GetAccessorExcludes",e[e.SetAccessorExcludes=78783]="SetAccessorExcludes",e[e.AccessorExcludes=13247]="AccessorExcludes",e[e.TypeParameterExcludes=526824]="TypeParameterExcludes",e[e.TypeAliasExcludes=788968]="TypeAliasExcludes",e[e.AliasExcludes=2097152]="AliasExcludes",e[e.ModuleMember=2623475]="ModuleMember",e[e.ExportHasLocal=944]="ExportHasLocal",e[e.BlockScoped=418]="BlockScoped",e[e.PropertyOrAccessor=98308]="PropertyOrAccessor",e[e.ClassMember=106500]="ClassMember",e[e.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",e[e.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",e[e.Classifiable=2885600]="Classifiable",e[e.LateBindingContainer=6256]="LateBindingContainer",e))(W7||{}),Kj=(e=>(e[e.Numeric=0]="Numeric",e[e.Literal=1]="Literal",e))(Kj||{}),eB=(e=>(e[e.None=0]="None",e[e.Instantiated=1]="Instantiated",e[e.SyntheticProperty=2]="SyntheticProperty",e[e.SyntheticMethod=4]="SyntheticMethod",e[e.Readonly=8]="Readonly",e[e.ReadPartial=16]="ReadPartial",e[e.WritePartial=32]="WritePartial",e[e.HasNonUniformType=64]="HasNonUniformType",e[e.HasLiteralType=128]="HasLiteralType",e[e.ContainsPublic=256]="ContainsPublic",e[e.ContainsProtected=512]="ContainsProtected",e[e.ContainsPrivate=1024]="ContainsPrivate",e[e.ContainsStatic=2048]="ContainsStatic",e[e.Late=4096]="Late",e[e.ReverseMapped=8192]="ReverseMapped",e[e.OptionalParameter=16384]="OptionalParameter",e[e.RestParameter=32768]="RestParameter",e[e.DeferredType=65536]="DeferredType",e[e.HasNeverType=131072]="HasNeverType",e[e.Mapped=262144]="Mapped",e[e.StripOptional=524288]="StripOptional",e[e.Unresolved=1048576]="Unresolved",e[e.Synthetic=6]="Synthetic",e[e.Discriminant=192]="Discriminant",e[e.Partial=48]="Partial",e))(eB||{}),tB=(e=>(e.Call="__call",e.Constructor="__constructor",e.New="__new",e.Index="__index",e.ExportStar="__export",e.Global="__global",e.Missing="__missing",e.Type="__type",e.Object="__object",e.JSXAttributes="__jsxAttributes",e.Class="__class",e.Function="__function",e.Computed="__computed",e.Resolving="__resolving__",e.ExportEquals="export=",e.Default="default",e.This="this",e))(tB||{}),rB=(e=>(e[e.None=0]="None",e[e.TypeChecked=1]="TypeChecked",e[e.LexicalThis=2]="LexicalThis",e[e.CaptureThis=4]="CaptureThis",e[e.CaptureNewTarget=8]="CaptureNewTarget",e[e.SuperInstance=16]="SuperInstance",e[e.SuperStatic=32]="SuperStatic",e[e.ContextChecked=64]="ContextChecked",e[e.MethodWithSuperPropertyAccessInAsync=128]="MethodWithSuperPropertyAccessInAsync",e[e.MethodWithSuperPropertyAssignmentInAsync=256]="MethodWithSuperPropertyAssignmentInAsync",e[e.CaptureArguments=512]="CaptureArguments",e[e.EnumValuesComputed=1024]="EnumValuesComputed",e[e.LexicalModuleMergesWithClass=2048]="LexicalModuleMergesWithClass",e[e.LoopWithCapturedBlockScopedBinding=4096]="LoopWithCapturedBlockScopedBinding",e[e.ContainsCapturedBlockScopeBinding=8192]="ContainsCapturedBlockScopeBinding",e[e.CapturedBlockScopedBinding=16384]="CapturedBlockScopedBinding",e[e.BlockScopedBindingInLoop=32768]="BlockScopedBindingInLoop",e[e.NeedsLoopOutParameter=65536]="NeedsLoopOutParameter",e[e.AssignmentsMarked=131072]="AssignmentsMarked",e[e.ContainsConstructorReference=262144]="ContainsConstructorReference",e[e.ConstructorReference=536870912]="ConstructorReference",e[e.ContainsClassWithPrivateIdentifiers=1048576]="ContainsClassWithPrivateIdentifiers",e[e.ContainsSuperPropertyInStaticInitializer=2097152]="ContainsSuperPropertyInStaticInitializer",e[e.InCheckIdentifier=4194304]="InCheckIdentifier",e))(rB||{}),U7=(e=>(e[e.Any=1]="Any",e[e.Unknown=2]="Unknown",e[e.String=4]="String",e[e.Number=8]="Number",e[e.Boolean=16]="Boolean",e[e.Enum=32]="Enum",e[e.BigInt=64]="BigInt",e[e.StringLiteral=128]="StringLiteral",e[e.NumberLiteral=256]="NumberLiteral",e[e.BooleanLiteral=512]="BooleanLiteral",e[e.EnumLiteral=1024]="EnumLiteral",e[e.BigIntLiteral=2048]="BigIntLiteral",e[e.ESSymbol=4096]="ESSymbol",e[e.UniqueESSymbol=8192]="UniqueESSymbol",e[e.Void=16384]="Void",e[e.Undefined=32768]="Undefined",e[e.Null=65536]="Null",e[e.Never=131072]="Never",e[e.TypeParameter=262144]="TypeParameter",e[e.Object=524288]="Object",e[e.Union=1048576]="Union",e[e.Intersection=2097152]="Intersection",e[e.Index=4194304]="Index",e[e.IndexedAccess=8388608]="IndexedAccess",e[e.Conditional=16777216]="Conditional",e[e.Substitution=33554432]="Substitution",e[e.NonPrimitive=67108864]="NonPrimitive",e[e.TemplateLiteral=134217728]="TemplateLiteral",e[e.StringMapping=268435456]="StringMapping",e[e.AnyOrUnknown=3]="AnyOrUnknown",e[e.Nullable=98304]="Nullable",e[e.Literal=2944]="Literal",e[e.Unit=109472]="Unit",e[e.Freshable=2976]="Freshable",e[e.StringOrNumberLiteral=384]="StringOrNumberLiteral",e[e.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",e[e.DefinitelyFalsy=117632]="DefinitelyFalsy",e[e.PossiblyFalsy=117724]="PossiblyFalsy",e[e.Intrinsic=67359327]="Intrinsic",e[e.StringLike=402653316]="StringLike",e[e.NumberLike=296]="NumberLike",e[e.BigIntLike=2112]="BigIntLike",e[e.BooleanLike=528]="BooleanLike",e[e.EnumLike=1056]="EnumLike",e[e.ESSymbolLike=12288]="ESSymbolLike",e[e.VoidLike=49152]="VoidLike",e[e.Primitive=402784252]="Primitive",e[e.DefinitelyNonNullable=470302716]="DefinitelyNonNullable",e[e.DisjointDomains=469892092]="DisjointDomains",e[e.UnionOrIntersection=3145728]="UnionOrIntersection",e[e.StructuredType=3670016]="StructuredType",e[e.TypeVariable=8650752]="TypeVariable",e[e.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",e[e.InstantiablePrimitive=406847488]="InstantiablePrimitive",e[e.Instantiable=465829888]="Instantiable",e[e.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",e[e.ObjectFlagsType=3899393]="ObjectFlagsType",e[e.Simplifiable=25165824]="Simplifiable",e[e.Singleton=67358815]="Singleton",e[e.Narrowable=536624127]="Narrowable",e[e.IncludesMask=473694207]="IncludesMask",e[e.IncludesMissingType=262144]="IncludesMissingType",e[e.IncludesNonWideningType=4194304]="IncludesNonWideningType",e[e.IncludesWildcard=8388608]="IncludesWildcard",e[e.IncludesEmptyObject=16777216]="IncludesEmptyObject",e[e.IncludesInstantiable=33554432]="IncludesInstantiable",e[e.NotPrimitiveUnion=36323331]="NotPrimitiveUnion",e))(U7||{}),V7=(e=>(e[e.None=0]="None",e[e.Class=1]="Class",e[e.Interface=2]="Interface",e[e.Reference=4]="Reference",e[e.Tuple=8]="Tuple",e[e.Anonymous=16]="Anonymous",e[e.Mapped=32]="Mapped",e[e.Instantiated=64]="Instantiated",e[e.ObjectLiteral=128]="ObjectLiteral",e[e.EvolvingArray=256]="EvolvingArray",e[e.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",e[e.ReverseMapped=1024]="ReverseMapped",e[e.JsxAttributes=2048]="JsxAttributes",e[e.JSLiteral=4096]="JSLiteral",e[e.FreshLiteral=8192]="FreshLiteral",e[e.ArrayLiteral=16384]="ArrayLiteral",e[e.PrimitiveUnion=32768]="PrimitiveUnion",e[e.ContainsWideningType=65536]="ContainsWideningType",e[e.ContainsObjectOrArrayLiteral=131072]="ContainsObjectOrArrayLiteral",e[e.NonInferrableType=262144]="NonInferrableType",e[e.CouldContainTypeVariablesComputed=524288]="CouldContainTypeVariablesComputed",e[e.CouldContainTypeVariables=1048576]="CouldContainTypeVariables",e[e.ClassOrInterface=3]="ClassOrInterface",e[e.RequiresWidening=196608]="RequiresWidening",e[e.PropagatingFlags=458752]="PropagatingFlags",e[e.InstantiatedMapped=96]="InstantiatedMapped",e[e.ObjectTypeKindMask=1343]="ObjectTypeKindMask",e[e.ContainsSpread=2097152]="ContainsSpread",e[e.ObjectRestType=4194304]="ObjectRestType",e[e.InstantiationExpressionType=8388608]="InstantiationExpressionType",e[e.IsClassInstanceClone=16777216]="IsClassInstanceClone",e[e.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",e[e.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",e[e.IsGenericTypeComputed=2097152]="IsGenericTypeComputed",e[e.IsGenericObjectType=4194304]="IsGenericObjectType",e[e.IsGenericIndexType=8388608]="IsGenericIndexType",e[e.IsGenericType=12582912]="IsGenericType",e[e.ContainsIntersections=16777216]="ContainsIntersections",e[e.IsUnknownLikeUnionComputed=33554432]="IsUnknownLikeUnionComputed",e[e.IsUnknownLikeUnion=67108864]="IsUnknownLikeUnion",e[e.IsNeverIntersectionComputed=16777216]="IsNeverIntersectionComputed",e[e.IsNeverIntersection=33554432]="IsNeverIntersection",e))(V7||{}),nB=(e=>(e[e.Invariant=0]="Invariant",e[e.Covariant=1]="Covariant",e[e.Contravariant=2]="Contravariant",e[e.Bivariant=3]="Bivariant",e[e.Independent=4]="Independent",e[e.VarianceMask=7]="VarianceMask",e[e.Unmeasurable=8]="Unmeasurable",e[e.Unreliable=16]="Unreliable",e[e.AllowsStructuralFallback=24]="AllowsStructuralFallback",e))(nB||{}),iB=(e=>(e[e.Required=1]="Required",e[e.Optional=2]="Optional",e[e.Rest=4]="Rest",e[e.Variadic=8]="Variadic",e[e.Fixed=3]="Fixed",e[e.Variable=12]="Variable",e[e.NonRequired=14]="NonRequired",e[e.NonRest=11]="NonRest",e))(iB||{}),sB=(e=>(e[e.None=0]="None",e[e.IncludeUndefined=1]="IncludeUndefined",e[e.NoIndexSignatures=2]="NoIndexSignatures",e[e.Writing=4]="Writing",e[e.CacheSymbol=8]="CacheSymbol",e[e.NoTupleBoundsCheck=16]="NoTupleBoundsCheck",e[e.ExpressionPosition=32]="ExpressionPosition",e[e.ReportDeprecated=64]="ReportDeprecated",e[e.SuppressNoImplicitAnyError=128]="SuppressNoImplicitAnyError",e[e.Contextual=256]="Contextual",e[e.Persistent=1]="Persistent",e))(sB||{}),aB=(e=>(e[e.None=0]="None",e[e.StringsOnly=1]="StringsOnly",e[e.NoIndexSignatures=2]="NoIndexSignatures",e[e.NoReducibleCheck=4]="NoReducibleCheck",e))(aB||{}),oB=(e=>(e[e.Component=0]="Component",e[e.Function=1]="Function",e[e.Mixed=2]="Mixed",e))(oB||{}),cB=(e=>(e[e.Call=0]="Call",e[e.Construct=1]="Construct",e))(cB||{}),q7=(e=>(e[e.None=0]="None",e[e.HasRestParameter=1]="HasRestParameter",e[e.HasLiteralTypes=2]="HasLiteralTypes",e[e.Abstract=4]="Abstract",e[e.IsInnerCallChain=8]="IsInnerCallChain",e[e.IsOuterCallChain=16]="IsOuterCallChain",e[e.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",e[e.IsNonInferrable=64]="IsNonInferrable",e[e.IsSignatureCandidateForOverloadFailure=128]="IsSignatureCandidateForOverloadFailure",e[e.PropagatingFlags=167]="PropagatingFlags",e[e.CallChainFlags=24]="CallChainFlags",e))(q7||{}),lB=(e=>(e[e.String=0]="String",e[e.Number=1]="Number",e))(lB||{}),uB=(e=>(e[e.Simple=0]="Simple",e[e.Array=1]="Array",e[e.Deferred=2]="Deferred",e[e.Function=3]="Function",e[e.Composite=4]="Composite",e[e.Merged=5]="Merged",e))(uB||{}),_B=(e=>(e[e.None=0]="None",e[e.NakedTypeVariable=1]="NakedTypeVariable",e[e.SpeculativeTuple=2]="SpeculativeTuple",e[e.SubstituteSource=4]="SubstituteSource",e[e.HomomorphicMappedType=8]="HomomorphicMappedType",e[e.PartialHomomorphicMappedType=16]="PartialHomomorphicMappedType",e[e.MappedTypeConstraint=32]="MappedTypeConstraint",e[e.ContravariantConditional=64]="ContravariantConditional",e[e.ReturnType=128]="ReturnType",e[e.LiteralKeyof=256]="LiteralKeyof",e[e.NoConstraints=512]="NoConstraints",e[e.AlwaysStrict=1024]="AlwaysStrict",e[e.MaxValue=2048]="MaxValue",e[e.PriorityImpliesCombination=416]="PriorityImpliesCombination",e[e.Circularity=-1]="Circularity",e))(_B||{}),fB=(e=>(e[e.None=0]="None",e[e.NoDefault=1]="NoDefault",e[e.AnyDefault=2]="AnyDefault",e[e.SkippedGenericFunction=4]="SkippedGenericFunction",e))(fB||{}),pB=(e=>(e[e.False=0]="False",e[e.Unknown=1]="Unknown",e[e.Maybe=3]="Maybe",e[e.True=-1]="True",e))(pB||{}),dB=(e=>(e[e.None=0]="None",e[e.ExportsProperty=1]="ExportsProperty",e[e.ModuleExports=2]="ModuleExports",e[e.PrototypeProperty=3]="PrototypeProperty",e[e.ThisProperty=4]="ThisProperty",e[e.Property=5]="Property",e[e.Prototype=6]="Prototype",e[e.ObjectDefinePropertyValue=7]="ObjectDefinePropertyValue",e[e.ObjectDefinePropertyExports=8]="ObjectDefinePropertyExports",e[e.ObjectDefinePrototypeProperty=9]="ObjectDefinePrototypeProperty",e))(dB||{}),YD=(e=>(e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Suggestion=2]="Suggestion",e[e.Message=3]="Message",e))(YD||{}),uk=(e=>(e[e.Classic=1]="Classic",e[e.NodeJs=2]="NodeJs",e[e.Node10=2]="Node10",e[e.Node16=3]="Node16",e[e.NodeNext=99]="NodeNext",e[e.Bundler=100]="Bundler",e))(uk||{}),mB=(e=>(e[e.Legacy=1]="Legacy",e[e.Auto=2]="Auto",e[e.Force=3]="Force",e))(mB||{}),gB=(e=>(e[e.FixedPollingInterval=0]="FixedPollingInterval",e[e.PriorityPollingInterval=1]="PriorityPollingInterval",e[e.DynamicPriorityPolling=2]="DynamicPriorityPolling",e[e.FixedChunkSizePolling=3]="FixedChunkSizePolling",e[e.UseFsEvents=4]="UseFsEvents",e[e.UseFsEventsOnParentDirectory=5]="UseFsEventsOnParentDirectory",e))(gB||{}),hB=(e=>(e[e.UseFsEvents=0]="UseFsEvents",e[e.FixedPollingInterval=1]="FixedPollingInterval",e[e.DynamicPriorityPolling=2]="DynamicPriorityPolling",e[e.FixedChunkSizePolling=3]="FixedChunkSizePolling",e))(hB||{}),yB=(e=>(e[e.FixedInterval=0]="FixedInterval",e[e.PriorityInterval=1]="PriorityInterval",e[e.DynamicPriority=2]="DynamicPriority",e[e.FixedChunkSize=3]="FixedChunkSize",e))(yB||{}),y4=(e=>(e[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES2015=5]="ES2015",e[e.ES2020=6]="ES2020",e[e.ES2022=7]="ES2022",e[e.ESNext=99]="ESNext",e[e.Node16=100]="Node16",e[e.NodeNext=199]="NodeNext",e))(y4||{}),vB=(e=>(e[e.None=0]="None",e[e.Preserve=1]="Preserve",e[e.React=2]="React",e[e.ReactNative=3]="ReactNative",e[e.ReactJSX=4]="ReactJSX",e[e.ReactJSXDev=5]="ReactJSXDev",e))(vB||{}),bB=(e=>(e[e.Remove=0]="Remove",e[e.Preserve=1]="Preserve",e[e.Error=2]="Error",e))(bB||{}),SB=(e=>(e[e.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",e[e.LineFeed=1]="LineFeed",e))(SB||{}),H7=(e=>(e[e.Unknown=0]="Unknown",e[e.JS=1]="JS",e[e.JSX=2]="JSX",e[e.TS=3]="TS",e[e.TSX=4]="TSX",e[e.External=5]="External",e[e.JSON=6]="JSON",e[e.Deferred=7]="Deferred",e))(H7||{}),TB=(e=>(e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ES2021=8]="ES2021",e[e.ES2022=9]="ES2022",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest",e))(TB||{}),xB=(e=>(e[e.Standard=0]="Standard",e[e.JSX=1]="JSX",e))(xB||{}),kB=(e=>(e[e.None=0]="None",e[e.Recursive=1]="Recursive",e))(kB||{}),CB=(e=>(e[e.nullCharacter=0]="nullCharacter",e[e.maxAsciiCharacter=127]="maxAsciiCharacter",e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.lineSeparator=8232]="lineSeparator",e[e.paragraphSeparator=8233]="paragraphSeparator",e[e.nextLine=133]="nextLine",e[e.space=32]="space",e[e.nonBreakingSpace=160]="nonBreakingSpace",e[e.enQuad=8192]="enQuad",e[e.emQuad=8193]="emQuad",e[e.enSpace=8194]="enSpace",e[e.emSpace=8195]="emSpace",e[e.threePerEmSpace=8196]="threePerEmSpace",e[e.fourPerEmSpace=8197]="fourPerEmSpace",e[e.sixPerEmSpace=8198]="sixPerEmSpace",e[e.figureSpace=8199]="figureSpace",e[e.punctuationSpace=8200]="punctuationSpace",e[e.thinSpace=8201]="thinSpace",e[e.hairSpace=8202]="hairSpace",e[e.zeroWidthSpace=8203]="zeroWidthSpace",e[e.narrowNoBreakSpace=8239]="narrowNoBreakSpace",e[e.ideographicSpace=12288]="ideographicSpace",e[e.mathematicalSpace=8287]="mathematicalSpace",e[e.ogham=5760]="ogham",e[e.replacementCharacter=65533]="replacementCharacter",e[e._=95]="_",e[e.$=36]="$",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.ampersand=38]="ampersand",e[e.asterisk=42]="asterisk",e[e.at=64]="at",e[e.backslash=92]="backslash",e[e.backtick=96]="backtick",e[e.bar=124]="bar",e[e.caret=94]="caret",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.closeParen=41]="closeParen",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.equals=61]="equals",e[e.exclamation=33]="exclamation",e[e.greaterThan=62]="greaterThan",e[e.hash=35]="hash",e[e.lessThan=60]="lessThan",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.openParen=40]="openParen",e[e.percent=37]="percent",e[e.plus=43]="plus",e[e.question=63]="question",e[e.semicolon=59]="semicolon",e[e.singleQuote=39]="singleQuote",e[e.slash=47]="slash",e[e.tilde=126]="tilde",e[e.backspace=8]="backspace",e[e.formFeed=12]="formFeed",e[e.byteOrderMark=65279]="byteOrderMark",e[e.tab=9]="tab",e[e.verticalTab=11]="verticalTab",e))(CB||{}),EB=(e=>(e.Ts=".ts",e.Tsx=".tsx",e.Dts=".d.ts",e.Js=".js",e.Jsx=".jsx",e.Json=".json",e.TsBuildInfo=".tsbuildinfo",e.Mjs=".mjs",e.Mts=".mts",e.Dmts=".d.mts",e.Cjs=".cjs",e.Cts=".cts",e.Dcts=".d.cts",e))(EB||{}),G7=(e=>(e[e.None=0]="None",e[e.ContainsTypeScript=1]="ContainsTypeScript",e[e.ContainsJsx=2]="ContainsJsx",e[e.ContainsESNext=4]="ContainsESNext",e[e.ContainsES2022=8]="ContainsES2022",e[e.ContainsES2021=16]="ContainsES2021",e[e.ContainsES2020=32]="ContainsES2020",e[e.ContainsES2019=64]="ContainsES2019",e[e.ContainsES2018=128]="ContainsES2018",e[e.ContainsES2017=256]="ContainsES2017",e[e.ContainsES2016=512]="ContainsES2016",e[e.ContainsES2015=1024]="ContainsES2015",e[e.ContainsGenerator=2048]="ContainsGenerator",e[e.ContainsDestructuringAssignment=4096]="ContainsDestructuringAssignment",e[e.ContainsTypeScriptClassSyntax=8192]="ContainsTypeScriptClassSyntax",e[e.ContainsLexicalThis=16384]="ContainsLexicalThis",e[e.ContainsRestOrSpread=32768]="ContainsRestOrSpread",e[e.ContainsObjectRestOrSpread=65536]="ContainsObjectRestOrSpread",e[e.ContainsComputedPropertyName=131072]="ContainsComputedPropertyName",e[e.ContainsBlockScopedBinding=262144]="ContainsBlockScopedBinding",e[e.ContainsBindingPattern=524288]="ContainsBindingPattern",e[e.ContainsYield=1048576]="ContainsYield",e[e.ContainsAwait=2097152]="ContainsAwait",e[e.ContainsHoistedDeclarationOrCompletion=4194304]="ContainsHoistedDeclarationOrCompletion",e[e.ContainsDynamicImport=8388608]="ContainsDynamicImport",e[e.ContainsClassFields=16777216]="ContainsClassFields",e[e.ContainsDecorators=33554432]="ContainsDecorators",e[e.ContainsPossibleTopLevelAwait=67108864]="ContainsPossibleTopLevelAwait",e[e.ContainsLexicalSuper=134217728]="ContainsLexicalSuper",e[e.ContainsUpdateExpressionForIdentifier=268435456]="ContainsUpdateExpressionForIdentifier",e[e.ContainsPrivateIdentifierInExpression=536870912]="ContainsPrivateIdentifierInExpression",e[e.HasComputedFlags=-2147483648]="HasComputedFlags",e[e.AssertTypeScript=1]="AssertTypeScript",e[e.AssertJsx=2]="AssertJsx",e[e.AssertESNext=4]="AssertESNext",e[e.AssertES2022=8]="AssertES2022",e[e.AssertES2021=16]="AssertES2021",e[e.AssertES2020=32]="AssertES2020",e[e.AssertES2019=64]="AssertES2019",e[e.AssertES2018=128]="AssertES2018",e[e.AssertES2017=256]="AssertES2017",e[e.AssertES2016=512]="AssertES2016",e[e.AssertES2015=1024]="AssertES2015",e[e.AssertGenerator=2048]="AssertGenerator",e[e.AssertDestructuringAssignment=4096]="AssertDestructuringAssignment",e[e.OuterExpressionExcludes=-2147483648]="OuterExpressionExcludes",e[e.PropertyAccessExcludes=-2147483648]="PropertyAccessExcludes",e[e.NodeExcludes=-2147483648]="NodeExcludes",e[e.ArrowFunctionExcludes=-2072174592]="ArrowFunctionExcludes",e[e.FunctionExcludes=-1937940480]="FunctionExcludes",e[e.ConstructorExcludes=-1937948672]="ConstructorExcludes",e[e.MethodOrAccessorExcludes=-2005057536]="MethodOrAccessorExcludes",e[e.PropertyExcludes=-2013249536]="PropertyExcludes",e[e.ClassExcludes=-2147344384]="ClassExcludes",e[e.ModuleExcludes=-1941676032]="ModuleExcludes",e[e.TypeExcludes=-2]="TypeExcludes",e[e.ObjectLiteralExcludes=-2147278848]="ObjectLiteralExcludes",e[e.ArrayLiteralOrCallOrNewExcludes=-2147450880]="ArrayLiteralOrCallOrNewExcludes",e[e.VariableDeclarationListExcludes=-2146893824]="VariableDeclarationListExcludes",e[e.ParameterExcludes=-2147483648]="ParameterExcludes",e[e.CatchClauseExcludes=-2147418112]="CatchClauseExcludes",e[e.BindingPatternExcludes=-2147450880]="BindingPatternExcludes",e[e.ContainsLexicalThisOrSuper=134234112]="ContainsLexicalThisOrSuper",e[e.PropertyNamePropagatingFlags=134234112]="PropertyNamePropagatingFlags",e))(G7||{}),$7=(e=>(e[e.TabStop=0]="TabStop",e[e.Placeholder=1]="Placeholder",e[e.Choice=2]="Choice",e[e.Variable=3]="Variable",e))($7||{}),X7=(e=>(e[e.None=0]="None",e[e.SingleLine=1]="SingleLine",e[e.MultiLine=2]="MultiLine",e[e.AdviseOnEmitNode=4]="AdviseOnEmitNode",e[e.NoSubstitution=8]="NoSubstitution",e[e.CapturesThis=16]="CapturesThis",e[e.NoLeadingSourceMap=32]="NoLeadingSourceMap",e[e.NoTrailingSourceMap=64]="NoTrailingSourceMap",e[e.NoSourceMap=96]="NoSourceMap",e[e.NoNestedSourceMaps=128]="NoNestedSourceMaps",e[e.NoTokenLeadingSourceMaps=256]="NoTokenLeadingSourceMaps",e[e.NoTokenTrailingSourceMaps=512]="NoTokenTrailingSourceMaps",e[e.NoTokenSourceMaps=768]="NoTokenSourceMaps",e[e.NoLeadingComments=1024]="NoLeadingComments",e[e.NoTrailingComments=2048]="NoTrailingComments",e[e.NoComments=3072]="NoComments",e[e.NoNestedComments=4096]="NoNestedComments",e[e.HelperName=8192]="HelperName",e[e.ExportName=16384]="ExportName",e[e.LocalName=32768]="LocalName",e[e.InternalName=65536]="InternalName",e[e.Indented=131072]="Indented",e[e.NoIndentation=262144]="NoIndentation",e[e.AsyncFunctionBody=524288]="AsyncFunctionBody",e[e.ReuseTempVariableScope=1048576]="ReuseTempVariableScope",e[e.CustomPrologue=2097152]="CustomPrologue",e[e.NoHoisting=4194304]="NoHoisting",e[e.Iterator=8388608]="Iterator",e[e.NoAsciiEscaping=16777216]="NoAsciiEscaping",e))(X7||{}),DB=(e=>(e[e.None=0]="None",e[e.TypeScriptClassWrapper=1]="TypeScriptClassWrapper",e[e.NeverApplyImportHelper=2]="NeverApplyImportHelper",e[e.IgnoreSourceNewlines=4]="IgnoreSourceNewlines",e[e.Immutable=8]="Immutable",e[e.IndirectCall=16]="IndirectCall",e[e.TransformPrivateStaticElements=32]="TransformPrivateStaticElements",e))(DB||{}),PB=(e=>(e[e.Extends=1]="Extends",e[e.Assign=2]="Assign",e[e.Rest=4]="Rest",e[e.Decorate=8]="Decorate",e[e.ESDecorateAndRunInitializers=8]="ESDecorateAndRunInitializers",e[e.Metadata=16]="Metadata",e[e.Param=32]="Param",e[e.Awaiter=64]="Awaiter",e[e.Generator=128]="Generator",e[e.Values=256]="Values",e[e.Read=512]="Read",e[e.SpreadArray=1024]="SpreadArray",e[e.Await=2048]="Await",e[e.AsyncGenerator=4096]="AsyncGenerator",e[e.AsyncDelegator=8192]="AsyncDelegator",e[e.AsyncValues=16384]="AsyncValues",e[e.ExportStar=32768]="ExportStar",e[e.ImportStar=65536]="ImportStar",e[e.ImportDefault=131072]="ImportDefault",e[e.MakeTemplateObject=262144]="MakeTemplateObject",e[e.ClassPrivateFieldGet=524288]="ClassPrivateFieldGet",e[e.ClassPrivateFieldSet=1048576]="ClassPrivateFieldSet",e[e.ClassPrivateFieldIn=2097152]="ClassPrivateFieldIn",e[e.CreateBinding=4194304]="CreateBinding",e[e.SetFunctionName=8388608]="SetFunctionName",e[e.PropKey=16777216]="PropKey",e[e.AddDisposableResourceAndDisposeResources=33554432]="AddDisposableResourceAndDisposeResources",e[e.FirstEmitHelper=1]="FirstEmitHelper",e[e.LastEmitHelper=33554432]="LastEmitHelper",e[e.ForOfIncludes=256]="ForOfIncludes",e[e.ForAwaitOfIncludes=16384]="ForAwaitOfIncludes",e[e.AsyncGeneratorIncludes=6144]="AsyncGeneratorIncludes",e[e.AsyncDelegatorIncludes=26624]="AsyncDelegatorIncludes",e[e.SpreadIncludes=1536]="SpreadIncludes",e))(PB||{}),wB=(e=>(e[e.SourceFile=0]="SourceFile",e[e.Expression=1]="Expression",e[e.IdentifierName=2]="IdentifierName",e[e.MappedTypeParameter=3]="MappedTypeParameter",e[e.Unspecified=4]="Unspecified",e[e.EmbeddedStatement=5]="EmbeddedStatement",e[e.JsxAttributeValue=6]="JsxAttributeValue",e))(wB||{}),AB=(e=>(e[e.Parentheses=1]="Parentheses",e[e.TypeAssertions=2]="TypeAssertions",e[e.NonNullAssertions=4]="NonNullAssertions",e[e.PartiallyEmittedExpressions=8]="PartiallyEmittedExpressions",e[e.Assertions=6]="Assertions",e[e.All=15]="All",e[e.ExcludeJSDocTypeAssertion=16]="ExcludeJSDocTypeAssertion",e))(AB||{}),NB=(e=>(e[e.None=0]="None",e[e.InParameters=1]="InParameters",e[e.VariablesHoistedInParameters=2]="VariablesHoistedInParameters",e))(NB||{}),IB=(e=>(e.Prologue="prologue",e.EmitHelpers="emitHelpers",e.NoDefaultLib="no-default-lib",e.Reference="reference",e.Type="type",e.TypeResolutionModeRequire="type-require",e.TypeResolutionModeImport="type-import",e.Lib="lib",e.Prepend="prepend",e.Text="text",e.Internal="internal",e))(IB||{}),FB=(e=>(e[e.None=0]="None",e[e.SingleLine=0]="SingleLine",e[e.MultiLine=1]="MultiLine",e[e.PreserveLines=2]="PreserveLines",e[e.LinesMask=3]="LinesMask",e[e.NotDelimited=0]="NotDelimited",e[e.BarDelimited=4]="BarDelimited",e[e.AmpersandDelimited=8]="AmpersandDelimited",e[e.CommaDelimited=16]="CommaDelimited",e[e.AsteriskDelimited=32]="AsteriskDelimited",e[e.DelimitersMask=60]="DelimitersMask",e[e.AllowTrailingComma=64]="AllowTrailingComma",e[e.Indented=128]="Indented",e[e.SpaceBetweenBraces=256]="SpaceBetweenBraces",e[e.SpaceBetweenSiblings=512]="SpaceBetweenSiblings",e[e.Braces=1024]="Braces",e[e.Parenthesis=2048]="Parenthesis",e[e.AngleBrackets=4096]="AngleBrackets",e[e.SquareBrackets=8192]="SquareBrackets",e[e.BracketsMask=15360]="BracketsMask",e[e.OptionalIfUndefined=16384]="OptionalIfUndefined",e[e.OptionalIfEmpty=32768]="OptionalIfEmpty",e[e.Optional=49152]="Optional",e[e.PreferNewLine=65536]="PreferNewLine",e[e.NoTrailingNewLine=131072]="NoTrailingNewLine",e[e.NoInterveningComments=262144]="NoInterveningComments",e[e.NoSpaceIfEmpty=524288]="NoSpaceIfEmpty",e[e.SingleElement=1048576]="SingleElement",e[e.SpaceAfterList=2097152]="SpaceAfterList",e[e.Modifiers=2359808]="Modifiers",e[e.HeritageClauses=512]="HeritageClauses",e[e.SingleLineTypeLiteralMembers=768]="SingleLineTypeLiteralMembers",e[e.MultiLineTypeLiteralMembers=32897]="MultiLineTypeLiteralMembers",e[e.SingleLineTupleTypeElements=528]="SingleLineTupleTypeElements",e[e.MultiLineTupleTypeElements=657]="MultiLineTupleTypeElements",e[e.UnionTypeConstituents=516]="UnionTypeConstituents",e[e.IntersectionTypeConstituents=520]="IntersectionTypeConstituents",e[e.ObjectBindingPatternElements=525136]="ObjectBindingPatternElements",e[e.ArrayBindingPatternElements=524880]="ArrayBindingPatternElements",e[e.ObjectLiteralExpressionProperties=526226]="ObjectLiteralExpressionProperties",e[e.ImportAttributes=526226]="ImportAttributes",e[e.ImportClauseEntries=526226]="ImportClauseEntries",e[e.ArrayLiteralExpressionElements=8914]="ArrayLiteralExpressionElements",e[e.CommaListElements=528]="CommaListElements",e[e.CallExpressionArguments=2576]="CallExpressionArguments",e[e.NewExpressionArguments=18960]="NewExpressionArguments",e[e.TemplateExpressionSpans=262144]="TemplateExpressionSpans",e[e.SingleLineBlockStatements=768]="SingleLineBlockStatements",e[e.MultiLineBlockStatements=129]="MultiLineBlockStatements",e[e.VariableDeclarationList=528]="VariableDeclarationList",e[e.SingleLineFunctionBodyStatements=768]="SingleLineFunctionBodyStatements",e[e.MultiLineFunctionBodyStatements=1]="MultiLineFunctionBodyStatements",e[e.ClassHeritageClauses=0]="ClassHeritageClauses",e[e.ClassMembers=129]="ClassMembers",e[e.InterfaceMembers=129]="InterfaceMembers",e[e.EnumMembers=145]="EnumMembers",e[e.CaseBlockClauses=129]="CaseBlockClauses",e[e.NamedImportsOrExportsElements=525136]="NamedImportsOrExportsElements",e[e.JsxElementOrFragmentChildren=262144]="JsxElementOrFragmentChildren",e[e.JsxElementAttributes=262656]="JsxElementAttributes",e[e.CaseOrDefaultClauseStatements=163969]="CaseOrDefaultClauseStatements",e[e.HeritageClauseTypes=528]="HeritageClauseTypes",e[e.SourceFileStatements=131073]="SourceFileStatements",e[e.Decorators=2146305]="Decorators",e[e.TypeArguments=53776]="TypeArguments",e[e.TypeParameters=53776]="TypeParameters",e[e.Parameters=2576]="Parameters",e[e.IndexSignatureParameters=8848]="IndexSignatureParameters",e[e.JSDocComment=33]="JSDocComment",e))(FB||{}),OB=(e=>(e[e.None=0]="None",e[e.TripleSlashXML=1]="TripleSlashXML",e[e.SingleLine=2]="SingleLine",e[e.MultiLine=4]="MultiLine",e[e.All=7]="All",e[e.Default=7]="Default",e))(OB||{}),ZD={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0},{name:"resolution-mode",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}},LB=(e=>(e[e.ParseAll=0]="ParseAll",e[e.ParseNone=1]="ParseNone",e[e.ParseForTypeErrors=2]="ParseForTypeErrors",e[e.ParseForTypeInfo=3]="ParseForTypeInfo",e))(LB||{})}});function v4(e){let t=5381;for(let r=0;r{W.isClosed=!0,X2(t,W)}}}function u(D){const O=[];return O.pollingInterval=D,O.pollIndex=0,O.pollScheduled=!1,O}function f(D,O){O.pollIndex=p(O,O.pollingInterval,O.pollIndex,Z7[O.pollingInterval]),O.length?w(O.pollingInterval):(E.assert(O.pollIndex===0),O.pollScheduled=!1)}function g(D,O){p(r,250,0,r.length),f(D,O),!O.pollScheduled&&r.length&&w(250)}function p(D,O,z,W){return Ihe(e,D,z,W,X);function X(J,ie,B){B?(J.unchangedPolls=0,D!==r&&(D[ie]=void 0,T(J))):J.unchangedPolls!==eP[O]?J.unchangedPolls++:D===r?(J.unchangedPolls=1,D[ie]=void 0,S(J,250)):O!==2e3&&(J.unchangedPolls++,D[ie]=void 0,S(J,O===250?500:2e3))}}function y(D){switch(D){case 250:return i;case 500:return s;case 2e3:return o}}function S(D,O){y(O).push(D),C(O)}function T(D){r.push(D),C(250)}function C(D){y(D).pollScheduled||w(D)}function w(D){y(D).pollScheduled=e.setTimeout(D===250?g:f,D,D===250?"pollLowPollingIntervalQueue":"pollPollingIntervalQueue",y(D))}}function e5e(e,t){const r=of(),i=new Map,s=tu(t);return o;function o(u,f,g,p){const y=s(u);r.add(y,f);const S=qn(y)||".",T=i.get(S)||c(qn(u)||".",S,p);return T.referenceCount++,{close:()=>{T.referenceCount===1?(T.close(),i.delete(S)):T.referenceCount--,r.remove(y,f)}}}function c(u,f,g){const p=e(u,1,(y,S,T)=>{if(!ns(S))return;const C=is(S,u),w=C&&r.get(s(C));if(w)for(const D of w)D(C,1,T)},!1,500,g);return p.referenceCount=0,i.set(f,p),p}}function t5e(e){const t=[];let r=0,i;return s;function s(u,f){const g={fileName:u,callback:f,mtime:YS(e,u)};return t.push(g),c(),{close:()=>{g.isClosed=!0,X2(t,g)}}}function o(){i=void 0,r=Ihe(e,t,r,Z7[250]),c()}function c(){!t.length||i||(i=e.setTimeout(o,2e3,"pollQueue"))}}function Fhe(e,t,r,i,s){const c=tu(t)(r),u=e.get(c);return u?u.callbacks.push(i):e.set(c,{watcher:s((f,g,p)=>{var y;return(y=e.get(c))==null?void 0:y.callbacks.slice().forEach(S=>S(f,g,p))}),callbacks:[i]}),{close:()=>{const f=e.get(c);f&&(!HD(f.callbacks,i)||f.callbacks.length||(e.delete(c),hf(f)))}}}function r5e(e,t){const r=e.mtime.getTime(),i=t.getTime();return r!==i?(e.mtime=t,e.callback(e.fileName,MB(r,i),t),!0):!1}function MB(e,t){return e===0?0:t===0?2:1}function KD(e){return hK(e)}function dK(e){hK=e}function n5e({watchDirectory:e,useCaseSensitiveFileNames:t,getCurrentDirectory:r,getAccessibleSortedChildDirectories:i,fileSystemEntryExists:s,realpath:o,setTimeout:c,clearTimeout:u}){const f=new Map,g=of(),p=new Map;let y;const S=d4(!t),T=tu(t);return(B,Y,ae,_e)=>ae?C(B,_e,Y):e(B,Y,ae,_e);function C(B,Y,ae){const _e=T(B);let $=f.get(_e);$?$.refCount++:($={watcher:e(B,K=>{J(K,Y)||(Y?.synchronousWatchDirectory?(w(_e,K),X(B,_e,Y)):D(B,_e,K,Y))},!1,Y),refCount:1,childWatches:ze},f.set(_e,$),X(B,_e,Y));const H=ae&&{dirName:B,callback:ae};return H&&g.add(_e,H),{dirName:B,close:()=>{const K=E.checkDefined(f.get(_e));H&&g.remove(_e,H),K.refCount--,!K.refCount&&(f.delete(_e),hf(K),K.childWatches.forEach(rd))}}}function w(B,Y,ae){let _e,$;ns(Y)?_e=Y:$=Y,g.forEach((H,K)=>{if(!($&&$.get(K)===!0)&&(K===B||Qi(B,K)&&B[K.length]===Co))if($)if(ae){const oe=$.get(K);oe?oe.push(...ae):$.set(K,ae.slice())}else $.set(K,!0);else H.forEach(({callback:oe})=>oe(_e))})}function D(B,Y,ae,_e){const $=f.get(Y);if($&&s(B,1)){O(B,Y,ae,_e);return}w(Y,ae),W($)}function O(B,Y,ae,_e){const $=p.get(Y);$?$.fileNames.push(ae):p.set(Y,{dirName:B,options:_e,fileNames:[ae]}),y&&(u(y),y=void 0),y=c(z,1e3,"timerToUpdateChildWatches")}function z(){y=void 0,KD(`sysLog:: onTimerToUpdateChildWatches:: ${p.size}`);const B=_o(),Y=new Map;for(;!y&&p.size;){const _e=p.entries().next();E.assert(!_e.done);const{value:[$,{dirName:H,options:K,fileNames:oe}]}=_e;p.delete($);const Se=X(H,$,K);w($,Y,Se?void 0:oe)}KD(`sysLog:: invokingWatchers:: Elapsed:: ${_o()-B}ms:: ${p.size}`),g.forEach((_e,$)=>{const H=Y.get($);H&&_e.forEach(({callback:K,dirName:oe})=>{es(H)?H.forEach(K):K(oe)})});const ae=_o()-B;KD(`sysLog:: Elapsed:: ${ae}ms:: onTimerToUpdateChildWatches:: ${p.size} ${y}`)}function W(B){if(!B)return;const Y=B.childWatches;B.childWatches=ze;for(const ae of Y)ae.close(),W(f.get(T(ae.dirName)))}function X(B,Y,ae){const _e=f.get(Y);if(!_e)return!1;let $;const H=N7(s(B,1)?Ii(i(B),Se=>{const se=is(Se,B);return!J(se,ae)&&S(se,qs(o(se)))===0?se:void 0}):ze,_e.childWatches,(Se,se)=>S(Se,se.dirName),K,rd,oe);return _e.childWatches=$||ze,H;function K(Se){const se=C(Se,ae);oe(se)}function oe(Se){($||($=[])).push(Se)}}function J(B,Y){return ut(tP,ae=>ie(B,ae))||Ohe(B,Y,t,r)}function ie(B,Y){return B.includes(Y)?!0:t?!1:T(B).includes(Y)}}function i5e(e){return(t,r,i)=>e(r===1?"change":"rename","",i)}function s5e(e,t,r){return(i,s,o)=>{i==="rename"?(o||(o=r(e)||Zm),t(e,o!==Zm?0:2,o)):t(e,1,o)}}function Ohe(e,t,r,i){return(t?.excludeDirectories||t?.excludeFiles)&&(cO(e,t?.excludeFiles,r,i())||cO(e,t?.excludeDirectories,r,i()))}function Lhe(e,t,r,i,s){return(o,c)=>{if(o==="rename"){const u=c?qs(Hn(e,c)):e;(!c||!Ohe(u,r,i,s))&&t(u)}}}function mK({pollingWatchFileWorker:e,getModifiedTime:t,setTimeout:r,clearTimeout:i,fsWatchWorker:s,fileSystemEntryExists:o,useCaseSensitiveFileNames:c,getCurrentDirectory:u,fsSupportsRecursiveFsWatch:f,getAccessibleSortedChildDirectories:g,realpath:p,tscWatchFile:y,useNonPollingWatchers:S,tscWatchDirectory:T,inodeWatching:C,sysLog:w}){const D=new Map,O=new Map,z=new Map;let W,X,J,ie,B=!1;return{watchFile:Y,watchDirectory:K};function Y(Te,Me,ke,he){he=$(he,S);const be=E.checkDefined(he.watchFile);switch(be){case 0:return se(Te,Me,250,void 0);case 1:return se(Te,Me,ke,void 0);case 2:return ae()(Te,Me,ke,void 0);case 3:return _e()(Te,Me,void 0,void 0);case 4:return Z(Te,0,s5e(Te,Me,t),!1,ke,Qw(he));case 5:return J||(J=e5e(Z,c)),J(Te,Me,ke,Qw(he));default:E.assertNever(be)}}function ae(){return W||(W=KIe({getModifiedTime:t,setTimeout:r}))}function _e(){return X||(X=t5e({getModifiedTime:t,setTimeout:r}))}function $(Te,Me){if(Te&&Te.watchFile!==void 0)return Te;switch(y){case"PriorityPollingInterval":return{watchFile:1};case"DynamicPriorityPolling":return{watchFile:2};case"UseFsEvents":return H(4,1,Te);case"UseFsEventsWithFallbackDynamicPolling":return H(4,2,Te);case"UseFsEventsOnParentDirectory":Me=!0;default:return Me?H(5,1,Te):{watchFile:4}}}function H(Te,Me,ke){const he=ke?.fallbackPolling;return{watchFile:Te,fallbackPolling:he===void 0?Me:he}}function K(Te,Me,ke,he){return f?Z(Te,1,Lhe(Te,Me,he,c,u),ke,500,Qw(he)):(ie||(ie=n5e({useCaseSensitiveFileNames:c,getCurrentDirectory:u,fileSystemEntryExists:o,getAccessibleSortedChildDirectories:g,watchDirectory:oe,realpath:p,setTimeout:r,clearTimeout:i})),ie(Te,Me,ke,he))}function oe(Te,Me,ke,he){E.assert(!ke);const be=Se(he),lt=E.checkDefined(be.watchDirectory);switch(lt){case 1:return se(Te,()=>Me(Te),500,void 0);case 2:return ae()(Te,()=>Me(Te),500,void 0);case 3:return _e()(Te,()=>Me(Te),void 0,void 0);case 0:return Z(Te,1,Lhe(Te,Me,he,c,u),ke,500,Qw(be));default:E.assertNever(lt)}}function Se(Te){if(Te&&Te.watchDirectory!==void 0)return Te;switch(T){case"RecursiveDirectoryUsingFsWatchFile":return{watchDirectory:1};case"RecursiveDirectoryUsingDynamicPriorityPolling":return{watchDirectory:2};default:const Me=Te?.fallbackPolling;return{watchDirectory:0,fallbackPolling:Me!==void 0?Me:void 0}}}function se(Te,Me,ke,he){return Fhe(D,c,Te,Me,be=>e(Te,be,ke,he))}function Z(Te,Me,ke,he,be,lt){return Fhe(he?z:O,c,Te,ke,pt=>ve(Te,Me,pt,he,be,lt))}function ve(Te,Me,ke,he,be,lt){let pt,me;C&&(pt=Te.substring(Te.lastIndexOf(Co)),me=pt.slice(Co.length));let Oe=o(Te,Me)?it():ot();return{close:()=>{Oe&&(Oe.close(),Oe=void 0)}};function Xe(Bt){Oe&&(w(`sysLog:: ${Te}:: Changing watcher to ${Bt===it?"Present":"Missing"}FileSystemEntryWatcher`),Oe.close(),Oe=Bt())}function it(){if(B)return w(`sysLog:: ${Te}:: Defaulting to watchFile`),Je();try{const Bt=s(Te,he,C?mt:ke);return Bt.on("error",()=>{ke("rename",""),Xe(ot)}),Bt}catch(Bt){return B||(B=Bt.code==="ENOSPC"),w(`sysLog:: ${Te}:: Changing to watchFile`),Je()}}function mt(Bt,Ht){let br;if(Ht&&fc(Ht,"~")&&(br=Ht,Ht=Ht.slice(0,Ht.length-1)),Bt==="rename"&&(!Ht||Ht===me||fc(Ht,pt))){const zr=t(Te)||Zm;br&&ke(Bt,br,zr),ke(Bt,Ht,zr),C?Xe(zr===Zm?ot:it):zr===Zm&&Xe(ot)}else br&&ke(Bt,br),ke(Bt,Ht)}function Je(){return Y(Te,i5e(ke),be,lt)}function ot(){return Y(Te,(Bt,Ht,br)=>{Ht===0&&(br||(br=t(Te)||Zm),br!==Zm&&(ke("rename","",br),Xe(it)))},be,lt)}}}function gK(e){const t=e.writeFile;e.writeFile=(r,i,s)=>vz(r,i,!!s,(o,c,u)=>t.call(e,o,c,u),o=>e.createDirectory(o),o=>e.directoryExists(o))}function Mhe(e){Bl=e}var RB,Q7,Zm,Y7,Z7,eP,tP,hK,jB,Bl,a5e=Nt({"src/compiler/sys.ts"(){"use strict";Ns(),RB=(e=>(e[e.Created=0]="Created",e[e.Changed=1]="Changed",e[e.Deleted=2]="Deleted",e))(RB||{}),Q7=(e=>(e[e.High=2e3]="High",e[e.Medium=500]="Medium",e[e.Low=250]="Low",e))(Q7||{}),Zm=new Date(0),Y7={Low:32,Medium:64,High:256},Z7=pK(Y7),eP=pK(Y7),tP=["/node_modules/.","/.git","/.#"],hK=Ca,jB=(e=>(e[e.File=0]="File",e[e.Directory=1]="Directory",e))(jB||{}),Bl=(()=>{const e="\uFEFF";function t(){const i=/^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/,s=require("fs"),o=require("path"),c=require("os");let u;try{u=require("crypto")}catch{u=void 0}let f,g="./profile.cpuprofile";const p=require("buffer").Buffer,y=process.platform==="linux"||process.platform==="darwin",S=c.platform(),T=_e(),C=s.realpathSync.native?process.platform==="win32"?be:s.realpathSync.native:s.realpathSync,w=__filename.endsWith("sys.js")?o.join(o.dirname(__dirname),"__fake__.js"):__filename,D=process.platform==="win32"||process.platform==="darwin",O=Vu(()=>process.cwd()),{watchFile:z,watchDirectory:W}=mK({pollingWatchFileWorker:H,getModifiedTime:pt,setTimeout,clearTimeout,fsWatchWorker:K,useCaseSensitiveFileNames:T,getCurrentDirectory:O,fileSystemEntryExists:Te,fsSupportsRecursiveFsWatch:D,getAccessibleSortedChildDirectories:it=>Z(it).directories,realpath:lt,tscWatchFile:process.env.TSC_WATCHFILE,useNonPollingWatchers:!!process.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:process.env.TSC_WATCHDIRECTORY,inodeWatching:y,sysLog:KD}),X={args:process.argv.slice(2),newLine:c.EOL,useCaseSensitiveFileNames:T,write(it){process.stdout.write(it)},getWidthOfTerminal(){return process.stdout.columns},writeOutputIsTTY(){return process.stdout.isTTY},readFile:Se,writeFile:se,watchFile:z,watchDirectory:W,resolvePath:it=>o.resolve(it),fileExists:Me,directoryExists:ke,createDirectory(it){if(!X.directoryExists(it))try{s.mkdirSync(it)}catch(mt){if(mt.code!=="EEXIST")throw mt}},getExecutingFilePath(){return w},getCurrentDirectory:O,getDirectories:he,getEnvironmentVariable(it){return process.env[it]||""},readDirectory:ve,getModifiedTime:pt,setModifiedTime:me,deleteFile:Oe,createHash:u?Xe:v4,createSHA256Hash:u?Xe:void 0,getMemoryUsage(){return global.gc&&global.gc(),process.memoryUsage().heapUsed},getFileSize(it){try{const mt=J(it);if(mt?.isFile())return mt.size}catch{}return 0},exit(it){Y(()=>process.exit(it))},enableCPUProfiler:ie,disableCPUProfiler:Y,cpuProfilingEnabled:()=>!!f||_s(process.execArgv,"--cpu-prof")||_s(process.execArgv,"--prof"),realpath:lt,debugMode:!!process.env.NODE_INSPECTOR_IPC||!!process.env.VSCODE_INSPECTOR_OPTIONS||ut(process.execArgv,it=>/^--(inspect|debug)(-brk)?(=\d+)?$/i.test(it))||!!process.recordreplay,tryEnableSourceMapsForHost(){try{require("source-map-support").install()}catch{}},setTimeout,clearTimeout,clearScreen:()=>{process.stdout.write("\x1Bc")},setBlocking:()=>{var it;const mt=(it=process.stdout)==null?void 0:it._handle;mt&&mt.setBlocking&&mt.setBlocking(!0)},bufferFrom:ae,base64decode:it=>ae(it,"base64").toString("utf8"),base64encode:it=>ae(it).toString("base64"),require:(it,mt)=>{try{const Je=pie(mt,it,X);return{module:require(Je),modulePath:Je,error:void 0}}catch(Je){return{module:void 0,modulePath:void 0,error:Je}}}};return X;function J(it){return s.statSync(it,{throwIfNoEntry:!1})}function ie(it,mt){if(f)return mt(),!1;const Je=require("inspector");if(!Je||!Je.Session)return mt(),!1;const ot=new Je.Session;return ot.connect(),ot.post("Profiler.enable",()=>{ot.post("Profiler.start",()=>{f=ot,g=it,mt()})}),!0}function B(it){let mt=0;const Je=new Map,ot=du(o.dirname(w)),Bt=`file://${pm(ot)===1?"":"/"}${ot}`;for(const Ht of it.nodes)if(Ht.callFrame.url){const br=du(Ht.callFrame.url);dm(Bt,br,T)?Ht.callFrame.url=KS(Bt,br,Bt,tu(T),!0):i.test(br)||(Ht.callFrame.url=(Je.has(br)?Je:Je.set(br,`external${mt}.js`)).get(br),mt++)}return it}function Y(it){if(f&&f!=="stopping"){const mt=f;return f.post("Profiler.stop",(Je,{profile:ot})=>{var Bt;if(!Je){try{(Bt=J(g))!=null&&Bt.isDirectory()&&(g=o.join(g,`${new Date().toISOString().replace(/:/g,"-")}+P${process.pid}.cpuprofile`))}catch{}try{s.mkdirSync(o.dirname(g),{recursive:!0})}catch{}s.writeFileSync(g,JSON.stringify(B(ot)))}f=void 0,mt.disconnect(),it()}),f="stopping",!0}else return it(),!1}function ae(it,mt){return p.from&&p.from!==Int8Array.from?p.from(it,mt):new p(it,mt)}function _e(){return S==="win32"||S==="win64"?!1:!Me($(__filename))}function $(it){return it.replace(/\w/g,mt=>{const Je=mt.toUpperCase();return mt===Je?mt.toLowerCase():Je})}function H(it,mt,Je){s.watchFile(it,{persistent:!0,interval:Je},Bt);let ot;return{close:()=>s.unwatchFile(it,Bt)};function Bt(Ht,br){const zr=+br.mtime==0||ot===2;if(+Ht.mtime==0){if(zr)return;ot=2}else if(zr)ot=0;else{if(+Ht.mtime==+br.mtime)return;ot=1}mt(it,ot,Ht.mtime)}}function K(it,mt,Je){return s.watch(it,D?{persistent:!0,recursive:!!mt}:{persistent:!0},Je)}function oe(it,mt){let Je;try{Je=s.readFileSync(it)}catch{return}let ot=Je.length;if(ot>=2&&Je[0]===254&&Je[1]===255){ot&=-2;for(let Bt=0;Bt=2&&Je[0]===255&&Je[1]===254?Je.toString("utf16le",2):ot>=3&&Je[0]===239&&Je[1]===187&&Je[2]===191?Je.toString("utf8",3):Je.toString("utf8")}function Se(it,mt){var Je,ot;(Je=Pu)==null||Je.logStartReadFile(it);const Bt=oe(it,mt);return(ot=Pu)==null||ot.logStopReadFile(),Bt}function se(it,mt,Je){var ot;(ot=Pu)==null||ot.logEvent("WriteFile: "+it),Je&&(mt=e+mt);let Bt;try{Bt=s.openSync(it,"w"),s.writeSync(Bt,mt,void 0,"utf8")}finally{Bt!==void 0&&s.closeSync(Bt)}}function Z(it){var mt;(mt=Pu)==null||mt.logEvent("ReadDir: "+(it||"."));try{const Je=s.readdirSync(it||".",{withFileTypes:!0}),ot=[],Bt=[];for(const Ht of Je){const br=typeof Ht=="string"?Ht:Ht.name;if(br==="."||br==="..")continue;let zr;if(typeof Ht=="string"||Ht.isSymbolicLink()){const ar=Hn(it,br);try{if(zr=J(ar),!zr)continue}catch{continue}}else zr=Ht;zr.isFile()?ot.push(br):zr.isDirectory()&&Bt.push(br)}return ot.sort(),Bt.sort(),{files:ot,directories:Bt}}catch{return eF}}function ve(it,mt,Je,ot,Bt){return Uz(it,mt,Je,ot,T,process.cwd(),Bt,Z,lt)}function Te(it,mt){const Je=Error.stackTraceLimit;Error.stackTraceLimit=0;try{const ot=J(it);if(!ot)return!1;switch(mt){case 0:return ot.isFile();case 1:return ot.isDirectory();default:return!1}}catch{return!1}finally{Error.stackTraceLimit=Je}}function Me(it){return Te(it,0)}function ke(it){return Te(it,1)}function he(it){return Z(it).directories.slice()}function be(it){return it.length<260?s.realpathSync.native(it):s.realpathSync(it)}function lt(it){try{return C(it)}catch{return it}}function pt(it){var mt;const Je=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return(mt=J(it))==null?void 0:mt.mtime}catch{return}finally{Error.stackTraceLimit=Je}}function me(it,mt){try{s.utimesSync(it,mt,mt)}catch{return}}function Oe(it){try{return s.unlinkSync(it)}catch{return}}function Xe(it){const mt=u.createHash("sha256");return mt.update(it),mt.digest("hex")}}let r;return Pj()&&(r=t()),r&&gK(r),r})(),Bl&&Bl.getEnvironmentVariable&&(ZIe(Bl),E.setAssertionLevel(/^development$/i.test(Bl.getEnvironmentVariable("NODE_ENV"))?1:0)),Bl&&Bl.debugMode&&(E.isDebugging=!0)}});function BB(e){return e===47||e===92}function yK(e){return K7(e)<0}function C_(e){return K7(e)>0}function JB(e){const t=K7(e);return t>0&&t===e.length}function b4(e){return K7(e)!==0}function U_(e){return/^\.\.?($|[\\/])/.test(e)}function zB(e){return!b4(e)&&!U_(e)}function ZS(e){return Pc(e).includes(".")}function Ho(e,t){return e.length>t.length&&fc(e,t)}function Jc(e,t){for(const r of t)if(Ho(e,r))return!0;return!1}function Nh(e){return e.length>0&&BB(e.charCodeAt(e.length-1))}function Rhe(e){return e>=97&&e<=122||e>=65&&e<=90}function o5e(e,t){const r=e.charCodeAt(t);if(r===58)return t+1;if(r===37&&e.charCodeAt(t+1)===51){const i=e.charCodeAt(t+2);if(i===97||i===65)return t+3}return-1}function K7(e){if(!e)return 0;const t=e.charCodeAt(0);if(t===47||t===92){if(e.charCodeAt(1)!==t)return 1;const i=e.indexOf(t===47?Co:sP,2);return i<0?e.length:i+1}if(Rhe(t)&&e.charCodeAt(1)===58){const i=e.charCodeAt(2);if(i===47||i===92)return 3;if(e.length===2)return 2}const r=e.indexOf(bK);if(r!==-1){const i=r+bK.length,s=e.indexOf(Co,i);if(s!==-1){const o=e.slice(0,r),c=e.slice(i,s);if(o==="file"&&(c===""||c==="localhost")&&Rhe(e.charCodeAt(s+1))){const u=o5e(e,s+2);if(u!==-1){if(e.charCodeAt(u)===47)return~(u+1);if(u===e.length)return~u}}return~(s+1)}return~e.length}return 0}function pm(e){const t=K7(e);return t<0?~t:t}function qn(e){e=du(e);const t=pm(e);return t===e.length?e:(e=Vy(e),e.slice(0,Math.max(t,e.lastIndexOf(Co))))}function Pc(e,t,r){if(e=du(e),pm(e)===e.length)return"";e=Vy(e);const s=e.slice(Math.max(pm(e),e.lastIndexOf(Co)+1)),o=t!==void 0&&r!==void 0?S4(s,t,r):void 0;return o?s.slice(0,s.length-o.length):s}function jhe(e,t,r){if(Qi(t,".")||(t="."+t),e.length>=t.length&&e.charCodeAt(e.length-t.length)===46){const i=e.slice(e.length-t.length);if(r(i,t))return i}}function c5e(e,t,r){if(typeof t=="string")return jhe(e,t,r)||"";for(const i of t){const s=jhe(e,i,r);if(s)return s}return""}function S4(e,t,r){if(t)return c5e(Vy(e),t,r?XS:QS);const i=Pc(e),s=i.lastIndexOf(".");return s>=0?i.substring(s):""}function l5e(e,t){const r=e.substring(0,t),i=e.substring(t).split(Co);return i.length&&!Mo(i)&&i.pop(),[r,...i]}function fl(e,t=""){return e=Hn(t,e),l5e(e,pm(e))}function N0(e,t){return e.length===0?"":(e[0]&&Sl(e[0]))+e.slice(1,t).join(Co)}function du(e){return e.includes("\\")?e.replace(zhe,Co):e}function eb(e){if(!ut(e))return[];const t=[e[0]];for(let r=1;r1){if(t[t.length-1]!==".."){t.pop();continue}}else if(t[0])continue}t.push(i)}}return t}function Hn(e,...t){e&&(e=du(e));for(let r of t)r&&(r=du(r),!e||pm(r)!==0?e=r:e=Sl(e)+r);return e}function I0(e,...t){return qs(ut(t)?Hn(e,...t):du(e))}function rP(e,t){return eb(fl(e,t))}function is(e,t){return N0(rP(e,t))}function qs(e){if(e=du(e),!tI.test(e))return e;const t=e.replace(/\/\.\//g,"/").replace(/^\.\//,"");if(t!==e&&(e=t,!tI.test(e)))return e;const r=N0(eb(fl(e)));return r&&Nh(e)?Sl(r):r}function u5e(e){return e.length===0?"":e.slice(1).join(Co)}function WB(e,t){return u5e(rP(e,t))}function fo(e,t,r){const i=C_(e)?qs(e):is(e,t);return r(i)}function Vy(e){return Nh(e)?e.substr(0,e.length-1):e}function Sl(e){return Nh(e)?e:e+Co}function dv(e){return!b4(e)&&!U_(e)?"./"+e:e}function nP(e,t,r,i){const s=r!==void 0&&i!==void 0?S4(e,r,i):S4(e);return s?e.slice(0,e.length-s.length)+(Qi(t,".")?t:"."+t):e}function vK(e,t,r){if(e===t)return 0;if(e===void 0)return-1;if(t===void 0)return 1;const i=e.substring(0,pm(e)),s=t.substring(0,pm(t)),o=D7(i,s);if(o!==0)return o;const c=e.substring(i.length),u=t.substring(s.length);if(!tI.test(c)&&!tI.test(u))return r(c,u);const f=eb(fl(e)),g=eb(fl(t)),p=Math.min(f.length,g.length);for(let y=1;y0==pm(t)>0,"Paths must either both be absolute or both be relative");const o=VB(e,t,(typeof r=="boolean"?r:!1)?XS:QS,typeof r=="function"?r:To);return N0(o)}function T4(e,t,r){return C_(e)?KS(t,e,t,r,!1):e}function iP(e,t,r){return dv(mm(qn(e),t,r))}function KS(e,t,r,i,s){const o=VB(I0(r,e),I0(r,t),QS,i),c=o[0];if(s&&C_(c)){const u=c.charAt(0)===Co?"file://":"file:///";o[0]=u+c}return N0(o)}function kd(e,t){for(;;){const r=t(e);if(r!==void 0)return r;const i=qn(e);if(i===e)return;e=i}}function eI(e){return fc(e,"/node_modules")}var Co,sP,bK,zhe,tI,_5e=Nt({"src/compiler/path.ts"(){"use strict";Ns(),Co="/",sP="\\",bK="://",zhe=/\\/g,tI=/(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/}});function b(e,t,r,i,s,o,c){return{code:e,category:t,key:r,message:i,reportsUnnecessary:s,elidedInCompatabilityPyramid:o,reportsDeprecated:c}}var d,f5e=Nt({"src/compiler/diagnosticInformationMap.generated.ts"(){"use strict";Ahe(),d={Unterminated_string_literal:b(1002,1,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:b(1003,1,"Identifier_expected_1003","Identifier expected."),_0_expected:b(1005,1,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:b(1006,1,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_1_to_match_the_0_token_here:b(1007,1,"The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007","The parser expected to find a '{1}' to match the '{0}' token here."),Trailing_comma_not_allowed:b(1009,1,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:b(1010,1,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:b(1011,1,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:b(1012,1,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:b(1013,1,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:b(1014,1,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:b(1015,1,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:b(1016,1,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:b(1017,1,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:b(1018,1,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:b(1019,1,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:b(1020,1,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:b(1021,1,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:b(1022,1,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:b(1024,1,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:b(1025,1,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:b(1028,1,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:b(1029,1,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:b(1030,1,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:b(1031,1,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:b(1034,1,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:b(1035,1,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:b(1036,1,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:b(1038,1,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:b(1039,1,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:b(1040,1,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:b(1042,1,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:b(1044,1,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:b(1046,1,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:b(1047,1,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:b(1048,1,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:b(1049,1,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:b(1051,1,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:b(1052,1,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:b(1053,1,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:b(1054,1,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:b(1055,1,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055","Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:b(1056,1,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:b(1058,1,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:b(1059,1,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:b(1060,1,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:b(1061,1,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:b(1062,1,"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062","Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),An_export_assignment_cannot_be_used_in_a_namespace:b(1063,1,"An_export_assignment_cannot_be_used_in_a_namespace_1063","An export assignment cannot be used in a namespace."),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0:b(1064,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064","The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type:b(1065,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065","The return type of an async function or method must be the global Promise type."),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:b(1066,1,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:b(1068,1,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:b(1069,1,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:b(1070,1,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:b(1071,1,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:b(1079,1,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:b(1084,1,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),_0_modifier_cannot_appear_on_a_constructor_declaration:b(1089,1,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:b(1090,1,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:b(1091,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:b(1092,1,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:b(1093,1,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:b(1094,1,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:b(1095,1,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:b(1096,1,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:b(1097,1,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:b(1098,1,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:b(1099,1,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:b(1100,1,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:b(1101,1,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:b(1102,1,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:b(1103,1,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:b(1104,1,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:b(1105,1,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:b(1106,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:b(1107,1,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:b(1108,1,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:b(1109,1,"Expression_expected_1109","Expression expected."),Type_expected:b(1110,1,"Type_expected_1110","Type expected."),Private_field_0_must_be_declared_in_an_enclosing_class:b(1111,1,"Private_field_0_must_be_declared_in_an_enclosing_class_1111","Private field '{0}' must be declared in an enclosing class."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:b(1113,1,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:b(1114,1,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:b(1115,1,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:b(1116,1,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:b(1117,1,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:b(1118,1,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:b(1119,1,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:b(1120,1,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_Use_the_syntax_0:b(1121,1,"Octal_literals_are_not_allowed_Use_the_syntax_0_1121","Octal literals are not allowed. Use the syntax '{0}'."),Variable_declaration_list_cannot_be_empty:b(1123,1,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:b(1124,1,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:b(1125,1,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:b(1126,1,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:b(1127,1,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:b(1128,1,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:b(1129,1,"Statement_expected_1129","Statement expected."),case_or_default_expected:b(1130,1,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:b(1131,1,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:b(1132,1,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:b(1134,1,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:b(1135,1,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:b(1136,1,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:b(1137,1,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:b(1138,1,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:b(1139,1,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:b(1140,1,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:b(1141,1,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:b(1142,1,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:b(1144,1,"or_expected_1144","'{' or ';' expected."),or_JSX_element_expected:b(1145,1,"or_JSX_element_expected_1145","'{' or JSX element expected."),Declaration_expected:b(1146,1,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:b(1147,1,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:b(1148,1,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:b(1149,1,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),_0_declarations_must_be_initialized:b(1155,1,"_0_declarations_must_be_initialized_1155","'{0}' declarations must be initialized."),_0_declarations_can_only_be_declared_inside_a_block:b(1156,1,"_0_declarations_can_only_be_declared_inside_a_block_1156","'{0}' declarations can only be declared inside a block."),Unterminated_template_literal:b(1160,1,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:b(1161,1,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:b(1162,1,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:b(1163,1,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:b(1164,1,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:b(1165,1,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:b(1166,1,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:b(1168,1,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:b(1169,1,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:b(1170,1,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:b(1171,1,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:b(1172,1,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:b(1173,1,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:b(1174,1,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:b(1175,1,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:b(1176,1,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:b(1177,1,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:b(1178,1,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:b(1179,1,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:b(1180,1,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:b(1181,1,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:b(1182,1,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:b(1183,1,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:b(1184,1,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:b(1185,1,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:b(1186,1,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:b(1187,1,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:b(1188,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:b(1189,1,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:b(1190,1,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:b(1191,1,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:b(1192,1,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:b(1193,1,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:b(1194,1,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:b(1195,1,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:b(1196,1,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:b(1197,1,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:b(1198,1,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:b(1199,1,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:b(1200,1,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:b(1202,1,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202",`Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:b(1203,1,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_0_is_enabled_requires_using_export_type:b(1205,1,"Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205","Re-exporting a type when '{0}' is enabled requires using 'export type'."),Decorators_are_not_valid_here:b(1206,1,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:b(1207,1,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0:b(1209,1,"Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209","Invalid optional chain from new expression. Did you mean to call '{0}()'?"),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:b(1210,1,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:b(1211,1,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:b(1212,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:b(1213,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:b(1214,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:b(1215,1,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:b(1216,1,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:b(1218,1,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Generators_are_not_allowed_in_an_ambient_context:b(1221,1,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:b(1222,1,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:b(1223,1,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:b(1224,1,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:b(1225,1,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:b(1226,1,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:b(1227,1,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:b(1228,1,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:b(1229,1,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:b(1230,1,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:b(1231,1,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:b(1232,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:b(1233,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:b(1234,1,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:b(1235,1,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:b(1236,1,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:b(1237,1,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:b(1238,1,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:b(1239,1,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:b(1240,1,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:b(1241,1,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:b(1242,1,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:b(1243,1,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:b(1244,1,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:b(1245,1,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:b(1246,1,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:b(1247,1,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:b(1248,1,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:b(1249,1,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5:b(1250,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:b(1251,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:b(1252,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),Abstract_properties_can_only_appear_within_an_abstract_class:b(1253,1,"Abstract_properties_can_only_appear_within_an_abstract_class_1253","Abstract properties can only appear within an abstract class."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:b(1254,1,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:b(1255,1,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:b(1257,1,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:b(1258,1,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:b(1259,1,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:b(1260,1,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:b(1261,1,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:b(1262,1,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:b(1263,1,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:b(1264,1,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:b(1265,1,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:b(1266,1,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:b(1267,1,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:b(1268,1,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled:b(1269,1,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269","Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."),Decorator_function_return_type_0_is_not_assignable_to_type_1:b(1270,1,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:b(1271,1,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:b(1272,1,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:b(1273,1,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:b(1274,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),accessor_modifier_can_only_appear_on_a_property_declaration:b(1275,1,"accessor_modifier_can_only_appear_on_a_property_declaration_1275","'accessor' modifier can only appear on a property declaration."),An_accessor_property_cannot_be_declared_optional:b(1276,1,"An_accessor_property_cannot_be_declared_optional_1276","An 'accessor' property cannot be declared optional."),_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class:b(1277,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277","'{0}' modifier can only appear on a type parameter of a function, method or class"),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0:b(1278,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278","The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0:b(1279,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279","The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."),Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement:b(1280,1,"Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280","Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."),Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead:b(1281,1,"Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281","Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."),An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:b(1282,1,"An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282","An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:b(1283,1,"An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283","An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:b(1284,1,"An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284","An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:b(1285,1,"An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285","An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:b(1286,1,"ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286","ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:b(1287,1,"A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287","A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled:b(1288,1,"An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288","An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),with_statements_are_not_allowed_in_an_async_function_block:b(1300,1,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:b(1308,1,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level:b(1309,1,"The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309","The current file is a CommonJS module and cannot use 'await' at the top level."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:b(1312,1,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:b(1313,1,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:b(1314,1,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:b(1315,1,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:b(1316,1,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:b(1317,1,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:b(1318,1,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:b(1319,1,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:b(1320,1,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:b(1321,1,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:b(1322,1,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext:b(1323,1,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext:b(1324,1,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),Argument_of_dynamic_import_cannot_be_spread_element:b(1325,1,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:b(1326,1,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:b(1327,1,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:b(1328,1,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:b(1329,1,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:b(1330,1,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:b(1331,1,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:b(1332,1,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:b(1333,1,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:b(1334,1,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:b(1335,1,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:b(1337,1,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:b(1338,1,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:b(1339,1,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:b(1340,1,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Class_constructor_may_not_be_an_accessor:b(1341,1,"Class_constructor_may_not_be_an_accessor_1341","Class constructor may not be an accessor."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext:b(1343,1,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),A_label_is_not_allowed_here:b(1344,1,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:b(1345,1,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:b(1346,1,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:b(1347,1,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:b(1348,1,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:b(1349,1,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:b(1350,3,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:b(1351,1,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:b(1352,1,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:b(1353,1,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:b(1354,1,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:b(1355,1,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:b(1356,1,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:b(1357,1,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:b(1358,1,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:b(1359,1,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),Type_0_does_not_satisfy_the_expected_type_1:b(1360,1,"Type_0_does_not_satisfy_the_expected_type_1_1360","Type '{0}' does not satisfy the expected type '{1}'."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:b(1361,1,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:b(1362,1,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:b(1363,1,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:b(1364,3,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:b(1365,3,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:b(1366,3,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:b(1367,3,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Class_constructor_may_not_be_a_generator:b(1368,1,"Class_constructor_may_not_be_a_generator_1368","Class constructor may not be a generator."),Did_you_mean_0:b(1369,3,"Did_you_mean_0_1369","Did you mean '{0}'?"),This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error:b(1371,1,"This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371","This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:b(1375,1,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:b(1376,3,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:b(1377,3,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:b(1378,1,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:b(1379,1,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:b(1380,1,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:b(1381,1,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:b(1382,1,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:b(1385,1,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:b(1386,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:b(1387,1,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:b(1388,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:b(1389,1,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:b(1390,1,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:b(1392,1,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:b(1393,3,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:b(1394,3,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:b(1395,3,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:b(1396,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:b(1397,3,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:b(1398,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:b(1399,3,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:b(1400,3,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:b(1401,3,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:b(1402,3,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:b(1403,3,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:b(1404,3,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:b(1405,3,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:b(1406,3,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:b(1407,3,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:b(1408,3,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:b(1409,3,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:b(1410,3,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:b(1411,3,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:b(1412,3,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:b(1413,3,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:b(1414,3,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:b(1415,3,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:b(1416,3,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:b(1417,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:b(1418,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:b(1419,3,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:b(1420,3,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:b(1421,3,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:b(1422,3,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:b(1423,3,"File_is_library_specified_here_1423","File is library specified here."),Default_library:b(1424,3,"Default_library_1424","Default library"),Default_library_for_target_0:b(1425,3,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:b(1426,3,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:b(1427,3,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:b(1428,3,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:b(1429,3,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:b(1430,3,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:b(1431,1,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:b(1432,1,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters:b(1433,1,"Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433","Neither decorators nor modifiers may be applied to 'this' parameters."),Unexpected_keyword_or_identifier:b(1434,1,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:b(1435,1,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:b(1436,1,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:b(1437,1,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:b(1438,1,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:b(1439,1,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:b(1440,1,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:b(1441,1,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:b(1442,1,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:b(1443,1,"Module_declaration_names_may_only_use_or_quoted_strings_1443",`Module declaration names may only use ' or " quoted strings.`),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:b(1444,1,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444","'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:b(1446,1,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled:b(1448,1,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:b(1449,3,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments:b(1450,3,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:b(1451,1,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),resolution_mode_should_be_either_require_or_import:b(1453,1,"resolution_mode_should_be_either_require_or_import_1453","`resolution-mode` should be either `require` or `import`."),resolution_mode_can_only_be_set_for_type_only_imports:b(1454,1,"resolution_mode_can_only_be_set_for_type_only_imports_1454","`resolution-mode` can only be set for type-only imports."),resolution_mode_is_the_only_valid_key_for_type_import_assertions:b(1455,1,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:b(1456,1,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:b(1457,3,"Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457","Matched by default include pattern '**/*'"),File_is_ECMAScript_module_because_0_has_field_type_with_value_module:b(1458,3,"File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458",`File is ECMAScript module because '{0}' has field "type" with value "module"`),File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:b(1459,3,"File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459",`File is CommonJS module because '{0}' has field "type" whose value is not "module"`),File_is_CommonJS_module_because_0_does_not_have_field_type:b(1460,3,"File_is_CommonJS_module_because_0_does_not_have_field_type_1460",`File is CommonJS module because '{0}' does not have field "type"`),File_is_CommonJS_module_because_package_json_was_not_found:b(1461,3,"File_is_CommonJS_module_because_package_json_was_not_found_1461","File is CommonJS module because 'package.json' was not found"),resolution_mode_is_the_only_valid_key_for_type_import_attributes:b(1463,1,"resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463","'resolution-mode' is the only valid key for type import attributes."),Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:b(1464,1,"Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464","Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:b(1470,1,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead:b(1471,1,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),catch_or_finally_expected:b(1472,1,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:b(1473,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:b(1474,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:b(1475,3,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:b(1476,3,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),An_instantiation_expression_cannot_be_followed_by_a_property_access:b(1477,1,"An_instantiation_expression_cannot_be_followed_by_a_property_access_1477","An instantiation expression cannot be followed by a property access."),Identifier_or_string_literal_expected:b(1478,1,"Identifier_or_string_literal_expected_1478","Identifier or string literal expected."),The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead:b(1479,1,"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479",`The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.`),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module:b(1480,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480",'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1:b(1481,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481",`To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`),To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0:b(1482,3,"To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482",'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'),To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module:b(1483,3,"To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483",'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:b(1484,1,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484","'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:b(1485,1,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),Decorator_used_before_export_here:b(1486,1,"Decorator_used_before_export_here_1486","Decorator used before 'export' here."),Octal_escape_sequences_are_not_allowed_Use_the_syntax_0:b(1487,1,"Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487","Octal escape sequences are not allowed. Use the syntax '{0}'."),Escape_sequence_0_is_not_allowed:b(1488,1,"Escape_sequence_0_is_not_allowed_1488","Escape sequence '{0}' is not allowed."),Decimals_with_leading_zeros_are_not_allowed:b(1489,1,"Decimals_with_leading_zeros_are_not_allowed_1489","Decimals with leading zeros are not allowed."),File_appears_to_be_binary:b(1490,1,"File_appears_to_be_binary_1490","File appears to be binary."),_0_modifier_cannot_appear_on_a_using_declaration:b(1491,1,"_0_modifier_cannot_appear_on_a_using_declaration_1491","'{0}' modifier cannot appear on a 'using' declaration."),_0_declarations_may_not_have_binding_patterns:b(1492,1,"_0_declarations_may_not_have_binding_patterns_1492","'{0}' declarations may not have binding patterns."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration:b(1493,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493","The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration:b(1494,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494","The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),_0_modifier_cannot_appear_on_an_await_using_declaration:b(1495,1,"_0_modifier_cannot_appear_on_an_await_using_declaration_1495","'{0}' modifier cannot appear on an 'await using' declaration."),Identifier_string_literal_or_number_literal_expected:b(1496,1,"Identifier_string_literal_or_number_literal_expected_1496","Identifier, string literal, or number literal expected."),The_types_of_0_are_incompatible_between_these_types:b(2200,1,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:b(2201,1,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:b(2202,1,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:b(2203,1,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:b(2204,1,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:b(2205,1,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:b(2206,1,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:b(2207,1,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),This_type_parameter_might_need_an_extends_0_constraint:b(2208,1,"This_type_parameter_might_need_an_extends_0_constraint_2208","This type parameter might need an `extends {0}` constraint."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:b(2209,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:b(2210,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Add_extends_constraint:b(2211,3,"Add_extends_constraint_2211","Add `extends` constraint."),Add_extends_constraint_to_all_type_parameters:b(2212,3,"Add_extends_constraint_to_all_type_parameters_2212","Add `extends` constraint to all type parameters"),Duplicate_identifier_0:b(2300,1,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:b(2301,1,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:b(2302,1,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:b(2303,1,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:b(2304,1,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:b(2305,1,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:b(2306,1,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:b(2307,1,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:b(2308,1,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:b(2309,1,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:b(2310,1,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:b(2311,1,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:b(2312,1,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:b(2313,1,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:b(2314,1,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:b(2315,1,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:b(2316,1,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:b(2317,1,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:b(2318,1,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:b(2319,1,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:b(2320,1,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:b(2321,1,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:b(2322,1,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:b(2323,1,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:b(2324,1,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:b(2325,1,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:b(2326,1,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:b(2327,1,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:b(2328,1,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:b(2329,1,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:b(2330,1,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:b(2331,1,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:b(2332,1,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_constructor_arguments:b(2333,1,"this_cannot_be_referenced_in_constructor_arguments_2333","'this' cannot be referenced in constructor arguments."),this_cannot_be_referenced_in_a_static_property_initializer:b(2334,1,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:b(2335,1,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:b(2336,1,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:b(2337,1,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:b(2338,1,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:b(2339,1,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:b(2340,1,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:b(2341,1,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:b(2343,1,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:b(2344,1,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:b(2345,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Untyped_function_calls_may_not_accept_type_arguments:b(2347,1,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:b(2348,1,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:b(2349,1,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:b(2350,1,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:b(2351,1,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:b(2352,1,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:b(2353,1,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:b(2354,1,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value:b(2355,1,"A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:b(2356,1,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:b(2357,1,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:b(2358,1,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method:b(2359,1,"The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359","The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:b(2362,1,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:b(2363,1,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:b(2364,1,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:b(2365,1,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:b(2366,1,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap:b(2367,1,"This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367","This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."),Type_parameter_name_cannot_be_0:b(2368,1,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:b(2369,1,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:b(2370,1,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:b(2371,1,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:b(2372,1,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:b(2373,1,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:b(2374,1,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:b(2375,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers:b(2376,1,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:b(2377,1,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:b(2378,1,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:b(2379,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),Overload_signatures_must_all_be_exported_or_non_exported:b(2383,1,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:b(2384,1,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:b(2385,1,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:b(2386,1,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:b(2387,1,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:b(2388,1,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:b(2389,1,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:b(2390,1,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:b(2391,1,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:b(2392,1,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:b(2393,1,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:b(2394,1,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:b(2395,1,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:b(2396,1,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:b(2397,1,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:b(2398,1,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:b(2399,1,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:b(2400,1,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers:b(2401,1,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:b(2402,1,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:b(2403,1,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:b(2404,1,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:b(2405,1,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:b(2406,1,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:b(2407,1,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:b(2408,1,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:b(2409,1,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:b(2410,1,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:b(2412,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:b(2411,1,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:b(2413,1,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:b(2414,1,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:b(2415,1,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:b(2416,1,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:b(2417,1,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:b(2418,1,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:b(2419,1,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:b(2420,1,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:b(2422,1,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:b(2423,1,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:b(2425,1,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:b(2426,1,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:b(2427,1,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:b(2428,1,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:b(2430,1,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:b(2431,1,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:b(2432,1,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:b(2433,1,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:b(2434,1,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:b(2435,1,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:b(2436,1,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:b(2437,1,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:b(2438,1,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:b(2439,1,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:b(2440,1,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:b(2441,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:b(2442,1,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:b(2443,1,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:b(2444,1,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:b(2445,1,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:b(2446,1,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:b(2447,1,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:b(2448,1,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:b(2449,1,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:b(2450,1,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:b(2451,1,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:b(2452,1,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:b(2454,1,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:b(2456,1,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:b(2457,1,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:b(2458,1,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:b(2459,1,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:b(2460,1,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:b(2461,1,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:b(2462,1,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:b(2463,1,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:b(2464,1,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:b(2465,1,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:b(2466,1,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:b(2467,1,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:b(2468,1,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:b(2469,1,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:b(2472,1,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:b(2473,1,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_must_be_constant_expressions:b(2474,1,"const_enum_member_initializers_must_be_constant_expressions_2474","const enum member initializers must be constant expressions."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:b(2475,1,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:b(2476,1,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:b(2477,1,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:b(2478,1,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:b(2480,1,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:b(2481,1,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:b(2483,1,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:b(2484,1,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:b(2487,1,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:b(2488,1,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:b(2489,1,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:b(2490,1,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:b(2491,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:b(2492,1,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:b(2493,1,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:b(2494,1,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:b(2495,1,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression:b(2496,1,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496","The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:b(2497,1,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:b(2498,1,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:b(2499,1,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:b(2500,1,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:b(2501,1,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:b(2502,1,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:b(2503,1,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:b(2504,1,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:b(2505,1,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:b(2506,1,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:b(2507,1,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:b(2508,1,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:b(2509,1,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:b(2510,1,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:b(2511,1,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:b(2512,1,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:b(2513,1,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),A_tuple_type_cannot_be_indexed_with_a_negative_value:b(2514,1,"A_tuple_type_cannot_be_indexed_with_a_negative_value_2514","A tuple type cannot be indexed with a negative value."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:b(2515,1,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:b(2516,1,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:b(2517,1,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:b(2518,1,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:b(2519,1,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:b(2520,1,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method:b(2522,1,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522","The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:b(2523,1,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:b(2524,1,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value:b(2525,1,"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525","Initializer provides no value for this binding element and the binding element has no default value."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:b(2526,1,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:b(2527,1,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:b(2528,1,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:b(2529,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:b(2530,1,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:b(2531,1,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:b(2532,1,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:b(2533,1,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:b(2534,1,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Type_0_cannot_be_used_to_index_type_1:b(2536,1,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:b(2537,1,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:b(2538,1,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:b(2539,1,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:b(2540,1,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:b(2542,1,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:b(2543,1,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:b(2544,1,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:b(2545,1,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:b(2547,1,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:b(2548,1,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:b(2549,1,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:b(2550,1,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:b(2551,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:b(2552,1,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:b(2553,1,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:b(2554,1,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:b(2555,1,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:b(2556,1,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:b(2558,1,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:b(2559,1,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:b(2560,1,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:b(2561,1,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:b(2562,1,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:b(2563,1,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:b(2564,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:b(2565,1,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:b(2566,1,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:b(2567,1,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:b(2568,1,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:b(2570,1,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:b(2571,1,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:b(2574,1,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:b(2575,1,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:b(2576,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:b(2577,1,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:b(2578,1,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:b(2580,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:b(2581,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:b(2582,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:b(2583,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:b(2584,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:b(2585,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:b(2588,1,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:b(2589,1,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:b(2590,1,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:b(2591,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:b(2592,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:b(2593,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:b(2594,1,"This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594","This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:b(2595,1,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:b(2596,1,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:b(2597,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:b(2598,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:b(2602,1,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:b(2603,1,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:b(2604,1,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:b(2606,1,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:b(2607,1,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:b(2608,1,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:b(2609,1,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:b(2610,1,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:b(2611,1,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:b(2612,1,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:b(2613,1,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:b(2614,1,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:b(2615,1,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:b(2616,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:b(2617,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:b(2618,1,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:b(2619,1,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:b(2620,1,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:b(2621,1,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:b(2623,1,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:b(2624,1,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:b(2625,1,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:b(2626,1,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:b(2627,1,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:b(2628,1,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:b(2629,1,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:b(2630,1,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:b(2631,1,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:b(2632,1,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:b(2633,1,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:b(2634,1,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:b(2635,1,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:b(2636,1,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:b(2637,1,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator:b(2638,1,"Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638","Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),React_components_cannot_include_JSX_namespace_names:b(2639,1,"React_components_cannot_include_JSX_namespace_names_2639","React components cannot include JSX namespace names"),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:b(2649,1,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:b(2651,1,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:b(2652,1,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:b(2653,1,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),JSX_expressions_must_have_one_parent_element:b(2657,1,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:b(2658,1,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:b(2659,1,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:b(2660,1,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:b(2661,1,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:b(2662,1,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:b(2663,1,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:b(2664,1,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:b(2665,1,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:b(2666,1,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:b(2667,1,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:b(2668,1,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:b(2669,1,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:b(2670,1,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:b(2671,1,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:b(2672,1,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:b(2673,1,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:b(2674,1,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:b(2675,1,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:b(2676,1,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:b(2677,1,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:b(2678,1,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:b(2679,1,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:b(2680,1,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:b(2681,1,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:b(2683,1,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:b(2684,1,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:b(2685,1,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:b(2686,1,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:b(2687,1,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:b(2688,1,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:b(2689,1,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:b(2690,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:b(2692,1,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:b(2693,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:b(2694,1,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:b(2695,1,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:b(2696,1,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:b(2697,1,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:b(2698,1,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:b(2699,1,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:b(2700,1,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:b(2701,1,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:b(2702,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:b(2703,1,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:b(2704,1,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:b(2705,1,"An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705","An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:b(2706,1,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:b(2707,1,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:b(2708,1,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:b(2709,1,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:b(2710,1,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:b(2711,1,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:b(2712,1,"A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712","A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:b(2713,1,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713",`Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:b(2714,1,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:b(2715,1,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:b(2716,1,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:b(2717,1,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:b(2718,1,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:b(2719,1,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:b(2720,1,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:b(2721,1,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:b(2722,1,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:b(2723,1,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:b(2724,1,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:b(2725,1,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:b(2726,1,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:b(2727,1,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:b(2728,3,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:b(2729,1,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:b(2730,1,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:b(2731,1,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:b(2732,1,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:b(2733,1,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:b(2734,1,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:b(2735,1,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:b(2736,1,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:b(2737,1,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:b(2738,3,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:b(2739,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:b(2740,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:b(2741,1,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:b(2742,1,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:b(2743,1,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:b(2744,1,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:b(2745,1,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:b(2746,1,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:b(2747,1,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_0_is_enabled:b(2748,1,"Cannot_access_ambient_const_enums_when_0_is_enabled_2748","Cannot access ambient const enums when '{0}' is enabled."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:b(2749,1,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:b(2750,1,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:b(2751,1,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:b(2752,1,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:b(2753,1,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:b(2754,1,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:b(2755,1,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:b(2756,1,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:b(2757,1,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:b(2758,1,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:b(2759,1,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:b(2760,1,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:b(2761,1,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:b(2762,1,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:b(2763,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:b(2764,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:b(2765,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:b(2766,1,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:b(2767,1,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:b(2768,1,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:b(2769,1,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:b(2770,1,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:b(2771,1,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:b(2772,1,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:b(2773,1,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:b(2774,1,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:b(2775,1,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:b(2776,1,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:b(2777,1,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:b(2778,1,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:b(2779,1,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:b(2780,1,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:b(2781,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:b(2782,3,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:b(2783,1,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:b(2784,1,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:b(2785,1,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:b(2786,1,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:b(2787,1,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:b(2788,1,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:b(2789,1,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:b(2790,1,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:b(2791,1,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:b(2792,1,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:b(2793,1,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:b(2794,1,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:b(2795,1,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:b(2796,1,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:b(2797,1,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:b(2798,1,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:b(2799,1,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:b(2800,1,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:b(2801,1,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:b(2802,1,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:b(2803,1,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:b(2804,1,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:b(2806,1,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:b(2807,1,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:b(2808,1,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses:b(2809,1,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:b(2810,1,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:b(2811,1,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:b(2812,1,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:b(2813,1,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:b(2814,1,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:b(2815,1,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:b(2816,1,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:b(2817,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:b(2818,1,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:b(2819,1,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:b(2820,1,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext:b(2821,1,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821","Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:b(2822,1,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext:b(2823,1,"Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823","Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),Cannot_find_namespace_0_Did_you_mean_1:b(2833,1,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path:b(2834,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0:b(2835,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:b(2836,1,"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836","Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),Import_assertion_values_must_be_string_literal_expressions:b(2837,1,"Import_assertion_values_must_be_string_literal_expressions_2837","Import assertion values must be string literal expressions."),All_declarations_of_0_must_have_identical_constraints:b(2838,1,"All_declarations_of_0_must_have_identical_constraints_2838","All declarations of '{0}' must have identical constraints."),This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value:b(2839,1,"This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839","This condition will always return '{0}' since JavaScript compares objects by reference, not value."),An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types:b(2840,1,"An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840","An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."),_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation:b(2842,1,"_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842","'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here:b(2843,1,"We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843","We can only write a type for '{0}' by adding a type for the entire parameter here."),Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:b(2844,1,"Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844","Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),This_condition_will_always_return_0:b(2845,1,"This_condition_will_always_return_0_2845","This condition will always return '{0}'."),A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead:b(2846,1,"A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846","A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"),The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression:b(2848,1,"The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848","The right-hand side of an 'instanceof' expression must not be an instantiation expression."),Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1:b(2849,1,"Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849","Target signature provides too few arguments. Expected {0} or more, but got {1}."),The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined:b(2850,1,"The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850","The initializer of a 'using' declaration must be either an object with a '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined:b(2851,1,"The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851","The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:b(2852,1,"await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852","'await using' statements are only allowed within async functions and at the top levels of modules."),await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:b(2853,1,"await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853","'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:b(2854,1,"Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854","Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super:b(2855,1,"Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855","Class field '{0}' defined by the parent class is not accessible in the child class via super."),Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:b(2856,1,"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856","Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),Import_attributes_cannot_be_used_with_type_only_imports_or_exports:b(2857,1,"Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857","Import attributes cannot be used with type-only imports or exports."),Import_attribute_values_must_be_string_literal_expressions:b(2858,1,"Import_attribute_values_must_be_string_literal_expressions_2858","Import attribute values must be string literal expressions."),Excessive_complexity_comparing_types_0_and_1:b(2859,1,"Excessive_complexity_comparing_types_0_and_1_2859","Excessive complexity comparing types '{0}' and '{1}'."),The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method:b(2860,1,"The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860","The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression:b(2861,1,"An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861","An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),Type_0_is_generic_and_can_only_be_indexed_for_reading:b(2862,1,"Type_0_is_generic_and_can_only_be_indexed_for_reading_2862","Type '{0}' is generic and can only be indexed for reading."),A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values:b(2863,1,"A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863","A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types:b(2864,1,"A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864","A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),Import_declaration_0_is_using_private_name_1:b(4e3,1,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:b(4002,1,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:b(4004,1,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:b(4006,1,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:b(4008,1,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:b(4010,1,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:b(4012,1,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:b(4014,1,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:b(4016,1,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:b(4019,1,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:b(4020,1,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:b(4021,1,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:b(4022,1,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4023,1,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:b(4024,1,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:b(4025,1,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4026,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:b(4027,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:b(4028,1,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4029,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:b(4030,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:b(4031,1,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:b(4032,1,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:b(4033,1,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:b(4034,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:b(4035,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:b(4036,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:b(4037,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4038,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:b(4039,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:b(4040,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4041,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:b(4042,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:b(4043,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:b(4044,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:b(4045,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:b(4046,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:b(4047,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:b(4048,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:b(4049,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:b(4050,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:b(4051,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:b(4052,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:b(4053,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:b(4054,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:b(4055,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:b(4056,1,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:b(4057,1,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:b(4058,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:b(4059,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:b(4060,1,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4061,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:b(4062,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:b(4063,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:b(4064,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:b(4065,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:b(4066,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:b(4067,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4068,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:b(4069,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:b(4070,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4071,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:b(4072,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:b(4073,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:b(4074,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:b(4075,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4076,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:b(4077,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:b(4078,1,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:b(4081,1,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:b(4082,1,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:b(4083,1,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:b(4084,1,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1:b(4085,1,"Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085","Extends clause for inferred type '{0}' has or is using private name '{1}'."),Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict:b(4090,1,"Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090","Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:b(4091,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:b(4092,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_class_expression_may_not_be_private_or_protected:b(4094,1,"Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094","Property '{0}' of exported class expression may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4095,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:b(4096,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:b(4097,1,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4098,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:b(4099,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:b(4100,1,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:b(4101,1,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:b(4102,1,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:b(4103,1,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:b(4104,1,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:b(4105,1,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:b(4106,1,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:b(4107,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:b(4108,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:b(4109,1,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:b(4110,1,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:b(4111,1,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:b(4112,1,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:b(4113,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:b(4114,1,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:b(4115,1,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:b(4116,1,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:b(4117,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:b(4118,1,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:b(4119,1,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:b(4120,1,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:b(4121,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:b(4122,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:b(4123,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:b(4124,1,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),The_current_host_does_not_support_the_0_option:b(5001,1,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:b(5009,1,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:b(5010,1,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:b(5012,1,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Failed_to_parse_file_0_Colon_1:b(5014,1,"Failed_to_parse_file_0_Colon_1_5014","Failed to parse file '{0}': {1}."),Unknown_compiler_option_0:b(5023,1,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:b(5024,1,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:b(5025,1,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:b(5033,1,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:b(5042,1,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:b(5047,1,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_cannot_be_specified_when_option_target_is_ES3:b(5048,1,"Option_0_cannot_be_specified_when_option_target_is_ES3_5048","Option '{0}' cannot be specified when option 'target' is 'ES3'."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:b(5051,1,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:b(5052,1,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:b(5053,1,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:b(5054,1,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:b(5055,1,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:b(5056,1,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:b(5057,1,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:b(5058,1,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:b(5059,1,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:b(5061,1,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:b(5062,1,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:b(5063,1,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:b(5064,1,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:b(5065,1,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:b(5066,1,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:b(5067,1,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:b(5068,1,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:b(5069,1,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic:b(5070,1,"Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070","Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext:b(5071,1,"Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071","Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),Unknown_build_option_0:b(5072,1,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:b(5073,1,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:b(5074,1,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:b(5075,1,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:b(5076,1,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:b(5077,1,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:b(5078,1,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:b(5079,1,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:b(5080,1,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:b(5081,1,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:b(5082,1,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:b(5083,1,"Cannot_read_file_0_5083","Cannot read file '{0}'."),A_tuple_member_cannot_be_both_optional_and_rest:b(5085,1,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:b(5086,1,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:b(5087,1,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:b(5088,1,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:b(5089,1,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:b(5090,1,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled:b(5091,1,"Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."),The_root_value_of_a_0_file_must_be_an_object:b(5092,1,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:b(5093,1,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:b(5094,1,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later:b(5095,1,"Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095","Option '{0}' can only be used when 'module' is set to 'es2015' or later."),Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set:b(5096,1,"Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096","Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled:b(5097,1,"An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097","An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler:b(5098,1,"Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098","Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error:b(5101,1,"Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101",`Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),Option_0_has_been_removed_Please_remove_it_from_your_configuration:b(5102,1,"Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102","Option '{0}' has been removed. Please remove it from your configuration."),Invalid_value_for_ignoreDeprecations:b(5103,1,"Invalid_value_for_ignoreDeprecations_5103","Invalid value for '--ignoreDeprecations'."),Option_0_is_redundant_and_cannot_be_specified_with_option_1:b(5104,1,"Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104","Option '{0}' is redundant and cannot be specified with option '{1}'."),Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System:b(5105,1,"Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105","Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),Use_0_instead:b(5106,3,"Use_0_instead_5106","Use '{0}' instead."),Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error:b(5107,1,"Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107",`Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),Option_0_1_has_been_removed_Please_remove_it_from_your_configuration:b(5108,1,"Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108","Option '{0}={1}' has been removed. Please remove it from your configuration."),Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1:b(5109,1,"Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109","Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1:b(5110,1,"Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110","Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:b(6e3,3,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:b(6001,3,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:b(6002,3,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:b(6004,3,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:b(6005,3,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:b(6006,3,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:b(6007,3,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:b(6008,3,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:b(6009,3,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:b(6010,3,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:b(6011,3,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:b(6012,3,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:b(6013,3,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:b(6014,3,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:b(6015,3,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:b(6016,3,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:b(6017,3,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:b(6019,3,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:b(6020,3,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:b(6023,3,"Syntax_Colon_0_6023","Syntax: {0}"),options:b(6024,3,"options_6024","options"),file:b(6025,3,"file_6025","file"),Examples_Colon_0:b(6026,3,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:b(6027,3,"Options_Colon_6027","Options:"),Version_0:b(6029,3,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:b(6030,3,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:b(6031,3,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:b(6032,3,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:b(6034,3,"KIND_6034","KIND"),FILE:b(6035,3,"FILE_6035","FILE"),VERSION:b(6036,3,"VERSION_6036","VERSION"),LOCATION:b(6037,3,"LOCATION_6037","LOCATION"),DIRECTORY:b(6038,3,"DIRECTORY_6038","DIRECTORY"),STRATEGY:b(6039,3,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:b(6040,3,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:b(6041,3,"Errors_Files_6041","Errors Files"),Generates_corresponding_map_file:b(6043,3,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:b(6044,1,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:b(6045,1,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:b(6046,1,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:b(6048,1,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form or -. For example '{0}' or '{1}'."),Unable_to_open_file_0:b(6050,1,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:b(6051,1,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:b(6052,3,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:b(6053,1,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:b(6054,1,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:b(6055,3,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:b(6056,3,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:b(6058,3,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:b(6059,1,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:b(6060,3,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:b(6061,3,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:b(6064,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:b(6065,3,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:b(6066,3,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:b(6070,3,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:b(6071,3,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:b(6072,3,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:b(6073,3,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:b(6074,3,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:b(6075,3,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:b(6076,3,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:b(6077,3,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:b(6078,3,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:b(6079,3,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:b(6080,3,"Specify_JSX_code_generation_6080","Specify JSX code generation."),File_0_has_an_unsupported_extension_so_skipping_it:b(6081,3,"File_0_has_an_unsupported_extension_so_skipping_it_6081","File '{0}' has an unsupported extension, so skipping it."),Only_amd_and_system_modules_are_supported_alongside_0:b(6082,1,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:b(6083,3,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:b(6084,3,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:b(6085,3,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:b(6086,3,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:b(6087,3,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:b(6088,3,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:b(6089,3,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:b(6090,3,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:b(6091,3,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:b(6092,3,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:b(6093,3,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:b(6094,3,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1:b(6095,3,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095","Loading module as file / folder, candidate module location '{0}', target file types: {1}."),File_0_does_not_exist:b(6096,3,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exists_use_it_as_a_name_resolution_result:b(6097,3,"File_0_exists_use_it_as_a_name_resolution_result_6097","File '{0}' exists - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_types_Colon_1:b(6098,3,"Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098","Loading module '{0}' from 'node_modules' folder, target file types: {1}."),Found_package_json_at_0:b(6099,3,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:b(6100,3,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:b(6101,3,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:b(6102,3,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:b(6104,3,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:b(6105,3,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:b(6106,3,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:b(6107,3,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:b(6108,3,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:b(6109,3,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:b(6110,3,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:b(6111,3,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:b(6112,3,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:b(6113,3,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:b(6114,1,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:b(6115,3,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:b(6116,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:b(6119,3,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:b(6120,3,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:b(6121,3,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:b(6122,3,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:b(6123,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:b(6124,3,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:b(6125,3,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:b(6126,3,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:b(6127,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:b(6128,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:b(6130,3,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:b(6131,1,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:b(6132,3,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:b(6133,1,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:b(6134,3,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:b(6135,3,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:b(6136,3,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:b(6137,1,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:b(6138,1,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:b(6139,3,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:b(6140,1,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:b(6141,3,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:b(6142,1,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:b(6144,3,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified:b(6145,3,"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145","Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:b(6146,3,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:b(6147,3,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:b(6148,3,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:b(6149,3,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:b(6150,3,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:b(6151,3,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:b(6152,3,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:b(6153,3,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:b(6154,3,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:b(6155,3,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:b(6156,3,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:b(6157,3,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:b(6158,3,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:b(6159,3,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:b(6160,3,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:b(6161,3,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:b(6162,3,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:b(6163,3,"The_character_set_of_the_input_files_6163","The character set of the input files."),Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1:b(6164,3,"Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164","Skipping module '{0}' that looks like an absolute URI, target file types: {1}."),Do_not_truncate_error_messages:b(6165,3,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:b(6166,3,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:b(6167,3,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:b(6168,3,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:b(6169,3,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:b(6170,3,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:b(6171,3,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3:b(6179,3,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),Enable_all_strict_type_checking_options:b(6180,3,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:b(6182,3,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:b(6183,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:b(6184,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:b(6186,3,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:b(6187,3,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:b(6188,1,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:b(6189,1,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:b(6191,3,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:b(6192,1,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:b(6193,3,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:b(6194,3,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:b(6195,3,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:b(6196,1,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:b(6197,3,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:b(6198,1,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:b(6199,1,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:b(6200,1,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:b(6201,3,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:b(6202,1,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:b(6203,3,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:b(6204,3,"and_here_6204","and here."),All_type_parameters_are_unused:b(6205,1,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:b(6206,3,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:b(6207,3,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:b(6208,3,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:b(6209,3,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:b(6210,3,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:b(6211,3,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:b(6212,3,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:b(6213,3,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:b(6214,3,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:b(6215,3,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:b(6216,3,"Found_1_error_6216","Found 1 error."),Found_0_errors:b(6217,3,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:b(6218,3,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:b(6219,3,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:b(6220,3,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:b(6221,3,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:b(6222,3,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:b(6223,3,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:b(6224,3,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:b(6225,3,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:b(6226,3,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:b(6227,3,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:b(6229,1,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:b(6230,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:b(6231,1,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:b(6232,1,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:b(6233,1,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:b(6234,1,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:b(6235,3,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:b(6236,1,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:b(6237,3,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:b(6238,1,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:b(6239,3,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:b(6240,3,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:b(6241,3,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:b(6242,3,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:b(6243,3,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:b(6244,3,"Modules_6244","Modules"),File_Management:b(6245,3,"File_Management_6245","File Management"),Emit:b(6246,3,"Emit_6246","Emit"),JavaScript_Support:b(6247,3,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:b(6248,3,"Type_Checking_6248","Type Checking"),Editor_Support:b(6249,3,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:b(6250,3,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:b(6251,3,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:b(6252,3,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:b(6253,3,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:b(6254,3,"Language_and_Environment_6254","Language and Environment"),Projects:b(6255,3,"Projects_6255","Projects"),Output_Formatting:b(6256,3,"Output_Formatting_6256","Output Formatting"),Completeness:b(6257,3,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:b(6258,1,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_0:b(6259,3,"Found_1_error_in_0_6259","Found 1 error in {0}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:b(6260,3,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:b(6261,3,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),File_name_0_has_a_1_extension_looking_up_2_instead:b(6262,3,"File_name_0_has_a_1_extension_looking_up_2_instead_6262","File name '{0}' has a '{1}' extension - looking up '{2}' instead."),Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set:b(6263,1,"Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263","Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."),Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present:b(6264,3,"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264","Enable importing files with any extension, provided a declaration file is present."),Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder:b(6265,3,"Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265","Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."),Option_0_can_only_be_specified_on_command_line:b(6266,1,"Option_0_can_only_be_specified_on_command_line_6266","Option '{0}' can only be specified on command line."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:b(6270,3,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:b(6271,3,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:b(6272,3,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:b(6273,3,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:b(6274,3,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:b(6275,3,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:b(6276,3,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update:b(6277,3,"Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277","Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings:b(6278,3,"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278",`There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),Enable_project_compilation:b(6302,3,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:b(6304,1,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:b(6305,1,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:b(6306,1,"Referenced_project_0_must_have_setting_composite_Colon_true_6306",`Referenced project '{0}' must have setting "composite": true.`),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:b(6307,1,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Cannot_prepend_project_0_because_it_does_not_have_outFile_set:b(6308,1,"Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308","Cannot prepend project '{0}' because it does not have 'outFile' set"),Output_file_0_from_project_1_does_not_exist:b(6309,1,"Output_file_0_from_project_1_does_not_exist_6309","Output file '{0}' from project '{1}' does not exist"),Referenced_project_0_may_not_disable_emit:b(6310,1,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_output_1_is_older_than_input_2:b(6350,3,"Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350","Project '{0}' is out of date because output '{1}' is older than input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2:b(6351,3,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:b(6352,3,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:b(6353,3,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:b(6354,3,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:b(6355,3,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:b(6356,3,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:b(6357,3,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:b(6358,3,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:b(6359,3,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:b(6361,3,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:b(6362,3,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:b(6363,3,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:b(6364,3,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:b(6365,3,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:b(6367,3,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:b(6369,1,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:b(6370,1,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:b(6371,3,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed:b(6372,3,"Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372","Project '{0}' is out of date because output of its dependency '{1}' has changed"),Updating_output_of_project_0:b(6373,3,"Updating_output_of_project_0_6373","Updating output of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:b(6374,3,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),A_non_dry_build_would_update_output_of_project_0:b(6375,3,"A_non_dry_build_would_update_output_of_project_0_6375","A non-dry build would update output of project '{0}'"),Cannot_update_output_of_project_0_because_there_was_error_reading_file_1:b(6376,3,"Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376","Cannot update output of project '{0}' because there was error reading file '{1}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:b(6377,1,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:b(6379,1,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:b(6380,3,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:b(6381,3,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:b(6382,3,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:b(6383,3,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:b(6384,3,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:b(6385,2,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:b(6386,3,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:b(6387,2,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:b(6388,3,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:b(6389,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:b(6390,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:b(6391,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:b(6392,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:b(6393,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:b(6394,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:b(6395,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:b(6396,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:b(6397,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:b(6398,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted:b(6399,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399","Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files:b(6400,3,"Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400","Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),Project_0_is_out_of_date_because_there_was_error_reading_file_1:b(6401,3,"Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401","Project '{0}' is out of date because there was error reading file '{1}'"),Resolving_in_0_mode_with_conditions_1:b(6402,3,"Resolving_in_0_mode_with_conditions_1_6402","Resolving in {0} mode with conditions {1}."),Matched_0_condition_1:b(6403,3,"Matched_0_condition_1_6403","Matched '{0}' condition '{1}'."),Using_0_subpath_1_with_target_2:b(6404,3,"Using_0_subpath_1_with_target_2_6404","Using '{0}' subpath '{1}' with target '{2}'."),Saw_non_matching_condition_0:b(6405,3,"Saw_non_matching_condition_0_6405","Saw non-matching condition '{0}'."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions:b(6406,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406","Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"),Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set:b(6407,3,"Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407","Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),Use_the_package_json_exports_field_when_resolving_package_imports:b(6408,3,"Use_the_package_json_exports_field_when_resolving_package_imports_6408","Use the package.json 'exports' field when resolving package imports."),Use_the_package_json_imports_field_when_resolving_imports:b(6409,3,"Use_the_package_json_imports_field_when_resolving_imports_6409","Use the package.json 'imports' field when resolving imports."),Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports:b(6410,3,"Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410","Conditions to set in addition to the resolver-specific defaults when resolving imports."),true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false:b(6411,3,"true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411","`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more:b(6412,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412","Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),Entering_conditional_exports:b(6413,3,"Entering_conditional_exports_6413","Entering conditional exports."),Resolved_under_condition_0:b(6414,3,"Resolved_under_condition_0_6414","Resolved under condition '{0}'."),Failed_to_resolve_under_condition_0:b(6415,3,"Failed_to_resolve_under_condition_0_6415","Failed to resolve under condition '{0}'."),Exiting_conditional_exports:b(6416,3,"Exiting_conditional_exports_6416","Exiting conditional exports."),Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0:b(6417,3,"Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417","Searching all ancestor node_modules directories for preferred extensions: {0}."),Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0:b(6418,3,"Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418","Searching all ancestor node_modules directories for fallback extensions: {0}."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:b(6500,3,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:b(6501,3,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:b(6502,3,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:b(6503,3,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:b(6504,1,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:b(6505,3,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:b(6506,3,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:b(6600,3,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:b(6601,3,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:b(6602,3,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:b(6603,3,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:b(6604,3,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:b(6605,3,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:b(6606,3,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:b(6607,3,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:b(6608,3,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:b(6609,3,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:b(6611,3,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:b(6612,3,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:b(6613,3,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:b(6614,3,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:b(6615,3,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:b(6616,3,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:b(6617,3,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:b(6618,3,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:b(6619,3,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:b(6620,3,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:b(6621,3,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:b(6622,3,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:b(6623,3,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:b(6624,3,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:b(6625,3,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:b(6626,3,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:b(6627,3,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:b(6628,3,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:b(6629,3,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_legacy_experimental_decorators:b(6630,3,"Enable_experimental_support_for_legacy_experimental_decorators_6630","Enable experimental support for legacy experimental decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:b(6631,3,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:b(6632,3,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:b(6633,3,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:b(6634,3,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:b(6635,3,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:b(6636,3,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:b(6637,3,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:b(6638,3,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:b(6639,3,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:b(6641,3,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:b(6642,3,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:b(6643,3,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:b(6644,3,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:b(6645,3,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:b(6646,3,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:b(6647,3,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:b(6648,3,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:b(6649,3,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:b(6650,3,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:b(6651,3,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:b(6652,3,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:b(6653,3,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:b(6654,3,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:b(6655,3,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:b(6656,3,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:b(6657,3,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:b(6658,3,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:b(6659,3,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:b(6660,3,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:b(6661,3,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:b(6662,3,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:b(6663,3,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:b(6664,3,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:b(6665,3,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:b(6666,3,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:b(6667,3,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:b(6668,3,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:b(6669,3,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:b(6670,3,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:b(6671,3,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:b(6672,3,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:b(6673,3,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:b(6674,3,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:b(6675,3,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:b(6676,3,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:b(6677,3,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:b(6678,3,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:b(6679,3,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:b(6680,3,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:b(6681,3,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:b(6682,3,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:b(6683,3,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:b(6684,3,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:b(6685,3,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:b(6686,3,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:b(6687,3,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:b(6688,3,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:b(6689,3,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:b(6690,3,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:b(6691,3,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:b(6692,3,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:b(6693,3,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:b(6694,3,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:b(6695,3,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:b(6697,3,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:b(6698,3,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:b(6699,3,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:b(6700,3,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:b(6701,3,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:b(6702,3,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:b(6703,3,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:b(6704,3,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:b(6705,3,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:b(6706,3,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:b(6707,3,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:b(6709,3,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:b(6710,3,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:b(6711,3,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:b(6712,3,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:b(6713,3,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:b(6714,3,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:b(6715,3,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:b(6717,3,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:b(6718,3,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Default_catch_clause_variables_as_unknown_instead_of_any:b(6803,3,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting:b(6804,3,"Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804","Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),one_of_Colon:b(6900,3,"one_of_Colon_6900","one of:"),one_or_more_Colon:b(6901,3,"one_or_more_Colon_6901","one or more:"),type_Colon:b(6902,3,"type_Colon_6902","type:"),default_Colon:b(6903,3,"default_Colon_6903","default:"),module_system_or_esModuleInterop:b(6904,3,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:b(6905,3,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:b(6906,3,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:b(6907,3,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:b(6908,3,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:b(6909,3,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:b(69010,3,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:b(6911,3,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:b(6912,3,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:b(6913,3,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:b(6914,3,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:b(6915,3,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:b(6916,3,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:b(6917,3,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:b(6918,3,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:b(6919,3,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:b(6920,3,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:b(6921,3,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:b(6922,3,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:b(6923,3,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:b(6924,3,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:b(6925,3,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:b(6926,3,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:b(6927,3,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:b(6928,3,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:b(6929,3,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:b(6930,3,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:b(6931,1,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:b(7005,1,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:b(7006,1,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:b(7008,1,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:b(7009,1,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:b(7010,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:b(7011,1,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation:b(7012,1,"This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012","This overload implicitly returns the type '{0}' because it lacks a return type annotation."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:b(7013,1,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:b(7014,1,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:b(7015,1,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:b(7016,1,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:b(7017,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:b(7018,1,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:b(7019,1,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:b(7020,1,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:b(7022,1,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:b(7023,1,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:b(7024,1,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:b(7025,1,"Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025","Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:b(7026,1,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:b(7027,1,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:b(7028,1,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:b(7029,1,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:b(7030,1,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:b(7031,1,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:b(7032,1,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:b(7033,1,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:b(7034,1,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:b(7035,1,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:b(7036,1,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:b(7037,3,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:b(7038,3,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:b(7039,1,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:b(7040,1,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:b(7041,1,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:b(7042,1,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:b(7043,2,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:b(7044,2,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:b(7045,2,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:b(7046,2,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:b(7047,2,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:b(7048,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:b(7049,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:b(7050,2,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:b(7051,1,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:b(7052,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:b(7053,1,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:b(7054,1,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:b(7055,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:b(7056,1,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:b(7057,1,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:b(7058,1,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:b(7059,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:b(7060,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:b(7061,1,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:b(8e3,1,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:b(8001,1,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:b(8002,1,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:b(8003,1,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:b(8004,1,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:b(8005,1,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:b(8006,1,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:b(8008,1,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:b(8009,1,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:b(8010,1,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:b(8011,1,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:b(8012,1,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:b(8013,1,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:b(8016,1,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Signature_declarations_can_only_be_used_in_TypeScript_files:b(8017,1,"Signature_declarations_can_only_be_used_in_TypeScript_files_8017","Signature declarations can only be used in TypeScript files."),Report_errors_in_js_files:b(8019,3,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:b(8020,1,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:b(8021,1,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:b(8022,1,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:b(8023,1,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:b(8024,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:b(8025,1,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:b(8026,1,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:b(8027,1,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:b(8028,1,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:b(8029,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:b(8030,1,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:b(8031,1,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:b(8032,1,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:b(8033,1,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:b(8034,1,"The_tag_was_first_specified_here_8034","The tag was first specified here."),You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:b(8035,1,"You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035","You cannot rename elements that are defined in a 'node_modules' folder."),You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder:b(8036,1,"You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036","You cannot rename elements that are defined in another 'node_modules' folder."),Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files:b(8037,1,"Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037","Type satisfaction expressions can only be used in TypeScript files."),Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export:b(8038,1,"Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038","Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag:b(8039,1,"A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039","A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:b(9005,1,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:b(9006,1,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:b(17e3,1,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:b(17001,1,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:b(17002,1,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:b(17004,1,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:b(17005,1,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:b(17006,1,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:b(17007,1,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:b(17008,1,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:b(17009,1,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:b(17010,1,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:b(17011,1,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:b(17012,1,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:b(17013,1,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:b(17014,1,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:b(17015,1,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:b(17016,1,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:b(17017,1,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:b(17018,1,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:b(17019,1,"_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019","'{0}' at the end of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:b(17020,1,"_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020","'{0}' at the start of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),Unicode_escape_sequence_cannot_appear_here:b(17021,1,"Unicode_escape_sequence_cannot_appear_here_17021","Unicode escape sequence cannot appear here."),Circularity_detected_while_resolving_configuration_Colon_0:b(18e3,1,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:b(18002,1,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:b(18003,1,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:b(80001,2,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:b(80002,2,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:b(80003,2,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:b(80004,2,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:b(80005,2,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:b(80006,2,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:b(80007,2,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:b(80008,2,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),JSDoc_typedef_may_be_converted_to_TypeScript_type:b(80009,2,"JSDoc_typedef_may_be_converted_to_TypeScript_type_80009","JSDoc typedef may be converted to TypeScript type."),JSDoc_typedefs_may_be_converted_to_TypeScript_types:b(80010,2,"JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010","JSDoc typedefs may be converted to TypeScript types."),Add_missing_super_call:b(90001,3,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:b(90002,3,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:b(90003,3,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:b(90004,3,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:b(90005,3,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:b(90006,3,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:b(90007,3,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:b(90008,3,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:b(90010,3,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:b(90011,3,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:b(90012,3,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:b(90013,3,"Import_0_from_1_90013",`Import '{0}' from "{1}"`),Change_0_to_1:b(90014,3,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:b(90016,3,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:b(90017,3,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:b(90018,3,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:b(90019,3,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:b(90020,3,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:b(90021,3,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:b(90022,3,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:b(90023,3,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:b(90024,3,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:b(90025,3,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:b(90026,3,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:b(90027,3,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:b(90028,3,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:b(90029,3,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:b(90030,3,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:b(90031,3,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:b(90034,3,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:b(90035,3,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:b(90036,3,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:b(90037,3,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:b(90038,3,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:b(90039,3,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:b(90041,3,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:b(90053,3,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:b(90054,3,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:b(90055,3,"Remove_type_from_import_declaration_from_0_90055",`Remove 'type' from import declaration from "{0}"`),Remove_type_from_import_of_0_from_1:b(90056,3,"Remove_type_from_import_of_0_from_1_90056",`Remove 'type' from import of '{0}' from "{1}"`),Add_import_from_0:b(90057,3,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:b(90058,3,"Update_import_from_0_90058",'Update import from "{0}"'),Export_0_from_module_1:b(90059,3,"Export_0_from_module_1_90059","Export '{0}' from module '{1}'"),Export_all_referenced_locals:b(90060,3,"Export_all_referenced_locals_90060","Export all referenced locals"),Convert_function_to_an_ES2015_class:b(95001,3,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:b(95003,3,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:b(95004,3,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:b(95005,3,"Extract_function_95005","Extract function"),Extract_constant:b(95006,3,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:b(95007,3,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:b(95008,3,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:b(95009,3,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:b(95011,3,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:b(95012,3,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:b(95013,3,"Convert_to_default_import_95013","Convert to default import"),Install_0:b(95014,3,"Install_0_95014","Install '{0}'"),Replace_import_with_0:b(95015,3,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:b(95016,3,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:b(95017,3,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:b(95018,3,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:b(95019,3,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:b(95020,3,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:b(95021,3,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:b(95022,3,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:b(95023,3,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:b(95024,3,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:b(95025,3,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:b(95026,3,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:b(95027,3,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:b(95028,3,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:b(95029,3,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:b(95030,3,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:b(95031,3,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:b(95032,3,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:b(95033,3,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:b(95034,3,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:b(95035,3,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:b(95036,3,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:b(95037,3,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:b(95038,3,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:b(95039,3,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:b(95040,3,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:b(95041,3,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:b(95042,3,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:b(95043,3,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:b(95044,3,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:b(95045,3,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:b(95046,3,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:b(95047,3,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:b(95048,3,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:b(95049,3,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:b(95050,3,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:b(95051,3,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:b(95052,3,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:b(95053,3,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:b(95054,3,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:b(95055,3,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:b(95056,3,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:b(95057,3,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:b(95058,3,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:b(95059,3,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:b(95060,3,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:b(95061,3,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:b(95062,3,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:b(95063,3,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:b(95064,3,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:b(95065,3,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:b(95066,3,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:b(95067,3,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:b(95068,3,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:b(95069,3,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:b(95070,3,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:b(95071,3,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:b(95072,3,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:b(95073,3,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:b(95074,3,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:b(95075,3,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:b(95077,3,"Extract_type_95077","Extract type"),Extract_to_type_alias:b(95078,3,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:b(95079,3,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:b(95080,3,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:b(95081,3,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:b(95082,3,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:b(95083,3,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:b(95084,3,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:b(95085,3,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:b(95086,3,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:b(95087,3,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:b(95088,3,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:b(95089,3,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:b(95090,3,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:b(95091,3,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:b(95092,3,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:b(95093,3,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:b(95094,3,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:b(95095,3,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:b(95096,3,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:b(95097,3,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:b(95098,3,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:b(95099,3,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:b(95100,3,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:b(95101,3,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_all_const_to_let:b(95102,3,"Convert_all_const_to_let_95102","Convert all 'const' to 'let'"),Convert_function_expression_0_to_arrow_function:b(95105,3,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:b(95106,3,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:b(95107,3,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:b(95108,3,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:b(95109,3,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:b(95110,3,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:b(95111,3,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:b(95112,3,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:b(95113,3,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:b(95114,3,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:b(95115,3,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:b(95116,3,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:b(95117,3,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:b(95118,3,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:b(95119,3,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:b(95120,3,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:b(95121,3,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:b(95122,3,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:b(95123,3,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:b(95124,3,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:b(95125,3,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:b(95126,3,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:b(95127,3,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:b(95128,3,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:b(95129,3,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:b(95130,3,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:b(95131,3,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:b(95132,3,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:b(95133,3,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:b(95134,3,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:b(95135,3,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:b(95136,3,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:b(95137,3,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:b(95138,3,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:b(95139,3,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:b(95140,3,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:b(95141,3,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:b(95142,3,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:b(95143,3,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:b(95144,3,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:b(95145,3,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:b(95146,3,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:b(95147,3,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:b(95148,3,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:b(95149,3,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:b(95150,3,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:b(95151,3,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:b(95152,3,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:b(95153,3,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenations_and_string_literals:b(95154,3,"Can_only_convert_string_concatenations_and_string_literals_95154","Can only convert string concatenations and string literals"),Selection_is_not_a_valid_statement_or_statements:b(95155,3,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:b(95156,3,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:b(95157,3,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:b(95158,3,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:b(95159,3,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:b(95160,3,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:b(95161,3,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:b(95162,3,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:b(95163,3,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:b(95164,3,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:b(95165,3,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:b(95166,3,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:b(95167,3,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:b(95168,3,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:b(95169,3,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:b(95170,3,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:b(95171,3,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:b(95172,3,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:b(95173,3,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),Use_0:b(95174,3,"Use_0_95174","Use `{0}`."),Use_Number_isNaN_in_all_conditions:b(95175,3,"Use_Number_isNaN_in_all_conditions_95175","Use `Number.isNaN` in all conditions."),Convert_typedef_to_TypeScript_type:b(95176,3,"Convert_typedef_to_TypeScript_type_95176","Convert typedef to TypeScript type."),Convert_all_typedef_to_TypeScript_types:b(95177,3,"Convert_all_typedef_to_TypeScript_types_95177","Convert all typedef to TypeScript types."),Move_to_file:b(95178,3,"Move_to_file_95178","Move to file"),Cannot_move_to_file_selected_file_is_invalid:b(95179,3,"Cannot_move_to_file_selected_file_is_invalid_95179","Cannot move to file, selected file is invalid"),Use_import_type:b(95180,3,"Use_import_type_95180","Use 'import type'"),Use_type_0:b(95181,3,"Use_type_0_95181","Use 'type {0}'"),Fix_all_with_type_only_imports:b(95182,3,"Fix_all_with_type_only_imports_95182","Fix all with type-only imports"),Cannot_move_statements_to_the_selected_file:b(95183,3,"Cannot_move_statements_to_the_selected_file_95183","Cannot move statements to the selected file"),Inline_variable:b(95184,3,"Inline_variable_95184","Inline variable"),Could_not_find_variable_to_inline:b(95185,3,"Could_not_find_variable_to_inline_95185","Could not find variable to inline."),Variables_with_multiple_declarations_cannot_be_inlined:b(95186,3,"Variables_with_multiple_declarations_cannot_be_inlined_95186","Variables with multiple declarations cannot be inlined."),Add_missing_comma_for_object_member_completion_0:b(95187,3,"Add_missing_comma_for_object_member_completion_0_95187","Add missing comma for object member completion '{0}'."),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:b(18004,1,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:b(18006,1,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:b(18007,1,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:b(18009,1,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:b(18010,1,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:b(18011,1,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:b(18012,1,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:b(18013,1,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:b(18014,1,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:b(18015,1,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:b(18016,1,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:b(18017,1,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:b(18018,1,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:b(18019,1,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:b(18024,1,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:b(18026,1,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:b(18027,1,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:b(18028,1,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:b(18029,1,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:b(18030,1,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:b(18031,1,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:b(18032,1,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values:b(18033,1,"Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033","Type '{0}' is not assignable to type '{1}' as required for computed enum member values."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:b(18034,3,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:b(18035,1,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:b(18036,1,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),await_expression_cannot_be_used_inside_a_class_static_block:b(18037,1,"await_expression_cannot_be_used_inside_a_class_static_block_18037","'await' expression cannot be used inside a class static block."),for_await_loops_cannot_be_used_inside_a_class_static_block:b(18038,1,"for_await_loops_cannot_be_used_inside_a_class_static_block_18038","'for await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:b(18039,1,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:b(18041,1,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block."),_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation:b(18042,1,"_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042","'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),Types_cannot_appear_in_export_declarations_in_JavaScript_files:b(18043,1,"Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043","Types cannot appear in export declarations in JavaScript files."),_0_is_automatically_exported_here:b(18044,3,"_0_is_automatically_exported_here_18044","'{0}' is automatically exported here."),Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher:b(18045,1,"Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045","Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."),_0_is_of_type_unknown:b(18046,1,"_0_is_of_type_unknown_18046","'{0}' is of type 'unknown'."),_0_is_possibly_null:b(18047,1,"_0_is_possibly_null_18047","'{0}' is possibly 'null'."),_0_is_possibly_undefined:b(18048,1,"_0_is_possibly_undefined_18048","'{0}' is possibly 'undefined'."),_0_is_possibly_null_or_undefined:b(18049,1,"_0_is_possibly_null_or_undefined_18049","'{0}' is possibly 'null' or 'undefined'."),The_value_0_cannot_be_used_here:b(18050,1,"The_value_0_cannot_be_used_here_18050","The value '{0}' cannot be used here."),Compiler_option_0_cannot_be_given_an_empty_string:b(18051,1,"Compiler_option_0_cannot_be_given_an_empty_string_18051","Compiler option '{0}' cannot be given an empty string."),Non_abstract_class_0_does_not_implement_all_abstract_members_of_1:b(18052,1,"Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052","Non-abstract class '{0}' does not implement all abstract members of '{1}'"),Its_type_0_is_not_a_valid_JSX_element_type:b(18053,1,"Its_type_0_is_not_a_valid_JSX_element_type_18053","Its type '{0}' is not a valid JSX element type."),await_using_statements_cannot_be_used_inside_a_class_static_block:b(18054,1,"await_using_statements_cannot_be_used_inside_a_class_static_block_18054","'await using' statements cannot be used inside a class static block.")}}});function wu(e){return e>=80}function SK(e){return e===32||wu(e)}function aP(e,t){if(e=2?aP(e,Xhe):t===1?aP(e,Ghe):aP(e,qhe)}function p5e(e,t){return t>=2?aP(e,Qhe):t===1?aP(e,$he):aP(e,Hhe)}function d5e(e){const t=[];return e.forEach((r,i)=>{t[r]=i}),t}function Hs(e){return e0e[e]}function mv(e){return CK.get(e)}function eT(e){const t=[];let r=0,i=0;for(;r127&&mu(s)&&(t.push(i),i=r);break}}return t.push(i),t}function oP(e,t,r,i){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,r,i):nI(Wg(e),t,r,e.text,i)}function nI(e,t,r,i,s){(t<0||t>=e.length)&&(s?t=t<0?0:t>=e.length?e.length-1:t:E.fail(`Bad line number. Line: ${t}, lineStarts.length: ${e.length} , line map is correct? ${i!==void 0?zD(e,eT(i)):"unknown"}`));const o=e[t]+r;return s?o>e[t+1]?e[t+1]:typeof i=="string"&&o>i.length?i.length:o:(t=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function mu(e){return e===10||e===13||e===8232||e===8233}function C4(e){return e>=48&&e<=57}function Whe(e){return C4(e)||e>=65&&e<=70||e>=97&&e<=102}function m5e(e){return e<=1114111}function iI(e){return e>=48&&e<=55}function TK(e,t){const r=e.charCodeAt(t);switch(r){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return!0;case 35:return t===0;default:return r>127}}function la(e,t,r,i,s){if(id(t))return t;let o=!1;for(;;){const c=e.charCodeAt(t);switch(c){case 13:e.charCodeAt(t+1)===10&&t++;case 10:if(t++,r)return t;o=!!s;continue;case 9:case 11:case 12:case 32:t++;continue;case 47:if(i)break;if(e.charCodeAt(t+1)===47){for(t+=2;t127&&Ug(c)){t++;continue}break}return t}}function E4(e,t){if(E.assert(t>=0),t===0||mu(e.charCodeAt(t-1))){const r=e.charCodeAt(t);if(t+aI=0&&r127&&Ug(C)){y&&mu(C)&&(p=!0),r++;continue}break e}}return y&&(T=s(u,f,g,p,o,T)),T}function lP(e,t,r,i){return GB(!1,e,t,!1,r,i)}function uP(e,t,r,i){return GB(!1,e,t,!0,r,i)}function xK(e,t,r,i,s){return GB(!0,e,t,!1,r,i,s)}function kK(e,t,r,i,s){return GB(!0,e,t,!0,r,i,s)}function Uhe(e,t,r,i,s,o=[]){return o.push({kind:r,pos:e,end:t,hasTrailingNewLine:i}),o}function Km(e,t){return xK(e,t,Uhe,void 0,void 0)}function Hy(e,t){return kK(e,t,Uhe,void 0,void 0)}function sI(e){const t=$B.exec(e);if(t)return t[0]}function eg(e,t){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>127&&rI(e,t)}function Gy(e,t,r){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===36||e===95||(r===1?e===45||e===58:!1)||e>127&&p5e(e,t)}function lf(e,t,r){let i=F0(e,0);if(!eg(i,t))return!1;for(let s=$y(i);sp,getStartPos:()=>p,getTokenEnd:()=>f,getTextPos:()=>f,getToken:()=>S,getTokenStart:()=>y,getTokenPos:()=>y,getTokenText:()=>u.substring(y,f),getTokenValue:()=>T,hasUnicodeEscape:()=>(C&1024)!==0,hasExtendedUnicodeEscape:()=>(C&8)!==0,hasPrecedingLineBreak:()=>(C&1)!==0,hasPrecedingJSDocComment:()=>(C&2)!==0,isIdentifier:()=>S===80||S>118,isReservedWord:()=>S>=83&&S<=118,isUnterminated:()=>(C&4)!==0,getCommentDirectives:()=>w,getNumericLiteralFlags:()=>C&25584,getTokenFlags:()=>C,reScanGreaterToken:me,reScanAsteriskEqualsToken:Oe,reScanSlashToken:Xe,reScanTemplateToken:Je,reScanTemplateHeadOrNoSubstitutionTemplate:ot,scanJsxIdentifier:Jt,scanJsxAttributeValue:It,reScanJsxAttributeValue:Nn,reScanJsxToken:Bt,reScanLessThanToken:Ht,reScanHashToken:br,reScanQuestionToken:zr,reScanInvalidIdentifier:lt,scanJsxToken:ar,scanJsDocToken:ei,scanJSDocCommentTextToken:Fi,scan:he,getText:Ft,clearCommentDirectives:yr,setText:Tr,setScriptTarget:Pi,setLanguageVariant:ji,setScriptKind:Di,setJSDocParsingMode:$i,setOnError:Xr,resetTokenState:Qs,setTextPos:Qs,setInJSDocType:Ds,tryScan:Dr,lookAhead:ur,scanRange:Qe};return E.isDebugging&&Object.defineProperty(W,"__debugShowCurrentPositionInText",{get:()=>{const Ce=W.getText();return Ce.slice(0,W.getTokenFullStart())+"\u2551"+Ce.slice(W.getTokenFullStart())}}),W;function X(Ce,Ue=f,rt,ft){if(s){const dt=f;f=Ue,s(Ce,rt||0,ft),f=dt}}function J(){let Ce=f,Ue=!1,rt=!1,ft="";for(;;){const dt=u.charCodeAt(f);if(dt===95){C|=512,Ue?(Ue=!1,rt=!0,ft+=u.substring(Ce,f)):(C|=16384,X(rt?d.Multiple_consecutive_numeric_separators_are_not_permitted:d.Numeric_separators_are_not_allowed_here,f,1)),f++,Ce=f;continue}if(C4(dt)){Ue=!0,rt=!1,f++;continue}break}return u.charCodeAt(f-1)===95&&(C|=16384,X(d.Numeric_separators_are_not_allowed_here,f-1,1)),ft+u.substring(Ce,f)}function ie(){let Ce=f,Ue;if(u.charCodeAt(f)===48)if(f++,u.charCodeAt(f)===95)C|=16896,X(d.Numeric_separators_are_not_allowed_here,f,1),f--,Ue=J();else if(!Y())C|=8192,Ue=""+ +T;else if(!T)Ue="0";else{T=""+parseInt(T,8),C|=32;const we=S===41,Be=(we?"-":"")+"0o"+(+T).toString(8);return we&&Ce--,X(d.Octal_literals_are_not_allowed_Use_the_syntax_0,Ce,f-Ce,Be),9}else Ue=J();let rt,ft;u.charCodeAt(f)===46&&(f++,rt=J());let dt=f;if(u.charCodeAt(f)===69||u.charCodeAt(f)===101){f++,C|=16,(u.charCodeAt(f)===43||u.charCodeAt(f)===45)&&f++;const we=f,Be=J();Be?(ft=u.substring(dt,we)+Be,dt=f):X(d.Digit_expected)}let fe;if(C&512?(fe=Ue,rt&&(fe+="."+rt),ft&&(fe+=ft)):fe=u.substring(Ce,dt),C&8192)return X(d.Decimals_with_leading_zeros_are_not_allowed,Ce,dt-Ce),T=""+ +fe,9;if(rt!==void 0||C&16)return B(Ce,rt===void 0&&!!(C&16)),T=""+ +fe,9;{T=fe;const we=ke();return B(Ce),we}}function B(Ce,Ue){if(!eg(F0(u,f),e))return;const rt=f,{length:ft}=ve();ft===1&&u[rt]==="n"?X(Ue?d.A_bigint_literal_cannot_use_exponential_notation:d.A_bigint_literal_must_be_an_integer,Ce,rt-Ce+1):(X(d.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal,rt,ft),f=rt)}function Y(){const Ce=f;let Ue=!0;for(;C4(u.charCodeAt(f));)iI(u.charCodeAt(f))||(Ue=!1),f++;return T=u.substring(Ce,f),Ue}function ae(Ce,Ue){const rt=$(Ce,!1,Ue);return rt?parseInt(rt,16):-1}function _e(Ce,Ue){return $(Ce,!0,Ue)}function $(Ce,Ue,rt){let ft=[],dt=!1,fe=!1;for(;ft.length=65&&we<=70)we+=32;else if(!(we>=48&&we<=57||we>=97&&we<=102))break;ft.push(we),f++,fe=!1}return ft.length=g){rt+=u.substring(ft,f),C|=4,X(d.Unterminated_string_literal);break}const dt=u.charCodeAt(f);if(dt===Ue){rt+=u.substring(ft,f),f++;break}if(dt===92&&!Ce){rt+=u.substring(ft,f),rt+=oe(!0),ft=f;continue}if((dt===10||dt===13)&&!Ce){rt+=u.substring(ft,f),C|=4,X(d.Unterminated_string_literal);break}f++}return rt}function K(Ce){const Ue=u.charCodeAt(f)===96;f++;let rt=f,ft="",dt;for(;;){if(f>=g){ft+=u.substring(rt,f),C|=4,X(d.Unterminated_template_literal),dt=Ue?15:18;break}const fe=u.charCodeAt(f);if(fe===96){ft+=u.substring(rt,f),f++,dt=Ue?15:18;break}if(fe===36&&f+1=g)return X(d.Unexpected_end_of_text),"";const rt=u.charCodeAt(f);switch(f++,rt){case 48:if(f>=g||!C4(u.charCodeAt(f)))return"\0";case 49:case 50:case 51:f=g?(C|=2048,Ce&&X(d.Unexpected_end_of_text),u.substring(Ue,f)):u.charCodeAt(f)!==125?(C|=2048,Ce&&X(d.Unterminated_Unicode_escape_sequence),u.substring(Ue,f)):(f++,C|=8,fk(dt)):(C|=2048,Ce&&X(d.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),u.substring(Ue,f))}for(;f1114111&&(X(d.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),rt=!0),f>=g?(X(d.Unexpected_end_of_text),rt=!0):u.charCodeAt(f)===125?f++:(X(d.Unterminated_Unicode_escape_sequence),rt=!0),rt?"":fk(Ue)}function se(){if(f+5=0&&Gy(rt,e)){f+=3,C|=8,Ce+=Se(),Ue=f;continue}if(rt=se(),!(rt>=0&&Gy(rt,e)))break;C|=1024,Ce+=u.substring(Ue,f),Ce+=fk(rt),f+=6,Ue=f}else break}return Ce+=u.substring(Ue,f),Ce}function Te(){const Ce=T.length;if(Ce>=2&&Ce<=12){const Ue=T.charCodeAt(0);if(Ue>=97&&Ue<=122){const rt=Vhe.get(T);if(rt!==void 0)return S=rt}}return S=80}function Me(Ce){let Ue="",rt=!1,ft=!1;for(;;){const dt=u.charCodeAt(f);if(dt===95){C|=512,rt?(rt=!1,ft=!0):X(ft?d.Multiple_consecutive_numeric_separators_are_not_permitted:d.Numeric_separators_are_not_allowed_here,f,1),f++;continue}if(rt=!0,!C4(dt)||dt-48>=Ce)break;Ue+=u[f],f++,ft=!1}return u.charCodeAt(f-1)===95&&X(d.Numeric_separators_are_not_allowed_here,f-1,1),Ue}function ke(){return u.charCodeAt(f)===110?(T+="n",C&384&&(T=bE(T)+"n"),f++,10):(T=""+(C&128?parseInt(T.slice(2),2):C&256?parseInt(T.slice(2),8):+T),9)}function he(){p=f,C=0;let Ce=!1;for(;;){if(y=f,f>=g)return S=1;const Ue=F0(u,f);if(f===0){if(Ue===65533)return X(d.File_appears_to_be_binary),f=g,S=8;if(Ue===35&&qB(u,f)){if(f=HB(u,f),t)continue;return S=6}}switch(Ue){case 10:case 13:if(C|=1,t){f++;continue}else return Ue===13&&f+1=0&&eg(rt,e))return f+=3,C|=8,T=Se()+ve(),S=Te();const ft=se();return ft>=0&&eg(ft,e)?(f+=6,C|=1024,T=String.fromCharCode(ft)+ve(),S=Te()):(X(d.Invalid_character),f++,S=0);case 35:if(f!==0&&u[f+1]==="!")return X(d.can_only_be_used_at_the_start_of_a_file),f++,S=0;const dt=F0(u,f+1);if(dt===92){f++;const Be=Z();if(Be>=0&&eg(Be,e))return f+=3,C|=8,T="#"+Se()+ve(),S=81;const gt=se();if(gt>=0&&eg(gt,e))return f+=6,C|=1024,T="#"+String.fromCharCode(gt)+ve(),S=81;f--}return eg(dt,e)?(f++,pt(dt,e)):(T="#",X(d.Invalid_character,f++,$y(Ue))),S=81;default:const fe=pt(Ue,e);if(fe)return S=fe;if(Cd(Ue)){f+=$y(Ue);continue}else if(mu(Ue)){C|=1,f+=$y(Ue);continue}const we=$y(Ue);return X(d.Invalid_character,f,we),f+=we,S=0}}}function be(){switch(z){case 0:return!0;case 1:return!1}return O!==3&&O!==4?!0:z===3?!1:Khe.test(u.slice(p,f))}function lt(){E.assert(S===0,"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."),f=y=p,C=0;const Ce=F0(u,f),Ue=pt(Ce,99);return Ue?S=Ue:(f+=$y(Ce),S)}function pt(Ce,Ue){let rt=Ce;if(eg(rt,Ue)){for(f+=$y(rt);f=g)return S=1;let Ue=u.charCodeAt(f);if(Ue===60)return u.charCodeAt(f+1)===47?(f+=2,S=31):(f++,S=30);if(Ue===123)return f++,S=19;let rt=0;for(;f0)break;Ug(Ue)||(rt=f)}f++}return T=u.substring(p,f),rt===-1?13:12}function Jt(){if(wu(S)){for(;f=g)return S=1;for(let Ue=u.charCodeAt(f);f=0&&Cd(u.charCodeAt(f-1))&&!(f+1=g)return S=1;const Ce=F0(u,f);switch(f+=$y(Ce),Ce){case 9:case 11:case 12:case 32:for(;f=0&&eg(Ue,e))return f+=3,C|=8,T=Se()+ve(),S=Te();const rt=se();return rt>=0&&eg(rt,e)?(f+=6,C|=1024,T=String.fromCharCode(rt)+ve(),S=Te()):(f++,S=0)}if(eg(Ce,e)){let Ue=Ce;for(;f=0),f=Ce,p=Ce,y=Ce,S=0,T=void 0,C=0}function Ds(Ce){D+=Ce?1:-1}}function F0(e,t){return e.codePointAt(t)}function $y(e){return e>=65536?2:1}function g5e(e){if(E.assert(0<=e&&e<=1114111),e<=65535)return String.fromCharCode(e);const t=Math.floor((e-65536)/1024)+55296,r=(e-65536)%1024+56320;return String.fromCharCode(t,r)}function fk(e){return t0e(e)}var _P,Vhe,CK,qhe,Hhe,Ghe,$he,Xhe,Qhe,Yhe,Zhe,Khe,e0e,aI,$B,t0e,h5e=Nt({"src/compiler/scanner.ts"(){"use strict";Ns(),_P={abstract:128,accessor:129,any:133,as:130,asserts:131,assert:132,bigint:163,boolean:136,break:83,case:84,catch:85,class:86,continue:88,const:87,constructor:137,debugger:89,declare:138,default:90,delete:91,do:92,else:93,enum:94,export:95,extends:96,false:97,finally:98,for:99,from:161,function:100,get:139,if:101,implements:119,import:102,in:103,infer:140,instanceof:104,interface:120,intrinsic:141,is:142,keyof:143,let:121,module:144,namespace:145,never:146,new:105,null:106,number:150,object:151,package:122,private:123,protected:124,public:125,override:164,out:147,readonly:148,require:149,global:162,return:107,satisfies:152,set:153,static:126,string:154,super:108,switch:109,symbol:155,this:110,throw:111,true:112,try:113,type:156,typeof:114,undefined:157,unique:158,unknown:159,using:160,var:115,void:116,while:117,with:118,yield:127,async:134,await:135,of:165},Vhe=new Map(Object.entries(_P)),CK=new Map(Object.entries({..._P,"{":19,"}":20,"(":21,")":22,"[":23,"]":24,".":25,"...":26,";":27,",":28,"<":30,">":32,"<=":33,">=":34,"==":35,"!=":36,"===":37,"!==":38,"=>":39,"+":40,"-":41,"**":43,"*":42,"/":44,"%":45,"++":46,"--":47,"<<":48,">":49,">>>":50,"&":51,"|":52,"^":53,"!":54,"~":55,"&&":56,"||":57,"?":58,"??":61,"?.":29,":":59,"=":64,"+=":65,"-=":66,"*=":67,"**=":68,"/=":69,"%=":70,"<<=":71,">>=":72,">>>=":73,"&=":74,"|=":75,"^=":79,"||=":76,"&&=":77,"??=":78,"@":60,"#":63,"`":62})),qhe=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],Hhe=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,768,846,864,866,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1155,1158,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1488,1514,1520,1522,1569,1594,1600,1621,1632,1641,1648,1747,1749,1756,1759,1768,1770,1773,1776,1788,1808,1836,1840,1866,1920,1968,2305,2307,2309,2361,2364,2381,2384,2388,2392,2403,2406,2415,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2524,2525,2527,2531,2534,2545,2562,2562,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2649,2652,2654,2654,2662,2676,2689,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2784,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2876,2883,2887,2888,2891,2893,2902,2903,2908,2909,2911,2913,2918,2927,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3134,3140,3142,3144,3146,3149,3157,3158,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3395,3398,3400,3402,3405,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3805,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3946,3953,3972,3974,3979,3984,3991,3993,4028,4038,4038,4096,4129,4131,4135,4137,4138,4140,4146,4150,4153,4160,4169,4176,4185,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4969,4977,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6099,6112,6121,6160,6169,6176,6263,6272,6313,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8319,8319,8400,8412,8417,8417,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12335,12337,12341,12344,12346,12353,12436,12441,12442,12445,12446,12449,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65056,65059,65075,65076,65101,65103,65136,65138,65140,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500],Ghe=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],$he=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],Xhe=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2208,2228,2230,2237,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42943,42946,42950,42999,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69376,69404,69415,69415,69424,69445,69600,69622,69635,69687,69763,69807,69840,69864,69891,69926,69956,69956,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70751,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71680,71723,71840,71903,71935,71935,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72384,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,123136,123180,123191,123197,123214,123214,123584,123627,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101],Qhe=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2208,2228,2230,2237,2259,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3162,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3328,3331,3333,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7673,7675,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42943,42946,42950,42999,43047,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69376,69404,69415,69415,69424,69456,69600,69622,69632,69702,69734,69743,69759,69818,69840,69864,69872,69881,69888,69940,69942,69951,69956,69958,69968,70003,70006,70006,70016,70084,70089,70092,70096,70106,70108,70108,70144,70161,70163,70199,70206,70206,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70751,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71680,71738,71840,71913,71935,71935,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72384,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92768,92777,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,123136,123180,123184,123197,123200,123209,123214,123214,123584,123641,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101,917760,917999],Yhe=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,Zhe=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/,Khe=/@(?:see|link)/i,e0e=d5e(CK),aI=7,$B=/^#!.*/,t0e=String.fromCodePoint?e=>String.fromCodePoint(e):g5e}});function Tl(e){return U_(e)||C_(e)}function pk(e){return _4(e,mE)}function fP(e){switch(Da(e)){case 99:return"lib.esnext.full.d.ts";case 9:return"lib.es2022.full.d.ts";case 8:return"lib.es2021.full.d.ts";case 7:return"lib.es2020.full.d.ts";case 6:return"lib.es2019.full.d.ts";case 5:return"lib.es2018.full.d.ts";case 4:return"lib.es2017.full.d.ts";case 3:return"lib.es2016.full.d.ts";case 2:return"lib.es6.d.ts";default:return"lib.d.ts"}}function yc(e){return e.start+e.length}function EK(e){return e.length===0}function XB(e,t){return t>=e.start&&t=e.pos&&t<=e.end}function DK(e,t){return t.start>=e.start&&yc(t)<=yc(e)}function r0e(e,t){return PK(e,t)!==void 0}function PK(e,t){const r=AK(e,t);return r&&r.length===0?void 0:r}function n0e(e,t){return dP(e.start,e.length,t.start,t.length)}function oI(e,t,r){return dP(e.start,e.length,t,r)}function dP(e,t,r,i){const s=e+t,o=r+i;return r<=s&&o>=e}function wK(e,t){return t<=yc(e)&&t>=e.start}function AK(e,t){const r=Math.max(e.start,t.start),i=Math.min(yc(e),yc(t));return r<=i?zc(r,i):void 0}function Jl(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return{start:e,length:t}}function zc(e,t){return Jl(e,t-e)}function D4(e){return Jl(e.span.start,e.newLength)}function NK(e){return EK(e.span)&&e.newLength===0}function mP(e,t){if(t<0)throw new Error("newLength < 0");return{span:e,newLength:t}}function IK(e){if(e.length===0)return NP;if(e.length===1)return e[0];const t=e[0];let r=t.span.start,i=yc(t.span),s=r+t.newLength;for(let o=1;o=2&&e.charCodeAt(0)===95&&e.charCodeAt(1)===95?"_"+e:e}function bi(e){const t=e;return t.length>=3&&t.charCodeAt(0)===95&&t.charCodeAt(1)===95&&t.charCodeAt(2)===95?t.substr(1):t}function an(e){return bi(e.escapedText)}function Xy(e){const t=mv(e.escapedText);return t?Jn(t,a_):void 0}function pc(e){return e.valueDeclaration&&Nu(e.valueDeclaration)?an(e.valueDeclaration.name):bi(e.escapedName)}function a0e(e){const t=e.parent.parent;if(t){if(hu(t))return YB(t);switch(t.kind){case 243:if(t.declarationList&&t.declarationList.declarations[0])return YB(t.declarationList.declarations[0]);break;case 244:let r=t.expression;switch(r.kind===226&&r.operatorToken.kind===64&&(r=r.left),r.kind){case 211:return r.name;case 212:const i=r.argumentExpression;if(Ie(i))return i}break;case 217:return YB(t.expression);case 256:{if(hu(t.statement)||ct(t.statement))return YB(t.statement);break}}}}function YB(e){const t=as(e);return t&&Ie(t)?t:void 0}function gP(e,t){return!!(Au(e)&&Ie(e.name)&&an(e.name)===an(t)||ec(e)&&ut(e.declarationList.declarations,r=>gP(r,t)))}function MK(e){return e.name||a0e(e)}function Au(e){return!!e.name}function cI(e){switch(e.kind){case 80:return e;case 355:case 348:{const{name:r}=e;if(r.kind===166)return r.right;break}case 213:case 226:{const r=e;switch(ac(r)){case 1:case 4:case 5:case 3:return r5(r.left);case 7:case 8:case 9:return r.arguments[1];default:return}}case 353:return MK(e);case 347:return a0e(e);case 277:{const{expression:r}=e;return Ie(r)?r:void 0}case 212:const t=e;if(t5(t))return t.argumentExpression}return e.name}function as(e){if(e!==void 0)return cI(e)||(ro(e)||go(e)||Nl(e)?ZB(e):void 0)}function ZB(e){if(e.parent){if(Hc(e.parent)||Pa(e.parent))return e.parent.name;if(Gr(e.parent)&&e===e.parent.right){if(Ie(e.parent.left))return e.parent.left;if(co(e.parent.left))return r5(e.parent.left)}else if(Ei(e.parent)&&Ie(e.parent.name))return e.parent.name}else return}function O0(e){if(Of(e))return wn(e.modifiers,ql)}function hv(e){if(In(e,98303))return wn(e.modifiers,Ys)}function o0e(e,t){if(e.name)if(Ie(e.name)){const r=e.name.escapedText;return yP(e.parent,t).filter(i=>ad(i)&&Ie(i.name)&&i.name.escapedText===r)}else{const r=e.parent.parameters.indexOf(e);E.assert(r>-1,"Parameters should always be in their parents' parameter list");const i=yP(e.parent,t).filter(ad);if(rod(i)&&i.typeParameters.some(s=>s.name.escapedText===r))}function jK(e){return c0e(e,!1)}function BK(e){return c0e(e,!0)}function JK(e){return!!np(e,ad)}function zK(e){return np(e,yC)}function WK(e){return nJ(e,XW)}function KB(e){return np(e,hne)}function l0e(e){return np(e,VW)}function UK(e){return np(e,VW,!0)}function u0e(e){return np(e,qW)}function VK(e){return np(e,qW,!0)}function _0e(e){return np(e,HW)}function qK(e){return np(e,HW,!0)}function f0e(e){return np(e,GW)}function HK(e){return np(e,GW,!0)}function GK(e){return np(e,GF,!0)}function eJ(e){return np(e,$W)}function $K(e){return np(e,$W,!0)}function tJ(e){return np(e,cw)}function lI(e){return np(e,yne)}function XK(e){return np(e,$F)}function p0e(e){return np(e,od)}function rJ(e){return np(e,XF)}function Qy(e){const t=np(e,qE);if(t&&t.typeExpression&&t.typeExpression.type)return t}function Yy(e){let t=np(e,qE);return!t&&us(e)&&(t=kn(mk(e),r=>!!r.typeExpression)),t&&t.typeExpression&&t.typeExpression.type}function hP(e){const t=XK(e);if(t&&t.typeExpression)return t.typeExpression.type;const r=Qy(e);if(r&&r.typeExpression){const i=r.typeExpression.type;if(X_(i)){const s=kn(i.members,cC);return s&&s.type}if(pg(i)||hC(i))return i.type}}function yP(e,t){var r;if(!a8(e))return ze;let i=(r=e.jsDoc)==null?void 0:r.jsDocCache;if(i===void 0||t){const s=KJ(e,t);E.assert(s.length<2||s[0]!==s[1]),i=ta(s,o=>zp(o)?o.tags:o),t||(e.jsDoc??(e.jsDoc=[]),e.jsDoc.jsDocCache=i)}return i}function Zy(e){return yP(e,!1)}function d0e(e){return yP(e,!0)}function np(e,t,r){return kn(yP(e,r),t)}function nJ(e,t){return Zy(e).filter(t)}function m0e(e,t){return Zy(e).filter(r=>r.kind===t)}function vP(e){return typeof e=="string"?e:e?.map(t=>t.kind===328?t.text:v5e(t)).join("")}function v5e(e){const t=e.kind===331?"link":e.kind===332?"linkcode":"linkplain",r=e.name?D_(e.name):"",i=e.name&&e.text.startsWith("://")?"":" ";return`{@${t} ${r}${i}${e.text}}`}function L0(e){if(m1(e)){if(vC(e.parent)){const t=$4(e.parent);if(t&&Ir(t.tags))return ta(t.tags,r=>od(r)?r.typeParameters:void 0)}return ze}if(op(e))return E.assert(e.parent.kind===327),ta(e.parent.tags,t=>od(t)?t.typeParameters:void 0);if(e.typeParameters||wne(e)&&e.typeParameters)return e.typeParameters;if(Hr(e)){const t=g5(e);if(t.length)return t;const r=Yy(e);if(r&&pg(r)&&r.typeParameters)return r.typeParameters}return ze}function gk(e){return e.constraint?e.constraint:od(e.parent)&&e===e.parent.typeParameters[0]?e.parent.constraint:void 0}function tg(e){return e.kind===80||e.kind===81}function uI(e){return e.kind===178||e.kind===177}function _I(e){return bn(e)&&!!(e.flags&64)}function iJ(e){return mo(e)&&!!(e.flags&64)}function tb(e){return Rs(e)&&!!(e.flags&64)}function gu(e){const t=e.kind;return!!(e.flags&64)&&(t===211||t===212||t===213||t===235)}function w4(e){return gu(e)&&!MT(e)&&!!e.questionDotToken}function fI(e){return w4(e.parent)&&e.parent.expression===e}function A4(e){return!gu(e.parent)||w4(e.parent)||e!==e.parent.expression}function sJ(e){return e.kind===226&&e.operatorToken.kind===61}function Vg(e){return mp(e)&&Ie(e.typeName)&&e.typeName.escapedText==="const"&&!e.typeArguments}function Fp(e){return bc(e,8)}function pI(e){return MT(e)&&!!(e.flags&64)}function N4(e){return e.kind===252||e.kind===251}function aJ(e){return e.kind===280||e.kind===279}function QK(e){switch(e.kind){case 309:case 310:return!0;default:return!1}}function oJ(e){return QK(e)||e.kind===307||e.kind===311}function bP(e){return e.kind===355||e.kind===348}function g0e(e){return SP(e.kind)}function SP(e){return e>=166}function cJ(e){return e>=0&&e<=165}function tT(e){return cJ(e.kind)}function yv(e){return Ya(e,"pos")&&Ya(e,"end")}function I4(e){return 9<=e&&e<=15}function vv(e){return I4(e.kind)}function lJ(e){switch(e.kind){case 210:case 209:case 14:case 218:case 231:return!0}return!1}function M0(e){return 15<=e&&e<=18}function YK(e){return M0(e.kind)}function dI(e){const t=e.kind;return t===17||t===18}function rT(e){return v_(e)||vu(e)}function mI(e){switch(e.kind){case 276:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 274:return e.parent.isTypeOnly;case 273:case 271:return e.isTypeOnly}return!1}function ZK(e){switch(e.kind){case 281:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 278:return e.isTypeOnly&&!!e.moduleSpecifier&&!e.exportClause;case 280:return e.parent.isTypeOnly}return!1}function bv(e){return mI(e)||ZK(e)}function uJ(e){return e.kind===11||M0(e.kind)}function KK(e){return ra(e)||Ie(e)}function Eo(e){var t;return Ie(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function rb(e){var t;return Ti(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function TP(e){const t=e.emitNode.autoGenerate.flags;return!!(t&32)&&!!(t&16)&&!!(t&8)}function Nu(e){return(Es(e)||vk(e))&&Ti(e.name)}function hk(e){return bn(e)&&Ti(e.name)}function Oh(e){switch(e){case 128:case 129:case 134:case 87:case 138:case 90:case 95:case 103:case 125:case 123:case 124:case 148:case 126:case 147:case 164:return!0}return!1}function F4(e){return!!(mT(e)&31)}function _J(e){return F4(e)||e===126||e===164||e===129}function Ys(e){return Oh(e.kind)}function V_(e){const t=e.kind;return t===166||t===80}function wc(e){const t=e.kind;return t===80||t===81||t===11||t===9||t===167}function nb(e){const t=e.kind;return t===80||t===206||t===207}function ks(e){return!!e&&nT(e.kind)}function yk(e){return!!e&&(nT(e.kind)||Go(e))}function po(e){return e&&h0e(e.kind)}function O4(e){return e.kind===112||e.kind===97}function h0e(e){switch(e){case 262:case 174:case 176:case 177:case 178:case 218:case 219:return!0;default:return!1}}function nT(e){switch(e){case 173:case 179:case 330:case 180:case 181:case 184:case 324:case 185:return!0;default:return h0e(e)}}function fJ(e){return Ai(e)||Ld(e)||Ss(e)&&ks(e.parent)}function Pl(e){const t=e.kind;return t===176||t===172||t===174||t===177||t===178||t===181||t===175||t===240}function Qn(e){return e&&(e.kind===263||e.kind===231)}function R0(e){return e&&(e.kind===177||e.kind===178)}function n_(e){return Es(e)&&Ad(e)}function eee(e){return Hr(e)&&$5(e)?(!wv(e)||!H0(e.expression))&&!db(e,!0):e.parent&&Qn(e.parent)&&Es(e)&&!Ad(e)}function vk(e){switch(e.kind){case 174:case 177:case 178:return!0;default:return!1}}function tee(e){switch(e.kind){case 174:case 177:case 178:case 172:return!0;default:return!1}}function Do(e){return Ys(e)||ql(e)}function ib(e){const t=e.kind;return t===180||t===179||t===171||t===173||t===181||t===177||t===178}function gI(e){return ib(e)||Pl(e)}function qg(e){const t=e.kind;return t===303||t===304||t===305||t===174||t===177||t===178}function Si(e){return Oz(e.kind)}function ree(e){switch(e.kind){case 184:case 185:return!0}return!1}function As(e){if(e){const t=e.kind;return t===207||t===206}return!1}function L4(e){const t=e.kind;return t===209||t===210}function hI(e){const t=e.kind;return t===208||t===232}function xP(e){switch(e.kind){case 260:case 169:case 208:return!0}return!1}function nee(e){return Ei(e)||us(e)||CP(e)||EP(e)}function kP(e){return pJ(e)||dJ(e)}function pJ(e){switch(e.kind){case 206:case 210:return!0}return!1}function CP(e){switch(e.kind){case 208:case 303:case 304:case 305:return!0}return!1}function dJ(e){switch(e.kind){case 207:case 209:return!0}return!1}function EP(e){switch(e.kind){case 208:case 232:case 230:case 209:case 210:case 80:case 211:case 212:return!0}return sl(e,!0)}function iee(e){const t=e.kind;return t===211||t===166||t===205}function see(e){const t=e.kind;return t===211||t===166}function mJ(e){return Sv(e)||Jv(e)}function Sv(e){switch(e.kind){case 286:case 285:case 213:case 214:case 215:case 170:return!0;default:return!1}}function gm(e){return e.kind===213||e.kind===214}function bk(e){const t=e.kind;return t===228||t===15}function m_(e){return y0e(Fp(e).kind)}function y0e(e){switch(e){case 211:case 212:case 214:case 213:case 284:case 285:case 288:case 215:case 209:case 217:case 210:case 231:case 218:case 80:case 81:case 14:case 9:case 10:case 11:case 15:case 228:case 97:case 106:case 110:case 112:case 108:case 235:case 233:case 236:case 102:case 282:return!0;default:return!1}}function gJ(e){return v0e(Fp(e).kind)}function v0e(e){switch(e){case 224:case 225:case 220:case 221:case 222:case 223:case 216:return!0;default:return y0e(e)}}function aee(e){switch(e.kind){case 225:return!0;case 224:return e.operator===46||e.operator===47;default:return!1}}function oee(e){switch(e.kind){case 106:case 112:case 97:case 224:return!0;default:return vv(e)}}function ct(e){return b5e(Fp(e).kind)}function b5e(e){switch(e){case 227:case 229:case 219:case 226:case 230:case 234:case 232:case 361:case 360:case 238:return!0;default:return v0e(e)}}function sb(e){const t=e.kind;return t===216||t===234}function b0e(e){return JW(e)||WF(e)}function j0(e,t){switch(e.kind){case 248:case 249:case 250:case 246:case 247:return!0;case 256:return t&&j0(e.statement,t)}return!1}function cee(e){return cc(e)||qc(e)}function lee(e){return ut(e,cee)}function yI(e){return!MP(e)&&!cc(e)&&!In(e,32)&&!ru(e)}function DP(e){return MP(e)||cc(e)||In(e,32)}function Sk(e){return e.kind===249||e.kind===250}function vI(e){return Ss(e)||ct(e)}function hJ(e){return Ss(e)}function Ff(e){return ml(e)||ct(e)}function uee(e){const t=e.kind;return t===268||t===267||t===80}function S0e(e){const t=e.kind;return t===268||t===267}function T0e(e){const t=e.kind;return t===80||t===267}function yJ(e){const t=e.kind;return t===275||t===274}function PP(e){return e.kind===267||e.kind===266}function Ed(e){switch(e.kind){case 219:case 226:case 208:case 213:case 179:case 263:case 231:case 175:case 176:case 185:case 180:case 212:case 266:case 306:case 277:case 278:case 281:case 262:case 218:case 184:case 177:case 80:case 273:case 271:case 276:case 181:case 264:case 345:case 347:case 324:case 348:case 355:case 330:case 353:case 329:case 291:case 292:case 293:case 200:case 174:case 173:case 267:case 202:case 280:case 270:case 274:case 214:case 15:case 9:case 210:case 169:case 211:case 303:case 172:case 171:case 178:case 304:case 312:case 305:case 11:case 265:case 187:case 168:case 260:return!0;default:return!1}}function hm(e){switch(e.kind){case 219:case 241:case 179:case 269:case 299:case 175:case 194:case 176:case 185:case 180:case 248:case 249:case 250:case 262:case 218:case 184:case 177:case 181:case 345:case 347:case 324:case 330:case 353:case 200:case 174:case 173:case 267:case 178:case 312:case 265:return!0;default:return!1}}function S5e(e){return e===219||e===208||e===263||e===231||e===175||e===176||e===266||e===306||e===281||e===262||e===218||e===177||e===273||e===271||e===276||e===264||e===291||e===174||e===173||e===267||e===270||e===274||e===280||e===169||e===303||e===172||e===171||e===178||e===304||e===265||e===168||e===260||e===353||e===345||e===355}function _ee(e){return e===262||e===282||e===263||e===264||e===265||e===266||e===267||e===272||e===271||e===278||e===277||e===270}function fee(e){return e===252||e===251||e===259||e===246||e===244||e===242||e===249||e===250||e===248||e===245||e===256||e===253||e===255||e===257||e===258||e===243||e===247||e===254||e===359}function hu(e){return e.kind===168?e.parent&&e.parent.kind!==352||Hr(e):S5e(e.kind)}function pee(e){return _ee(e.kind)}function wP(e){return fee(e.kind)}function Ci(e){const t=e.kind;return fee(t)||_ee(t)||T5e(e)}function T5e(e){return e.kind!==241||e.parent!==void 0&&(e.parent.kind===258||e.parent.kind===299)?!1:!Dv(e)}function dee(e){const t=e.kind;return fee(t)||_ee(t)||t===241}function mee(e){const t=e.kind;return t===283||t===166||t===80}function M4(e){const t=e.kind;return t===110||t===80||t===211||t===295}function AP(e){const t=e.kind;return t===284||t===294||t===285||t===12||t===288}function bI(e){const t=e.kind;return t===291||t===293}function gee(e){const t=e.kind;return t===11||t===294}function qu(e){const t=e.kind;return t===286||t===285}function SI(e){const t=e.kind;return t===296||t===297}function Tk(e){return e.kind>=316&&e.kind<=357}function TI(e){return e.kind===327||e.kind===326||e.kind===328||iT(e)||xk(e)||JT(e)||m1(e)}function xk(e){return e.kind>=334&&e.kind<=357}function Lh(e){return e.kind===178}function B0(e){return e.kind===177}function q_(e){if(!a8(e))return!1;const{jsDoc:t}=e;return!!t&&t.length>0}function xI(e){return!!e.type}function J0(e){return!!e.initializer}function ab(e){switch(e.kind){case 260:case 169:case 208:case 172:case 303:case 306:return!0;default:return!1}}function vJ(e){return e.kind===291||e.kind===293||qg(e)}function kI(e){return e.kind===183||e.kind===233}function hee(e){let t=yee;for(const r of e){if(!r.length)continue;let i=0;for(;ir.kind===t)}function zs(e){const t=new Map;if(e)for(const r of e)t.set(r.escapedName,r);return t}function ym(e){return(e.flags&33554432)!==0}function k5e(){var e="";const t=r=>e+=r;return{getText:()=>e,write:t,rawWrite:t,writeKeyword:t,writeOperator:t,writePunctuation:t,writeSpace:t,writeStringLiteral:t,writeLiteral:t,writeParameter:t,writeProperty:t,writeSymbol:(r,i)=>t(r),writeTrailingSemicolon:t,writeComment:t,getTextPos:()=>e.length,getLine:()=>0,getColumn:()=>0,getIndent:()=>0,isAtStartOfLine:()=>!1,hasTrailingComment:()=>!1,hasTrailingWhitespace:()=>!!e.length&&Ug(e.charCodeAt(e.length-1)),writeLine:()=>e+=" ",increaseIndent:Ca,decreaseIndent:Ca,clear:()=>e=""}}function CI(e,t){return e.configFilePath!==t.configFilePath||bee(e,t)}function bee(e,t){return kk(e,t,uO)}function See(e,t){return kk(e,t,NU)}function kk(e,t,r){return e!==t&&r.some(i=>!W5(I5(e,i),I5(t,i)))}function Tee(e,t){for(;;){const r=t(e);if(r==="quit")return;if(r!==void 0)return r;if(Ai(e))return;e=e.parent}}function zl(e,t){const r=e.entries();for(const[i,s]of r){const o=t(s,i);if(o)return o}}function ng(e,t){const r=e.keys();for(const i of r){const s=t(i);if(s)return s}}function EI(e,t){e.forEach((r,i)=>{t.set(i,r)})}function R4(e){const t=J8.getText();try{return e(J8),J8.getText()}finally{J8.clear(),J8.writeKeyword(t)}}function IP(e){return e.end-e.pos}function TJ(e,t){return e.path===t.path&&!e.prepend==!t.prepend&&!e.circular==!t.circular}function xee(e,t){return e===t||e.resolvedModule===t.resolvedModule||!!e.resolvedModule&&!!t.resolvedModule&&e.resolvedModule.isExternalLibraryImport===t.resolvedModule.isExternalLibraryImport&&e.resolvedModule.extension===t.resolvedModule.extension&&e.resolvedModule.resolvedFileName===t.resolvedModule.resolvedFileName&&e.resolvedModule.originalPath===t.resolvedModule.originalPath&&C5e(e.resolvedModule.packageId,t.resolvedModule.packageId)&&e.node10Result===t.node10Result}function xJ(e,t,r,i,s){var o;const c=(o=t.getResolvedModule(e,r,i))==null?void 0:o.node10Result,u=c?ps(void 0,d.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,c,c.includes(Am+"@types/")?`@types/${IC(s)}`:s):t.typesPackageExists(s)?ps(void 0,d.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,s,IC(s)):t.packageBundlesTypes(s)?ps(void 0,d.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,s,r):ps(void 0,d.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,r,IC(s));return u&&(u.repopulateInfo=()=>({moduleReference:r,mode:i,packageName:s===r?void 0:s})),u}function C5e(e,t){return e===t||!!e&&!!t&&e.name===t.name&&e.subModuleName===t.subModuleName&&e.version===t.version}function DI({name:e,subModuleName:t}){return t?`${e}/${t}`:e}function z0(e){return`${DI(e)}@${e.version}`}function kee(e,t){return e===t||e.resolvedTypeReferenceDirective===t.resolvedTypeReferenceDirective||!!e.resolvedTypeReferenceDirective&&!!t.resolvedTypeReferenceDirective&&e.resolvedTypeReferenceDirective.resolvedFileName===t.resolvedTypeReferenceDirective.resolvedFileName&&!!e.resolvedTypeReferenceDirective.primary==!!t.resolvedTypeReferenceDirective.primary&&e.resolvedTypeReferenceDirective.originalPath===t.resolvedTypeReferenceDirective.originalPath}function kJ(e,t,r,i,s,o){E.assert(e.length===r.length);for(let c=0;c=0),Wg(t)[e]}function x0e(e){const t=Or(e),r=qa(t,e.pos);return`${t.fileName}(${r.line+1},${r.character+1})`}function OP(e,t){E.assert(e>=0);const r=Wg(t),i=e,s=t.text;if(i+1===r.length)return s.length-1;{const o=r[i];let c=r[i+1]-1;for(E.assert(mu(s.charCodeAt(c)));o<=c&&mu(s.charCodeAt(c));)c--;return c}}function wI(e,t,r){return!(r&&r(t))&&!e.identifiers.has(t)}function sc(e){return e===void 0?!0:e.pos===e.end&&e.pos>=0&&e.kind!==1}function ip(e){return!sc(e)}function Eee(e,t){return Uo(e)?t===e.expression:Go(e)?t===e.modifiers:ff(e)?t===e.initializer:Es(e)?t===e.questionToken&&n_(e):Hc(e)?t===e.modifiers||t===e.questionToken||t===e.exclamationToken||LP(e.modifiers,t,Do):Y_(e)?t===e.equalsToken||t===e.modifiers||t===e.questionToken||t===e.exclamationToken||LP(e.modifiers,t,Do):mc(e)?t===e.exclamationToken:gc(e)?t===e.typeParameters||t===e.type||LP(e.typeParameters,t,Uo):pf(e)?t===e.typeParameters||LP(e.typeParameters,t,Uo):N_(e)?t===e.typeParameters||t===e.type||LP(e.typeParameters,t,Uo):aw(e)?t===e.modifiers||LP(e.modifiers,t,Do):!1}function LP(e,t,r){return!e||es(t)||!r(t)?!1:_s(e,t)}function k0e(e,t,r){if(t===void 0||t.length===0)return e;let i=0;for(;i[`${qa(e,c.range.end).line}`,c])),i=new Map;return{getUnusedExpectations:s,markUsed:o};function s(){return fs(r.entries()).filter(([c,u])=>u.type===0&&!i.get(c)).map(([c,u])=>u)}function o(c){return r.has(`${c}`)?(i.set(`${c}`,!0),!0):!1}}function cb(e,t,r){return sc(e)?e.pos:Tk(e)||e.kind===12?la((t||Or(e)).text,e.pos,!1,!0):r&&q_(e)?cb(e.jsDoc[0],t):e.kind===358&&e._children.length>0?cb(e._children[0],t,r):la((t||Or(e)).text,e.pos,!1,!1,GP(e))}function DJ(e,t){const r=!sc(e)&&Wp(e)?US(e.modifiers,ql):void 0;return r?la((t||Or(e)).text,r.end):cb(e,t)}function Tv(e,t,r=!1){return j4(e.text,t,r)}function D5e(e){return!!Ar(e,Fb)}function NI(e){return!!(qc(e)&&e.exportClause&&Dm(e.exportClause)&&e.exportClause.name.escapedText==="default")}function j4(e,t,r=!1){if(sc(t))return"";let i=e.substring(r?t.pos:la(e,t.pos),t.end);return D5e(t)&&(i=i.split(/\r\n|\n|\r/).map(s=>s.replace(/^\s*\*/,"").trimStart()).join(` +`)),i}function Wc(e,t=!1){return Tv(Or(e),e,t)}function P5e(e){return e.pos}function Ek(e,t){return Dh(e,t,P5e,xo)}function da(e){const t=e.emitNode;return t&&t.flags||0}function Op(e){const t=e.emitNode;return t&&t.internalFlags||0}function Pee(e,t,r){if(t&&w5e(e,r))return Tv(t,e);switch(e.kind){case 11:{const i=r&2?mz:r&1||da(e)&16777216?n1:g8;return e.singleQuote?"'"+i(e.text,39)+"'":'"'+i(e.text,34)+'"'}case 15:case 16:case 17:case 18:{const i=r&1||da(e)&16777216?n1:g8,s=e.rawText??J5e(i(e.text,96));switch(e.kind){case 15:return"`"+s+"`";case 16:return"`"+s+"${";case 17:return"}"+s+"${";case 18:return"}"+s+"`"}break}case 9:case 10:return e.text;case 14:return r&4&&e.isUnterminated?e.text+(e.text.charCodeAt(e.text.length-1)===92?" /":"/"):e.text}return E.fail(`Literal kind '${e.kind}' not accounted for.`)}function w5e(e,t){if(Po(e)||!e.parent||t&4&&e.isUnterminated)return!1;if(A_(e)){if(e.numericLiteralFlags&26656)return!1;if(e.numericLiteralFlags&512)return!!(t&8)}return!FF(e)}function wee(e){return ns(e)?'"'+g8(e)+'"':""+e}function Aee(e){return Pc(e).replace(/^(\d)/,"_$1").replace(/\W/g,"_")}function PJ(e){return(Fh(e)&7)!==0||wJ(e)}function wJ(e){const t=Tm(e);return t.kind===260&&t.parent.kind===299}function ru(e){return vc(e)&&(e.name.kind===11||Dd(e))}function II(e){return vc(e)&&e.name.kind===11}function AJ(e){return vc(e)&&ra(e.name)}function Nee(e){return vc(e)||Ie(e)}function B4(e){return A5e(e.valueDeclaration)}function A5e(e){return!!e&&e.kind===267&&!e.body}function Iee(e){return e.kind===312||e.kind===267||yk(e)}function Dd(e){return!!(e.flags&2048)}function xv(e){return ru(e)&&NJ(e)}function NJ(e){switch(e.parent.kind){case 312:return Nc(e.parent);case 268:return ru(e.parent.parent)&&Ai(e.parent.parent.parent)&&!Nc(e.parent.parent.parent)}return!1}function IJ(e){var t;return(t=e.declarations)==null?void 0:t.find(r=>!xv(r)&&!(vc(r)&&Dd(r)))}function N5e(e){return e===1||e===100||e===199}function sT(e,t){return Nc(e)||N5e(Ul(t))&&!!e.commonJsModuleIndicator}function FJ(e,t){switch(e.scriptKind){case 1:case 3:case 2:case 4:break;default:return!1}return e.isDeclarationFile?!1:fp(t,"alwaysStrict")||Cne(e.statements)?!0:Nc(e)||nd(t)?Ul(t)>=5?!0:!t.noImplicitUseStrict:!1}function OJ(e){return!!(e.flags&33554432)||In(e,128)}function LJ(e,t){switch(e.kind){case 312:case 269:case 299:case 267:case 248:case 249:case 250:case 176:case 174:case 177:case 178:case 262:case 218:case 219:case 172:case 175:return!0;case 241:return!yk(t)}return!1}function MJ(e){switch(E.type(e),e.kind){case 345:case 353:case 330:return!0;default:return RJ(e)}}function RJ(e){switch(E.type(e),e.kind){case 179:case 180:case 173:case 181:case 184:case 185:case 324:case 263:case 231:case 264:case 265:case 352:case 262:case 174:case 176:case 177:case 178:case 218:case 219:return!0;default:return!1}}function lb(e){switch(e.kind){case 272:case 271:return!0;default:return!1}}function Fee(e){return lb(e)||Pv(e)}function FI(e){switch(e.kind){case 272:case 271:case 243:case 263:case 262:case 267:case 265:case 264:case 266:return!0;default:return!1}}function Oee(e){return MP(e)||vc(e)||Zg(e)||G_(e)}function MP(e){return lb(e)||qc(e)}function jJ(e){return Ar(e.parent,t=>!!($U(t)&1))}function bm(e){return Ar(e.parent,t=>LJ(t,t.parent))}function Lee(e,t){let r=bm(e);for(;r;)t(r),r=bm(r)}function eo(e){return!e||IP(e)===0?"(Missing)":Wc(e)}function Mee(e){return e.declaration?eo(e.declaration.parameters[0].name):void 0}function RP(e){return e.kind===167&&!_f(e.expression)}function J4(e){var t;switch(e.kind){case 80:case 81:return(t=e.emitNode)!=null&&t.autoGenerate?void 0:e.escapedText;case 11:case 9:case 15:return zo(e.text);case 167:return _f(e.expression)?zo(e.expression.text):void 0;case 295:return TT(e);default:return E.assertNever(e)}}function Dk(e){return E.checkDefined(J4(e))}function D_(e){switch(e.kind){case 110:return"this";case 81:case 80:return IP(e)===0?an(e):Wc(e);case 166:return D_(e.left)+"."+D_(e.right);case 211:return Ie(e.name)||Ti(e.name)?D_(e.expression)+"."+D_(e.name):E.assertNever(e.name);case 318:return D_(e.left)+D_(e.right);case 295:return D_(e.namespace)+":"+D_(e.name);default:return E.assertNever(e)}}function mn(e,t,...r){const i=Or(e);return sp(i,e,t,...r)}function Pk(e,t,r,...i){const s=la(e.text,t.pos);return xl(e,s,t.end-s,r,...i)}function sp(e,t,r,...i){const s=kv(e,t);return xl(e,s.start,s.length,r,...i)}function Hg(e,t,r,i){const s=kv(e,t);return OI(e,s.start,s.length,r,i)}function jP(e,t,r,i){const s=la(e.text,t.pos);return OI(e,s,t.end-s,r,i)}function Ree(e,t,r){E.assertGreaterThanOrEqual(t,0),E.assertGreaterThanOrEqual(r,0),E.assertLessThanOrEqual(t,e.length),E.assertLessThanOrEqual(t+r,e.length)}function OI(e,t,r,i,s){return Ree(e.text,t,r),{file:e,start:t,length:r,code:i.code,category:i.category,messageText:i.next?i:i.messageText,relatedInformation:s}}function BJ(e,t,r){return{file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:r}}function jee(e){return typeof e.messageText=="string"?{code:e.code,category:e.category,messageText:e.messageText,next:e.next}:e.messageText}function Bee(e,t,r){return{file:e,start:t.pos,length:t.end-t.pos,code:r.code,category:r.category,messageText:r.message}}function Sm(e,t){const r=Ih(e.languageVersion,!0,e.languageVariant,e.text,void 0,t);r.scan();const i=r.getTokenStart();return zc(i,r.getTokenEnd())}function Jee(e,t){const r=Ih(e.languageVersion,!0,e.languageVariant,e.text,void 0,t);return r.scan(),r.getToken()}function I5e(e,t){const r=la(e.text,t.pos);if(t.body&&t.body.kind===241){const{line:i}=qa(e,t.body.pos),{line:s}=qa(e,t.body.end);if(i0?t.statements[0].pos:t.end;return zc(o,c)}case 253:case 229:{const o=la(e.text,t.pos);return Sm(e,o)}case 238:{const o=la(e.text,t.expression.end);return Sm(e,o)}case 357:{const o=la(e.text,t.tagName.pos);return Sm(e,o)}}if(r===void 0)return Sm(e,t.pos);E.assert(!zp(r));const i=sc(r),s=i||DT(t)?r.pos:la(e.text,r.pos);return i?(E.assert(s===r.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),E.assert(s===r.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")):(E.assert(s>=r.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),E.assert(s<=r.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")),zc(s,r.end)}function H_(e){return(e.externalModuleIndicator||e.commonJsModuleIndicator)!==void 0}function ap(e){return e.scriptKind===6}function Cv(e){return!!(gv(e)&4096)}function LI(e){return!!(gv(e)&8&&!E_(e,e.parent))}function BP(e){return(Fh(e)&7)===6}function JP(e){return(Fh(e)&7)===4}function wk(e){return(Fh(e)&7)===2}function MI(e){return(Fh(e)&7)===1}function ub(e){return e.kind===213&&e.expression.kind===108}function G_(e){return e.kind===213&&e.expression.kind===102}function Ak(e){return BE(e)&&e.keywordToken===102&&e.name.escapedText==="meta"}function U0(e){return Zg(e)&&_1(e.argument)&&ra(e.argument.literal)}function Lp(e){return e.kind===244&&e.expression.kind===11}function zP(e){return!!(da(e)&2097152)}function RI(e){return zP(e)&&Zc(e)}function F5e(e){return Ie(e.name)&&!e.initializer}function jI(e){return zP(e)&&ec(e)&&qi(e.declarationList.declarations,F5e)}function JJ(e,t){return e.kind!==12?Km(t.text,e.pos):void 0}function zJ(e,t){const r=e.kind===169||e.kind===168||e.kind===218||e.kind===219||e.kind===217||e.kind===260||e.kind===281?Xi(Hy(t,e.pos),Km(t,e.pos)):Km(t,e.pos);return wn(r,i=>t.charCodeAt(i.pos+1)===42&&t.charCodeAt(i.pos+2)===42&&t.charCodeAt(i.pos+3)!==47)}function ig(e){if(182<=e.kind&&e.kind<=205)return!0;switch(e.kind){case 133:case 159:case 150:case 163:case 154:case 136:case 155:case 151:case 157:case 106:case 146:return!0;case 116:return e.parent.kind!==222;case 233:return Q_(e.parent)&&!T8(e);case 168:return e.parent.kind===200||e.parent.kind===195;case 80:(e.parent.kind===166&&e.parent.right===e||e.parent.kind===211&&e.parent.name===e)&&(e=e.parent),E.assert(e.kind===80||e.kind===166||e.kind===211,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 166:case 211:case 110:{const{parent:t}=e;if(t.kind===186)return!1;if(t.kind===205)return!t.isTypeOf;if(182<=t.kind&&t.kind<=205)return!0;switch(t.kind){case 233:return Q_(t.parent)&&!T8(t);case 168:return e===t.constraint;case 352:return e===t.constraint;case 172:case 171:case 169:case 260:return e===t.type;case 262:case 218:case 219:case 176:case 174:case 173:case 177:case 178:return e===t.type;case 179:case 180:case 181:return e===t.type;case 216:return e===t.type;case 213:case 214:case 215:return _s(t.typeArguments,e)}}}return!1}function P0e(e,t){for(;e;){if(e.kind===t)return!0;e=e.parent}return!1}function Ev(e,t){return r(e);function r(i){switch(i.kind){case 253:return t(i);case 269:case 241:case 245:case 246:case 247:case 248:case 249:case 250:case 254:case 255:case 296:case 297:case 256:case 258:case 299:return ds(i,r)}}}function zee(e,t){return r(e);function r(i){switch(i.kind){case 229:t(i);const s=i.expression;s&&r(s);return;case 266:case 264:case 267:case 265:return;default:if(ks(i)){if(i.name&&i.name.kind===167){r(i.name.expression);return}}else ig(i)||ds(i,r)}}}function WJ(e){return e&&e.kind===188?e.elementType:e&&e.kind===183?lm(e.typeArguments):void 0}function Wee(e){switch(e.kind){case 264:case 263:case 231:case 187:return e.members;case 210:return e.properties}}function Nk(e){if(e)switch(e.kind){case 208:case 306:case 169:case 303:case 172:case 171:case 304:case 260:return!0}return!1}function Uee(e){return Nk(e)||R0(e)}function z4(e){return e.parent.kind===261&&e.parent.parent.kind===243}function Vee(e){return Hr(e)?ma(e.parent)&&Gr(e.parent.parent)&&ac(e.parent.parent)===2||BI(e.parent):!1}function BI(e){return Hr(e)?Gr(e)&&ac(e)===1:!1}function qee(e){return(Ei(e)?wk(e)&&Ie(e.name)&&z4(e):Es(e)?sE(e)&&Uc(e):ff(e)&&sE(e))||BI(e)}function Hee(e){switch(e.kind){case 174:case 173:case 176:case 177:case 178:case 262:case 218:return!0}return!1}function UJ(e,t){for(;;){if(t&&t(e),e.statement.kind!==256)return e.statement;e=e.statement}}function Dv(e){return e&&e.kind===241&&ks(e.parent)}function Mp(e){return e&&e.kind===174&&e.parent.kind===210}function JI(e){return(e.kind===174||e.kind===177||e.kind===178)&&(e.parent.kind===210||e.parent.kind===231)}function Gee(e){return e&&e.kind===1}function w0e(e){return e&&e.kind===0}function Ik(e,t,r,i){return Zt(e?.properties,s=>{if(!Hc(s))return;const o=J4(s.name);return t===o||i&&i===o?r(s):void 0})}function $ee(e,t,r){return Ik(e,t,i=>Lu(i.initializer)?kn(i.initializer.elements,s=>ra(s)&&s.text===r):void 0)}function W4(e){if(e&&e.statements.length){const t=e.statements[0].expression;return Jn(t,ma)}}function zI(e,t,r){return WP(e,t,i=>Lu(i.initializer)?kn(i.initializer.elements,s=>ra(s)&&s.text===r):void 0)}function WP(e,t,r){return Ik(W4(e),t,r)}function uf(e){return Ar(e.parent,ks)}function Xee(e){return Ar(e.parent,po)}function wl(e){return Ar(e.parent,Qn)}function Qee(e){return Ar(e.parent,t=>Qn(t)||ks(t)?"quit":Go(t))}function WI(e){return Ar(e.parent,yk)}function UI(e){const t=Ar(e.parent,r=>Qn(r)?"quit":ql(r));return t&&Qn(t.parent)?wl(t.parent):wl(t??e)}function i_(e,t,r){for(E.assert(e.kind!==312);;){if(e=e.parent,!e)return E.fail();switch(e.kind){case 167:if(r&&Qn(e.parent.parent))return e;e=e.parent.parent;break;case 170:e.parent.kind===169&&Pl(e.parent.parent)?e=e.parent.parent:Pl(e.parent)&&(e=e.parent);break;case 219:if(!t)continue;case 262:case 218:case 267:case 175:case 172:case 171:case 174:case 173:case 176:case 177:case 178:case 179:case 180:case 181:case 266:case 312:return e}}}function Yee(e){switch(e.kind){case 219:case 262:case 218:case 172:return!0;case 241:switch(e.parent.kind){case 176:case 174:case 177:case 178:return!0;default:return!1}default:return!1}}function VI(e){Ie(e)&&(Vc(e.parent)||Zc(e.parent))&&e.parent.name===e&&(e=e.parent);const t=i_(e,!0,!1);return Ai(t)}function Zee(e){const t=i_(e,!1,!1);if(t)switch(t.kind){case 176:case 262:case 218:return t}}function UP(e,t){for(;;){if(e=e.parent,!e)return;switch(e.kind){case 167:e=e.parent;break;case 262:case 218:case 219:if(!t)continue;case 172:case 171:case 174:case 173:case 176:case 177:case 178:case 175:return e;case 170:e.parent.kind===169&&Pl(e.parent.parent)?e=e.parent.parent:Pl(e.parent)&&(e=e.parent);break}}}function _b(e){if(e.kind===218||e.kind===219){let t=e,r=e.parent;for(;r.kind===217;)t=r,r=r.parent;if(r.kind===213&&r.expression===t)return r}}function A0e(e){return e.kind===108||s_(e)}function s_(e){const t=e.kind;return(t===211||t===212)&&e.expression.kind===108}function VP(e){const t=e.kind;return(t===211||t===212)&&e.expression.kind===110}function qI(e){var t;return!!e&&Ei(e)&&((t=e.initializer)==null?void 0:t.kind)===110}function Kee(e){return!!e&&(Y_(e)||Hc(e))&&Gr(e.parent.parent)&&e.parent.parent.operatorToken.kind===64&&e.parent.parent.right.kind===110}function qP(e){switch(e.kind){case 183:return e.typeName;case 233:return oc(e.expression)?e.expression:void 0;case 80:case 166:return e}}function HI(e){switch(e.kind){case 215:return e.tag;case 286:case 285:return e.tagName;case 226:return e.right;default:return e.expression}}function GI(e,t,r,i){if(e&&Au(t)&&Ti(t.name))return!1;switch(t.kind){case 263:return!0;case 231:return!e;case 172:return r!==void 0&&(e?Vc(r):Qn(r)&&!Mv(t)&&!Sz(t));case 177:case 178:case 174:return t.body!==void 0&&r!==void 0&&(e?Vc(r):Qn(r));case 169:return e?r!==void 0&&r.body!==void 0&&(r.kind===176||r.kind===174||r.kind===178)&&Fv(r)!==t&&i!==void 0&&i.kind===263:!1}return!1}function U4(e,t,r,i){return Of(t)&&GI(e,t,r,i)}function HP(e,t,r,i){return U4(e,t,r,i)||V4(e,t,r)}function V4(e,t,r){switch(t.kind){case 263:return ut(t.members,i=>HP(e,i,t,r));case 231:return!e&&ut(t.members,i=>HP(e,i,t,r));case 174:case 178:case 176:return ut(t.parameters,i=>U4(e,i,t,r));default:return!1}}function Mh(e,t){if(U4(e,t))return!0;const r=cg(t);return!!r&&V4(e,r,t)}function VJ(e,t,r){let i;if(R0(t)){const{firstAccessor:s,secondAccessor:o,setAccessor:c}=vb(r.members,t),u=Of(s)?s:o&&Of(o)?o:void 0;if(!u||t!==u)return!1;i=c?.parameters}else mc(t)&&(i=t.parameters);if(U4(e,t,r))return!0;if(i){for(const s of i)if(!Ov(s)&&U4(e,s,t,r))return!0}return!1}function qJ(e){if(e.textSourceNode){switch(e.textSourceNode.kind){case 11:return qJ(e.textSourceNode);case 15:return e.text===""}return!1}return e.text===""}function Fk(e){const{parent:t}=e;return t.kind===286||t.kind===285||t.kind===287?t.tagName===e:!1}function sg(e){switch(e.kind){case 108:case 106:case 112:case 97:case 14:case 209:case 210:case 211:case 212:case 213:case 214:case 215:case 234:case 216:case 238:case 235:case 217:case 218:case 231:case 219:case 222:case 220:case 221:case 224:case 225:case 226:case 227:case 230:case 228:case 232:case 284:case 285:case 288:case 229:case 223:case 236:return!0;case 233:return!Q_(e.parent)&&!yC(e.parent);case 166:for(;e.parent.kind===166;)e=e.parent;return e.parent.kind===186||iT(e.parent)||VE(e.parent)||d1(e.parent)||Fk(e);case 318:for(;d1(e.parent);)e=e.parent;return e.parent.kind===186||iT(e.parent)||VE(e.parent)||d1(e.parent)||Fk(e);case 81:return Gr(e.parent)&&e.parent.left===e&&e.parent.operatorToken.kind===103;case 80:if(e.parent.kind===186||iT(e.parent)||VE(e.parent)||d1(e.parent)||Fk(e))return!0;case 9:case 10:case 11:case 15:case 110:return $I(e);default:return!1}}function $I(e){const{parent:t}=e;switch(t.kind){case 260:case 169:case 172:case 171:case 306:case 303:case 208:return t.initializer===e;case 244:case 245:case 246:case 247:case 253:case 254:case 255:case 296:case 257:return t.expression===e;case 248:const r=t;return r.initializer===e&&r.initializer.kind!==261||r.condition===e||r.incrementor===e;case 249:case 250:const i=t;return i.initializer===e&&i.initializer.kind!==261||i.expression===e;case 216:case 234:return e===t.expression;case 239:return e===t.expression;case 167:return e===t.expression;case 170:case 294:case 293:case 305:return!0;case 233:return t.expression===e&&!ig(t);case 304:return t.objectAssignmentInitializer===e;case 238:return e===t.expression;default:return sg(t)}}function XI(e){for(;e.kind===166||e.kind===80;)e=e.parent;return e.kind===186}function ete(e){return Dm(e)&&!!e.parent.moduleSpecifier}function Ky(e){return e.kind===271&&e.moduleReference.kind===283}function q4(e){return E.assert(Ky(e)),e.moduleReference.expression}function HJ(e){return Pv(e)&&dE(e.initializer).arguments[0]}function Ok(e){return e.kind===271&&e.moduleReference.kind!==283}function Iu(e){return Hr(e)}function N0e(e){return!Hr(e)}function Hr(e){return!!e&&!!(e.flags&524288)}function QI(e){return!!e&&!!(e.flags&134217728)}function GJ(e){return!ap(e)}function GP(e){return!!e&&!!(e.flags&16777216)}function YI(e){return mp(e)&&Ie(e.typeName)&&e.typeName.escapedText==="Object"&&e.typeArguments&&e.typeArguments.length===2&&(e.typeArguments[0].kind===154||e.typeArguments[0].kind===150)}function g_(e,t){if(e.kind!==213)return!1;const{expression:r,arguments:i}=e;if(r.kind!==80||r.escapedText!=="require"||i.length!==1)return!1;const s=i[0];return!t||Ja(s)}function ZI(e){return I0e(e,!1)}function Pv(e){return I0e(e,!0)}function tte(e){return Pa(e)&&Pv(e.parent.parent)}function I0e(e,t){return Ei(e)&&!!e.initializer&&g_(t?dE(e.initializer):e.initializer,!0)}function $J(e){return ec(e)&&e.declarationList.declarations.length>0&&qi(e.declarationList.declarations,t=>ZI(t))}function $P(e){return e===39||e===34}function KI(e,t){return Tv(t,e).charCodeAt(0)===34}function H4(e){return Gr(e)||co(e)||Ie(e)||Rs(e)}function XP(e){return Hr(e)&&e.initializer&&Gr(e.initializer)&&(e.initializer.operatorToken.kind===57||e.initializer.operatorToken.kind===61)&&e.name&&oc(e.name)&&Lk(e.name,e.initializer.left)?e.initializer.right:e.initializer}function QP(e){const t=XP(e);return t&&e1(t,H0(e.name))}function O5e(e,t){return Zt(e.properties,r=>Hc(r)&&Ie(r.name)&&r.name.escapedText==="value"&&r.initializer&&e1(r.initializer,t))}function aT(e){if(e&&e.parent&&Gr(e.parent)&&e.parent.operatorToken.kind===64){const t=H0(e.parent.left);return e1(e.parent.right,t)||L5e(e.parent.left,e.parent.right,t)}if(e&&Rs(e)&&pb(e)){const t=O5e(e.arguments[2],e.arguments[1].text==="prototype");if(t)return t}}function e1(e,t){if(Rs(e)){const r=Ha(e.expression);return r.kind===218||r.kind===219?e:void 0}if(e.kind===218||e.kind===231||e.kind===219||ma(e)&&(e.properties.length===0||t))return e}function L5e(e,t,r){const i=Gr(t)&&(t.operatorToken.kind===57||t.operatorToken.kind===61)&&e1(t.right,r);if(i&&Lk(e,t.left))return i}function rte(e){const t=Ei(e.parent)?e.parent.name:Gr(e.parent)&&e.parent.operatorToken.kind===64?e.parent.left:void 0;return t&&e1(e.right,H0(t))&&oc(t)&&Lk(t,e.left)}function XJ(e){if(Gr(e.parent)){const t=(e.parent.operatorToken.kind===57||e.parent.operatorToken.kind===61)&&Gr(e.parent.parent)?e.parent.parent:e.parent;if(t.operatorToken.kind===64&&Ie(t.left))return t.left}else if(Ei(e.parent))return e.parent.name}function Lk(e,t){return wd(e)&&wd(t)?cp(e)===cp(t):tg(e)&&e5(t)&&(t.expression.kind===110||Ie(t.expression)&&(t.expression.escapedText==="window"||t.expression.escapedText==="self"||t.expression.escapedText==="global"))?Lk(e,KP(t)):e5(e)&&e5(t)?Gg(e)===Gg(t)&&Lk(e.expression,t.expression):!1}function YP(e){for(;sl(e,!0);)e=e.right;return e}function fb(e){return Ie(e)&&e.escapedText==="exports"}function QJ(e){return Ie(e)&&e.escapedText==="module"}function ag(e){return(bn(e)||ZP(e))&&QJ(e.expression)&&Gg(e)==="exports"}function ac(e){const t=M5e(e);return t===5||Hr(e)?t:0}function pb(e){return Ir(e.arguments)===3&&bn(e.expression)&&Ie(e.expression.expression)&&an(e.expression.expression)==="Object"&&an(e.expression.name)==="defineProperty"&&_f(e.arguments[1])&&db(e.arguments[0],!0)}function e5(e){return bn(e)||ZP(e)}function ZP(e){return mo(e)&&_f(e.argumentExpression)}function wv(e,t){return bn(e)&&(!t&&e.expression.kind===110||Ie(e.name)&&db(e.expression,!0))||t5(e,t)}function t5(e,t){return ZP(e)&&(!t&&e.expression.kind===110||oc(e.expression)||wv(e.expression,!0))}function db(e,t){return oc(e)||wv(e,t)}function KP(e){return bn(e)?e.name:e.argumentExpression}function M5e(e){if(Rs(e)){if(!pb(e))return 0;const t=e.arguments[0];return fb(t)||ag(t)?8:wv(t)&&Gg(t)==="prototype"?9:7}return e.operatorToken.kind!==64||!co(e.left)||R5e(YP(e))?0:db(e.left.expression,!0)&&Gg(e.left)==="prototype"&&ma(YJ(e))?6:e8(e.left)}function R5e(e){return LT(e)&&A_(e.expression)&&e.expression.text==="0"}function r5(e){if(bn(e))return e.name;const t=Ha(e.argumentExpression);return A_(t)||Ja(t)?t:e}function Gg(e){const t=r5(e);if(t){if(Ie(t))return t.escapedText;if(Ja(t)||A_(t))return zo(t.text)}}function e8(e){if(e.expression.kind===110)return 4;if(ag(e))return 2;if(db(e.expression,!0)){if(H0(e.expression))return 3;let t=e;for(;!Ie(t.expression);)t=t.expression;const r=t.expression;if((r.escapedText==="exports"||r.escapedText==="module"&&Gg(t)==="exports")&&wv(e))return 1;if(db(e,!0)||mo(e)&&l5(e))return 5}return 0}function YJ(e){for(;Gr(e.right);)e=e.right;return e.right}function t8(e){return Gr(e)&&ac(e)===3}function nte(e){return Hr(e)&&e.parent&&e.parent.kind===244&&(!mo(e)||ZP(e))&&!!Qy(e.parent)}function r8(e,t){const{valueDeclaration:r}=e;(!r||!(t.flags&33554432&&!Hr(t)&&!(r.flags&33554432))&&H4(r)&&!H4(t)||r.kind!==t.kind&&Nee(r))&&(e.valueDeclaration=t)}function ite(e){if(!e||!e.valueDeclaration)return!1;const t=e.valueDeclaration;return t.kind===262||Ei(t)&&t.initializer&&ks(t.initializer)}function Mk(e){var t,r;switch(e.kind){case 260:case 208:return(t=Ar(e.initializer,i=>g_(i,!0)))==null?void 0:t.arguments[0];case 272:case 278:return Jn(e.moduleSpecifier,Ja);case 271:return Jn((r=Jn(e.moduleReference,Pm))==null?void 0:r.expression,Ja);case 273:case 280:return Jn(e.parent.moduleSpecifier,Ja);case 274:case 281:return Jn(e.parent.parent.moduleSpecifier,Ja);case 276:return Jn(e.parent.parent.parent.moduleSpecifier,Ja);case 205:return U0(e)?e.argument.literal:void 0;default:E.assertNever(e)}}function G4(e){return n8(e)||E.failBadSyntaxKind(e.parent)}function n8(e){switch(e.parent.kind){case 272:case 278:return e.parent;case 283:return e.parent.parent;case 213:return G_(e.parent)||g_(e.parent,!1)?e.parent:void 0;case 201:return E.assert(ra(e)),Jn(e.parent.parent,Zg);default:return}}function Rk(e){switch(e.kind){case 272:case 278:return e.moduleSpecifier;case 271:return e.moduleReference.kind===283?e.moduleReference.expression:void 0;case 205:return U0(e)?e.argument.literal:void 0;case 213:return e.arguments[0];case 267:return e.name.kind===11?e.name:void 0;default:return E.assertNever(e)}}function jk(e){switch(e.kind){case 272:return e.importClause&&Jn(e.importClause.namedBindings,K0);case 271:return e;case 278:return e.exportClause&&Jn(e.exportClause,Dm);default:return E.assertNever(e)}}function oT(e){return e.kind===272&&!!e.importClause&&!!e.importClause.name}function n5(e,t){if(e.name){const r=t(e);if(r)return r}if(e.namedBindings){const r=K0(e.namedBindings)?t(e.namedBindings):Zt(e.namedBindings.elements,t);if(r)return r}}function cT(e){if(e)switch(e.kind){case 169:case 174:case 173:case 304:case 303:case 172:case 171:return e.questionToken!==void 0}return!1}function Bk(e){const t=hC(e)?bl(e.parameters):void 0,r=Jn(t&&t.name,Ie);return!!r&&r.escapedText==="new"}function op(e){return e.kind===353||e.kind===345||e.kind===347}function i8(e){return op(e)||Jp(e)}function j5e(e){return kl(e)&&Gr(e.expression)&&e.expression.operatorToken.kind===64?YP(e.expression):void 0}function F0e(e){return kl(e)&&Gr(e.expression)&&ac(e.expression)!==0&&Gr(e.expression.right)&&(e.expression.right.operatorToken.kind===57||e.expression.right.operatorToken.kind===61)?e.expression.right.right:void 0}function ZJ(e){switch(e.kind){case 243:const t=Jk(e);return t&&t.initializer;case 172:return e.initializer;case 303:return e.initializer}}function Jk(e){return ec(e)?bl(e.declarationList.declarations):void 0}function O0e(e){return vc(e)&&e.body&&e.body.kind===267?e.body:void 0}function s8(e){if(e.kind>=243&&e.kind<=259)return!0;switch(e.kind){case 80:case 110:case 108:case 166:case 236:case 212:case 211:case 208:case 218:case 219:case 174:case 177:case 178:return!0;default:return!1}}function a8(e){switch(e.kind){case 219:case 226:case 241:case 252:case 179:case 296:case 263:case 231:case 175:case 176:case 185:case 180:case 251:case 259:case 246:case 212:case 242:case 1:case 266:case 306:case 277:case 278:case 281:case 244:case 249:case 250:case 248:case 262:case 218:case 184:case 177:case 80:case 245:case 272:case 271:case 181:case 264:case 324:case 330:case 256:case 174:case 173:case 267:case 202:case 270:case 210:case 169:case 217:case 211:case 303:case 172:case 171:case 253:case 240:case 178:case 304:case 305:case 255:case 257:case 258:case 265:case 168:case 260:case 243:case 247:case 254:return!0;default:return!1}}function KJ(e,t){let r;Nk(e)&&J0(e)&&q_(e.initializer)&&(r=Dn(r,L0e(e,Sa(e.initializer.jsDoc))));let i=e;for(;i&&i.parent;){if(q_(i)&&(r=Dn(r,L0e(e,Sa(i.jsDoc)))),i.kind===169){r=Dn(r,(t?RK:mk)(i));break}if(i.kind===168){r=Dn(r,(t?BK:jK)(i));break}i=ez(i)}return r||ze}function L0e(e,t){if(zp(t)){const r=wn(t.tags,i=>M0e(e,i));return t.tags===r?[t]:r}return M0e(e,t)?[t]:void 0}function M0e(e,t){return!(qE(t)||XF(t))||!t.parent||!zp(t.parent)||!y_(t.parent.parent)||t.parent.parent===e}function ez(e){const t=e.parent;if(t.kind===303||t.kind===277||t.kind===172||t.kind===244&&e.kind===211||t.kind===253||O0e(t)||sl(e))return t;if(t.parent&&(Jk(t.parent)===e||sl(t)))return t.parent;if(t.parent&&t.parent.parent&&(Jk(t.parent.parent)||ZJ(t.parent.parent)===e||F0e(t.parent.parent)))return t.parent.parent}function o8(e){if(e.symbol)return e.symbol;if(!Ie(e.name))return;const t=e.name.escapedText,r=t1(e);if(!r)return;const i=kn(r.parameters,s=>s.name.kind===80&&s.name.escapedText===t);return i&&i.symbol}function i5(e){if(zp(e.parent)&&e.parent.tags){const t=kn(e.parent.tags,op);if(t)return t}return t1(e)}function t1(e){const t=mb(e);if(t)return ff(t)&&t.type&&ks(t.type)?t.type:ks(t)?t:void 0}function mb(e){const t=lT(e);if(t)return F0e(t)||j5e(t)||ZJ(t)||Jk(t)||O0e(t)||t}function lT(e){const t=$4(e);if(!t)return;const r=t.parent;if(r&&r.jsDoc&&t===Mo(r.jsDoc))return r}function $4(e){return Ar(e.parent,zp)}function ste(e){const t=e.name.escapedText,{typeParameters:r}=e.parent.parent.parent;return r&&kn(r,i=>i.name.escapedText===t)}function R0e(e){return!!e.typeArguments}function ate(e){let t=e.parent;for(;;){switch(t.kind){case 226:const r=t,i=r.operatorToken.kind;return Bh(i)&&r.left===e?r:void 0;case 224:case 225:const s=t,o=s.operator;return o===46||o===47?s:void 0;case 249:case 250:const c=t;return c.initializer===e?c:void 0;case 217:case 209:case 230:case 235:e=t;break;case 305:e=t.parent;break;case 304:if(t.name!==e)return;e=t.parent;break;case 303:if(t.name===e)return;e=t.parent;break;default:return}t=e.parent}}function uT(e){const t=ate(e);if(!t)return 0;switch(t.kind){case 226:const r=t.operatorToken.kind;return r===64||aE(r)?1:2;case 224:case 225:return 2;case 249:case 250:return 1}}function og(e){return!!ate(e)}function B5e(e){const t=Ha(e.right);return t.kind===226&&sU(t.operatorToken.kind)}function tz(e){const t=ate(e);return!!t&&sl(t,!0)&&B5e(t)}function ote(e){switch(e.kind){case 241:case 243:case 254:case 245:case 255:case 269:case 296:case 297:case 256:case 248:case 249:case 250:case 246:case 247:case 258:case 299:return!0}return!1}function cte(e){return ro(e)||go(e)||vk(e)||Zc(e)||gc(e)}function j0e(e,t){for(;e&&e.kind===t;)e=e.parent;return e}function c8(e){return j0e(e,196)}function Rh(e){return j0e(e,217)}function lte(e){let t;for(;e&&e.kind===196;)t=e,e=e.parent;return[t,e]}function rz(e){for(;IT(e);)e=e.type;return e}function Ha(e,t){return bc(e,t?17:1)}function nz(e){return e.kind!==211&&e.kind!==212?!1:(e=Rh(e.parent),e&&e.kind===220)}function Av(e,t){for(;e;){if(e===t)return!0;e=e.parent}return!1}function $g(e){return!Ai(e)&&!As(e)&&hu(e.parent)&&e.parent.name===e}function X4(e){const t=e.parent;switch(e.kind){case 11:case 15:case 9:if(xa(t))return t.parent;case 80:if(hu(t))return t.name===e?t:void 0;if(h_(t)){const r=t.parent;return ad(r)&&r.name===t?r:void 0}else{const r=t.parent;return Gr(r)&&ac(r)!==0&&(r.left.symbol||r.symbol)&&as(r)===e?r:void 0}case 81:return hu(t)&&t.name===e?t:void 0;default:return}}function l8(e){return _f(e)&&e.parent.kind===167&&hu(e.parent.parent)}function ute(e){const t=e.parent;switch(t.kind){case 172:case 171:case 174:case 173:case 177:case 178:case 306:case 303:case 211:return t.name===e;case 166:return t.right===e;case 208:case 276:return t.propertyName===e;case 281:case 291:case 285:case 286:case 287:return!0}return!1}function B0e(e){return e.kind===271||e.kind===270||e.kind===273&&e.name||e.kind===274||e.kind===280||e.kind===276||e.kind===281||e.kind===277&&zk(e)?!0:Hr(e)&&(Gr(e)&&ac(e)===2&&zk(e)||bn(e)&&Gr(e.parent)&&e.parent.left===e&&e.parent.operatorToken.kind===64&&u8(e.parent.right))}function iz(e){switch(e.parent.kind){case 273:case 276:case 274:case 281:case 277:case 271:case 280:return e.parent;case 166:do e=e.parent;while(e.parent.kind===166);return iz(e)}}function u8(e){return oc(e)||Nl(e)}function zk(e){const t=sz(e);return u8(t)}function sz(e){return cc(e)?e.expression:e.right}function _te(e){return e.kind===304?e.name:e.kind===303?e.initializer:e.parent.right}function Pd(e){const t=Nv(e);if(t&&Hr(e)){const r=zK(e);if(r)return r.class}return t}function Nv(e){const t=_8(e.heritageClauses,96);return t&&t.types.length>0?t.types[0]:void 0}function Wk(e){if(Hr(e))return WK(e).map(t=>t.class);{const t=_8(e.heritageClauses,119);return t?.types}}function Q4(e){return Mu(e)?Y4(e)||ze:Qn(e)&&Xi(Q2(Pd(e)),Wk(e))||ze}function Y4(e){const t=_8(e.heritageClauses,96);return t?t.types:void 0}function _8(e,t){if(e){for(const r of e)if(r.token===t)return r}}function r1(e,t){for(;e;){if(e.kind===t)return e;e=e.parent}}function a_(e){return 83<=e&&e<=165}function az(e){return 19<=e&&e<=79}function s5(e){return a_(e)||az(e)}function a5(e){return 128<=e&&e<=165}function oz(e){return a_(e)&&!a5(e)}function J0e(e){return 119<=e&&e<=127}function _T(e){const t=mv(e);return t!==void 0&&oz(t)}function z0e(e){const t=mv(e);return t!==void 0&&a_(t)}function o5(e){const t=Xy(e);return!!t&&!a5(t)}function Uk(e){return 2<=e&&e<=7}function pl(e){if(!e)return 4;let t=0;switch(e.kind){case 262:case 218:case 174:e.asteriskToken&&(t|=1);case 219:In(e,1024)&&(t|=2);break}return e.body||(t|=4),t}function Z4(e){switch(e.kind){case 262:case 218:case 219:case 174:return e.body!==void 0&&e.asteriskToken===void 0&&In(e,1024)}return!1}function _f(e){return Ja(e)||A_(e)}function c5(e){return f1(e)&&(e.operator===40||e.operator===41)&&A_(e.operand)}function V0(e){const t=as(e);return!!t&&l5(t)}function l5(e){if(!(e.kind===167||e.kind===212))return!1;const t=mo(e)?Ha(e.argumentExpression):e.expression;return!_f(t)&&!c5(t)}function gb(e){switch(e.kind){case 80:case 81:return e.escapedText;case 11:case 15:case 9:return zo(e.text);case 167:const t=e.expression;return _f(t)?zo(t.text):c5(t)?t.operator===41?Hs(t.operator)+t.operand.text:t.operand.text:void 0;case 295:return TT(e);default:return E.assertNever(e)}}function wd(e){switch(e.kind){case 80:case 11:case 15:case 9:return!0;default:return!1}}function cp(e){return tg(e)?an(e):sd(e)?PE(e):e.text}function K4(e){return tg(e)?e.escapedText:sd(e)?TT(e):zo(e.text)}function W0e(e){return`__@${Xs(e)}@${e.escapedName}`}function f8(e,t){return`__#${Xs(e)}@${t}`}function p8(e){return Qi(e.escapedName,"__@")}function fte(e){return Qi(e.escapedName,"__#")}function U0e(e){return e.kind===80&&e.escapedText==="Symbol"}function pte(e){return Ie(e)?an(e)==="__proto__":ra(e)&&e.text==="__proto__"}function eE(e,t){switch(e=bc(e),e.kind){case 231:if(hV(e))return!1;break;case 218:if(e.name)return!1;break;case 219:break;default:return!1}return typeof t=="function"?t(e):!0}function cz(e){switch(e.kind){case 303:return!pte(e.name);case 304:return!!e.objectAssignmentInitializer;case 260:return Ie(e.name)&&!!e.initializer;case 169:return Ie(e.name)&&!!e.initializer&&!e.dotDotDotToken;case 208:return Ie(e.name)&&!!e.initializer&&!e.dotDotDotToken;case 172:return!!e.initializer;case 226:switch(e.operatorToken.kind){case 64:case 77:case 76:case 78:return Ie(e.left)}break;case 277:return!0}return!1}function P_(e,t){if(!cz(e))return!1;switch(e.kind){case 303:return eE(e.initializer,t);case 304:return eE(e.objectAssignmentInitializer,t);case 260:case 169:case 208:case 172:return eE(e.initializer,t);case 226:return eE(e.right,t);case 277:return eE(e.expression,t)}}function lz(e){return e.escapedText==="push"||e.escapedText==="unshift"}function Iv(e){return Tm(e).kind===169}function Tm(e){for(;e.kind===208;)e=e.parent.parent;return e}function uz(e){const t=e.kind;return t===176||t===218||t===262||t===219||t===174||t===177||t===178||t===267||t===312}function Po(e){return id(e.pos)||id(e.end)}function V0e(e){return ss(e,Ai)||e}function _z(e){const t=pz(e),r=e.kind===214&&e.arguments!==void 0;return fz(e.kind,t,r)}function fz(e,t,r){switch(e){case 214:return r?0:1;case 224:case 221:case 222:case 220:case 223:case 227:case 229:return 1;case 226:switch(t){case 43:case 64:case 65:case 66:case 68:case 67:case 69:case 70:case 71:case 72:case 73:case 74:case 79:case 75:case 76:case 77:case 78:return 1}}return 0}function tE(e){const t=pz(e),r=e.kind===214&&e.arguments!==void 0;return d8(e.kind,t,r)}function pz(e){return e.kind===226?e.operatorToken.kind:e.kind===224||e.kind===225?e.operator:e.kind}function d8(e,t,r){switch(e){case 361:return 0;case 230:return 1;case 229:return 2;case 227:return 4;case 226:switch(t){case 28:return 0;case 64:case 65:case 66:case 68:case 67:case 69:case 70:case 71:case 72:case 73:case 74:case 79:case 75:case 76:case 77:case 78:return 3;default:return m8(t)}case 216:case 235:case 224:case 221:case 222:case 220:case 223:return 16;case 225:return 17;case 213:return 18;case 214:return r?19:18;case 215:case 211:case 212:case 236:return 19;case 234:case 238:return 11;case 110:case 108:case 80:case 81:case 106:case 112:case 97:case 9:case 10:case 11:case 209:case 210:case 218:case 219:case 231:case 14:case 15:case 228:case 217:case 232:case 284:case 285:case 288:return 20;default:return-1}}function m8(e){switch(e){case 61:return 4;case 57:return 5;case 56:return 6;case 52:return 7;case 53:return 8;case 51:return 9;case 35:case 36:case 37:case 38:return 10;case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:return 11;case 48:case 49:case 50:return 12;case 40:case 41:return 13;case 42:case 44:case 45:return 14;case 43:return 15}return-1}function Vk(e){return wn(e,t=>{switch(t.kind){case 294:return!!t.expression;case 12:return!t.containsOnlyTriviaWhiteSpaces;default:return!0}})}function qk(){let e=[];const t=[],r=new Map;let i=!1;return{add:o,lookup:s,getGlobalDiagnostics:c,getDiagnostics:u};function s(f){let g;if(f.file?g=r.get(f.file.fileName):g=e,!g)return;const p=Dh(g,f,To,D5);if(p>=0)return g[p]}function o(f){let g;f.file?(g=r.get(f.file.fileName),g||(g=[],r.set(f.file.fileName,g),P0(t,f.file.fileName,Du))):(i&&(i=!1,e=e.slice()),g=e),P0(g,f,D5)}function c(){return i=!0,e}function u(f){if(f)return r.get(f)||[];const g=l4(t,p=>r.get(p));return e.length&&g.unshift(...e),g}}function J5e(e){return e.replace(yye,"\\${")}function dte(e){return!!((e.templateFlags||0)&2048)}function dz(e){return e&&!!(PT(e)?dte(e):dte(e.head)||ut(e.templateSpans,t=>dte(t.literal)))}function q0e(e){return"\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4)}function z5e(e,t,r){if(e.charCodeAt(0)===0){const i=r.charCodeAt(t+e.length);return i>=48&&i<=57?"\\x00":"\\0"}return Tye.get(e)||q0e(e.charCodeAt(0))}function n1(e,t){const r=t===96?Sye:t===39?bye:vye;return e.replace(r,z5e)}function g8(e,t){return e=n1(e,t),kre.test(e)?e.replace(kre,r=>q0e(r.charCodeAt(0))):e}function W5e(e){return"&#x"+e.toString(16).toUpperCase()+";"}function U5e(e){return e.charCodeAt(0)===0?"�":Cye.get(e)||W5e(e.charCodeAt(0))}function mz(e,t){const r=t===39?kye:xye;return e.replace(r,U5e)}function lp(e){const t=e.length;return t>=2&&e.charCodeAt(0)===e.charCodeAt(t-1)&&V5e(e.charCodeAt(0))?e.substring(1,t-1):e}function V5e(e){return e===39||e===34||e===96}function Hk(e){const t=e.charCodeAt(0);return t>=97&&t<=122||e.includes("-")}function u5(e){const t=wE[1];for(let r=wE.length;r<=e;r++)wE.push(wE[r-1]+t);return wE[e]}function Gk(){return wE[1].length}function h8(e){var t,r,i,s,o,c=!1;function u(D){const O=eT(D);O.length>1?(s=s+O.length-1,o=t.length-D.length+Sa(O),i=o-t.length===0):i=!1}function f(D){D&&D.length&&(i&&(D=u5(r)+D,i=!1),t+=D,u(D))}function g(D){D&&(c=!1),f(D)}function p(D){D&&(c=!0),f(D)}function y(){t="",r=0,i=!0,s=0,o=0,c=!1}function S(D){D!==void 0&&(t+=D,u(D),c=!1)}function T(D){D&&D.length&&g(D)}function C(D){(!i||D)&&(t+=e,s++,o=t.length,i=!0,c=!1)}function w(){return i?t.length:t.length+e.length}return y(),{write:g,rawWrite:S,writeLiteral:T,writeLine:C,increaseIndent:()=>{r++},decreaseIndent:()=>{r--},getIndent:()=>r,getTextPos:()=>t.length,getLine:()=>s,getColumn:()=>i?r*Gk():t.length-o,getText:()=>t,isAtStartOfLine:()=>i,hasTrailingComment:()=>c,hasTrailingWhitespace:()=>!!t.length&&Ug(t.charCodeAt(t.length-1)),clear:y,writeKeyword:g,writeOperator:g,writeParameter:g,writeProperty:g,writePunctuation:g,writeSpace:g,writeStringLiteral:g,writeSymbol:(D,O)=>g(D),writeTrailingSemicolon:g,writeComment:p,getTextPosWithWriteLine:w}}function gz(e){let t=!1;function r(){t&&(e.writeTrailingSemicolon(";"),t=!1)}return{...e,writeTrailingSemicolon(){t=!0},writeLiteral(i){r(),e.writeLiteral(i)},writeStringLiteral(i){r(),e.writeStringLiteral(i)},writeSymbol(i,s){r(),e.writeSymbol(i,s)},writePunctuation(i){r(),e.writePunctuation(i)},writeKeyword(i){r(),e.writeKeyword(i)},writeOperator(i){r(),e.writeOperator(i)},writeParameter(i){r(),e.writeParameter(i)},writeSpace(i){r(),e.writeSpace(i)},writeProperty(i){r(),e.writeProperty(i)},writeComment(i){r(),e.writeComment(i)},writeLine(){r(),e.writeLine()},increaseIndent(){r(),e.increaseIndent()},decreaseIndent(){r(),e.decreaseIndent()}}}function y8(e){return e.useCaseSensitiveFileNames?e.useCaseSensitiveFileNames():!1}function jh(e){return tu(y8(e))}function _5(e,t,r){return t.moduleName||hz(e,t.fileName,r&&r.fileName)}function H0e(e,t){return e.getCanonicalFileName(is(t,e.getCurrentDirectory()))}function mte(e,t,r){const i=t.getExternalModuleFileFromDeclaration(r);if(!i||i.isDeclarationFile)return;const s=Rk(r);if(!(s&&Ja(s)&&!U_(s.text)&&!H0e(e,i.path).includes(H0e(e,Sl(e.getCommonSourceDirectory())))))return _5(e,i)}function hz(e,t,r){const i=f=>e.getCanonicalFileName(f),s=fo(r?qn(r):e.getCommonSourceDirectory(),e.getCurrentDirectory(),i),o=is(t,e.getCurrentDirectory()),c=KS(s,o,s,i,!1),u=Ou(c);return r?dv(u):u}function gte(e,t,r){const i=t.getCompilerOptions();let s;return i.outDir?s=Ou(d5(e,t,i.outDir)):s=Ou(e),s+r}function hte(e,t){return f5(e,t.getCompilerOptions(),t.getCurrentDirectory(),t.getCommonSourceDirectory(),r=>t.getCanonicalFileName(r))}function f5(e,t,r,i,s){const o=t.declarationDir||t.outDir,c=o?m5(e,o,r,i,s):e,u=v8(c);return Ou(c)+u}function v8(e){return Jc(e,[".mjs",".mts"])?".d.mts":Jc(e,[".cjs",".cts"])?".d.cts":Jc(e,[".json"])?".d.json.ts":".d.ts"}function yte(e){return Jc(e,[".d.mts",".mjs",".mts"])?[".mts",".mjs"]:Jc(e,[".d.cts",".cjs",".cts"])?[".cts",".cjs"]:Jc(e,[".d.json.ts"])?[".json"]:[".tsx",".ts",".jsx",".js"]}function to(e){return e.outFile||e.out}function p5(e,t){var r;if(e.paths)return e.baseUrl??E.checkDefined(e.pathsBasePath||((r=t.getCurrentDirectory)==null?void 0:r.call(t)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")}function yz(e,t,r){const i=e.getCompilerOptions();if(to(i)){const s=Ul(i),o=i.emitDeclarationOnly||s===2||s===4;return wn(e.getSourceFiles(),c=>(o||!Nc(c))&&fT(c,e,r))}else{const s=t===void 0?e.getSourceFiles():[t];return wn(s,o=>fT(o,e,r))}}function fT(e,t,r){const i=t.getCompilerOptions();if(i.noEmitForJsFiles&&Iu(e)||e.isDeclarationFile||t.isSourceFileFromExternalLibrary(e))return!1;if(r)return!0;if(t.isSourceOfProjectReferenceRedirect(e.fileName))return!1;if(!ap(e))return!0;if(t.getResolvedProjectReferenceToRedirect(e.fileName))return!1;if(to(i))return!0;if(!i.outDir)return!1;if(i.rootDir||i.composite&&i.configFilePath){const s=is(g3(i,()=>[],t.getCurrentDirectory(),t.getCanonicalFileName),t.getCurrentDirectory()),o=m5(e.fileName,i.outDir,t.getCurrentDirectory(),s,t.getCanonicalFileName);if(qy(e.fileName,o,t.getCurrentDirectory(),!t.useCaseSensitiveFileNames())===0)return!1}return!0}function d5(e,t,r){return m5(e,r,t.getCurrentDirectory(),t.getCommonSourceDirectory(),i=>t.getCanonicalFileName(i))}function m5(e,t,r,i,s){let o=is(e,r);return o=s(o).indexOf(s(i))===0?o.substring(i.length):o,Hn(t,o)}function rE(e,t,r,i,s,o,c){e.writeFile(r,i,s,u=>{t.add(dc(d.Could_not_write_file_0_Colon_1,r,u))},o,c)}function G0e(e,t,r){if(e.length>pm(e)&&!r(e)){const i=qn(e);G0e(i,t,r),t(e)}}function vz(e,t,r,i,s,o){try{i(e,t,r)}catch{G0e(qn(qs(e)),s,o),i(e,t,r)}}function nE(e,t){const r=Wg(e);return x4(r,t)}function hb(e,t){return x4(e,t)}function cg(e){return kn(e.members,t=>gc(t)&&ip(t.body))}function iE(e){if(e&&e.parameters.length>0){const t=e.parameters.length===2&&Ov(e.parameters[0]);return e.parameters[t?1:0]}}function vte(e){const t=iE(e);return t&&t.type}function Fv(e){if(e.parameters.length&&!m1(e)){const t=e.parameters[0];if(Ov(t))return t}}function Ov(e){return Lv(e.name)}function Lv(e){return!!e&&e.kind===80&&bz(e)}function yb(e){return!!Ar(e,t=>t.kind===186?!0:t.kind===80||t.kind===166?!1:"quit")}function pT(e){if(!Lv(e))return!1;for(;h_(e.parent)&&e.parent.left===e;)e=e.parent;return e.parent.kind===186}function bz(e){return e.escapedText==="this"}function vb(e,t){let r,i,s,o;return V0(t)?(r=t,t.kind===177?s=t:t.kind===178?o=t:E.fail("Accessor has wrong kind")):Zt(e,c=>{if(R0(c)&&Ls(c)===Ls(t)){const u=gb(c.name),f=gb(t.name);u===f&&(r?i||(i=c):r=c,c.kind===177&&!s&&(s=c),c.kind===178&&!o&&(o=c))}}),{firstAccessor:r,secondAccessor:i,getAccessor:s,setAccessor:o}}function Wl(e){if(!Hr(e)&&Zc(e))return;const t=e.type;return t||!Hr(e)?t:bP(e)?e.typeExpression&&e.typeExpression.type:Yy(e)}function bte(e){return e.type}function up(e){return m1(e)?e.type&&e.type.typeExpression&&e.type.typeExpression.type:e.type||(Hr(e)?hP(e):void 0)}function g5(e){return ta(Zy(e),t=>q5e(t)?t.typeParameters:void 0)}function q5e(e){return od(e)&&!(e.parent.kind===327&&(e.parent.tags.some(op)||e.parent.tags.some(vC)))}function Ste(e){const t=iE(e);return t&&Wl(t)}function Tte(e,t,r,i){xte(e,t,r.pos,i)}function xte(e,t,r,i){i&&i.length&&r!==i[0].pos&&hb(e,r)!==hb(e,i[0].pos)&&t.writeLine()}function kte(e,t,r,i){r!==i&&hb(e,r)!==hb(e,i)&&t.writeLine()}function Cte(e,t,r,i,s,o,c,u){if(i&&i.length>0){s&&r.writeSpace(" ");let f=!1;for(const g of i)f&&(r.writeSpace(" "),f=!1),u(e,t,r,g.pos,g.end,c),g.hasTrailingNewLine?r.writeLine():f=!0;f&&o&&r.writeSpace(" ")}}function Ete(e,t,r,i,s,o,c){let u,f;if(c?s.pos===0&&(u=wn(Km(e,s.pos),g)):u=Km(e,s.pos),u){const p=[];let y;for(const S of u){if(y){const T=hb(t,y.end);if(hb(t,S.pos)>=T+2)break}p.push(S),y=S}if(p.length){const S=hb(t,Sa(p).end);hb(t,la(e,s.pos))>=S+2&&(Tte(t,r,s,u),Cte(e,t,r,p,!1,!0,o,i),f={nodePos:s.pos,detachedCommentEndPos:Sa(p).end})}}return f;function g(p){return AI(e,p.pos)}}function $k(e,t,r,i,s,o){if(e.charCodeAt(i+1)===42){const c=_k(t,i),u=t.length;let f;for(let g=i,p=c.line;g0){let C=T%Gk();const w=u5((T-C)/Gk());for(r.rawWrite(w);C;)r.rawWrite(" "),C--}else r.rawWrite("")}H5e(e,s,r,o,g,y),g=y}}else r.writeComment(e.substring(i,s))}function H5e(e,t,r,i,s,o){const c=Math.min(t,o-1),u=e.substring(s,c).trim();u?(r.writeComment(u),c!==t&&r.writeLine()):r.rawWrite(i)}function $0e(e,t,r){let i=0;for(;t=0&&e.kind<=165?0:(e.modifierFlagsCache&536870912||(e.modifierFlagsCache=Tz(e)|536870912),r||t&&Hr(e)?(!(e.modifierFlagsCache&268435456)&&e.parent&&(e.modifierFlagsCache|=X0e(e)|268435456),Q0e(e.modifierFlagsCache)):G5e(e.modifierFlagsCache))}function Fu(e){return wte(e,!0)}function Ate(e){return wte(e,!0,!0)}function q0(e){return wte(e,!1)}function X0e(e){let t=0;return e.parent&&!us(e)&&(Hr(e)&&(UK(e)&&(t|=8388608),VK(e)&&(t|=16777216),qK(e)&&(t|=33554432),HK(e)&&(t|=67108864),GK(e)&&(t|=134217728)),$K(e)&&(t|=65536)),t}function G5e(e){return e&65535}function Q0e(e){return e&131071|(e&260046848)>>>23}function $5e(e){return Q0e(X0e(e))}function Nte(e){return Tz(e)|$5e(e)}function Tz(e){let t=Wp(e)?Nd(e.modifiers):0;return(e.flags&8||e.kind===80&&e.flags&4096)&&(t|=32),t}function Nd(e){let t=0;if(e)for(const r of e)t|=mT(r.kind);return t}function mT(e){switch(e){case 126:return 256;case 125:return 1;case 124:return 4;case 123:return 2;case 128:return 64;case 129:return 512;case 95:return 32;case 138:return 128;case 87:return 4096;case 90:return 2048;case 134:return 1024;case 148:return 8;case 164:return 16;case 103:return 8192;case 147:return 16384;case 170:return 32768}return 0}function Y0e(e){return e===57||e===56}function Ite(e){return Y0e(e)||e===54}function aE(e){return e===76||e===77||e===78}function xz(e){return Gr(e)&&aE(e.operatorToken.kind)}function b8(e){return Y0e(e)||e===61}function S8(e){return Gr(e)&&b8(e.operatorToken.kind)}function Bh(e){return e>=64&&e<=79}function kz(e){const t=Cz(e);return t&&!t.isImplements?t.class:void 0}function Cz(e){if(qh(e)){if(Q_(e.parent)&&Qn(e.parent.parent))return{class:e.parent.parent,isImplements:e.parent.token===119};if(yC(e.parent)){const t=mb(e.parent);if(t&&Qn(t))return{class:t,isImplements:!1}}}}function sl(e,t){return Gr(e)&&(t?e.operatorToken.kind===64:Bh(e.operatorToken.kind))&&m_(e.left)}function Z0e(e){return sl(e.parent)&&e.parent.left===e}function Jh(e){if(sl(e,!0)){const t=e.left.kind;return t===210||t===209}return!1}function T8(e){return kz(e)!==void 0}function oc(e){return e.kind===80||x8(e)}function $_(e){switch(e.kind){case 80:return e;case 166:do e=e.left;while(e.kind!==80);return e;case 211:do e=e.expression;while(e.kind!==80);return e}}function oE(e){return e.kind===80||e.kind===110||e.kind===108||e.kind===236||e.kind===211&&oE(e.expression)||e.kind===217&&oE(e.expression)}function x8(e){return bn(e)&&Ie(e.name)&&oc(e.expression)}function k8(e){if(bn(e)){const t=k8(e.expression);if(t!==void 0)return t+"."+D_(e.name)}else if(mo(e)){const t=k8(e.expression);if(t!==void 0&&wc(e.argumentExpression))return t+"."+gb(e.argumentExpression)}else{if(Ie(e))return bi(e.escapedText);if(sd(e))return PE(e)}}function H0(e){return wv(e)&&Gg(e)==="prototype"}function cE(e){return e.parent.kind===166&&e.parent.right===e||e.parent.kind===211&&e.parent.name===e||e.parent.kind===236&&e.parent.name===e}function Ez(e){return!!e.parent&&(bn(e.parent)&&e.parent.name===e||mo(e.parent)&&e.parent.argumentExpression===e)}function Fte(e){return h_(e.parent)&&e.parent.right===e||bn(e.parent)&&e.parent.name===e||d1(e.parent)&&e.parent.right===e}function v5(e){return Gr(e)&&e.operatorToken.kind===104}function Ote(e){return v5(e.parent)&&e===e.parent.right}function Dz(e){return e.kind===210&&e.properties.length===0}function Lte(e){return e.kind===209&&e.elements.length===0}function Xk(e){if(!(!X5e(e)||!e.declarations)){for(const t of e.declarations)if(t.localSymbol)return t.localSymbol}}function X5e(e){return e&&Ir(e.declarations)>0&&In(e.declarations[0],2048)}function b5(e){return kn(Aye,t=>Ho(e,t))}function Q5e(e){const t=[],r=e.length;for(let i=0;i>6|192),t.push(s&63|128)):s<65536?(t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)):s<131072?(t.push(s>>18|240),t.push(s>>12&63|128),t.push(s>>6&63|128),t.push(s&63|128)):E.assert(!1,"Unexpected code point")}return t}function Mte(e){let t="";const r=Q5e(e);let i=0;const s=r.length;let o,c,u,f;for(;i>2,c=(r[i]&3)<<4|r[i+1]>>4,u=(r[i+1]&15)<<2|r[i+2]>>6,f=r[i+2]&63,i+1>=s?u=f=64:i+2>=s&&(f=64),t+=xb.charAt(o)+xb.charAt(c)+xb.charAt(u)+xb.charAt(f),i+=3;return t}function Y5e(e){let t="",r=0;const i=e.length;for(;r>4&3,p=(c&15)<<4|u>>2&15,y=(u&3)<<6|f&63;p===0&&u!==0?i.push(g):y===0&&f!==0?i.push(g,p):i.push(g,p,y),s+=4}return Y5e(i)}function Pz(e,t){const r=ns(t)?t:t.readFile(e);if(!r)return;const i=hU(e,r);return i.error?void 0:i.config}function lE(e,t){return Pz(e,t)||{}}function td(e,t){return!t.directoryExists||t.directoryExists(e)}function zh(e){switch(e.newLine){case 0:return Eye;case 1:case void 0:return Dye}}function Lf(e,t=e){return E.assert(t>=e||t===-1),{pos:e,end:t}}function S5(e,t){return Lf(e.pos,t)}function i1(e,t){return Lf(t,e.end)}function Wh(e){const t=Wp(e)?US(e.modifiers,ql):void 0;return t&&!id(t.end)?i1(e,t.end):e}function Id(e){if(Es(e)||mc(e))return i1(e,e.name.pos);const t=Wp(e)?Mo(e.modifiers):void 0;return t&&!id(t.end)?i1(e,t.end):Wh(e)}function K0e(e){return e.pos===e.end}function wz(e,t){return Lf(e,e+Hs(t).length)}function bb(e,t){return Jte(e,e,t)}function T5(e,t,r){return _p(uE(e,r,!1),uE(t,r,!1),r)}function Bte(e,t,r){return _p(e.end,t.end,r)}function Jte(e,t,r){return _p(uE(e,r,!1),t.end,r)}function C8(e,t,r){return _p(e.end,uE(t,r,!1),r)}function Az(e,t,r,i){const s=uE(t,r,i);return k4(r,e.end,s)}function eye(e,t,r){return k4(r,e.end,t.end)}function zte(e,t){return!_p(e.pos,e.end,t)}function _p(e,t,r){return k4(r,e,t)===0}function uE(e,t,r){return id(e.pos)?-1:la(t.text,e.pos,!1,r)}function Wte(e,t,r,i){const s=la(r.text,e,!1,i),o=Z5e(s,t,r);return k4(r,o??t,s)}function Ute(e,t,r,i){const s=la(r.text,e,!1,i);return k4(r,e,Math.min(t,s))}function Z5e(e,t=0,r){for(;e-- >t;)if(!Ug(r.text.charCodeAt(e)))return e}function Nz(e){const t=ss(e);if(t)switch(t.parent.kind){case 266:case 267:return t===t.parent.name}return!1}function _E(e){return wn(e.declarations,E8)}function E8(e){return Ei(e)&&e.initializer!==void 0}function tye(e){return e.watch&&Ya(e,"watch")}function rd(e){e.close()}function Ko(e){return e.flags&33554432?e.links.checkFlags:0}function Mf(e,t=!1){if(e.valueDeclaration){const r=t&&e.declarations&&kn(e.declarations,N_)||e.flags&32768&&kn(e.declarations,pf)||e.valueDeclaration,i=gv(r);return e.parent&&e.parent.flags&32?i:i&-8}if(Ko(e)&6){const r=e.links.checkFlags,i=r&1024?2:r&256?1:4,s=r&2048?256:0;return i|s}return e.flags&4194304?257:0}function yu(e,t){return e.flags&2097152?t.getAliasedSymbol(e):e}function fE(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags}function x5(e){return pE(e)===1}function gT(e){return pE(e)!==0}function pE(e){const{parent:t}=e;switch(t?.kind){case 217:return pE(t);case 225:case 224:const{operator:r}=t;return r===46||r===47?2:0;case 226:const{left:i,operatorToken:s}=t;return i===e&&Bh(s.kind)?s.kind===64?1:2:0;case 211:return t.name!==e?0:pE(t);case 303:{const o=pE(t.parent);return e===t.name?K5e(o):o}case 304:return e===t.objectAssignmentInitializer?0:pE(t.parent);case 209:return pE(t);default:return 0}}function K5e(e){switch(e){case 0:return 1;case 1:return 0;case 2:return 2;default:return E.assertNever(e)}}function Iz(e,t){if(!e||!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(typeof e[r]=="object"){if(!Iz(e[r],t[r]))return!1}else if(typeof e[r]!="function"&&e[r]!==t[r])return!1;return!0}function o_(e,t){e.forEach(t),e.clear()}function Xg(e,t,r){const{onDeleteValue:i,onExistingValue:s}=r;e.forEach((o,c)=>{const u=t.get(c);u===void 0?(e.delete(c),i(o,c)):s&&s(o,u,c)})}function Qk(e,t,r){Xg(e,t,r);const{createNewValue:i}=r;t.forEach((s,o)=>{e.has(o)||e.set(o,i(o,s))})}function Vte(e){if(e.flags&32){const t=Qg(e);return!!t&&In(t,64)}return!1}function Qg(e){var t;return(t=e.declarations)==null?void 0:t.find(Qn)}function Pn(e){return e.flags&3899393?e.objectFlags:0}function rye(e,t){return!!kd(e,r=>t(r)?!0:void 0)}function k5(e){return!!e&&!!e.declarations&&!!e.declarations[0]&&aw(e.declarations[0])}function qte({moduleSpecifier:e}){return ra(e)?e.text:Wc(e)}function Fz(e){let t;return ds(e,r=>{ip(r)&&(t=r)},r=>{for(let i=r.length-1;i>=0;i--)if(ip(r[i])){t=r[i];break}}),t}function Rp(e,t,r=!0){return e.has(t)?!1:(e.set(t,r),!0)}function hT(e){return Qn(e)||Mu(e)||X_(e)}function Oz(e){return e>=182&&e<=205||e===133||e===159||e===150||e===163||e===151||e===136||e===154||e===155||e===116||e===157||e===146||e===141||e===233||e===319||e===320||e===321||e===322||e===323||e===324||e===325}function co(e){return e.kind===211||e.kind===212}function Hte(e){return e.kind===211?e.name:(E.assert(e.kind===212),e.argumentExpression)}function Gte(e){switch(e.kind){case"text":case"internal":return!0;default:return!1}}function C5(e){return e.kind===275||e.kind===279}function dE(e){for(;co(e);)e=e.expression;return e}function $te(e,t){if(co(e.parent)&&Ez(e))return r(e.parent);function r(i){if(i.kind===211){const s=t(i.name);if(s!==void 0)return s}else if(i.kind===212)if(Ie(i.argumentExpression)||Ja(i.argumentExpression)){const s=t(i.argumentExpression);if(s!==void 0)return s}else return;if(co(i.expression))return r(i.expression);if(Ie(i.expression))return t(i.expression)}}function Yk(e,t){for(;;){switch(e.kind){case 225:e=e.operand;continue;case 226:e=e.left;continue;case 227:e=e.condition;continue;case 215:e=e.tag;continue;case 213:if(t)return e;case 234:case 212:case 211:case 235:case 360:case 238:e=e.expression;continue}return e}}function eFe(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=0,this.mergeId=0,this.parent=void 0,this.members=void 0,this.exports=void 0,this.exportSymbol=void 0,this.constEnumOnlyModule=void 0,this.isReferenced=void 0,this.isAssigned=void 0,this.links=void 0}function tFe(e,t){this.flags=t,(E.isDebugging||Jr)&&(this.checker=e)}function rFe(e,t){this.flags=t,E.isDebugging&&(this.checker=e)}function Xte(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function nFe(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.emitNode=void 0}function iFe(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}function sFe(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||(i=>i)}function Qte(e){Cre.push(e),e(Al)}function Yte(e){Object.assign(Al,e),Zt(Cre,t=>t(Al))}function lg(e,t){return e.replace(/{(\d+)}/g,(r,i)=>""+E.checkDefined(t[+i]))}function Zte(e){Z5=e}function Kte(e){!Z5&&e&&(Z5=e())}function ls(e){return Z5&&Z5[e.key]||e.message}function Zk(e,t,r,i,s,...o){r+i>t.length&&(i=t.length-r),Ree(t,r,i);let c=ls(s);return ut(o)&&(c=lg(c,o)),{file:void 0,start:r,length:i,messageText:c,category:s.category,code:s.code,reportsUnnecessary:s.reportsUnnecessary,fileName:e}}function aFe(e){return e.file===void 0&&e.start!==void 0&&e.length!==void 0&&typeof e.fileName=="string"}function nye(e,t){const r=t.fileName||"",i=t.text.length;E.assertEqual(e.fileName,r),E.assertLessThanOrEqual(e.start,i),E.assertLessThanOrEqual(e.start+e.length,i);const s={file:t,start:e.start,length:e.length,messageText:e.messageText,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary};if(e.relatedInformation){s.relatedInformation=[];for(const o of e.relatedInformation)aFe(o)&&o.fileName===r?(E.assertLessThanOrEqual(o.start,i),E.assertLessThanOrEqual(o.start+o.length,i),s.relatedInformation.push(nye(o,t))):s.relatedInformation.push(o)}return s}function yT(e,t){const r=[];for(const i of e)r.push(nye(i,t));return r}function xl(e,t,r,i,...s){Ree(e.text,t,r);let o=ls(i);return ut(s)&&(o=lg(o,s)),{file:e,start:t,length:r,messageText:o,category:i.category,code:i.code,reportsUnnecessary:i.reportsUnnecessary,reportsDeprecated:i.reportsDeprecated}}function Lz(e,...t){let r=ls(e);return ut(t)&&(r=lg(r,t)),r}function dc(e,...t){let r=ls(e);return ut(t)&&(r=lg(r,t)),{file:void 0,start:void 0,length:void 0,messageText:r,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function E5(e,t){return{file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}}function ps(e,t,...r){let i=ls(t);return ut(r)&&(i=lg(i,r)),{messageText:i,category:t.category,code:t.code,next:e===void 0||Array.isArray(e)?e:[e]}}function ere(e,t){let r=e;for(;r.next;)r=r.next[0];r.next=[t]}function iye(e){return e.file?e.file.path:void 0}function mE(e,t){return D5(e,t)||oFe(e,t)||0}function D5(e,t){return Du(iye(e),iye(t))||xo(e.start,t.start)||xo(e.length,t.length)||xo(e.code,t.code)||sye(e.messageText,t.messageText)||0}function oFe(e,t){return!e.relatedInformation&&!t.relatedInformation?0:e.relatedInformation&&t.relatedInformation?xo(e.relatedInformation.length,t.relatedInformation.length)||Zt(e.relatedInformation,(r,i)=>{const s=t.relatedInformation[i];return mE(r,s)})||0:e.relatedInformation?-1:1}function sye(e,t){if(typeof e=="string"&&typeof t=="string")return Du(e,t);if(typeof e=="string")return-1;if(typeof t=="string")return 1;let r=Du(e.messageText,t.messageText);if(r)return r;if(!e.next&&!t.next)return 0;if(!e.next)return-1;if(!t.next)return 1;const i=Math.min(e.next.length,t.next.length);for(let s=0;st.next.length?1:0}function D8(e){return e===4||e===2||e===1||e===6?1:0}function aye(e){if(e.transformFlags&2)return qu(e)||qv(e)?e:ds(e,aye)}function cFe(e){return e.isDeclarationFile?void 0:aye(e)}function lFe(e){return(e.impliedNodeFormat===99||Jc(e.fileName,[".cjs",".cts",".mjs",".mts"]))&&!e.isDeclarationFile?!0:void 0}function P8(e){switch(tre(e)){case 3:return s=>{s.externalModuleIndicator=yw(s)||!s.isDeclarationFile||void 0};case 1:return s=>{s.externalModuleIndicator=yw(s)};case 2:const t=[yw];(e.jsx===4||e.jsx===5)&&t.push(cFe),t.push(lFe);const r=ed(...t);return s=>void(s.externalModuleIndicator=r(s))}}function Da(e){return e.target??(e.module===100&&9||e.module===199&&99||1)}function Ul(e){return typeof e.module=="number"?e.module:Da(e)>=2?5:1}function P5(e){return e>=5&&e<=99}function Vl(e){let t=e.moduleResolution;if(t===void 0)switch(Ul(e)){case 1:t=2;break;case 100:t=3;break;case 199:t=99;break;default:t=1;break}return t}function tre(e){return e.moduleDetection||(Ul(e)===100||Ul(e)===199?3:2)}function w5(e){switch(Ul(e)){case 1:case 2:case 5:case 6:case 7:case 99:case 100:case 199:return!0;default:return!1}}function nd(e){return!!(e.isolatedModules||e.verbatimModuleSyntax)}function Mz(e){return e.verbatimModuleSyntax||e.isolatedModules&&e.preserveValueImports}function rre(e){return e.allowUnreachableCode===!1}function nre(e){return e.allowUnusedLabels===!1}function A5(e){return!!(Rf(e)&&e.declarationMap)}function xm(e){if(e.esModuleInterop!==void 0)return e.esModuleInterop;switch(Ul(e)){case 100:case 199:return!0}}function vT(e){return e.allowSyntheticDefaultImports!==void 0?e.allowSyntheticDefaultImports:xm(e)||Ul(e)===4||Vl(e)===100}function bT(e){return e>=3&&e<=99||e===100}function N5(e){return!!e.noDtsResolution||Vl(e)!==100}function Rz(e){const t=Vl(e);if(!bT(t))return!1;if(e.resolvePackageJsonExports!==void 0)return e.resolvePackageJsonExports;switch(t){case 3:case 99:case 100:return!0}return!1}function oye(e){const t=Vl(e);if(!bT(t))return!1;if(e.resolvePackageJsonExports!==void 0)return e.resolvePackageJsonExports;switch(t){case 3:case 99:case 100:return!0}return!1}function Rv(e){return e.resolveJsonModule!==void 0?e.resolveJsonModule:Vl(e)===100}function Rf(e){return!!(e.declaration||e.composite)}function Sb(e){return!!(e.preserveConstEnums||nd(e))}function w8(e){return!!(e.incremental||e.composite)}function fp(e,t){return e[t]===void 0?!!e.strict:!!e[t]}function s1(e){return e.allowJs===void 0?!!e.checkJs:e.allowJs}function A8(e){return e.useDefineForClassFields===void 0?Da(e)>=9:e.useDefineForClassFields}function ire(e){return e.useDefineForClassFields!==!1&&Da(e)>=9}function sre(e,t){return kk(t,e,PU)}function are(e,t){return kk(t,e,wU)}function ore(e,t){return kk(t,e,AU)}function I5(e,t){return t.strictFlag?fp(e,t.name):t.allowJsFlag?s1(e):e[t.name]}function F5(e){const t=e.jsx;return t===2||t===4||t===5}function O5(e,t){const r=t?.pragmas.get("jsximportsource"),i=es(r)?r[r.length-1]:r;return e.jsx===4||e.jsx===5||e.jsxImportSource||i?i?.arguments.factory||e.jsxImportSource||"react":void 0}function L5(e,t){return e?`${e}/${t.jsx===5?"jsx-dev-runtime":"jsx-runtime"}`:void 0}function jz(e){let t=!1;for(let r=0;rs,getSymlinkedDirectories:()=>r,getSymlinkedDirectoriesByRealpath:()=>i,setSymlinkedFile:(u,f)=>(s||(s=new Map)).set(u,f),setSymlinkedDirectory:(u,f)=>{let g=fo(u,e,t);xE(g)||(g=Sl(g),f!==!1&&!r?.has(g)&&(i||(i=of())).add(f.realPath,u),(r||(r=new Map)).set(g,f))},setSymlinksFromResolutions(u,f,g){E.assert(!o),o=!0,u(p=>c(this,p.resolvedModule)),f(p=>c(this,p.resolvedTypeReferenceDirective)),g.forEach(p=>c(this,p.resolvedTypeReferenceDirective))},hasProcessedResolutions:()=>o};function c(u,f){if(!f||!f.originalPath||!f.resolvedFileName)return;const{resolvedFileName:g,originalPath:p}=f;u.setSymlinkedFile(fo(p,e,t),g);const[y,S]=uFe(g,p,e,t)||ze;y&&S&&u.setSymlinkedDirectory(S,{real:Sl(y),realPath:Sl(fo(y,e,t))})}}function uFe(e,t,r,i){const s=fl(is(e,r)),o=fl(is(t,r));let c=!1;for(;s.length>=2&&o.length>=2&&!cye(s[s.length-2],i)&&!cye(o[o.length-2],i)&&i(s[s.length-1])===i(o[o.length-1]);)s.pop(),o.pop(),c=!0;return c?[N0(s),N0(o)]:void 0}function cye(e,t){return e!==void 0&&(t(e)==="node_modules"||Qi(e,"@"))}function _Fe(e){return BB(e.charCodeAt(0))?e.slice(1):void 0}function Jz(e,t,r){const i=Dj(e,t,r);return i===void 0?void 0:_Fe(i)}function lye(e){return e.replace(lW,fFe)}function fFe(e){return"\\"+e}function gE(e,t,r){const i=M5(e,t,r);return!i||!i.length?void 0:`^(${i.map(c=>`(${c})`).join("|")})${r==="exclude"?"($|/)":"$"}`}function M5(e,t,r){if(!(e===void 0||e.length===0))return ta(e,i=>i&&uye(i,t,r,wre[r]))}function zz(e){return!/[.*?]/.test(e)}function Wz(e,t,r){const i=e&&uye(e,t,r,wre[r]);return i&&`^(${i})${r==="exclude"?"($|/)":"$"}`}function uye(e,t,r,{singleAsteriskRegexFragment:i,doubleAsteriskRegexFragment:s,replaceWildcardCharacter:o}){let c="",u=!1;const f=rP(e,t),g=Sa(f);if(r!=="exclude"&&g==="**")return;f[0]=Vy(f[0]),zz(g)&&f.push("**","*");let p=0;for(let y of f){if(y==="**")c+=s;else if(r==="directories"&&(c+="(",p++),u&&(c+=Co),r!=="exclude"){let S="";y.charCodeAt(0)===42?(S+="([^./]"+i+")?",y=y.substr(1)):y.charCodeAt(0)===63&&(S+="[^./]",y=y.substr(1)),S+=y.replace(lW,o),S!==y&&(c+=_W),c+=S}else c+=y.replace(lW,o);u=!0}for(;p>0;)c+=")?",p--;return c}function cre(e,t){return e==="*"?t:e==="?"?"[^/]":"\\"+e}function R5(e,t,r,i,s){e=qs(e),s=qs(s);const o=Hn(s,e);return{includeFilePatterns:Yt(M5(r,o,"files"),c=>`^${c}$`),includeFilePattern:gE(r,o,"files"),includeDirectoryPattern:gE(r,o,"directories"),excludePattern:gE(t,o,"exclude"),basePaths:pFe(e,r,i)}}function G0(e,t){return new RegExp(e,t?"":"i")}function Uz(e,t,r,i,s,o,c,u,f){e=qs(e),o=qs(o);const g=R5(e,r,i,s,o),p=g.includeFilePatterns&&g.includeFilePatterns.map(O=>G0(O,s)),y=g.includeDirectoryPattern&&G0(g.includeDirectoryPattern,s),S=g.excludePattern&&G0(g.excludePattern,s),T=p?p.map(()=>[]):[[]],C=new Map,w=tu(s);for(const O of g.basePaths)D(O,Hn(o,O),c);return Np(T);function D(O,z,W){const X=w(f(z));if(C.has(X))return;C.set(X,!0);const{files:J,directories:ie}=u(O);for(const B of qS(J,Du)){const Y=Hn(O,B),ae=Hn(z,B);if(!(t&&!Jc(Y,t))&&!(S&&S.test(ae)))if(!p)T[0].push(Y);else{const _e=Dc(p,$=>$.test(ae));_e!==-1&&T[_e].push(Y)}}if(!(W!==void 0&&(W--,W===0)))for(const B of qS(ie,Du)){const Y=Hn(O,B),ae=Hn(z,B);(!y||y.test(ae))&&(!S||!S.test(ae))&&D(Y,ae,W)}}}function pFe(e,t,r){const i=[e];if(t){const s=[];for(const o of t){const c=C_(o)?o:qs(Hn(e,o));s.push(dFe(c))}s.sort(d4(!r));for(const o of s)qi(i,c=>!dm(c,o,e,!r))&&i.push(o)}return i}function dFe(e){const t=FZ(e,Pye);return t<0?ZS(e)?Vy(qn(e)):e:e.substring(0,e.lastIndexOf(Co,t))}function j5(e,t){return t||B5(e)||3}function B5(e){switch(e.substr(e.lastIndexOf(".")).toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}function hE(e,t){const r=e&&s1(e);if(!t||t.length===0)return r?K5:nC;const i=r?K5:nC,s=Np(i);return[...i,...Ii(t,c=>c.scriptKind===7||r&&mFe(c.scriptKind)&&!s.includes(c.extension)?[c.extension]:void 0)]}function N8(e,t){return!e||!Rv(e)?t:t===K5?Nye:t===nC?wye:[...t,[".json"]]}function mFe(e){return e===1||e===2}function jv(e){return ut(iC,t=>Ho(e,t))}function Tb(e){return ut(fW,t=>Ho(e,t))}function lre({imports:e},t=ed(jv,Tb)){return ic(e,({text:r})=>U_(r)&&!Jc(r,U8)?t(r):void 0)||!1}function Vz(e,t,r,i){if(e==="js"||t===99)return FC(r)&&s()!==2?3:2;if(e==="minimal")return 0;if(e==="index")return 1;if(!FC(r))return lre(i)?2:0;return s();function s(){let o=!1;const c=i.imports.length?i.imports.map(u=>u.text):Iu(i)?gFe(i).map(u=>u.arguments[0].text):ze;for(const u of c)if(U_(u)){if(Jc(u,U8))continue;if(Tb(u))return 3;jv(u)&&(o=!0)}return o?2:0}}function gFe(e){let t=0,r;for(const i of e.statements){if(t>3)break;$J(i)?r=Xi(r,i.declarationList.declarations.map(s=>s.initializer)):kl(i)&&g_(i.expression,!0)?r=lr(r,i.expression):t++}return r||ze}function ure(e,t,r){if(!e)return!1;const i=hE(t,r);for(const s of Np(N8(t,i)))if(Ho(e,s))return!0;return!1}function _ye(e){const t=e.match(/\//g);return t?t.length:0}function I8(e,t){return xo(_ye(e),_ye(t))}function Ou(e){for(const t of mW){const r=_re(e,t);if(r!==void 0)return r}return e}function _re(e,t){return Ho(e,t)?F8(e,t):void 0}function F8(e,t){return e.substring(0,e.length-t.length)}function a1(e,t){return nP(e,t,mW,!1)}function Kk(e){const t=e.indexOf("*");return t===-1?e:e.indexOf("*",t+1)!==-1?void 0:{prefix:e.substr(0,t),suffix:e.substr(t+1)}}function J5(e){return Ii(Jg(e),t=>Kk(t))}function id(e){return!(e>=0)}function z5(e){return e===".ts"||e===".tsx"||e===".d.ts"||e===".cts"||e===".mts"||e===".d.mts"||e===".d.cts"||Qi(e,".d.")&&fc(e,".ts")}function yE(e){return z5(e)||e===".json"}function ST(e){const t=ug(e);return t!==void 0?t:E.fail(`File ${e} has unknown extension.`)}function fye(e){return ug(e)!==void 0}function ug(e){return kn(mW,t=>Ho(e,t))}function O8(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs}function qz(e,t){const r=[];for(const i of e){if(i===t)return t;ns(i)||r.push(i)}return Ej(r,i=>i,t)}function Hz(e,t){const r=e.indexOf(t);return E.assert(r!==-1),e.slice(r)}function ua(e,...t){return t.length&&(e.relatedInformation||(e.relatedInformation=[]),E.assert(e.relatedInformation!==ze,"Diagnostic had empty array singleton for related info, but is still being constructed!"),e.relatedInformation.push(...t)),e}function fre(e,t){E.assert(e.length!==0);let r=t(e[0]),i=r;for(let s=1;si&&(i=o)}return{min:r,max:i}}function Gz(e){return{pos:cb(e),end:e.end}}function $z(e,t){const r=t.pos-1,i=Math.min(e.text.length,la(e.text,t.end)+1);return{pos:r,end:i}}function vE(e,t,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||r.isSourceOfProjectReferenceRedirect(e.fileName)}function W5(e,t){return e===t||typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null&&WZ(e,t,W5)}function bE(e){let t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:const g=e.length-1;let p=0;for(;e.charCodeAt(p)===48;)p++;return e.slice(p,g)||"0"}const r=2,i=e.length-1,s=(i-r)*t,o=new Uint16Array((s>>>4)+(s&15?1:0));for(let g=i-1,p=0;g>=r;g--,p+=t){const y=p>>>4,S=e.charCodeAt(g),C=(S<=57?S-48:10+S-(S<=70?65:97))<<(p&15);o[y]|=C;const w=C>>>16;w&&(o[y+1]|=w)}let c="",u=o.length-1,f=!0;for(;f;){let g=0;f=!1;for(let p=u;p>=0;p--){const y=g<<16|o[p],S=y/10|0;o[p]=S,g=y-S*10,S&&!f&&(u=p,f=!0)}c=g+c}return c}function Bv({negative:e,base10Value:t}){return(e&&t!=="0"?"-":"")+t}function pre(e){if(U5(e,!1))return Xz(e)}function Xz(e){const t=e.startsWith("-"),r=bE(`${t?e.slice(1):e}n`);return{negative:t,base10Value:r}}function U5(e,t){if(e==="")return!1;const r=Ih(99,!1);let i=!0;r.setOnError(()=>i=!1),r.setText(e+"n");let s=r.scan();const o=s===41;o&&(s=r.scan());const c=r.getTokenFlags();return i&&s===10&&r.getTokenEnd()===e.length+1&&!(c&512)&&(!t||e===Bv({negative:o,base10Value:bE(r.getTokenValue())}))}function o1(e){return!!(e.flags&33554432)||XI(e)||vFe(e)||yFe(e)||!(sg(e)||hFe(e))}function hFe(e){return Ie(e)&&Y_(e.parent)&&e.parent.name===e}function yFe(e){for(;e.kind===80||e.kind===211;)e=e.parent;if(e.kind!==167)return!1;if(In(e.parent,64))return!0;const t=e.parent.parent.kind;return t===264||t===187}function vFe(e){if(e.kind!==80)return!1;const t=Ar(e.parent,r=>{switch(r.kind){case 298:return!0;case 211:case 233:return!1;default:return"quit"}});return t?.token===119||t?.parent.kind===264}function dre(e){return mp(e)&&Ie(e.typeName)}function mre(e,t=w0){if(e.length<2)return!0;const r=e[0];for(let i=1,s=e.length;ie.includes(t))}function yre(e){if(!e.parent)return;switch(e.kind){case 168:const{parent:r}=e;return r.kind===195?void 0:r.typeParameters;case 169:return e.parent.parameters;case 204:return e.parent.templateSpans;case 239:return e.parent.templateSpans;case 170:{const{parent:i}=e;return Lb(i)?i.modifiers:void 0}case 298:return e.parent.heritageClauses}const{parent:t}=e;if(xk(e))return JT(e.parent)?void 0:e.parent.tags;switch(t.kind){case 187:case 264:return ib(e)?t.members:void 0;case 192:case 193:return t.types;case 189:case 209:case 361:case 275:case 279:return t.elements;case 210:case 292:return t.properties;case 213:case 214:return Si(e)?t.typeArguments:t.expression===e?void 0:t.arguments;case 284:case 288:return AP(e)?t.children:void 0;case 286:case 285:return Si(e)?t.typeArguments:void 0;case 241:case 296:case 297:case 268:return t.statements;case 269:return t.clauses;case 263:case 231:return Pl(e)?t.members:void 0;case 266:return $v(e)?t.members:void 0;case 312:return t.statements}}function V5(e){if(!e.typeParameters){if(ut(e.parameters,t=>!Wl(t)))return!0;if(e.kind!==219){const t=bl(e.parameters);if(!(t&&Ov(t)))return!0}}return!1}function kE(e){return e==="Infinity"||e==="-Infinity"||e==="NaN"}function vre(e){return e.kind===260&&e.parent.kind===299}function Yz(e){const t=e.valueDeclaration&&Tm(e.valueDeclaration);return!!t&&(us(t)||vre(t))}function Jv(e){return e.kind===218||e.kind===219}function zv(e){return e.replace(/\$/gm,()=>"\\$")}function _g(e){return(+e).toString()===e}function q5(e,t,r,i,s){const o=s&&e==="new";return!o&&lf(e,t)?I.createIdentifier(e):!i&&!o&&_g(e)&&+e>=0?I.createNumericLiteral(+e):I.createStringLiteral(e,!!r)}function CE(e){return!!(e.flags&262144&&e.isThisType)}function H5(e){let t=0,r=0,i=0,s=0,o;(g=>{g[g.BeforeNodeModules=0]="BeforeNodeModules",g[g.NodeModules=1]="NodeModules",g[g.Scope=2]="Scope",g[g.PackageContent=3]="PackageContent"})(o||(o={}));let c=0,u=0,f=0;for(;u>=0;)switch(c=u,u=e.indexOf("/",c+1),f){case 0:e.indexOf(Am,c)===c&&(t=c,r=u,f=1);break;case 1:case 2:f===1&&e.charAt(c+1)==="@"?f=2:(i=u,f=3);break;case 3:e.indexOf(Am,c)===c?f=1:f=3;break}return s=c,f>1?{topLevelNodeModulesIndex:t,topLevelPackageNameIndex:r,packageRootIndex:i,fileNameIndex:s}:void 0}function pye(e){var t;return e.kind===348?(t=e.typeExpression)==null?void 0:t.type:e.type}function rC(e){switch(e.kind){case 168:case 263:case 264:case 265:case 266:case 353:case 345:case 347:return!0;case 273:return e.isTypeOnly;case 276:case 281:return e.parent.parent.isTypeOnly;default:return!1}}function L8(e){return p1(e)||ec(e)||Zc(e)||Vc(e)||Mu(e)||rC(e)||vc(e)&&!xv(e)&&!Dd(e)}function M8(e){if(!bP(e))return!1;const{isBracketed:t,typeExpression:r}=e;return t||!!r&&r.type.kind===323}function Zz(e,t){if(e.length===0)return!1;const r=e.charCodeAt(0);return r===35?e.length>1&&eg(e.charCodeAt(1),t):eg(r,t)}function bre(e){var t;return((t=kW(e))==null?void 0:t.kind)===0}function R8(e){return Hr(e)&&(e.type&&e.type.kind===323||mk(e).some(({isBracketed:t,typeExpression:r})=>t||!!r&&r.type.kind===323))}function EE(e){switch(e.kind){case 172:case 171:return!!e.questionToken;case 169:return!!e.questionToken||R8(e);case 355:case 348:return M8(e);default:return!1}}function Sre(e){const t=e.kind;return(t===211||t===212)&&MT(e.expression)}function Kz(e){return Hr(e)&&y_(e)&&q_(e)&&!!rJ(e)}function eW(e){return E.checkDefined(G5(e))}function G5(e){const t=rJ(e);return t&&t.typeExpression&&t.typeExpression.type}function DE(e){return Ie(e)?e.escapedText:TT(e)}function j8(e){return Ie(e)?an(e):PE(e)}function Tre(e){const t=e.kind;return t===80||t===295}function TT(e){return`${e.namespace.escapedText}:${an(e.name)}`}function PE(e){return`${an(e.namespace)}:${an(e.name)}`}function tW(e){return Ie(e)?an(e):PE(e)}function pp(e){return!!(e.flags&8576)}function dp(e){return e.flags&8192?e.escapedName:e.flags&384?zo(""+e.value):E.fail()}function $5(e){return!!e&&(bn(e)||mo(e)||Gr(e))}function xre(e){return e===void 0?!1:!!LC(e.attributes)}var X5,X0,B8,Q5,J8,Y5,rW,nW,dye,mye,iW,gye,hye,sW,aW,oW,cW,yye,vye,bye,Sye,Tye,kre,xye,kye,Cye,wE,xb,Eye,Dye,Al,Cre,Z5,lW,Pye,uW,_W,Ere,Dre,Pre,wre,nC,fW,wye,Aye,pW,iC,K5,Nye,z8,W8,U8,dW,mW,eF,SFe=Nt({"src/compiler/utilities.ts"(){"use strict";Ns(),X5=[],X0="tslib",B8=160,Q5=1e6,J8=k5e(),Y5=Vu(()=>new Map(Object.entries({Array:new Map(Object.entries({es2015:["find","findIndex","fill","copyWithin","entries","keys","values"],es2016:["includes"],es2019:["flat","flatMap"],es2022:["at"],es2023:["findLastIndex","findLast"]})),Iterator:new Map(Object.entries({es2015:ze})),AsyncIterator:new Map(Object.entries({es2015:ze})),Atomics:new Map(Object.entries({es2017:ze})),SharedArrayBuffer:new Map(Object.entries({es2017:ze})),AsyncIterable:new Map(Object.entries({es2018:ze})),AsyncIterableIterator:new Map(Object.entries({es2018:ze})),AsyncGenerator:new Map(Object.entries({es2018:ze})),AsyncGeneratorFunction:new Map(Object.entries({es2018:ze})),RegExp:new Map(Object.entries({es2015:["flags","sticky","unicode"],es2018:["dotAll"]})),Reflect:new Map(Object.entries({es2015:["apply","construct","defineProperty","deleteProperty","get","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"]})),ArrayConstructor:new Map(Object.entries({es2015:["from","of"]})),ObjectConstructor:new Map(Object.entries({es2015:["assign","getOwnPropertySymbols","keys","is","setPrototypeOf"],es2017:["values","entries","getOwnPropertyDescriptors"],es2019:["fromEntries"],es2022:["hasOwn"]})),NumberConstructor:new Map(Object.entries({es2015:["isFinite","isInteger","isNaN","isSafeInteger","parseFloat","parseInt"]})),Math:new Map(Object.entries({es2015:["clz32","imul","sign","log10","log2","log1p","expm1","cosh","sinh","tanh","acosh","asinh","atanh","hypot","trunc","fround","cbrt"]})),Map:new Map(Object.entries({es2015:["entries","keys","values"]})),Set:new Map(Object.entries({es2015:["entries","keys","values"]})),PromiseConstructor:new Map(Object.entries({es2015:["all","race","reject","resolve"],es2020:["allSettled"],es2021:["any"]})),Symbol:new Map(Object.entries({es2015:["for","keyFor"],es2019:["description"]})),WeakMap:new Map(Object.entries({es2015:["entries","keys","values"]})),WeakSet:new Map(Object.entries({es2015:["entries","keys","values"]})),String:new Map(Object.entries({es2015:["codePointAt","includes","endsWith","normalize","repeat","startsWith","anchor","big","blink","bold","fixed","fontcolor","fontsize","italics","link","small","strike","sub","sup"],es2017:["padStart","padEnd"],es2019:["trimStart","trimEnd","trimLeft","trimRight"],es2020:["matchAll"],es2021:["replaceAll"],es2022:["at"]})),StringConstructor:new Map(Object.entries({es2015:["fromCodePoint","raw"]})),DateTimeFormat:new Map(Object.entries({es2017:["formatToParts"]})),Promise:new Map(Object.entries({es2015:ze,es2018:["finally"]})),RegExpMatchArray:new Map(Object.entries({es2018:["groups"]})),RegExpExecArray:new Map(Object.entries({es2018:["groups"]})),Intl:new Map(Object.entries({es2018:["PluralRules"]})),NumberFormat:new Map(Object.entries({es2018:["formatToParts"]})),SymbolConstructor:new Map(Object.entries({es2020:["matchAll"]})),DataView:new Map(Object.entries({es2020:["setBigInt64","setBigUint64","getBigInt64","getBigUint64"]})),BigInt:new Map(Object.entries({es2020:ze})),RelativeTimeFormat:new Map(Object.entries({es2020:["format","formatToParts","resolvedOptions"]})),Int8Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Uint8Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Uint8ClampedArray:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Int16Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Uint16Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Int32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Uint32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Float32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),Float64Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast"]})),BigInt64Array:new Map(Object.entries({es2020:ze,es2022:["at"],es2023:["findLastIndex","findLast"]})),BigUint64Array:new Map(Object.entries({es2020:ze,es2022:["at"],es2023:["findLastIndex","findLast"]})),Error:new Map(Object.entries({es2022:["cause"]}))}))),rW=(e=>(e[e.None=0]="None",e[e.NeverAsciiEscape=1]="NeverAsciiEscape",e[e.JsxAttributeEscape=2]="JsxAttributeEscape",e[e.TerminateUnterminatedLiterals=4]="TerminateUnterminatedLiterals",e[e.AllowNumericSeparator=8]="AllowNumericSeparator",e))(rW||{}),nW=/^(\/\/\/\s*/,dye=/^(\/\/\/\s*/,mye=/^(\/\/\/\s*/,iW=/^(\/\/\/\s*/,gye=/^\/\/\/\s*/,hye=/^(\/\/\/\s*/,sW=(e=>(e[e.None=0]="None",e[e.Definite=1]="Definite",e[e.Compound=2]="Compound",e))(sW||{}),aW=(e=>(e[e.Normal=0]="Normal",e[e.Generator=1]="Generator",e[e.Async=2]="Async",e[e.Invalid=4]="Invalid",e[e.AsyncGenerator=3]="AsyncGenerator",e))(aW||{}),oW=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(oW||{}),cW=(e=>(e[e.Comma=0]="Comma",e[e.Spread=1]="Spread",e[e.Yield=2]="Yield",e[e.Assignment=3]="Assignment",e[e.Conditional=4]="Conditional",e[e.Coalesce=4]="Coalesce",e[e.LogicalOR=5]="LogicalOR",e[e.LogicalAND=6]="LogicalAND",e[e.BitwiseOR=7]="BitwiseOR",e[e.BitwiseXOR=8]="BitwiseXOR",e[e.BitwiseAND=9]="BitwiseAND",e[e.Equality=10]="Equality",e[e.Relational=11]="Relational",e[e.Shift=12]="Shift",e[e.Additive=13]="Additive",e[e.Multiplicative=14]="Multiplicative",e[e.Exponentiation=15]="Exponentiation",e[e.Unary=16]="Unary",e[e.Update=17]="Update",e[e.LeftHandSide=18]="LeftHandSide",e[e.Member=19]="Member",e[e.Primary=20]="Primary",e[e.Highest=20]="Highest",e[e.Lowest=0]="Lowest",e[e.Invalid=-1]="Invalid",e))(cW||{}),yye=/\$\{/g,vye=/[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,bye=/[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Sye=/\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g,Tye=new Map(Object.entries({" ":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","\x85":"\\u0085","\r\n":"\\r\\n"})),kre=/[^\u0000-\u007F]/g,xye=/["\u0000-\u001f\u2028\u2029\u0085]/g,kye=/['\u0000-\u001f\u2028\u2029\u0085]/g,Cye=new Map(Object.entries({'"':""","'":"'"})),wE=[""," "],xb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Eye=`\r +`,Dye=` +`,Al={getNodeConstructor:()=>Xte,getTokenConstructor:()=>nFe,getIdentifierConstructor:()=>iFe,getPrivateIdentifierConstructor:()=>Xte,getSourceFileConstructor:()=>Xte,getSymbolConstructor:()=>eFe,getTypeConstructor:()=>tFe,getSignatureConstructor:()=>rFe,getSourceMapSourceConstructor:()=>sFe},Cre=[],lW=/[^\w\s/]/g,Pye=[42,63],uW=["node_modules","bower_components","jspm_packages"],_W=`(?!(${uW.join("|")})(/|$))`,Ere={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:`(/${_W}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>cre(e,Ere.singleAsteriskRegexFragment)},Dre={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:`(/${_W}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>cre(e,Dre.singleAsteriskRegexFragment)},Pre={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/.+?)?",replaceWildcardCharacter:e=>cre(e,Pre.singleAsteriskRegexFragment)},wre={files:Ere,directories:Dre,exclude:Pre},nC=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]],fW=Np(nC),wye=[...nC,[".json"]],Aye=[".d.ts",".d.cts",".d.mts",".cts",".mts",".ts",".tsx"],pW=[[".js",".jsx"],[".mjs"],[".cjs"]],iC=Np(pW),K5=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]],Nye=[...K5,[".json"]],z8=[".d.ts",".d.cts",".d.mts"],W8=[".ts",".cts",".mts",".tsx"],U8=[".mts",".d.mts",".mjs",".cts",".d.cts",".cjs"],dW=(e=>(e[e.Minimal=0]="Minimal",e[e.Index=1]="Index",e[e.JsExtension=2]="JsExtension",e[e.TsExtension=3]="TsExtension",e))(dW||{}),mW=[".d.ts",".d.mts",".d.cts",".mjs",".mts",".cjs",".cts",".ts",".js",".tsx",".jsx",".json"],eF={files:ze,directories:ze}}});function Are(){let e,t,r,i,s;return{createBaseSourceFileNode:o,createBaseIdentifierNode:c,createBasePrivateIdentifierNode:u,createBaseTokenNode:f,createBaseNode:g};function o(p){return new(s||(s=Al.getSourceFileConstructor()))(p,-1,-1)}function c(p){return new(r||(r=Al.getIdentifierConstructor()))(p,-1,-1)}function u(p){return new(i||(i=Al.getPrivateIdentifierConstructor()))(p,-1,-1)}function f(p){return new(t||(t=Al.getTokenConstructor()))(p,-1,-1)}function g(p){return new(e||(e=Al.getNodeConstructor()))(p,-1,-1)}}var TFe=Nt({"src/compiler/factory/baseNodeFactory.ts"(){"use strict";Ns()}});function Nre(e){let t,r;return{getParenthesizeLeftSideOfBinaryForOperator:i,getParenthesizeRightSideOfBinaryForOperator:s,parenthesizeLeftSideOfBinary:g,parenthesizeRightSideOfBinary:p,parenthesizeExpressionOfComputedPropertyName:y,parenthesizeConditionOfConditionalExpression:S,parenthesizeBranchOfConditionalExpression:T,parenthesizeExpressionOfExportDefault:C,parenthesizeExpressionOfNew:w,parenthesizeLeftSideOfAccess:D,parenthesizeOperandOfPostfixUnary:O,parenthesizeOperandOfPrefixUnary:z,parenthesizeExpressionsOfCommaDelimitedList:W,parenthesizeExpressionForDisallowedComma:X,parenthesizeExpressionOfExpressionStatement:J,parenthesizeConciseBodyOfArrowFunction:ie,parenthesizeCheckTypeOfConditionalType:B,parenthesizeExtendsTypeOfConditionalType:Y,parenthesizeConstituentTypesOfUnionType:_e,parenthesizeConstituentTypeOfUnionType:ae,parenthesizeConstituentTypesOfIntersectionType:H,parenthesizeConstituentTypeOfIntersectionType:$,parenthesizeOperandOfTypeOperator:K,parenthesizeOperandOfReadonlyTypeOperator:oe,parenthesizeNonArrayTypeOfPostfixType:Se,parenthesizeElementTypesOfTupleType:se,parenthesizeElementTypeOfTupleType:Z,parenthesizeTypeOfOptionalType:Te,parenthesizeTypeArguments:he,parenthesizeLeadingTypeArgument:Me};function i(be){t||(t=new Map);let lt=t.get(be);return lt||(lt=pt=>g(be,pt),t.set(be,lt)),lt}function s(be){r||(r=new Map);let lt=r.get(be);return lt||(lt=pt=>p(be,void 0,pt),r.set(be,lt)),lt}function o(be,lt,pt,me){const Oe=d8(226,be),Xe=fz(226,be),it=Fp(lt);if(!pt&<.kind===219&&Oe>3)return!0;const mt=tE(it);switch(xo(mt,Oe)){case-1:return!(!pt&&Xe===1&<.kind===229);case 1:return!1;case 0:if(pt)return Xe===1;if(Gr(it)&&it.operatorToken.kind===be){if(c(be))return!1;if(be===40){const ot=me?u(me):0;if(I4(ot)&&ot===u(it))return!1}}return _z(it)===0}}function c(be){return be===42||be===52||be===51||be===53||be===28}function u(be){if(be=Fp(be),I4(be.kind))return be.kind;if(be.kind===226&&be.operatorToken.kind===40){if(be.cachedLiteralKind!==void 0)return be.cachedLiteralKind;const lt=u(be.left),pt=I4(lt)&<===u(be.right)?lt:0;return be.cachedLiteralKind=pt,pt}return 0}function f(be,lt,pt,me){return Fp(lt).kind===217?lt:o(be,lt,pt,me)?e.createParenthesizedExpression(lt):lt}function g(be,lt){return f(be,lt,!0)}function p(be,lt,pt){return f(be,pt,!1,lt)}function y(be){return HE(be)?e.createParenthesizedExpression(be):be}function S(be){const lt=d8(227,58),pt=Fp(be),me=tE(pt);return xo(me,lt)!==1?e.createParenthesizedExpression(be):be}function T(be){const lt=Fp(be);return HE(lt)?e.createParenthesizedExpression(be):be}function C(be){const lt=Fp(be);let pt=HE(lt);if(!pt)switch(Yk(lt,!1).kind){case 231:case 218:pt=!0}return pt?e.createParenthesizedExpression(be):be}function w(be){const lt=Yk(be,!0);switch(lt.kind){case 213:return e.createParenthesizedExpression(be);case 214:return lt.arguments?be:e.createParenthesizedExpression(be)}return D(be)}function D(be,lt){const pt=Fp(be);return m_(pt)&&(pt.kind!==214||pt.arguments)&&(lt||!gu(pt))?be:tt(e.createParenthesizedExpression(be),be)}function O(be){return m_(be)?be:tt(e.createParenthesizedExpression(be),be)}function z(be){return gJ(be)?be:tt(e.createParenthesizedExpression(be),be)}function W(be){const lt=Yc(be,X);return tt(e.createNodeArray(lt,be.hasTrailingComma),be)}function X(be){const lt=Fp(be),pt=tE(lt),me=d8(226,28);return pt>me?be:tt(e.createParenthesizedExpression(be),be)}function J(be){const lt=Fp(be);if(Rs(lt)){const me=lt.expression,Oe=Fp(me).kind;if(Oe===218||Oe===219){const Xe=e.updateCallExpression(lt,tt(e.createParenthesizedExpression(me),me),lt.typeArguments,lt.arguments);return e.restoreOuterExpressions(be,Xe,8)}}const pt=Yk(lt,!1).kind;return pt===210||pt===218?tt(e.createParenthesizedExpression(be),be):be}function ie(be){return!Ss(be)&&(HE(be)||Yk(be,!1).kind===210)?tt(e.createParenthesizedExpression(be),be):be}function B(be){switch(be.kind){case 184:case 185:case 194:return e.createParenthesizedType(be)}return be}function Y(be){switch(be.kind){case 194:return e.createParenthesizedType(be)}return be}function ae(be){switch(be.kind){case 192:case 193:return e.createParenthesizedType(be)}return B(be)}function _e(be){return e.createNodeArray(Yc(be,ae))}function $(be){switch(be.kind){case 192:case 193:return e.createParenthesizedType(be)}return ae(be)}function H(be){return e.createNodeArray(Yc(be,$))}function K(be){switch(be.kind){case 193:return e.createParenthesizedType(be)}return $(be)}function oe(be){switch(be.kind){case 198:return e.createParenthesizedType(be)}return K(be)}function Se(be){switch(be.kind){case 195:case 198:case 186:return e.createParenthesizedType(be)}return K(be)}function se(be){return e.createNodeArray(Yc(be,Z))}function Z(be){return ve(be)?e.createParenthesizedType(be):be}function ve(be){return gC(be)?be.postfix:RE(be)||pg(be)||ME(be)||FT(be)?ve(be.type):fC(be)?ve(be.falseType):u1(be)||_C(be)?ve(Sa(be.types)):NT(be)?!!be.typeParameter.constraint&&ve(be.typeParameter.constraint):!1}function Te(be){return ve(be)?e.createParenthesizedType(be):Se(be)}function Me(be){return ree(be)&&be.typeParameters?e.createParenthesizedType(be):be}function ke(be,lt){return lt===0?Me(be):be}function he(be){if(ut(be))return e.createNodeArray(Yc(be,ke))}}var gW,xFe=Nt({"src/compiler/factory/parenthesizerRules.ts"(){"use strict";Ns(),gW={getParenthesizeLeftSideOfBinaryForOperator:e=>To,getParenthesizeRightSideOfBinaryForOperator:e=>To,parenthesizeLeftSideOfBinary:(e,t)=>t,parenthesizeRightSideOfBinary:(e,t,r)=>r,parenthesizeExpressionOfComputedPropertyName:To,parenthesizeConditionOfConditionalExpression:To,parenthesizeBranchOfConditionalExpression:To,parenthesizeExpressionOfExportDefault:To,parenthesizeExpressionOfNew:e=>Ms(e,m_),parenthesizeLeftSideOfAccess:e=>Ms(e,m_),parenthesizeOperandOfPostfixUnary:e=>Ms(e,m_),parenthesizeOperandOfPrefixUnary:e=>Ms(e,gJ),parenthesizeExpressionsOfCommaDelimitedList:e=>Ms(e,yv),parenthesizeExpressionForDisallowedComma:To,parenthesizeExpressionOfExpressionStatement:To,parenthesizeConciseBodyOfArrowFunction:To,parenthesizeCheckTypeOfConditionalType:To,parenthesizeExtendsTypeOfConditionalType:To,parenthesizeConstituentTypesOfUnionType:e=>Ms(e,yv),parenthesizeConstituentTypeOfUnionType:To,parenthesizeConstituentTypesOfIntersectionType:e=>Ms(e,yv),parenthesizeConstituentTypeOfIntersectionType:To,parenthesizeOperandOfTypeOperator:To,parenthesizeOperandOfReadonlyTypeOperator:To,parenthesizeNonArrayTypeOfPostfixType:To,parenthesizeElementTypesOfTupleType:e=>Ms(e,yv),parenthesizeElementTypeOfTupleType:To,parenthesizeTypeOfOptionalType:To,parenthesizeTypeArguments:e=>e&&Ms(e,yv),parenthesizeLeadingTypeArgument:To}}});function Ire(e){return{convertToFunctionBlock:t,convertToFunctionExpression:r,convertToClassExpression:i,convertToArrayAssignmentElement:s,convertToObjectAssignmentElement:o,convertToAssignmentPattern:c,convertToObjectAssignmentPattern:u,convertToArrayAssignmentPattern:f,convertToAssignmentElementTarget:g};function t(p,y){if(Ss(p))return p;const S=e.createReturnStatement(p);tt(S,p);const T=e.createBlock([S],y);return tt(T,p),T}function r(p){var y;if(!p.body)return E.fail("Cannot convert a FunctionDeclaration without a body");const S=e.createFunctionExpression((y=hv(p))==null?void 0:y.filter(T=>!wT(T)&&!MF(T)),p.asteriskToken,p.name,p.typeParameters,p.parameters,p.type,p.body);return rn(S,p),tt(S,p),AE(p)&&nF(S,!0),S}function i(p){var y;const S=e.createClassExpression((y=p.modifiers)==null?void 0:y.filter(T=>!wT(T)&&!MF(T)),p.name,p.typeParameters,p.heritageClauses,p.members);return rn(S,p),tt(S,p),AE(p)&&nF(S,!0),S}function s(p){if(Pa(p)){if(p.dotDotDotToken)return E.assertNode(p.name,Ie),rn(tt(e.createSpreadElement(p.name),p),p);const y=g(p.name);return p.initializer?rn(tt(e.createAssignment(y,p.initializer),p),p):y}return Ms(p,ct)}function o(p){if(Pa(p)){if(p.dotDotDotToken)return E.assertNode(p.name,Ie),rn(tt(e.createSpreadAssignment(p.name),p),p);if(p.propertyName){const y=g(p.name);return rn(tt(e.createPropertyAssignment(p.propertyName,p.initializer?e.createAssignment(y,p.initializer):y),p),p)}return E.assertNode(p.name,Ie),rn(tt(e.createShorthandPropertyAssignment(p.name,p.initializer),p),p)}return Ms(p,qg)}function c(p){switch(p.kind){case 207:case 209:return f(p);case 206:case 210:return u(p)}}function u(p){return jp(p)?rn(tt(e.createObjectLiteralExpression(Yt(p.elements,o)),p),p):Ms(p,ma)}function f(p){return Eb(p)?rn(tt(e.createArrayLiteralExpression(Yt(p.elements,s)),p),p):Ms(p,Lu)}function g(p){return As(p)?c(p):Ms(p,ct)}}var hW,kFe=Nt({"src/compiler/factory/nodeConverters.ts"(){"use strict";Ns(),hW={convertToFunctionBlock:ys,convertToFunctionExpression:ys,convertToClassExpression:ys,convertToArrayAssignmentElement:ys,convertToObjectAssignmentElement:ys,convertToAssignmentPattern:ys,convertToObjectAssignmentPattern:ys,convertToArrayAssignmentPattern:ys,convertToAssignmentElementTarget:ys}}});function Iye(e){Ore.push(e)}function V8(e,t){const r=e&8?CFe:EFe,i=Vu(()=>e&1?gW:Nre(O)),s=Vu(()=>e&2?hW:Ire(O)),o=_m(v=>(P,R)=>pe(P,v,R)),c=_m(v=>P=>Ye(v,P)),u=_m(v=>P=>Pt(P,v)),f=_m(v=>()=>eD(v)),g=_m(v=>P=>io(v,P)),p=_m(v=>(P,R)=>kx(v,P,R)),y=_m(v=>(P,R)=>xx(v,P,R)),S=_m(v=>(P,R)=>v2(v,P,R)),T=_m(v=>(P,R)=>qf(v,P,R)),C=_m(v=>(P,R,re)=>U1(v,P,R,re)),w=_m(v=>(P,R,re)=>f0(v,P,R,re)),D=_m(v=>(P,R,re,Le)=>Ll(v,P,R,re,Le)),O={get parenthesizer(){return i()},get converters(){return s()},baseFactory:t,flags:e,createNodeArray:z,createNumericLiteral:ie,createBigIntLiteral:B,createStringLiteral:ae,createStringLiteralFromNode:_e,createRegularExpressionLiteral:$,createLiteralLikeNode:H,createIdentifier:Se,createTempVariable:se,createLoopVariable:Z,createUniqueName:ve,getGeneratedNameForNode:Te,createPrivateIdentifier:ke,createUniquePrivateName:be,getGeneratedPrivateNameForNode:lt,createToken:me,createSuper:Oe,createThis:Xe,createNull:it,createTrue:mt,createFalse:Je,createModifier:ot,createModifiersFromModifierFlags:Bt,createQualifiedName:Ht,updateQualifiedName:br,createComputedPropertyName:zr,updateComputedPropertyName:ar,createTypeParameterDeclaration:Jt,updateTypeParameterDeclaration:It,createParameterDeclaration:Nn,updateParameterDeclaration:Fi,createDecorator:ei,updateDecorator:zi,createPropertySignature:Qe,updatePropertySignature:ur,createPropertyDeclaration:Ft,updatePropertyDeclaration:yr,createMethodSignature:Tr,updateMethodSignature:Xr,createMethodDeclaration:Pi,updateMethodDeclaration:ji,createConstructorDeclaration:Ce,updateConstructorDeclaration:Ue,createGetAccessorDeclaration:ft,updateGetAccessorDeclaration:dt,createSetAccessorDeclaration:we,updateSetAccessorDeclaration:Be,createCallSignature:G,updateCallSignature:ht,createConstructSignature:Dt,updateConstructSignature:Re,createIndexSignature:st,updateIndexSignature:Ct,createClassStaticBlockDeclaration:$i,updateClassStaticBlockDeclaration:Qs,createTemplateLiteralTypeSpan:Qt,updateTemplateLiteralTypeSpan:er,createKeywordTypeNode:or,createTypePredicateNode:U,updateTypePredicateNode:j,createTypeReferenceNode:ce,updateTypeReferenceNode:ee,createFunctionTypeNode:ue,updateFunctionTypeNode:M,createConstructorTypeNode:Ve,updateConstructorTypeNode:Lt,createTypeQueryNode:Zr,updateTypeQueryNode:gn,createTypeLiteralNode:On,updateTypeLiteralNode:Ln,createArrayTypeNode:Ni,updateArrayTypeNode:Cn,createTupleTypeNode:Ki,updateTupleTypeNode:wr,createNamedTupleMember:_i,updateNamedTupleMember:ia,createOptionalTypeNode:Is,updateOptionalTypeNode:Cr,createRestTypeNode:Tc,updateRestTypeNode:os,createUnionTypeNode:Vo,updateUnionTypeNode:cl,createIntersectionTypeNode:Ro,updateIntersectionTypeNode:hs,createConditionalTypeNode:Ws,updateConditionalTypeNode:el,createInferTypeNode:yo,updateInferTypeNode:Us,createImportTypeNode:Fc,updateImportTypeNode:$o,createParenthesizedType:Ao,updateParenthesizedType:rs,createThisTypeNode:qt,createTypeOperatorNode:No,updateTypeOperatorNode:$c,createIndexedAccessTypeNode:ju,updateIndexedAccessTypeNode:u_,createMappedTypeNode:vo,updateMappedTypeNode:xc,createLiteralTypeNode:A,updateLiteralTypeNode:Pe,createTemplateLiteralType:Ic,updateTemplateLiteralType:Hp,createObjectBindingPattern:qe,updateObjectBindingPattern:Tt,createArrayBindingPattern:dr,updateArrayBindingPattern:En,createBindingElement:$r,updateBindingElement:yn,createArrayLiteralExpression:li,updateArrayLiteralExpression:Tn,createObjectLiteralExpression:va,updateObjectLiteralExpression:lc,createPropertyAccessExpression:e&4?(v,P)=>Vr(no(v,P),262144):no,updatePropertyAccessExpression:rl,createPropertyAccessChain:e&4?(v,P,R)=>Vr(Xa(v,P,R),262144):Xa,updatePropertyAccessChain:hl,createElementAccessExpression:xu,updateElementAccessExpression:Bf,createElementAccessChain:$l,updateElementAccessChain:ye,createCallExpression:Fr,updateCallExpression:Wi,createCallChain:Ps,updateCallChain:Fs,createNewExpression:uc,updateNewExpression:hc,createTaggedTemplateExpression:jo,updateTaggedTemplateExpression:qo,createTypeAssertion:kc,updateTypeAssertion:nc,createParenthesizedExpression:Oc,updateParenthesizedExpression:yp,createFunctionExpression:xf,updateFunctionExpression:Xu,createArrowFunction:Jf,updateArrowFunction:vg,createDeleteExpression:Fm,updateDeleteExpression:n0,createTypeOfExpression:ou,updateTypeOfExpression:bg,createVoidExpression:L_,updateVoidExpression:zf,createAwaitExpression:Qu,updateAwaitExpression:Q,createPrefixUnaryExpression:Ye,updatePrefixUnaryExpression:Et,createPostfixUnaryExpression:Pt,updatePostfixUnaryExpression:L,createBinaryExpression:pe,updateBinaryExpression:At,createConditionalExpression:Mr,updateConditionalExpression:Rn,createTemplateExpression:jn,updateTemplateExpression:Oi,createTemplateHead:kf,createTemplateMiddle:_a,createTemplateTail:vp,createNoSubstitutionTemplateLiteral:Cf,createTemplateLiteralLikeNode:ll,createYieldExpression:Sg,updateYieldExpression:Om,createSpreadElement:ki,updateSpreadElement:ay,createClassExpression:oy,updateClassExpression:fd,createOmittedExpression:u2,createExpressionWithTypeArguments:i0,updateExpressionWithTypeArguments:Ee,createAsExpression:We,updateAsExpression:bt,createNonNullExpression:Rt,updateNonNullExpression:tr,createSatisfiesExpression:Rr,updateSatisfiesExpression:nr,createNonNullChain:xr,updateNonNullChain:ni,createMetaProperty:_n,updateMetaProperty:fn,createTemplateSpan:on,updateTemplateSpan:wi,createSemicolonClassElement:Qa,createBlock:Va,updateBlock:M_,createVariableStatement:A1,updateVariableStatement:cy,createEmptyStatement:sh,createExpressionStatement:ly,updateExpressionStatement:Kb,createIfStatement:_2,updateIfStatement:eS,createDoStatement:tS,updateDoStatement:Z3,createWhileStatement:gx,updateWhileStatement:g6,createForStatement:N1,updateForStatement:hx,createForInStatement:yx,updateForInStatement:h6,createForOfStatement:rS,updateForOfStatement:y6,createContinueStatement:vx,updateContinueStatement:bx,createBreakStatement:nS,updateBreakStatement:f2,createReturnStatement:p2,updateReturnStatement:I1,createWithStatement:s0,updateWithStatement:d2,createSwitchStatement:Ud,updateSwitchStatement:wa,createLabeledStatement:iS,updateLabeledStatement:v6,createThrowStatement:uy,updateThrowStatement:a0,createTryStatement:Lm,updateTryStatement:Wf,createDebuggerStatement:R_,createVariableDeclaration:Yu,updateVariableDeclaration:K_,createVariableDeclarationList:F1,updateVariableDeclarationList:b6,createFunctionDeclaration:Sx,updateFunctionDeclaration:sS,createClassDeclaration:O1,updateClassDeclaration:aS,createInterfaceDeclaration:L1,updateInterfaceDeclaration:Cl,createTypeAliasDeclaration:o0,updateTypeAliasDeclaration:c0,createEnumDeclaration:Tg,updateEnumDeclaration:je,createModuleDeclaration:Ol,updateModuleDeclaration:Uf,createModuleBlock:Bu,updateModuleBlock:S6,createCaseBlock:l0,updateCaseBlock:M1,createNamespaceExportDeclaration:xg,updateNamespaceExportDeclaration:K3,createImportEqualsDeclaration:pd,updateImportEqualsDeclaration:oS,createImportDeclaration:cS,updateImportDeclaration:g2,createImportClause:h2,updateImportClause:bp,createAssertClause:dd,updateAssertClause:kg,createAssertEntry:lS,updateAssertEntry:Vd,createImportTypeAssertionContainer:uS,updateImportTypeAssertionContainer:T6,createImportAttributes:yi,updateImportAttributes:Wn,createImportAttribute:qd,updateImportAttribute:S_,createNamespaceImport:x6,updateNamespaceImport:u0,createNamespaceExport:k6,updateNamespaceExport:y2,createNamedImports:_c,updateNamedImports:Ju,createImportSpecifier:ah,updateImportSpecifier:Mm,createExportAssignment:Cg,updateExportAssignment:Gp,createExportDeclaration:R1,updateExportDeclaration:Eg,createNamedExports:Rm,updateNamedExports:E6,createExportSpecifier:Hd,updateExportSpecifier:jm,createMissingDeclaration:_0,createExternalModuleReference:D6,updateExternalModuleReference:Tx,get createJSDocAllType(){return f(319)},get createJSDocUnknownType(){return f(320)},get createJSDocNonNullableType(){return y(322)},get updateJSDocNonNullableType(){return S(322)},get createJSDocNullableType(){return y(321)},get updateJSDocNullableType(){return S(321)},get createJSDocOptionalType(){return g(323)},get updateJSDocOptionalType(){return p(323)},get createJSDocVariadicType(){return g(325)},get updateJSDocVariadicType(){return p(325)},get createJSDocNamepathType(){return g(326)},get updateJSDocNamepathType(){return p(326)},createJSDocFunctionType:Sp,updateJSDocFunctionType:j1,createJSDocTypeLiteral:Cx,updateJSDocTypeLiteral:tD,createJSDocTypeExpression:_S,updateJSDocTypeExpression:Kr,createJSDocSignature:Ql,updateJSDocSignature:Yi,createJSDocTemplateTag:Ur,updateJSDocTemplateTag:b2,createJSDocTypedefTag:B1,updateJSDocTypedefTag:yl,createJSDocParameterTag:$d,updateJSDocParameterTag:Xd,createJSDocPropertyTag:_y,updateJSDocPropertyTag:Ex,createJSDocCallbackTag:oh,updateJSDocCallbackTag:J1,createJSDocOverloadTag:z1,updateJSDocOverloadTag:Dg,createJSDocAugmentsTag:Bm,updateJSDocAugmentsTag:fS,createJSDocImplementsTag:ch,updateJSDocImplementsTag:x2,createJSDocSeeTag:fy,updateJSDocSeeTag:S2,createJSDocNameReference:Dx,updateJSDocNameReference:pS,createJSDocMemberName:T2,updateJSDocMemberName:Vf,createJSDocLink:W1,updateJSDocLink:Cc,createJSDocLinkCode:ul,updateJSDocLinkCode:Px,createJSDocLinkPlain:cu,updateJSDocLinkPlain:T_,get createJSDocTypeTag(){return w(351)},get updateJSDocTypeTag(){return D(351)},get createJSDocReturnTag(){return w(349)},get updateJSDocReturnTag(){return D(349)},get createJSDocThisTag(){return w(350)},get updateJSDocThisTag(){return D(350)},get createJSDocAuthorTag(){return T(337)},get updateJSDocAuthorTag(){return C(337)},get createJSDocClassTag(){return T(339)},get updateJSDocClassTag(){return C(339)},get createJSDocPublicTag(){return T(340)},get updateJSDocPublicTag(){return C(340)},get createJSDocPrivateTag(){return T(341)},get updateJSDocPrivateTag(){return C(341)},get createJSDocProtectedTag(){return T(342)},get updateJSDocProtectedTag(){return C(342)},get createJSDocReadonlyTag(){return T(343)},get updateJSDocReadonlyTag(){return C(343)},get createJSDocOverrideTag(){return T(344)},get updateJSDocOverrideTag(){return C(344)},get createJSDocDeprecatedTag(){return T(338)},get updateJSDocDeprecatedTag(){return C(338)},get createJSDocThrowsTag(){return w(356)},get updateJSDocThrowsTag(){return D(356)},get createJSDocSatisfiesTag(){return w(357)},get updateJSDocSatisfiesTag(){return D(357)},createJSDocEnumTag:py,updateJSDocEnumTag:P6,createJSDocUnknownTag:dS,updateJSDocUnknownTag:xp,createJSDocText:lo,updateJSDocText:w6,createJSDocComment:mS,updateJSDocComment:V1,createJsxElement:wx,updateJsxElement:Zu,createJsxSelfClosingElement:Pg,updateJsxSelfClosingElement:lh,createJsxOpeningElement:k2,updateJsxOpeningElement:ef,createJsxClosingElement:Ax,updateJsxClosingElement:dy,createJsxFragment:Ef,createJsxText:p0,updateJsxText:rD,createJsxOpeningFragment:Nx,createJsxJsxClosingFragment:Ix,updateJsxFragment:C2,createJsxAttribute:Fx,updateJsxAttribute:q1,createJsxAttributes:j_,updateJsxAttributes:wg,createJsxSpreadAttribute:Ox,updateJsxSpreadAttribute:Lx,createJsxExpression:Na,updateJsxExpression:cn,createJsxNamespacedName:tf,updateJsxNamespacedName:f_,createCaseClause:E2,updateCaseClause:A6,createDefaultClause:H1,updateDefaultClause:D2,createHeritageClause:my,updateHeritageClause:Df,createCatchClause:kp,updateCatchClause:gy,createPropertyAssignment:$p,updatePropertyAssignment:Cp,createShorthandPropertyAssignment:P2,updateShorthandPropertyAssignment:Lc,createSpreadAssignment:Hf,updateSpreadAssignment:N6,createEnumMember:lu,updateEnumMember:G1,createSourceFile:w2,updateSourceFile:hy,createRedirectedSourceFile:gS,createBundle:Ag,updateBundle:$1,createUnparsedSource:F6,createUnparsedPrologue:k,createUnparsedPrepend:te,createUnparsedTextLike:at,createUnparsedSyntheticReference:Gt,createInputFiles:pn,createSyntheticExpression:hi,createSyntaxList:ri,createNotEmittedStatement:Mi,createPartiallyEmittedExpression:ws,updatePartiallyEmittedExpression:x_,createCommaListExpression:ii,updateCommaListExpression:Yd,createSyntheticReferenceExpression:mr,updateSyntheticReferenceExpression:vy,cloneNode:yS,get createComma(){return o(28)},get createAssignment(){return o(64)},get createLogicalOr(){return o(57)},get createLogicalAnd(){return o(56)},get createBitwiseOr(){return o(52)},get createBitwiseXor(){return o(53)},get createBitwiseAnd(){return o(51)},get createStrictEquality(){return o(37)},get createStrictInequality(){return o(38)},get createEquality(){return o(35)},get createInequality(){return o(36)},get createLessThan(){return o(30)},get createLessThanEquals(){return o(33)},get createGreaterThan(){return o(32)},get createGreaterThanEquals(){return o(34)},get createLeftShift(){return o(48)},get createRightShift(){return o(49)},get createUnsignedRightShift(){return o(50)},get createAdd(){return o(40)},get createSubtract(){return o(41)},get createMultiply(){return o(42)},get createDivide(){return o(44)},get createModulo(){return o(45)},get createExponent(){return o(43)},get createPrefixPlus(){return c(40)},get createPrefixMinus(){return c(41)},get createPrefixIncrement(){return c(46)},get createPrefixDecrement(){return c(47)},get createBitwiseNot(){return c(55)},get createLogicalNot(){return c(54)},get createPostfixIncrement(){return u(46)},get createPostfixDecrement(){return u(47)},createImmediatelyInvokedFunctionExpression:Jm,createImmediatelyInvokedArrowFunction:g0,createVoidZero:Ng,createExportDefault:O6,createExternalModuleExport:Rx,createTypeCheck:EN,createIsNotTypeCheck:iD,createMethodCall:zm,createGlobalMethodCall:Q1,createFunctionBindCall:uh,createFunctionCallCall:L6,createFunctionApplyCall:Wm,createArraySliceCall:qM,createArrayConcatCall:Zd,createObjectDefinePropertyCall:vS,createObjectGetOwnPropertyDescriptorCall:DN,createReflectGetCall:q,createReflectSetCall:ge,createPropertyDescriptor:et,createCallBinding:Yn,createAssignmentTargetWrapper:Li,inlineExpressions:Za,getInternalName:Ia,getLocalName:$f,getExportName:Xp,getDeclarationName:by,getNamespaceMemberName:Ig,getExternalModuleOrNamespaceExportName:El,restoreOuterExpressions:vn,restoreEnclosingLabel:di,createUseStrictPrologue:M6,copyPrologue:_h,copyStandardPrologue:R6,copyCustomPrologue:aD,ensureUseStrict:HM,liftToBlock:oD,mergeLexicalEnvironment:fh,replaceModifiers:cD,replaceDecoratorsAndModifiers:Xf,replacePropertyName:j6};return Zt(Ore,v=>v(O)),O;function z(v,P){if(v===void 0||v===ze)v=[];else if(yv(v)){if(P===void 0||v.hasTrailingComma===P)return v.transformFlags===void 0&&Fye(v),E.attachNodeArrayDebugInfo(v),v;const Le=v.slice();return Le.pos=v.pos,Le.end=v.end,Le.hasTrailingComma=P,Le.transformFlags=v.transformFlags,E.attachNodeArrayDebugInfo(Le),Le}const R=v.length,re=R>=1&&R<=4?v.slice():v;return re.pos=-1,re.end=-1,re.hasTrailingComma=!!P,re.transformFlags=0,Fye(re),E.attachNodeArrayDebugInfo(re),re}function W(v){return t.createBaseNode(v)}function X(v){const P=W(v);return P.symbol=void 0,P.localSymbol=void 0,P}function J(v,P){return v!==P&&(v.typeArguments=P.typeArguments),r(v,P)}function ie(v,P=0){const R=X(9);return R.text=typeof v=="number"?v+"":v,R.numericLiteralFlags=P,P&384&&(R.transformFlags|=1024),R}function B(v){const P=pt(10);return P.text=typeof v=="string"?v:Bv(v)+"n",P.transformFlags|=32,P}function Y(v,P){const R=X(11);return R.text=v,R.singleQuote=P,R}function ae(v,P,R){const re=Y(v,P);return re.hasExtendedUnicodeEscape=R,R&&(re.transformFlags|=1024),re}function _e(v){const P=Y(cp(v),void 0);return P.textSourceNode=v,P}function $(v){const P=pt(14);return P.text=v,P}function H(v,P){switch(v){case 9:return ie(P,0);case 10:return B(P);case 11:return ae(P,void 0);case 12:return p0(P,!1);case 13:return p0(P,!0);case 14:return $(P);case 15:return ll(v,P,void 0,0)}}function K(v){const P=t.createBaseIdentifierNode(80);return P.escapedText=v,P.jsDoc=void 0,P.flowNode=void 0,P.symbol=void 0,P}function oe(v,P,R,re){const Le=K(zo(v));return Q8(Le,{flags:P,id:rF,prefix:R,suffix:re}),rF++,Le}function Se(v,P,R){P===void 0&&v&&(P=mv(v)),P===80&&(P=void 0);const re=K(zo(v));return R&&(re.flags|=256),re.escapedText==="await"&&(re.transformFlags|=67108864),re.flags&256&&(re.transformFlags|=1024),re}function se(v,P,R,re){let Le=1;P&&(Le|=8);const Ot=oe("",Le,R,re);return v&&v(Ot),Ot}function Z(v){let P=2;return v&&(P|=8),oe("",P,void 0,void 0)}function ve(v,P=0,R,re){return E.assert(!(P&7),"Argument out of range: flags"),E.assert((P&48)!==32,"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),oe(v,3|P,R,re)}function Te(v,P=0,R,re){E.assert(!(P&7),"Argument out of range: flags");const Le=v?tg(v)?g1(!1,R,v,re,an):`generated@${Oa(v)}`:"";(R||re)&&(P|=16);const Ot=oe(Le,4|P,R,re);return Ot.original=v,Ot}function Me(v){const P=t.createBasePrivateIdentifierNode(81);return P.escapedText=v,P.transformFlags|=16777216,P}function ke(v){return Qi(v,"#")||E.fail("First character of private identifier must be #: "+v),Me(zo(v))}function he(v,P,R,re){const Le=Me(zo(v));return Q8(Le,{flags:P,id:rF,prefix:R,suffix:re}),rF++,Le}function be(v,P,R){v&&!Qi(v,"#")&&E.fail("First character of private identifier must be #: "+v);const re=8|(v?3:1);return he(v??"",re,P,R)}function lt(v,P,R){const re=tg(v)?g1(!0,P,v,R,an):`#generated@${Oa(v)}`,Ot=he(re,4|(P||R?16:0),P,R);return Ot.original=v,Ot}function pt(v){return t.createBaseTokenNode(v)}function me(v){E.assert(v>=0&&v<=165,"Invalid token"),E.assert(v<=15||v>=18,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),E.assert(v<=9||v>=15,"Invalid token. Use 'createLiteralLikeNode' to create literals."),E.assert(v!==80,"Invalid token. Use 'createIdentifier' to create identifiers");const P=pt(v);let R=0;switch(v){case 134:R=384;break;case 160:R=4;break;case 125:case 123:case 124:case 148:case 128:case 138:case 87:case 133:case 150:case 163:case 146:case 151:case 103:case 147:case 164:case 154:case 136:case 155:case 116:case 159:case 157:R=1;break;case 108:R=134218752,P.flowNode=void 0;break;case 126:R=1024;break;case 129:R=16777216;break;case 110:R=16384,P.flowNode=void 0;break}return R&&(P.transformFlags|=R),P}function Oe(){return me(108)}function Xe(){return me(110)}function it(){return me(106)}function mt(){return me(112)}function Je(){return me(97)}function ot(v){return me(v)}function Bt(v){const P=[];return v&32&&P.push(ot(95)),v&128&&P.push(ot(138)),v&2048&&P.push(ot(90)),v&4096&&P.push(ot(87)),v&1&&P.push(ot(125)),v&2&&P.push(ot(123)),v&4&&P.push(ot(124)),v&64&&P.push(ot(128)),v&256&&P.push(ot(126)),v&16&&P.push(ot(164)),v&8&&P.push(ot(148)),v&512&&P.push(ot(129)),v&1024&&P.push(ot(134)),v&8192&&P.push(ot(103)),v&16384&&P.push(ot(147)),P.length?P:void 0}function Ht(v,P){const R=W(166);return R.left=v,R.right=Mc(P),R.transformFlags|=tn(R.left)|q8(R.right),R.flowNode=void 0,R}function br(v,P,R){return v.left!==P||v.right!==R?r(Ht(P,R),v):v}function zr(v){const P=W(167);return P.expression=i().parenthesizeExpressionOfComputedPropertyName(v),P.transformFlags|=tn(P.expression)|1024|131072,P}function ar(v,P){return v.expression!==P?r(zr(P),v):v}function Jt(v,P,R,re){const Le=X(168);return Le.modifiers=ka(v),Le.name=Mc(P),Le.constraint=R,Le.default=re,Le.transformFlags=1,Le.expression=void 0,Le.jsDoc=void 0,Le}function It(v,P,R,re,Le){return v.modifiers!==P||v.name!==R||v.constraint!==re||v.default!==Le?r(Jt(P,R,re,Le),v):v}function Nn(v,P,R,re,Le,Ot){const en=X(169);return en.modifiers=ka(v),en.dotDotDotToken=P,en.name=Mc(R),en.questionToken=re,en.type=Le,en.initializer=bS(Ot),Lv(en.name)?en.transformFlags=1:en.transformFlags=ha(en.modifiers)|tn(en.dotDotDotToken)|Q0(en.name)|tn(en.questionToken)|tn(en.initializer)|(en.questionToken??en.type?1:0)|(en.dotDotDotToken??en.initializer?1024:0)|(Nd(en.modifiers)&31?8192:0),en.jsDoc=void 0,en}function Fi(v,P,R,re,Le,Ot,en){return v.modifiers!==P||v.dotDotDotToken!==R||v.name!==re||v.questionToken!==Le||v.type!==Ot||v.initializer!==en?r(Nn(P,R,re,Le,Ot,en),v):v}function ei(v){const P=W(170);return P.expression=i().parenthesizeLeftSideOfAccess(v,!1),P.transformFlags|=tn(P.expression)|1|8192|33554432,P}function zi(v,P){return v.expression!==P?r(ei(P),v):v}function Qe(v,P,R,re){const Le=X(171);return Le.modifiers=ka(v),Le.name=Mc(P),Le.type=re,Le.questionToken=R,Le.transformFlags=1,Le.initializer=void 0,Le.jsDoc=void 0,Le}function ur(v,P,R,re,Le){return v.modifiers!==P||v.name!==R||v.questionToken!==re||v.type!==Le?Dr(Qe(P,R,re,Le),v):v}function Dr(v,P){return v!==P&&(v.initializer=P.initializer),r(v,P)}function Ft(v,P,R,re,Le){const Ot=X(172);Ot.modifiers=ka(v),Ot.name=Mc(P),Ot.questionToken=R&&Y0(R)?R:void 0,Ot.exclamationToken=R&&tw(R)?R:void 0,Ot.type=re,Ot.initializer=bS(Le);const en=Ot.flags&33554432||Nd(Ot.modifiers)&128;return Ot.transformFlags=ha(Ot.modifiers)|Q0(Ot.name)|tn(Ot.initializer)|(en||Ot.questionToken||Ot.exclamationToken||Ot.type?1:0)|(xa(Ot.name)||Nd(Ot.modifiers)&256&&Ot.initializer?8192:0)|16777216,Ot.jsDoc=void 0,Ot}function yr(v,P,R,re,Le,Ot){return v.modifiers!==P||v.name!==R||v.questionToken!==(re!==void 0&&Y0(re)?re:void 0)||v.exclamationToken!==(re!==void 0&&tw(re)?re:void 0)||v.type!==Le||v.initializer!==Ot?r(Ft(P,R,re,Le,Ot),v):v}function Tr(v,P,R,re,Le,Ot){const en=X(173);return en.modifiers=ka(v),en.name=Mc(P),en.questionToken=R,en.typeParameters=ka(re),en.parameters=ka(Le),en.type=Ot,en.transformFlags=1,en.jsDoc=void 0,en.locals=void 0,en.nextContainer=void 0,en.typeArguments=void 0,en}function Xr(v,P,R,re,Le,Ot,en){return v.modifiers!==P||v.name!==R||v.questionToken!==re||v.typeParameters!==Le||v.parameters!==Ot||v.type!==en?J(Tr(P,R,re,Le,Ot,en),v):v}function Pi(v,P,R,re,Le,Ot,en,Zi){const za=X(174);if(za.modifiers=ka(v),za.asteriskToken=P,za.name=Mc(R),za.questionToken=re,za.exclamationToken=void 0,za.typeParameters=ka(Le),za.parameters=z(Ot),za.type=en,za.body=Zi,!za.body)za.transformFlags=1;else{const wf=Nd(za.modifiers)&1024,Ty=!!za.asteriskToken,xy=wf&&Ty;za.transformFlags=ha(za.modifiers)|tn(za.asteriskToken)|Q0(za.name)|tn(za.questionToken)|ha(za.typeParameters)|ha(za.parameters)|tn(za.type)|tn(za.body)&-67108865|(xy?128:wf?256:Ty?2048:0)|(za.questionToken||za.typeParameters||za.type?1:0)|1024}return za.typeArguments=void 0,za.jsDoc=void 0,za.locals=void 0,za.nextContainer=void 0,za.flowNode=void 0,za.endFlowNode=void 0,za.returnFlowNode=void 0,za}function ji(v,P,R,re,Le,Ot,en,Zi,za){return v.modifiers!==P||v.asteriskToken!==R||v.name!==re||v.questionToken!==Le||v.typeParameters!==Ot||v.parameters!==en||v.type!==Zi||v.body!==za?Di(Pi(P,R,re,Le,Ot,en,Zi,za),v):v}function Di(v,P){return v!==P&&(v.exclamationToken=P.exclamationToken),r(v,P)}function $i(v){const P=X(175);return P.body=v,P.transformFlags=tn(v)|16777216,P.modifiers=void 0,P.jsDoc=void 0,P.locals=void 0,P.nextContainer=void 0,P.endFlowNode=void 0,P.returnFlowNode=void 0,P}function Qs(v,P){return v.body!==P?Ds($i(P),v):v}function Ds(v,P){return v!==P&&(v.modifiers=P.modifiers),r(v,P)}function Ce(v,P,R){const re=X(176);return re.modifiers=ka(v),re.parameters=z(P),re.body=R,re.transformFlags=ha(re.modifiers)|ha(re.parameters)|tn(re.body)&-67108865|1024,re.typeParameters=void 0,re.type=void 0,re.typeArguments=void 0,re.jsDoc=void 0,re.locals=void 0,re.nextContainer=void 0,re.endFlowNode=void 0,re.returnFlowNode=void 0,re}function Ue(v,P,R,re){return v.modifiers!==P||v.parameters!==R||v.body!==re?rt(Ce(P,R,re),v):v}function rt(v,P){return v!==P&&(v.typeParameters=P.typeParameters,v.type=P.type),J(v,P)}function ft(v,P,R,re,Le){const Ot=X(177);return Ot.modifiers=ka(v),Ot.name=Mc(P),Ot.parameters=z(R),Ot.type=re,Ot.body=Le,Ot.body?Ot.transformFlags=ha(Ot.modifiers)|Q0(Ot.name)|ha(Ot.parameters)|tn(Ot.type)|tn(Ot.body)&-67108865|(Ot.type?1:0):Ot.transformFlags=1,Ot.typeArguments=void 0,Ot.typeParameters=void 0,Ot.jsDoc=void 0,Ot.locals=void 0,Ot.nextContainer=void 0,Ot.flowNode=void 0,Ot.endFlowNode=void 0,Ot.returnFlowNode=void 0,Ot}function dt(v,P,R,re,Le,Ot){return v.modifiers!==P||v.name!==R||v.parameters!==re||v.type!==Le||v.body!==Ot?fe(ft(P,R,re,Le,Ot),v):v}function fe(v,P){return v!==P&&(v.typeParameters=P.typeParameters),J(v,P)}function we(v,P,R,re){const Le=X(178);return Le.modifiers=ka(v),Le.name=Mc(P),Le.parameters=z(R),Le.body=re,Le.body?Le.transformFlags=ha(Le.modifiers)|Q0(Le.name)|ha(Le.parameters)|tn(Le.body)&-67108865|(Le.type?1:0):Le.transformFlags=1,Le.typeArguments=void 0,Le.typeParameters=void 0,Le.type=void 0,Le.jsDoc=void 0,Le.locals=void 0,Le.nextContainer=void 0,Le.flowNode=void 0,Le.endFlowNode=void 0,Le.returnFlowNode=void 0,Le}function Be(v,P,R,re,Le){return v.modifiers!==P||v.name!==R||v.parameters!==re||v.body!==Le?gt(we(P,R,re,Le),v):v}function gt(v,P){return v!==P&&(v.typeParameters=P.typeParameters,v.type=P.type),J(v,P)}function G(v,P,R){const re=X(179);return re.typeParameters=ka(v),re.parameters=ka(P),re.type=R,re.transformFlags=1,re.jsDoc=void 0,re.locals=void 0,re.nextContainer=void 0,re.typeArguments=void 0,re}function ht(v,P,R,re){return v.typeParameters!==P||v.parameters!==R||v.type!==re?J(G(P,R,re),v):v}function Dt(v,P,R){const re=X(180);return re.typeParameters=ka(v),re.parameters=ka(P),re.type=R,re.transformFlags=1,re.jsDoc=void 0,re.locals=void 0,re.nextContainer=void 0,re.typeArguments=void 0,re}function Re(v,P,R,re){return v.typeParameters!==P||v.parameters!==R||v.type!==re?J(Dt(P,R,re),v):v}function st(v,P,R){const re=X(181);return re.modifiers=ka(v),re.parameters=ka(P),re.type=R,re.transformFlags=1,re.jsDoc=void 0,re.locals=void 0,re.nextContainer=void 0,re.typeArguments=void 0,re}function Ct(v,P,R,re){return v.parameters!==R||v.type!==re||v.modifiers!==P?J(st(P,R,re),v):v}function Qt(v,P){const R=W(204);return R.type=v,R.literal=P,R.transformFlags=1,R}function er(v,P,R){return v.type!==P||v.literal!==R?r(Qt(P,R),v):v}function or(v){return me(v)}function U(v,P,R){const re=W(182);return re.assertsModifier=v,re.parameterName=Mc(P),re.type=R,re.transformFlags=1,re}function j(v,P,R,re){return v.assertsModifier!==P||v.parameterName!==R||v.type!==re?r(U(P,R,re),v):v}function ce(v,P){const R=W(183);return R.typeName=Mc(v),R.typeArguments=P&&i().parenthesizeTypeArguments(z(P)),R.transformFlags=1,R}function ee(v,P,R){return v.typeName!==P||v.typeArguments!==R?r(ce(P,R),v):v}function ue(v,P,R){const re=X(184);return re.typeParameters=ka(v),re.parameters=ka(P),re.type=R,re.transformFlags=1,re.modifiers=void 0,re.jsDoc=void 0,re.locals=void 0,re.nextContainer=void 0,re.typeArguments=void 0,re}function M(v,P,R,re){return v.typeParameters!==P||v.parameters!==R||v.type!==re?De(ue(P,R,re),v):v}function De(v,P){return v!==P&&(v.modifiers=P.modifiers),J(v,P)}function Ve(...v){return v.length===4?Fe(...v):v.length===3?vt(...v):E.fail("Incorrect number of arguments specified.")}function Fe(v,P,R,re){const Le=X(185);return Le.modifiers=ka(v),Le.typeParameters=ka(P),Le.parameters=ka(R),Le.type=re,Le.transformFlags=1,Le.jsDoc=void 0,Le.locals=void 0,Le.nextContainer=void 0,Le.typeArguments=void 0,Le}function vt(v,P,R){return Fe(void 0,v,P,R)}function Lt(...v){return v.length===5?Wt(...v):v.length===4?Lr(...v):E.fail("Incorrect number of arguments specified.")}function Wt(v,P,R,re,Le){return v.modifiers!==P||v.typeParameters!==R||v.parameters!==re||v.type!==Le?J(Ve(P,R,re,Le),v):v}function Lr(v,P,R,re){return Wt(v,v.modifiers,P,R,re)}function Zr(v,P){const R=W(186);return R.exprName=v,R.typeArguments=P&&i().parenthesizeTypeArguments(P),R.transformFlags=1,R}function gn(v,P,R){return v.exprName!==P||v.typeArguments!==R?r(Zr(P,R),v):v}function On(v){const P=X(187);return P.members=z(v),P.transformFlags=1,P}function Ln(v,P){return v.members!==P?r(On(P),v):v}function Ni(v){const P=W(188);return P.elementType=i().parenthesizeNonArrayTypeOfPostfixType(v),P.transformFlags=1,P}function Cn(v,P){return v.elementType!==P?r(Ni(P),v):v}function Ki(v){const P=W(189);return P.elements=z(i().parenthesizeElementTypesOfTupleType(v)),P.transformFlags=1,P}function wr(v,P){return v.elements!==P?r(Ki(P),v):v}function _i(v,P,R,re){const Le=X(202);return Le.dotDotDotToken=v,Le.name=P,Le.questionToken=R,Le.type=re,Le.transformFlags=1,Le.jsDoc=void 0,Le}function ia(v,P,R,re,Le){return v.dotDotDotToken!==P||v.name!==R||v.questionToken!==re||v.type!==Le?r(_i(P,R,re,Le),v):v}function Is(v){const P=W(190);return P.type=i().parenthesizeTypeOfOptionalType(v),P.transformFlags=1,P}function Cr(v,P){return v.type!==P?r(Is(P),v):v}function Tc(v){const P=W(191);return P.type=v,P.transformFlags=1,P}function os(v,P){return v.type!==P?r(Tc(P),v):v}function Ga(v,P,R){const re=W(v);return re.types=O.createNodeArray(R(P)),re.transformFlags=1,re}function rc(v,P,R){return v.types!==P?r(Ga(v.kind,P,R),v):v}function Vo(v){return Ga(192,v,i().parenthesizeConstituentTypesOfUnionType)}function cl(v,P){return rc(v,P,i().parenthesizeConstituentTypesOfUnionType)}function Ro(v){return Ga(193,v,i().parenthesizeConstituentTypesOfIntersectionType)}function hs(v,P){return rc(v,P,i().parenthesizeConstituentTypesOfIntersectionType)}function Ws(v,P,R,re){const Le=W(194);return Le.checkType=i().parenthesizeCheckTypeOfConditionalType(v),Le.extendsType=i().parenthesizeExtendsTypeOfConditionalType(P),Le.trueType=R,Le.falseType=re,Le.transformFlags=1,Le.locals=void 0,Le.nextContainer=void 0,Le}function el(v,P,R,re,Le){return v.checkType!==P||v.extendsType!==R||v.trueType!==re||v.falseType!==Le?r(Ws(P,R,re,Le),v):v}function yo(v){const P=W(195);return P.typeParameter=v,P.transformFlags=1,P}function Us(v,P){return v.typeParameter!==P?r(yo(P),v):v}function Ic(v,P){const R=W(203);return R.head=v,R.templateSpans=z(P),R.transformFlags=1,R}function Hp(v,P,R){return v.head!==P||v.templateSpans!==R?r(Ic(P,R),v):v}function Fc(v,P,R,re,Le=!1){const Ot=W(205);return Ot.argument=v,Ot.attributes=P,Ot.assertions&&Ot.assertions.assertClause&&Ot.attributes&&(Ot.assertions.assertClause=Ot.attributes),Ot.qualifier=R,Ot.typeArguments=re&&i().parenthesizeTypeArguments(re),Ot.isTypeOf=Le,Ot.transformFlags=1,Ot}function $o(v,P,R,re,Le,Ot=v.isTypeOf){return v.argument!==P||v.attributes!==R||v.qualifier!==re||v.typeArguments!==Le||v.isTypeOf!==Ot?r(Fc(P,R,re,Le,Ot),v):v}function Ao(v){const P=W(196);return P.type=v,P.transformFlags=1,P}function rs(v,P){return v.type!==P?r(Ao(P),v):v}function qt(){const v=W(197);return v.transformFlags=1,v}function No(v,P){const R=W(198);return R.operator=v,R.type=v===148?i().parenthesizeOperandOfReadonlyTypeOperator(P):i().parenthesizeOperandOfTypeOperator(P),R.transformFlags=1,R}function $c(v,P){return v.type!==P?r(No(v.operator,P),v):v}function ju(v,P){const R=W(199);return R.objectType=i().parenthesizeNonArrayTypeOfPostfixType(v),R.indexType=P,R.transformFlags=1,R}function u_(v,P,R){return v.objectType!==P||v.indexType!==R?r(ju(P,R),v):v}function vo(v,P,R,re,Le,Ot){const en=X(200);return en.readonlyToken=v,en.typeParameter=P,en.nameType=R,en.questionToken=re,en.type=Le,en.members=Ot&&z(Ot),en.transformFlags=1,en.locals=void 0,en.nextContainer=void 0,en}function xc(v,P,R,re,Le,Ot,en){return v.readonlyToken!==P||v.typeParameter!==R||v.nameType!==re||v.questionToken!==Le||v.type!==Ot||v.members!==en?r(vo(P,R,re,Le,Ot,en),v):v}function A(v){const P=W(201);return P.literal=v,P.transformFlags=1,P}function Pe(v,P){return v.literal!==P?r(A(P),v):v}function qe(v){const P=W(206);return P.elements=z(v),P.transformFlags|=ha(P.elements)|1024|524288,P.transformFlags&32768&&(P.transformFlags|=65664),P}function Tt(v,P){return v.elements!==P?r(qe(P),v):v}function dr(v){const P=W(207);return P.elements=z(v),P.transformFlags|=ha(P.elements)|1024|524288,P}function En(v,P){return v.elements!==P?r(dr(P),v):v}function $r(v,P,R,re){const Le=X(208);return Le.dotDotDotToken=v,Le.propertyName=Mc(P),Le.name=Mc(R),Le.initializer=bS(re),Le.transformFlags|=tn(Le.dotDotDotToken)|Q0(Le.propertyName)|Q0(Le.name)|tn(Le.initializer)|(Le.dotDotDotToken?32768:0)|1024,Le.flowNode=void 0,Le}function yn(v,P,R,re,Le){return v.propertyName!==R||v.dotDotDotToken!==P||v.name!==re||v.initializer!==Le?r($r(P,R,re,Le),v):v}function li(v,P){const R=W(209),re=v&&Mo(v),Le=z(v,re&&dl(re)?!0:void 0);return R.elements=i().parenthesizeExpressionsOfCommaDelimitedList(Le),R.multiLine=P,R.transformFlags|=ha(R.elements),R}function Tn(v,P){return v.elements!==P?r(li(P,v.multiLine),v):v}function va(v,P){const R=X(210);return R.properties=z(v),R.multiLine=P,R.transformFlags|=ha(R.properties),R.jsDoc=void 0,R}function lc(v,P){return v.properties!==P?r(va(P,v.multiLine),v):v}function tl(v,P,R){const re=X(211);return re.expression=v,re.questionDotToken=P,re.name=R,re.transformFlags=tn(re.expression)|tn(re.questionDotToken)|(Ie(re.name)?q8(re.name):tn(re.name)|536870912),re.jsDoc=void 0,re.flowNode=void 0,re}function no(v,P){const R=tl(i().parenthesizeLeftSideOfAccess(v,!1),void 0,Mc(P));return OE(v)&&(R.transformFlags|=384),R}function rl(v,P,R){return _I(v)?hl(v,P,v.questionDotToken,Ms(R,Ie)):v.expression!==P||v.name!==R?r(no(P,R),v):v}function Xa(v,P,R){const re=tl(i().parenthesizeLeftSideOfAccess(v,!0),P,Mc(R));return re.flags|=64,re.transformFlags|=32,re}function hl(v,P,R,re){return E.assert(!!(v.flags&64),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."),v.expression!==P||v.questionDotToken!==R||v.name!==re?r(Xa(P,R,re),v):v}function $u(v,P,R){const re=X(212);return re.expression=v,re.questionDotToken=P,re.argumentExpression=R,re.transformFlags|=tn(re.expression)|tn(re.questionDotToken)|tn(re.argumentExpression),re.jsDoc=void 0,re.flowNode=void 0,re}function xu(v,P){const R=$u(i().parenthesizeLeftSideOfAccess(v,!1),void 0,Sy(P));return OE(v)&&(R.transformFlags|=384),R}function Bf(v,P,R){return iJ(v)?ye(v,P,v.questionDotToken,R):v.expression!==P||v.argumentExpression!==R?r(xu(P,R),v):v}function $l(v,P,R){const re=$u(i().parenthesizeLeftSideOfAccess(v,!0),P,Sy(R));return re.flags|=64,re.transformFlags|=32,re}function ye(v,P,R,re){return E.assert(!!(v.flags&64),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."),v.expression!==P||v.questionDotToken!==R||v.argumentExpression!==re?r($l(P,R,re),v):v}function St(v,P,R,re){const Le=X(213);return Le.expression=v,Le.questionDotToken=P,Le.typeArguments=R,Le.arguments=re,Le.transformFlags|=tn(Le.expression)|tn(Le.questionDotToken)|ha(Le.typeArguments)|ha(Le.arguments),Le.typeArguments&&(Le.transformFlags|=1),s_(Le.expression)&&(Le.transformFlags|=16384),Le}function Fr(v,P,R){const re=St(i().parenthesizeLeftSideOfAccess(v,!1),void 0,ka(P),i().parenthesizeExpressionsOfCommaDelimitedList(z(R)));return LE(re.expression)&&(re.transformFlags|=8388608),re}function Wi(v,P,R,re){return tb(v)?Fs(v,P,v.questionDotToken,R,re):v.expression!==P||v.typeArguments!==R||v.arguments!==re?r(Fr(P,R,re),v):v}function Ps(v,P,R,re){const Le=St(i().parenthesizeLeftSideOfAccess(v,!0),P,ka(R),i().parenthesizeExpressionsOfCommaDelimitedList(z(re)));return Le.flags|=64,Le.transformFlags|=32,Le}function Fs(v,P,R,re,Le){return E.assert(!!(v.flags&64),"Cannot update a CallExpression using updateCallChain. Use updateCall instead."),v.expression!==P||v.questionDotToken!==R||v.typeArguments!==re||v.arguments!==Le?r(Ps(P,R,re,Le),v):v}function uc(v,P,R){const re=X(214);return re.expression=i().parenthesizeExpressionOfNew(v),re.typeArguments=ka(P),re.arguments=R?i().parenthesizeExpressionsOfCommaDelimitedList(R):void 0,re.transformFlags|=tn(re.expression)|ha(re.typeArguments)|ha(re.arguments)|32,re.typeArguments&&(re.transformFlags|=1),re}function hc(v,P,R,re){return v.expression!==P||v.typeArguments!==R||v.arguments!==re?r(uc(P,R,re),v):v}function jo(v,P,R){const re=W(215);return re.tag=i().parenthesizeLeftSideOfAccess(v,!1),re.typeArguments=ka(P),re.template=R,re.transformFlags|=tn(re.tag)|ha(re.typeArguments)|tn(re.template)|1024,re.typeArguments&&(re.transformFlags|=1),dz(re.template)&&(re.transformFlags|=128),re}function qo(v,P,R,re){return v.tag!==P||v.typeArguments!==R||v.template!==re?r(jo(P,R,re),v):v}function kc(v,P){const R=W(216);return R.expression=i().parenthesizeOperandOfPrefixUnary(P),R.type=v,R.transformFlags|=tn(R.expression)|tn(R.type)|1,R}function nc(v,P,R){return v.type!==P||v.expression!==R?r(kc(P,R),v):v}function Oc(v){const P=W(217);return P.expression=v,P.transformFlags=tn(P.expression),P.jsDoc=void 0,P}function yp(v,P){return v.expression!==P?r(Oc(P),v):v}function xf(v,P,R,re,Le,Ot,en){const Zi=X(218);Zi.modifiers=ka(v),Zi.asteriskToken=P,Zi.name=Mc(R),Zi.typeParameters=ka(re),Zi.parameters=z(Le),Zi.type=Ot,Zi.body=en;const za=Nd(Zi.modifiers)&1024,wf=!!Zi.asteriskToken,Ty=za&&wf;return Zi.transformFlags=ha(Zi.modifiers)|tn(Zi.asteriskToken)|Q0(Zi.name)|ha(Zi.typeParameters)|ha(Zi.parameters)|tn(Zi.type)|tn(Zi.body)&-67108865|(Ty?128:za?256:wf?2048:0)|(Zi.typeParameters||Zi.type?1:0)|4194304,Zi.typeArguments=void 0,Zi.jsDoc=void 0,Zi.locals=void 0,Zi.nextContainer=void 0,Zi.flowNode=void 0,Zi.endFlowNode=void 0,Zi.returnFlowNode=void 0,Zi}function Xu(v,P,R,re,Le,Ot,en,Zi){return v.name!==re||v.modifiers!==P||v.asteriskToken!==R||v.typeParameters!==Le||v.parameters!==Ot||v.type!==en||v.body!==Zi?J(xf(P,R,re,Le,Ot,en,Zi),v):v}function Jf(v,P,R,re,Le,Ot){const en=X(219);en.modifiers=ka(v),en.typeParameters=ka(P),en.parameters=z(R),en.type=re,en.equalsGreaterThanToken=Le??me(39),en.body=i().parenthesizeConciseBodyOfArrowFunction(Ot);const Zi=Nd(en.modifiers)&1024;return en.transformFlags=ha(en.modifiers)|ha(en.typeParameters)|ha(en.parameters)|tn(en.type)|tn(en.equalsGreaterThanToken)|tn(en.body)&-67108865|(en.typeParameters||en.type?1:0)|(Zi?16640:0)|1024,en.typeArguments=void 0,en.jsDoc=void 0,en.locals=void 0,en.nextContainer=void 0,en.flowNode=void 0,en.endFlowNode=void 0,en.returnFlowNode=void 0,en}function vg(v,P,R,re,Le,Ot,en){return v.modifiers!==P||v.typeParameters!==R||v.parameters!==re||v.type!==Le||v.equalsGreaterThanToken!==Ot||v.body!==en?J(Jf(P,R,re,Le,Ot,en),v):v}function Fm(v){const P=W(220);return P.expression=i().parenthesizeOperandOfPrefixUnary(v),P.transformFlags|=tn(P.expression),P}function n0(v,P){return v.expression!==P?r(Fm(P),v):v}function ou(v){const P=W(221);return P.expression=i().parenthesizeOperandOfPrefixUnary(v),P.transformFlags|=tn(P.expression),P}function bg(v,P){return v.expression!==P?r(ou(P),v):v}function L_(v){const P=W(222);return P.expression=i().parenthesizeOperandOfPrefixUnary(v),P.transformFlags|=tn(P.expression),P}function zf(v,P){return v.expression!==P?r(L_(P),v):v}function Qu(v){const P=W(223);return P.expression=i().parenthesizeOperandOfPrefixUnary(v),P.transformFlags|=tn(P.expression)|256|128|2097152,P}function Q(v,P){return v.expression!==P?r(Qu(P),v):v}function Ye(v,P){const R=W(224);return R.operator=v,R.operand=i().parenthesizeOperandOfPrefixUnary(P),R.transformFlags|=tn(R.operand),(v===46||v===47)&&Ie(R.operand)&&!Eo(R.operand)&&!eh(R.operand)&&(R.transformFlags|=268435456),R}function Et(v,P){return v.operand!==P?r(Ye(v.operator,P),v):v}function Pt(v,P){const R=W(225);return R.operator=P,R.operand=i().parenthesizeOperandOfPostfixUnary(v),R.transformFlags|=tn(R.operand),Ie(R.operand)&&!Eo(R.operand)&&!eh(R.operand)&&(R.transformFlags|=268435456),R}function L(v,P){return v.operand!==P?r(Pt(P,v.operator),v):v}function pe(v,P,R){const re=X(226),Le=GM(P),Ot=Le.kind;return re.left=i().parenthesizeLeftSideOfBinary(Ot,v),re.operatorToken=Le,re.right=i().parenthesizeRightSideOfBinary(Ot,re.left,R),re.transformFlags|=tn(re.left)|tn(re.operatorToken)|tn(re.right),Ot===61?re.transformFlags|=32:Ot===64?ma(re.left)?re.transformFlags|=5248|Ze(re.left):Lu(re.left)&&(re.transformFlags|=5120|Ze(re.left)):Ot===43||Ot===68?re.transformFlags|=512:aE(Ot)&&(re.transformFlags|=16),Ot===103&&Ti(re.left)&&(re.transformFlags|=536870912),re.jsDoc=void 0,re}function Ze(v){return hw(v)?65536:0}function At(v,P,R,re){return v.left!==P||v.operatorToken!==R||v.right!==re?r(pe(P,R,re),v):v}function Mr(v,P,R,re,Le){const Ot=W(227);return Ot.condition=i().parenthesizeConditionOfConditionalExpression(v),Ot.questionToken=P??me(58),Ot.whenTrue=i().parenthesizeBranchOfConditionalExpression(R),Ot.colonToken=re??me(59),Ot.whenFalse=i().parenthesizeBranchOfConditionalExpression(Le),Ot.transformFlags|=tn(Ot.condition)|tn(Ot.questionToken)|tn(Ot.whenTrue)|tn(Ot.colonToken)|tn(Ot.whenFalse),Ot}function Rn(v,P,R,re,Le,Ot){return v.condition!==P||v.questionToken!==R||v.whenTrue!==re||v.colonToken!==Le||v.whenFalse!==Ot?r(Mr(P,R,re,Le,Ot),v):v}function jn(v,P){const R=W(228);return R.head=v,R.templateSpans=z(P),R.transformFlags|=tn(R.head)|ha(R.templateSpans)|1024,R}function Oi(v,P,R){return v.head!==P||v.templateSpans!==R?r(jn(P,R),v):v}function sa(v,P,R,re=0){E.assert(!(re&-7177),"Unsupported template flags.");let Le;if(R!==void 0&&R!==P&&(Le=DFe(v,R),typeof Le=="object"))return E.fail("Invalid raw text");if(P===void 0){if(Le===void 0)return E.fail("Arguments 'text' and 'rawText' may not both be undefined.");P=Le}else Le!==void 0&&E.assert(P===Le,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");return P}function aa(v){let P=1024;return v&&(P|=128),P}function Xo(v,P,R,re){const Le=pt(v);return Le.text=P,Le.rawText=R,Le.templateFlags=re&7176,Le.transformFlags=aa(Le.templateFlags),Le}function Xl(v,P,R,re){const Le=X(v);return Le.text=P,Le.rawText=R,Le.templateFlags=re&7176,Le.transformFlags=aa(Le.templateFlags),Le}function ll(v,P,R,re){return v===15?Xl(v,P,R,re):Xo(v,P,R,re)}function kf(v,P,R){return v=sa(16,v,P,R),ll(16,v,P,R)}function _a(v,P,R){return v=sa(16,v,P,R),ll(17,v,P,R)}function vp(v,P,R){return v=sa(16,v,P,R),ll(18,v,P,R)}function Cf(v,P,R){return v=sa(16,v,P,R),Xl(15,v,P,R)}function Sg(v,P){E.assert(!v||!!P,"A `YieldExpression` with an asteriskToken must have an expression.");const R=W(229);return R.expression=P&&i().parenthesizeExpressionForDisallowedComma(P),R.asteriskToken=v,R.transformFlags|=tn(R.expression)|tn(R.asteriskToken)|1024|128|1048576,R}function Om(v,P,R){return v.expression!==R||v.asteriskToken!==P?r(Sg(P,R),v):v}function ki(v){const P=W(230);return P.expression=i().parenthesizeExpressionForDisallowedComma(v),P.transformFlags|=tn(P.expression)|1024|32768,P}function ay(v,P){return v.expression!==P?r(ki(P),v):v}function oy(v,P,R,re,Le){const Ot=X(231);return Ot.modifiers=ka(v),Ot.name=Mc(P),Ot.typeParameters=ka(R),Ot.heritageClauses=ka(re),Ot.members=z(Le),Ot.transformFlags|=ha(Ot.modifiers)|Q0(Ot.name)|ha(Ot.typeParameters)|ha(Ot.heritageClauses)|ha(Ot.members)|(Ot.typeParameters?1:0)|1024,Ot.jsDoc=void 0,Ot}function fd(v,P,R,re,Le,Ot){return v.modifiers!==P||v.name!==R||v.typeParameters!==re||v.heritageClauses!==Le||v.members!==Ot?r(oy(P,R,re,Le,Ot),v):v}function u2(){return W(232)}function i0(v,P){const R=W(233);return R.expression=i().parenthesizeLeftSideOfAccess(v,!1),R.typeArguments=P&&i().parenthesizeTypeArguments(P),R.transformFlags|=tn(R.expression)|ha(R.typeArguments)|1024,R}function Ee(v,P,R){return v.expression!==P||v.typeArguments!==R?r(i0(P,R),v):v}function We(v,P){const R=W(234);return R.expression=v,R.type=P,R.transformFlags|=tn(R.expression)|tn(R.type)|1,R}function bt(v,P,R){return v.expression!==P||v.type!==R?r(We(P,R),v):v}function Rt(v){const P=W(235);return P.expression=i().parenthesizeLeftSideOfAccess(v,!1),P.transformFlags|=tn(P.expression)|1,P}function tr(v,P){return pI(v)?ni(v,P):v.expression!==P?r(Rt(P),v):v}function Rr(v,P){const R=W(238);return R.expression=v,R.type=P,R.transformFlags|=tn(R.expression)|tn(R.type)|1,R}function nr(v,P,R){return v.expression!==P||v.type!==R?r(Rr(P,R),v):v}function xr(v){const P=W(235);return P.flags|=64,P.expression=i().parenthesizeLeftSideOfAccess(v,!0),P.transformFlags|=tn(P.expression)|1,P}function ni(v,P){return E.assert(!!(v.flags&64),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."),v.expression!==P?r(xr(P),v):v}function _n(v,P){const R=W(236);switch(R.keywordToken=v,R.name=P,R.transformFlags|=tn(R.name),v){case 105:R.transformFlags|=1024;break;case 102:R.transformFlags|=32;break;default:return E.assertNever(v)}return R.flowNode=void 0,R}function fn(v,P){return v.name!==P?r(_n(v.keywordToken,P),v):v}function on(v,P){const R=W(239);return R.expression=v,R.literal=P,R.transformFlags|=tn(R.expression)|tn(R.literal)|1024,R}function wi(v,P,R){return v.expression!==P||v.literal!==R?r(on(P,R),v):v}function Qa(){const v=W(240);return v.transformFlags|=1024,v}function Va(v,P){const R=W(241);return R.statements=z(v),R.multiLine=P,R.transformFlags|=ha(R.statements),R.jsDoc=void 0,R.locals=void 0,R.nextContainer=void 0,R}function M_(v,P){return v.statements!==P?r(Va(P,v.multiLine),v):v}function A1(v,P){const R=W(243);return R.modifiers=ka(v),R.declarationList=es(P)?F1(P):P,R.transformFlags|=ha(R.modifiers)|tn(R.declarationList),Nd(R.modifiers)&128&&(R.transformFlags=1),R.jsDoc=void 0,R.flowNode=void 0,R}function cy(v,P,R){return v.modifiers!==P||v.declarationList!==R?r(A1(P,R),v):v}function sh(){const v=W(242);return v.jsDoc=void 0,v}function ly(v){const P=W(244);return P.expression=i().parenthesizeExpressionOfExpressionStatement(v),P.transformFlags|=tn(P.expression),P.jsDoc=void 0,P.flowNode=void 0,P}function Kb(v,P){return v.expression!==P?r(ly(P),v):v}function _2(v,P,R){const re=W(245);return re.expression=v,re.thenStatement=Um(P),re.elseStatement=Um(R),re.transformFlags|=tn(re.expression)|tn(re.thenStatement)|tn(re.elseStatement),re.jsDoc=void 0,re.flowNode=void 0,re}function eS(v,P,R,re){return v.expression!==P||v.thenStatement!==R||v.elseStatement!==re?r(_2(P,R,re),v):v}function tS(v,P){const R=W(246);return R.statement=Um(v),R.expression=P,R.transformFlags|=tn(R.statement)|tn(R.expression),R.jsDoc=void 0,R.flowNode=void 0,R}function Z3(v,P,R){return v.statement!==P||v.expression!==R?r(tS(P,R),v):v}function gx(v,P){const R=W(247);return R.expression=v,R.statement=Um(P),R.transformFlags|=tn(R.expression)|tn(R.statement),R.jsDoc=void 0,R.flowNode=void 0,R}function g6(v,P,R){return v.expression!==P||v.statement!==R?r(gx(P,R),v):v}function N1(v,P,R,re){const Le=W(248);return Le.initializer=v,Le.condition=P,Le.incrementor=R,Le.statement=Um(re),Le.transformFlags|=tn(Le.initializer)|tn(Le.condition)|tn(Le.incrementor)|tn(Le.statement),Le.jsDoc=void 0,Le.locals=void 0,Le.nextContainer=void 0,Le.flowNode=void 0,Le}function hx(v,P,R,re,Le){return v.initializer!==P||v.condition!==R||v.incrementor!==re||v.statement!==Le?r(N1(P,R,re,Le),v):v}function yx(v,P,R){const re=W(249);return re.initializer=v,re.expression=P,re.statement=Um(R),re.transformFlags|=tn(re.initializer)|tn(re.expression)|tn(re.statement),re.jsDoc=void 0,re.locals=void 0,re.nextContainer=void 0,re.flowNode=void 0,re}function h6(v,P,R,re){return v.initializer!==P||v.expression!==R||v.statement!==re?r(yx(P,R,re),v):v}function rS(v,P,R,re){const Le=W(250);return Le.awaitModifier=v,Le.initializer=P,Le.expression=i().parenthesizeExpressionForDisallowedComma(R),Le.statement=Um(re),Le.transformFlags|=tn(Le.awaitModifier)|tn(Le.initializer)|tn(Le.expression)|tn(Le.statement)|1024,v&&(Le.transformFlags|=128),Le.jsDoc=void 0,Le.locals=void 0,Le.nextContainer=void 0,Le.flowNode=void 0,Le}function y6(v,P,R,re,Le){return v.awaitModifier!==P||v.initializer!==R||v.expression!==re||v.statement!==Le?r(rS(P,R,re,Le),v):v}function vx(v){const P=W(251);return P.label=Mc(v),P.transformFlags|=tn(P.label)|4194304,P.jsDoc=void 0,P.flowNode=void 0,P}function bx(v,P){return v.label!==P?r(vx(P),v):v}function nS(v){const P=W(252);return P.label=Mc(v),P.transformFlags|=tn(P.label)|4194304,P.jsDoc=void 0,P.flowNode=void 0,P}function f2(v,P){return v.label!==P?r(nS(P),v):v}function p2(v){const P=W(253);return P.expression=v,P.transformFlags|=tn(P.expression)|128|4194304,P.jsDoc=void 0,P.flowNode=void 0,P}function I1(v,P){return v.expression!==P?r(p2(P),v):v}function s0(v,P){const R=W(254);return R.expression=v,R.statement=Um(P),R.transformFlags|=tn(R.expression)|tn(R.statement),R.jsDoc=void 0,R.flowNode=void 0,R}function d2(v,P,R){return v.expression!==P||v.statement!==R?r(s0(P,R),v):v}function Ud(v,P){const R=W(255);return R.expression=i().parenthesizeExpressionForDisallowedComma(v),R.caseBlock=P,R.transformFlags|=tn(R.expression)|tn(R.caseBlock),R.jsDoc=void 0,R.flowNode=void 0,R.possiblyExhaustive=!1,R}function wa(v,P,R){return v.expression!==P||v.caseBlock!==R?r(Ud(P,R),v):v}function iS(v,P){const R=W(256);return R.label=Mc(v),R.statement=Um(P),R.transformFlags|=tn(R.label)|tn(R.statement),R.jsDoc=void 0,R.flowNode=void 0,R}function v6(v,P,R){return v.label!==P||v.statement!==R?r(iS(P,R),v):v}function uy(v){const P=W(257);return P.expression=v,P.transformFlags|=tn(P.expression),P.jsDoc=void 0,P.flowNode=void 0,P}function a0(v,P){return v.expression!==P?r(uy(P),v):v}function Lm(v,P,R){const re=W(258);return re.tryBlock=v,re.catchClause=P,re.finallyBlock=R,re.transformFlags|=tn(re.tryBlock)|tn(re.catchClause)|tn(re.finallyBlock),re.jsDoc=void 0,re.flowNode=void 0,re}function Wf(v,P,R,re){return v.tryBlock!==P||v.catchClause!==R||v.finallyBlock!==re?r(Lm(P,R,re),v):v}function R_(){const v=W(259);return v.jsDoc=void 0,v.flowNode=void 0,v}function Yu(v,P,R,re){const Le=X(260);return Le.name=Mc(v),Le.exclamationToken=P,Le.type=R,Le.initializer=bS(re),Le.transformFlags|=Q0(Le.name)|tn(Le.initializer)|(Le.exclamationToken??Le.type?1:0),Le.jsDoc=void 0,Le}function K_(v,P,R,re,Le){return v.name!==P||v.type!==re||v.exclamationToken!==R||v.initializer!==Le?r(Yu(P,R,re,Le),v):v}function F1(v,P=0){const R=W(261);return R.flags|=P&7,R.declarations=z(v),R.transformFlags|=ha(R.declarations)|4194304,P&7&&(R.transformFlags|=263168),P&4&&(R.transformFlags|=4),R}function b6(v,P){return v.declarations!==P?r(F1(P,v.flags),v):v}function Sx(v,P,R,re,Le,Ot,en){const Zi=X(262);if(Zi.modifiers=ka(v),Zi.asteriskToken=P,Zi.name=Mc(R),Zi.typeParameters=ka(re),Zi.parameters=z(Le),Zi.type=Ot,Zi.body=en,!Zi.body||Nd(Zi.modifiers)&128)Zi.transformFlags=1;else{const za=Nd(Zi.modifiers)&1024,wf=!!Zi.asteriskToken,Ty=za&&wf;Zi.transformFlags=ha(Zi.modifiers)|tn(Zi.asteriskToken)|Q0(Zi.name)|ha(Zi.typeParameters)|ha(Zi.parameters)|tn(Zi.type)|tn(Zi.body)&-67108865|(Ty?128:za?256:wf?2048:0)|(Zi.typeParameters||Zi.type?1:0)|4194304}return Zi.typeArguments=void 0,Zi.jsDoc=void 0,Zi.locals=void 0,Zi.nextContainer=void 0,Zi.endFlowNode=void 0,Zi.returnFlowNode=void 0,Zi}function sS(v,P,R,re,Le,Ot,en,Zi){return v.modifiers!==P||v.asteriskToken!==R||v.name!==re||v.typeParameters!==Le||v.parameters!==Ot||v.type!==en||v.body!==Zi?m2(Sx(P,R,re,Le,Ot,en,Zi),v):v}function m2(v,P){return v!==P&&v.modifiers===P.modifiers&&(v.modifiers=P.modifiers),J(v,P)}function O1(v,P,R,re,Le){const Ot=X(263);return Ot.modifiers=ka(v),Ot.name=Mc(P),Ot.typeParameters=ka(R),Ot.heritageClauses=ka(re),Ot.members=z(Le),Nd(Ot.modifiers)&128?Ot.transformFlags=1:(Ot.transformFlags|=ha(Ot.modifiers)|Q0(Ot.name)|ha(Ot.typeParameters)|ha(Ot.heritageClauses)|ha(Ot.members)|(Ot.typeParameters?1:0)|1024,Ot.transformFlags&8192&&(Ot.transformFlags|=1)),Ot.jsDoc=void 0,Ot}function aS(v,P,R,re,Le,Ot){return v.modifiers!==P||v.name!==R||v.typeParameters!==re||v.heritageClauses!==Le||v.members!==Ot?r(O1(P,R,re,Le,Ot),v):v}function L1(v,P,R,re,Le){const Ot=X(264);return Ot.modifiers=ka(v),Ot.name=Mc(P),Ot.typeParameters=ka(R),Ot.heritageClauses=ka(re),Ot.members=z(Le),Ot.transformFlags=1,Ot.jsDoc=void 0,Ot}function Cl(v,P,R,re,Le,Ot){return v.modifiers!==P||v.name!==R||v.typeParameters!==re||v.heritageClauses!==Le||v.members!==Ot?r(L1(P,R,re,Le,Ot),v):v}function o0(v,P,R,re){const Le=X(265);return Le.modifiers=ka(v),Le.name=Mc(P),Le.typeParameters=ka(R),Le.type=re,Le.transformFlags=1,Le.jsDoc=void 0,Le.locals=void 0,Le.nextContainer=void 0,Le}function c0(v,P,R,re,Le){return v.modifiers!==P||v.name!==R||v.typeParameters!==re||v.type!==Le?r(o0(P,R,re,Le),v):v}function Tg(v,P,R){const re=X(266);return re.modifiers=ka(v),re.name=Mc(P),re.members=z(R),re.transformFlags|=ha(re.modifiers)|tn(re.name)|ha(re.members)|1,re.transformFlags&=-67108865,re.jsDoc=void 0,re}function je(v,P,R,re){return v.modifiers!==P||v.name!==R||v.members!==re?r(Tg(P,R,re),v):v}function Ol(v,P,R,re=0){const Le=X(267);return Le.modifiers=ka(v),Le.flags|=re&2088,Le.name=P,Le.body=R,Nd(Le.modifiers)&128?Le.transformFlags=1:Le.transformFlags|=ha(Le.modifiers)|tn(Le.name)|tn(Le.body)|1,Le.transformFlags&=-67108865,Le.jsDoc=void 0,Le.locals=void 0,Le.nextContainer=void 0,Le}function Uf(v,P,R,re){return v.modifiers!==P||v.name!==R||v.body!==re?r(Ol(P,R,re,v.flags),v):v}function Bu(v){const P=W(268);return P.statements=z(v),P.transformFlags|=ha(P.statements),P.jsDoc=void 0,P}function S6(v,P){return v.statements!==P?r(Bu(P),v):v}function l0(v){const P=W(269);return P.clauses=z(v),P.transformFlags|=ha(P.clauses),P.locals=void 0,P.nextContainer=void 0,P}function M1(v,P){return v.clauses!==P?r(l0(P),v):v}function xg(v){const P=X(270);return P.name=Mc(v),P.transformFlags|=q8(P.name)|1,P.modifiers=void 0,P.jsDoc=void 0,P}function K3(v,P){return v.name!==P?Aa(xg(P),v):v}function Aa(v,P){return v!==P&&(v.modifiers=P.modifiers),r(v,P)}function pd(v,P,R,re){const Le=X(271);return Le.modifiers=ka(v),Le.name=Mc(R),Le.isTypeOnly=P,Le.moduleReference=re,Le.transformFlags|=ha(Le.modifiers)|q8(Le.name)|tn(Le.moduleReference),Pm(Le.moduleReference)||(Le.transformFlags|=1),Le.transformFlags&=-67108865,Le.jsDoc=void 0,Le}function oS(v,P,R,re,Le){return v.modifiers!==P||v.isTypeOnly!==R||v.name!==re||v.moduleReference!==Le?r(pd(P,R,re,Le),v):v}function cS(v,P,R,re){const Le=W(272);return Le.modifiers=ka(v),Le.importClause=P,Le.moduleSpecifier=R,Le.attributes=Le.assertClause=re,Le.transformFlags|=tn(Le.importClause)|tn(Le.moduleSpecifier),Le.transformFlags&=-67108865,Le.jsDoc=void 0,Le}function g2(v,P,R,re,Le){return v.modifiers!==P||v.importClause!==R||v.moduleSpecifier!==re||v.attributes!==Le?r(cS(P,R,re,Le),v):v}function h2(v,P,R){const re=X(273);return re.isTypeOnly=v,re.name=P,re.namedBindings=R,re.transformFlags|=tn(re.name)|tn(re.namedBindings),v&&(re.transformFlags|=1),re.transformFlags&=-67108865,re}function bp(v,P,R,re){return v.isTypeOnly!==P||v.name!==R||v.namedBindings!==re?r(h2(P,R,re),v):v}function dd(v,P){const R=W(300);return R.elements=z(v),R.multiLine=P,R.token=132,R.transformFlags|=4,R}function kg(v,P,R){return v.elements!==P||v.multiLine!==R?r(dd(P,R),v):v}function lS(v,P){const R=W(301);return R.name=v,R.value=P,R.transformFlags|=4,R}function Vd(v,P,R){return v.name!==P||v.value!==R?r(lS(P,R),v):v}function uS(v,P){const R=W(302);return R.assertClause=v,R.multiLine=P,R}function T6(v,P,R){return v.assertClause!==P||v.multiLine!==R?r(uS(P,R),v):v}function yi(v,P,R){const re=W(300);return re.token=R??118,re.elements=z(v),re.multiLine=P,re.transformFlags|=4,re}function Wn(v,P,R){return v.elements!==P||v.multiLine!==R?r(yi(P,R,v.token),v):v}function qd(v,P){const R=W(301);return R.name=v,R.value=P,R.transformFlags|=4,R}function S_(v,P,R){return v.name!==P||v.value!==R?r(qd(P,R),v):v}function x6(v){const P=X(274);return P.name=v,P.transformFlags|=tn(P.name),P.transformFlags&=-67108865,P}function u0(v,P){return v.name!==P?r(x6(P),v):v}function k6(v){const P=X(280);return P.name=v,P.transformFlags|=tn(P.name)|32,P.transformFlags&=-67108865,P}function y2(v,P){return v.name!==P?r(k6(P),v):v}function _c(v){const P=W(275);return P.elements=z(v),P.transformFlags|=ha(P.elements),P.transformFlags&=-67108865,P}function Ju(v,P){return v.elements!==P?r(_c(P),v):v}function ah(v,P,R){const re=X(276);return re.isTypeOnly=v,re.propertyName=P,re.name=R,re.transformFlags|=tn(re.propertyName)|tn(re.name),re.transformFlags&=-67108865,re}function Mm(v,P,R,re){return v.isTypeOnly!==P||v.propertyName!==R||v.name!==re?r(ah(P,R,re),v):v}function Cg(v,P,R){const re=X(277);return re.modifiers=ka(v),re.isExportEquals=P,re.expression=P?i().parenthesizeRightSideOfBinary(64,void 0,R):i().parenthesizeExpressionOfExportDefault(R),re.transformFlags|=ha(re.modifiers)|tn(re.expression),re.transformFlags&=-67108865,re.jsDoc=void 0,re}function Gp(v,P,R){return v.modifiers!==P||v.expression!==R?r(Cg(P,v.isExportEquals,R),v):v}function R1(v,P,R,re,Le){const Ot=X(278);return Ot.modifiers=ka(v),Ot.isTypeOnly=P,Ot.exportClause=R,Ot.moduleSpecifier=re,Ot.attributes=Ot.assertClause=Le,Ot.transformFlags|=ha(Ot.modifiers)|tn(Ot.exportClause)|tn(Ot.moduleSpecifier),Ot.transformFlags&=-67108865,Ot.jsDoc=void 0,Ot}function Eg(v,P,R,re,Le,Ot){return v.modifiers!==P||v.isTypeOnly!==R||v.exportClause!==re||v.moduleSpecifier!==Le||v.attributes!==Ot?C6(R1(P,R,re,Le,Ot),v):v}function C6(v,P){return v!==P&&v.modifiers===P.modifiers&&(v.modifiers=P.modifiers),r(v,P)}function Rm(v){const P=W(279);return P.elements=z(v),P.transformFlags|=ha(P.elements),P.transformFlags&=-67108865,P}function E6(v,P){return v.elements!==P?r(Rm(P),v):v}function Hd(v,P,R){const re=W(281);return re.isTypeOnly=v,re.propertyName=Mc(P),re.name=Mc(R),re.transformFlags|=tn(re.propertyName)|tn(re.name),re.transformFlags&=-67108865,re.jsDoc=void 0,re}function jm(v,P,R,re){return v.isTypeOnly!==P||v.propertyName!==R||v.name!==re?r(Hd(P,R,re),v):v}function _0(){const v=X(282);return v.jsDoc=void 0,v}function D6(v){const P=W(283);return P.expression=v,P.transformFlags|=tn(P.expression),P.transformFlags&=-67108865,P}function Tx(v,P){return v.expression!==P?r(D6(P),v):v}function eD(v){return W(v)}function xx(v,P,R=!1){const re=io(v,R?P&&i().parenthesizeNonArrayTypeOfPostfixType(P):P);return re.postfix=R,re}function io(v,P){const R=W(v);return R.type=P,R}function v2(v,P,R){return P.type!==R?r(xx(v,R,P.postfix),P):P}function kx(v,P,R){return P.type!==R?r(io(v,R),P):P}function Sp(v,P){const R=X(324);return R.parameters=ka(v),R.type=P,R.transformFlags=ha(R.parameters)|(R.type?1:0),R.jsDoc=void 0,R.locals=void 0,R.nextContainer=void 0,R.typeArguments=void 0,R}function j1(v,P,R){return v.parameters!==P||v.type!==R?r(Sp(P,R),v):v}function Cx(v,P=!1){const R=X(329);return R.jsDocPropertyTags=ka(v),R.isArrayType=P,R}function tD(v,P,R){return v.jsDocPropertyTags!==P||v.isArrayType!==R?r(Cx(P,R),v):v}function _S(v){const P=W(316);return P.type=v,P}function Kr(v,P){return v.type!==P?r(_S(P),v):v}function Ql(v,P,R){const re=X(330);return re.typeParameters=ka(v),re.parameters=z(P),re.type=R,re.jsDoc=void 0,re.locals=void 0,re.nextContainer=void 0,re}function Yi(v,P,R,re){return v.typeParameters!==P||v.parameters!==R||v.type!==re?r(Ql(P,R,re),v):v}function __(v){const P=yW(v.kind);return v.tagName.escapedText===zo(P)?v.tagName:Se(P)}function Gd(v,P,R){const re=W(v);return re.tagName=P,re.comment=R,re}function Tp(v,P,R){const re=X(v);return re.tagName=P,re.comment=R,re}function Ur(v,P,R,re){const Le=Gd(352,v??Se("template"),re);return Le.constraint=P,Le.typeParameters=z(R),Le}function b2(v,P=__(v),R,re,Le){return v.tagName!==P||v.constraint!==R||v.typeParameters!==re||v.comment!==Le?r(Ur(P,R,re,Le),v):v}function B1(v,P,R,re){const Le=Tp(353,v??Se("typedef"),re);return Le.typeExpression=P,Le.fullName=R,Le.name=nU(R),Le.locals=void 0,Le.nextContainer=void 0,Le}function yl(v,P=__(v),R,re,Le){return v.tagName!==P||v.typeExpression!==R||v.fullName!==re||v.comment!==Le?r(B1(P,R,re,Le),v):v}function $d(v,P,R,re,Le,Ot){const en=Tp(348,v??Se("param"),Ot);return en.typeExpression=re,en.name=P,en.isNameFirst=!!Le,en.isBracketed=R,en}function Xd(v,P=__(v),R,re,Le,Ot,en){return v.tagName!==P||v.name!==R||v.isBracketed!==re||v.typeExpression!==Le||v.isNameFirst!==Ot||v.comment!==en?r($d(P,R,re,Le,Ot,en),v):v}function _y(v,P,R,re,Le,Ot){const en=Tp(355,v??Se("prop"),Ot);return en.typeExpression=re,en.name=P,en.isNameFirst=!!Le,en.isBracketed=R,en}function Ex(v,P=__(v),R,re,Le,Ot,en){return v.tagName!==P||v.name!==R||v.isBracketed!==re||v.typeExpression!==Le||v.isNameFirst!==Ot||v.comment!==en?r(_y(P,R,re,Le,Ot,en),v):v}function oh(v,P,R,re){const Le=Tp(345,v??Se("callback"),re);return Le.typeExpression=P,Le.fullName=R,Le.name=nU(R),Le.locals=void 0,Le.nextContainer=void 0,Le}function J1(v,P=__(v),R,re,Le){return v.tagName!==P||v.typeExpression!==R||v.fullName!==re||v.comment!==Le?r(oh(P,R,re,Le),v):v}function z1(v,P,R){const re=Gd(346,v??Se("overload"),R);return re.typeExpression=P,re}function Dg(v,P=__(v),R,re){return v.tagName!==P||v.typeExpression!==R||v.comment!==re?r(z1(P,R,re),v):v}function Bm(v,P,R){const re=Gd(335,v??Se("augments"),R);return re.class=P,re}function fS(v,P=__(v),R,re){return v.tagName!==P||v.class!==R||v.comment!==re?r(Bm(P,R,re),v):v}function ch(v,P,R){const re=Gd(336,v??Se("implements"),R);return re.class=P,re}function fy(v,P,R){const re=Gd(354,v??Se("see"),R);return re.name=P,re}function S2(v,P,R,re){return v.tagName!==P||v.name!==R||v.comment!==re?r(fy(P,R,re),v):v}function Dx(v){const P=W(317);return P.name=v,P}function pS(v,P){return v.name!==P?r(Dx(P),v):v}function T2(v,P){const R=W(318);return R.left=v,R.right=P,R.transformFlags|=tn(R.left)|tn(R.right),R}function Vf(v,P,R){return v.left!==P||v.right!==R?r(T2(P,R),v):v}function W1(v,P){const R=W(331);return R.name=v,R.text=P,R}function Cc(v,P,R){return v.name!==P?r(W1(P,R),v):v}function ul(v,P){const R=W(332);return R.name=v,R.text=P,R}function Px(v,P,R){return v.name!==P?r(ul(P,R),v):v}function cu(v,P){const R=W(333);return R.name=v,R.text=P,R}function T_(v,P,R){return v.name!==P?r(cu(P,R),v):v}function x2(v,P=__(v),R,re){return v.tagName!==P||v.class!==R||v.comment!==re?r(ch(P,R,re),v):v}function qf(v,P,R){return Gd(v,P??Se(yW(v)),R)}function U1(v,P,R=__(P),re){return P.tagName!==R||P.comment!==re?r(qf(v,R,re),P):P}function f0(v,P,R,re){const Le=Gd(v,P??Se(yW(v)),re);return Le.typeExpression=R,Le}function Ll(v,P,R=__(P),re,Le){return P.tagName!==R||P.typeExpression!==re||P.comment!==Le?r(f0(v,R,re,Le),P):P}function dS(v,P){return Gd(334,v,P)}function xp(v,P,R){return v.tagName!==P||v.comment!==R?r(dS(P,R),v):v}function py(v,P,R){const re=Tp(347,v??Se(yW(347)),R);return re.typeExpression=P,re.locals=void 0,re.nextContainer=void 0,re}function P6(v,P=__(v),R,re){return v.tagName!==P||v.typeExpression!==R||v.comment!==re?r(py(P,R,re),v):v}function lo(v){const P=W(328);return P.text=v,P}function w6(v,P){return v.text!==P?r(lo(P),v):v}function mS(v,P){const R=W(327);return R.comment=v,R.tags=ka(P),R}function V1(v,P,R){return v.comment!==P||v.tags!==R?r(mS(P,R),v):v}function wx(v,P,R){const re=W(284);return re.openingElement=v,re.children=z(P),re.closingElement=R,re.transformFlags|=tn(re.openingElement)|ha(re.children)|tn(re.closingElement)|2,re}function Zu(v,P,R,re){return v.openingElement!==P||v.children!==R||v.closingElement!==re?r(wx(P,R,re),v):v}function Pg(v,P,R){const re=W(285);return re.tagName=v,re.typeArguments=ka(P),re.attributes=R,re.transformFlags|=tn(re.tagName)|ha(re.typeArguments)|tn(re.attributes)|2,re.typeArguments&&(re.transformFlags|=1),re}function lh(v,P,R,re){return v.tagName!==P||v.typeArguments!==R||v.attributes!==re?r(Pg(P,R,re),v):v}function k2(v,P,R){const re=W(286);return re.tagName=v,re.typeArguments=ka(P),re.attributes=R,re.transformFlags|=tn(re.tagName)|ha(re.typeArguments)|tn(re.attributes)|2,P&&(re.transformFlags|=1),re}function ef(v,P,R,re){return v.tagName!==P||v.typeArguments!==R||v.attributes!==re?r(k2(P,R,re),v):v}function Ax(v){const P=W(287);return P.tagName=v,P.transformFlags|=tn(P.tagName)|2,P}function dy(v,P){return v.tagName!==P?r(Ax(P),v):v}function Ef(v,P,R){const re=W(288);return re.openingFragment=v,re.children=z(P),re.closingFragment=R,re.transformFlags|=tn(re.openingFragment)|ha(re.children)|tn(re.closingFragment)|2,re}function C2(v,P,R,re){return v.openingFragment!==P||v.children!==R||v.closingFragment!==re?r(Ef(P,R,re),v):v}function p0(v,P){const R=W(12);return R.text=v,R.containsOnlyTriviaWhiteSpaces=!!P,R.transformFlags|=2,R}function rD(v,P,R){return v.text!==P||v.containsOnlyTriviaWhiteSpaces!==R?r(p0(P,R),v):v}function Nx(){const v=W(289);return v.transformFlags|=2,v}function Ix(){const v=W(290);return v.transformFlags|=2,v}function Fx(v,P){const R=X(291);return R.name=v,R.initializer=P,R.transformFlags|=tn(R.name)|tn(R.initializer)|2,R}function q1(v,P,R){return v.name!==P||v.initializer!==R?r(Fx(P,R),v):v}function j_(v){const P=X(292);return P.properties=z(v),P.transformFlags|=ha(P.properties)|2,P}function wg(v,P){return v.properties!==P?r(j_(P),v):v}function Ox(v){const P=W(293);return P.expression=v,P.transformFlags|=tn(P.expression)|2,P}function Lx(v,P){return v.expression!==P?r(Ox(P),v):v}function Na(v,P){const R=W(294);return R.dotDotDotToken=v,R.expression=P,R.transformFlags|=tn(R.dotDotDotToken)|tn(R.expression)|2,R}function cn(v,P){return v.expression!==P?r(Na(v.dotDotDotToken,P),v):v}function tf(v,P){const R=W(295);return R.namespace=v,R.name=P,R.transformFlags|=tn(R.namespace)|tn(R.name)|2,R}function f_(v,P,R){return v.namespace!==P||v.name!==R?r(tf(P,R),v):v}function E2(v,P){const R=W(296);return R.expression=i().parenthesizeExpressionForDisallowedComma(v),R.statements=z(P),R.transformFlags|=tn(R.expression)|ha(R.statements),R.jsDoc=void 0,R}function A6(v,P,R){return v.expression!==P||v.statements!==R?r(E2(P,R),v):v}function H1(v){const P=W(297);return P.statements=z(v),P.transformFlags=ha(P.statements),P}function D2(v,P){return v.statements!==P?r(H1(P),v):v}function my(v,P){const R=W(298);switch(R.token=v,R.types=z(P),R.transformFlags|=ha(R.types),v){case 96:R.transformFlags|=1024;break;case 119:R.transformFlags|=1;break;default:return E.assertNever(v)}return R}function Df(v,P){return v.types!==P?r(my(v.token,P),v):v}function kp(v,P){const R=W(299);return R.variableDeclaration=jx(v),R.block=P,R.transformFlags|=tn(R.variableDeclaration)|tn(R.block)|(v?0:64),R.locals=void 0,R.nextContainer=void 0,R}function gy(v,P,R){return v.variableDeclaration!==P||v.block!==R?r(kp(P,R),v):v}function $p(v,P){const R=X(303);return R.name=Mc(v),R.initializer=i().parenthesizeExpressionForDisallowedComma(P),R.transformFlags|=Q0(R.name)|tn(R.initializer),R.modifiers=void 0,R.questionToken=void 0,R.exclamationToken=void 0,R.jsDoc=void 0,R}function Cp(v,P,R){return v.name!==P||v.initializer!==R?d0($p(P,R),v):v}function d0(v,P){return v!==P&&(v.modifiers=P.modifiers,v.questionToken=P.questionToken,v.exclamationToken=P.exclamationToken),r(v,P)}function P2(v,P){const R=X(304);return R.name=Mc(v),R.objectAssignmentInitializer=P&&i().parenthesizeExpressionForDisallowedComma(P),R.transformFlags|=q8(R.name)|tn(R.objectAssignmentInitializer)|1024,R.equalsToken=void 0,R.modifiers=void 0,R.questionToken=void 0,R.exclamationToken=void 0,R.jsDoc=void 0,R}function Lc(v,P,R){return v.name!==P||v.objectAssignmentInitializer!==R?nD(P2(P,R),v):v}function nD(v,P){return v!==P&&(v.modifiers=P.modifiers,v.questionToken=P.questionToken,v.exclamationToken=P.exclamationToken,v.equalsToken=P.equalsToken),r(v,P)}function Hf(v){const P=X(305);return P.expression=i().parenthesizeExpressionForDisallowedComma(v),P.transformFlags|=tn(P.expression)|128|65536,P.jsDoc=void 0,P}function N6(v,P){return v.expression!==P?r(Hf(P),v):v}function lu(v,P){const R=X(306);return R.name=Mc(v),R.initializer=P&&i().parenthesizeExpressionForDisallowedComma(P),R.transformFlags|=tn(R.name)|tn(R.initializer)|1,R.jsDoc=void 0,R}function G1(v,P,R){return v.name!==P||v.initializer!==R?r(lu(P,R),v):v}function w2(v,P,R){const re=t.createBaseSourceFileNode(312);return re.statements=z(v),re.endOfFileToken=P,re.flags|=R,re.text="",re.fileName="",re.path="",re.resolvedPath="",re.originalFileName="",re.languageVersion=0,re.languageVariant=0,re.scriptKind=0,re.isDeclarationFile=!1,re.hasNoDefaultLib=!1,re.transformFlags|=ha(re.statements)|tn(re.endOfFileToken),re.locals=void 0,re.nextContainer=void 0,re.endFlowNode=void 0,re.nodeCount=0,re.identifierCount=0,re.symbolCount=0,re.parseDiagnostics=void 0,re.bindDiagnostics=void 0,re.bindSuggestionDiagnostics=void 0,re.lineMap=void 0,re.externalModuleIndicator=void 0,re.setExternalModuleIndicator=void 0,re.pragmas=void 0,re.checkJsDirective=void 0,re.referencedFiles=void 0,re.typeReferenceDirectives=void 0,re.libReferenceDirectives=void 0,re.amdDependencies=void 0,re.commentDirectives=void 0,re.identifiers=void 0,re.packageJsonLocations=void 0,re.packageJsonScope=void 0,re.imports=void 0,re.moduleAugmentations=void 0,re.ambientModuleNames=void 0,re.classifiableNames=void 0,re.impliedNodeFormat=void 0,re}function gS(v){const P=Object.create(v.redirectTarget);return Object.defineProperties(P,{id:{get(){return this.redirectInfo.redirectTarget.id},set(R){this.redirectInfo.redirectTarget.id=R}},symbol:{get(){return this.redirectInfo.redirectTarget.symbol},set(R){this.redirectInfo.redirectTarget.symbol=R}}}),P.redirectInfo=v,P}function I6(v){const P=gS(v.redirectInfo);return P.flags|=v.flags&-17,P.fileName=v.fileName,P.path=v.path,P.resolvedPath=v.resolvedPath,P.originalFileName=v.originalFileName,P.packageJsonLocations=v.packageJsonLocations,P.packageJsonScope=v.packageJsonScope,P.emitNode=void 0,P}function Gf(v){const P=t.createBaseSourceFileNode(312);P.flags|=v.flags&-17;for(const R in v)if(!(Ya(P,R)||!Ya(v,R))){if(R==="emitNode"){P.emitNode=void 0;continue}P[R]=v[R]}return P}function Qo(v){const P=v.redirectInfo?I6(v):Gf(v);return rn(P,v),P}function Qd(v,P,R,re,Le,Ot,en){const Zi=Qo(v);return Zi.statements=z(P),Zi.isDeclarationFile=R,Zi.referencedFiles=re,Zi.typeReferenceDirectives=Le,Zi.hasNoDefaultLib=Ot,Zi.libReferenceDirectives=en,Zi.transformFlags=ha(Zi.statements)|tn(Zi.endOfFileToken),Zi}function hy(v,P,R=v.isDeclarationFile,re=v.referencedFiles,Le=v.typeReferenceDirectives,Ot=v.hasNoDefaultLib,en=v.libReferenceDirectives){return v.statements!==P||v.isDeclarationFile!==R||v.referencedFiles!==re||v.typeReferenceDirectives!==Le||v.hasNoDefaultLib!==Ot||v.libReferenceDirectives!==en?r(Qd(v,P,R,re,Le,Ot,en),v):v}function Ag(v,P=ze){const R=W(313);return R.prepends=P,R.sourceFiles=v,R.syntheticFileReferences=void 0,R.syntheticTypeReferences=void 0,R.syntheticLibReferences=void 0,R.hasNoDefaultLib=void 0,R}function $1(v,P,R=ze){return v.sourceFiles!==P||v.prepends!==R?r(Ag(P,R),v):v}function F6(v,P,R){const re=W(314);return re.prologues=v,re.syntheticReferences=P,re.texts=R,re.fileName="",re.text="",re.referencedFiles=ze,re.libReferenceDirectives=ze,re.getLineAndCharacterOfPosition=Le=>qa(re,Le),re}function yy(v,P){const R=W(v);return R.data=P,R}function k(v){return yy(307,v)}function te(v,P){const R=yy(308,v);return R.texts=P,R}function at(v,P){return yy(P?310:309,v)}function Gt(v){const P=W(311);return P.data=v.data,P.section=v,P}function pn(){const v=W(315);return v.javascriptText="",v.declarationText="",v}function hi(v,P=!1,R){const re=W(237);return re.type=v,re.isSpread=P,re.tupleNameSource=R,re}function ri(v){const P=W(358);return P._children=v,P}function Mi(v){const P=W(359);return P.original=v,tt(P,v),P}function ws(v,P){const R=W(360);return R.expression=v,R.original=P,R.transformFlags|=tn(R.expression)|1,tt(R,P),R}function x_(v,P){return v.expression!==P?r(ws(P,v.original),v):v}function B_(v){if(Po(v)&&!P4(v)&&!v.original&&!v.emitNode&&!v.id){if(JE(v))return v.elements;if(Gr(v)&&$re(v.operatorToken))return[v.left,v.right]}return v}function ii(v){const P=W(361);return P.elements=z(OZ(v,B_)),P.transformFlags|=ha(P.elements),P}function Yd(v,P){return v.elements!==P?r(ii(P),v):v}function mr(v,P){const R=W(362);return R.expression=v,R.thisArg=P,R.transformFlags|=tn(R.expression)|tn(R.thisArg),R}function vy(v,P,R){return v.expression!==P||v.thisArg!==R?r(mr(P,R),v):v}function m0(v){const P=K(v.escapedText);return P.flags|=v.flags&-17,P.transformFlags=v.transformFlags,rn(P,v),Q8(P,{...v.emitNode.autoGenerate}),P}function hS(v){const P=K(v.escapedText);P.flags|=v.flags&-17,P.jsDoc=v.jsDoc,P.flowNode=v.flowNode,P.symbol=v.symbol,P.transformFlags=v.transformFlags,rn(P,v);const R=kb(v);return R&&Vh(P,R),P}function X1(v){const P=Me(v.escapedText);return P.flags|=v.flags&-17,P.transformFlags=v.transformFlags,rn(P,v),Q8(P,{...v.emitNode.autoGenerate}),P}function Mx(v){const P=Me(v.escapedText);return P.flags|=v.flags&-17,P.transformFlags=v.transformFlags,rn(P,v),P}function yS(v){if(v===void 0)return v;if(Ai(v))return Qo(v);if(Eo(v))return m0(v);if(Ie(v))return hS(v);if(rb(v))return X1(v);if(Ti(v))return Mx(v);const P=SP(v.kind)?t.createBaseNode(v.kind):t.createBaseTokenNode(v.kind);P.flags|=v.flags&-17,P.transformFlags=v.transformFlags,rn(P,v);for(const R in v)Ya(P,R)||!Ya(v,R)||(P[R]=v[R]);return P}function Jm(v,P,R){return Fr(xf(void 0,void 0,void 0,void 0,P?[P]:[],void 0,Va(v,!0)),void 0,R?[R]:[])}function g0(v,P,R){return Fr(Jf(void 0,void 0,P?[P]:[],void 0,void 0,Va(v,!0)),void 0,R?[R]:[])}function Ng(){return L_(ie("0"))}function O6(v){return Cg(void 0,!1,v)}function Rx(v){return R1(void 0,!1,Rm([Hd(!1,void 0,v)]))}function EN(v,P){return P==="null"?O.createStrictEquality(v,it()):P==="undefined"?O.createStrictEquality(v,Ng()):O.createStrictEquality(ou(v),ae(P))}function iD(v,P){return P==="null"?O.createStrictInequality(v,it()):P==="undefined"?O.createStrictInequality(v,Ng()):O.createStrictInequality(ou(v),ae(P))}function zm(v,P,R){return tb(v)?Ps(Xa(v,void 0,P),void 0,void 0,R):Fr(no(v,P),void 0,R)}function uh(v,P,R){return zm(v,"bind",[P,...R])}function L6(v,P,R){return zm(v,"call",[P,...R])}function Wm(v,P,R){return zm(v,"apply",[P,R])}function Q1(v,P,R){return zm(Se(v),P,R)}function qM(v,P){return zm(v,"slice",P===void 0?[]:[Sy(P)])}function Zd(v,P){return zm(v,"concat",P)}function vS(v,P,R){return Q1("Object","defineProperty",[v,Sy(P),R])}function DN(v,P){return Q1("Object","getOwnPropertyDescriptor",[v,Sy(P)])}function q(v,P,R){return Q1("Reflect","get",R?[v,P,R]:[v,P])}function ge(v,P,R,re){return Q1("Reflect","set",re?[v,P,R,re]:[v,P,R])}function Ae(v,P,R){return R?(v.push($p(P,R)),!0):!1}function et(v,P){const R=[];Ae(R,"enumerable",Sy(v.enumerable)),Ae(R,"configurable",Sy(v.configurable));let re=Ae(R,"writable",Sy(v.writable));re=Ae(R,"value",v.value)||re;let Le=Ae(R,"get",v.get);return Le=Ae(R,"set",v.set)||Le,E.assert(!(re&&Le),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."),va(R,!P)}function wt(v,P){switch(v.kind){case 217:return yp(v,P);case 216:return nc(v,v.type,P);case 234:return bt(v,P,v.type);case 238:return nr(v,P,v.type);case 235:return tr(v,P);case 360:return x_(v,P)}}function rr(v){return y_(v)&&Po(v)&&Po(c1(v))&&Po(Fd(v))&&!ut(sC(v))&&!ut(X8(v))}function vn(v,P,R=15){return v&&KF(v,R)&&!rr(v)?wt(v,vn(v.expression,P)):P}function di(v,P,R){if(!P)return v;const re=v6(P,P.label,Uv(P.statement)?di(v,P.statement):v);return R&&R(P),re}function ci(v,P){const R=Ha(v);switch(R.kind){case 80:return P;case 110:case 9:case 10:case 11:return!1;case 209:return R.elements.length!==0;case 210:return R.properties.length>0;default:return!0}}function Yn(v,P,R,re=!1){const Le=bc(v,15);let Ot,en;return s_(Le)?(Ot=Xe(),en=Le):OE(Le)?(Ot=Xe(),en=R!==void 0&&R<2?tt(Se("_super"),Le):Le):da(Le)&8192?(Ot=Ng(),en=i().parenthesizeLeftSideOfAccess(Le,!1)):bn(Le)?ci(Le.expression,re)?(Ot=se(P),en=no(tt(O.createAssignment(Ot,Le.expression),Le.expression),Le.name),tt(en,Le)):(Ot=Le.expression,en=Le):mo(Le)?ci(Le.expression,re)?(Ot=se(P),en=xu(tt(O.createAssignment(Ot,Le.expression),Le.expression),Le.argumentExpression),tt(en,Le)):(Ot=Le.expression,en=Le):(Ot=Ng(),en=i().parenthesizeLeftSideOfAccess(v,!1)),{target:en,thisArg:Ot}}function Li(v,P){return no(Oc(va([we(void 0,"value",[Nn(void 0,void 0,v,void 0,void 0,void 0)],Va([ly(P)]))])),"value")}function Za(v){return v.length>10?ii(v):Eu(v,O.createComma)}function La(v,P,R,re=0,Le){const Ot=Le?v&&cI(v):as(v);if(Ot&&Ie(Ot)&&!Eo(Ot)){const en=ga(tt(yS(Ot),Ot),Ot.parent);return re|=da(Ot),R||(re|=96),P||(re|=3072),re&&Vr(en,re),en}return Te(v)}function Ia(v,P,R){return La(v,P,R,98304)}function $f(v,P,R,re){return La(v,P,R,32768,re)}function Xp(v,P,R){return La(v,P,R,16384)}function by(v,P,R){return La(v,P,R)}function Ig(v,P,R,re){const Le=no(v,Po(P)?P:yS(P));tt(Le,P);let Ot=0;return re||(Ot|=96),R||(Ot|=3072),Ot&&Vr(Le,Ot),Le}function El(v,P,R,re){return v&&In(P,32)?Ig(v,La(P),R,re):Xp(P,R,re)}function _h(v,P,R,re){const Le=R6(v,P,0,R);return aD(v,P,Le,re)}function sD(v){return ra(v.expression)&&v.expression.text==="use strict"}function M6(){return Ru(ly(ae("use strict")))}function R6(v,P,R=0,re){E.assert(P.length===0,"Prologue directives should be at the first statement in the target statements array");let Le=!1;const Ot=v.length;for(;RZi&&wf.splice(Le,0,...P.slice(Zi,za)),Zi>en&&wf.splice(re,0,...P.slice(en,Zi)),en>Ot&&wf.splice(R,0,...P.slice(Ot,en)),Ot>0)if(R===0)wf.splice(0,0,...P.slice(0,Ot));else{const Ty=new Map;for(let xy=0;xy=0;xy--){const Y1=P[xy];Ty.has(Y1.expression.text)||wf.unshift(Y1)}}return yv(v)?tt(z(wf,v.hasTrailingComma),v):v}function cD(v,P){let R;return typeof P=="number"?R=Bt(P):R=P,Uo(v)?It(v,R,v.name,v.constraint,v.default):us(v)?Fi(v,R,v.dotDotDotToken,v.name,v.questionToken,v.type,v.initializer):ME(v)?Wt(v,R,v.typeParameters,v.parameters,v.type):ff(v)?ur(v,R,v.name,v.questionToken,v.type):Es(v)?yr(v,R,v.name,v.questionToken??v.exclamationToken,v.type,v.initializer):fg(v)?Xr(v,R,v.name,v.questionToken,v.typeParameters,v.parameters,v.type):mc(v)?ji(v,R,v.asteriskToken,v.name,v.questionToken,v.typeParameters,v.parameters,v.type,v.body):gc(v)?Ue(v,R,v.parameters,v.body):pf(v)?dt(v,R,v.name,v.parameters,v.type,v.body):N_(v)?Be(v,R,v.name,v.parameters,v.body):Cb(v)?Ct(v,R,v.parameters,v.type):ro(v)?Xu(v,R,v.asteriskToken,v.name,v.typeParameters,v.parameters,v.type,v.body):go(v)?vg(v,R,v.typeParameters,v.parameters,v.type,v.equalsGreaterThanToken,v.body):Nl(v)?fd(v,R,v.name,v.typeParameters,v.heritageClauses,v.members):ec(v)?cy(v,R,v.declarationList):Zc(v)?sS(v,R,v.asteriskToken,v.name,v.typeParameters,v.parameters,v.type,v.body):Vc(v)?aS(v,R,v.name,v.typeParameters,v.heritageClauses,v.members):Mu(v)?Cl(v,R,v.name,v.typeParameters,v.heritageClauses,v.members):Jp(v)?c0(v,R,v.name,v.typeParameters,v.type):p1(v)?je(v,R,v.name,v.members):vc(v)?Uf(v,R,v.name,v.body):Hl(v)?oS(v,R,v.isTypeOnly,v.name,v.moduleReference):gl(v)?g2(v,R,v.importClause,v.moduleSpecifier,v.attributes):cc(v)?Gp(v,R,v.expression):qc(v)?Eg(v,R,v.isTypeOnly,v.exportClause,v.moduleSpecifier,v.attributes):E.assertNever(v)}function Xf(v,P){return us(v)?Fi(v,P,v.dotDotDotToken,v.name,v.questionToken,v.type,v.initializer):Es(v)?yr(v,P,v.name,v.questionToken??v.exclamationToken,v.type,v.initializer):mc(v)?ji(v,P,v.asteriskToken,v.name,v.questionToken,v.typeParameters,v.parameters,v.type,v.body):pf(v)?dt(v,P,v.name,v.parameters,v.type,v.body):N_(v)?Be(v,P,v.name,v.parameters,v.body):Nl(v)?fd(v,P,v.name,v.typeParameters,v.heritageClauses,v.members):Vc(v)?aS(v,P,v.name,v.typeParameters,v.heritageClauses,v.members):E.assertNever(v)}function j6(v,P){switch(v.kind){case 177:return dt(v,v.modifiers,P,v.parameters,v.type,v.body);case 178:return Be(v,v.modifiers,P,v.parameters,v.body);case 174:return ji(v,v.modifiers,v.asteriskToken,P,v.questionToken,v.typeParameters,v.parameters,v.type,v.body);case 173:return Xr(v,v.modifiers,P,v.questionToken,v.typeParameters,v.parameters,v.type);case 172:return yr(v,v.modifiers,P,v.questionToken??v.exclamationToken,v.type,v.initializer);case 171:return ur(v,v.modifiers,P,v.questionToken,v.type);case 303:return Cp(v,P,v.initializer)}}function ka(v){return v?z(v):void 0}function Mc(v){return typeof v=="string"?Se(v):v}function Sy(v){return typeof v=="string"?ae(v):typeof v=="number"?ie(v):typeof v=="boolean"?v?mt():Je():v}function bS(v){return v&&i().parenthesizeExpressionForDisallowedComma(v)}function GM(v){return typeof v=="number"?me(v):v}function Um(v){return v&&JW(v)?tt(rn(sh(),v),v):v}function jx(v){return typeof v=="string"||v&&!Ei(v)?Yu(v,void 0,void 0,void 0):v}}function CFe(e,t){return e!==t&&tt(e,t),e}function EFe(e,t){return e!==t&&(rn(e,t),tt(e,t)),e}function yW(e){switch(e){case 351:return"type";case 349:return"returns";case 350:return"this";case 347:return"enum";case 337:return"author";case 339:return"class";case 340:return"public";case 341:return"private";case 342:return"protected";case 343:return"readonly";case 344:return"override";case 352:return"template";case 353:return"typedef";case 348:return"param";case 355:return"prop";case 345:return"callback";case 346:return"overload";case 335:return"augments";case 336:return"implements";default:return E.fail(`Unsupported kind: ${E.formatSyntaxKind(e)}`)}}function DFe(e,t){switch(Uh||(Uh=Ih(99,!1,0)),e){case 15:Uh.setText("`"+t+"`");break;case 16:Uh.setText("`"+t+"${");break;case 17:Uh.setText("}"+t+"${");break;case 18:Uh.setText("}"+t+"`");break}let r=Uh.scan();if(r===20&&(r=Uh.reScanTemplateToken(!1)),Uh.isUnterminated())return Uh.setText(void 0),Lre;let i;switch(r){case 15:case 16:case 17:case 18:i=Uh.getTokenValue();break}return i===void 0||Uh.scan()!==1?(Uh.setText(void 0),Lre):(Uh.setText(void 0),i)}function Q0(e){return e&&Ie(e)?q8(e):tn(e)}function q8(e){return tn(e)&-67108865}function PFe(e,t){return t|e.transformFlags&134234112}function tn(e){if(!e)return 0;const t=e.transformFlags&~Fre(e.kind);return Au(e)&&wc(e.name)?PFe(e.name,t):t}function ha(e){return e?e.transformFlags:0}function Fye(e){let t=0;for(const r of e)t|=tn(r);e.transformFlags=t}function Fre(e){if(e>=182&&e<=205)return-2;switch(e){case 213:case 214:case 209:return-2147450880;case 267:return-1941676032;case 169:return-2147483648;case 219:return-2072174592;case 218:case 262:return-1937940480;case 261:return-2146893824;case 263:case 231:return-2147344384;case 176:return-1937948672;case 172:return-2013249536;case 174:case 177:case 178:return-2005057536;case 133:case 150:case 163:case 146:case 154:case 151:case 136:case 155:case 116:case 168:case 171:case 173:case 179:case 180:case 181:case 264:case 265:return-2;case 210:return-2147278848;case 299:return-2147418112;case 206:case 207:return-2147450880;case 216:case 238:case 234:case 360:case 217:case 108:return-2147483648;case 211:case 212:return-2147483648;default:return-2147483648}}function tF(e){return e.flags|=16,e}function vW(e,t,r){let i,s,o,c,u,f,g,p,y,S;ns(e)?(o="",c=e,u=e.length,f=t,g=r):(E.assert(t==="js"||t==="dts"),o=(t==="js"?e.javascriptPath:e.declarationPath)||"",f=t==="js"?e.javascriptMapPath:e.declarationMapPath,p=()=>t==="js"?e.javascriptText:e.declarationText,y=()=>t==="js"?e.javascriptMapText:e.declarationMapText,u=()=>p().length,e.buildInfo&&e.buildInfo.bundle&&(E.assert(r===void 0||typeof r=="boolean"),i=r,s=t==="js"?e.buildInfo.bundle.js:e.buildInfo.bundle.dts,S=e.oldFileOfCurrentEmit));const T=S?AFe(E.checkDefined(s)):wFe(s,i,u);return T.fileName=o,T.sourceMapPath=f,T.oldFileOfCurrentEmit=S,p&&y?(Object.defineProperty(T,"text",{get:p}),Object.defineProperty(T,"sourceMapText",{get:y})):(E.assert(!S),T.text=c??"",T.sourceMapText=g),T}function wFe(e,t,r){let i,s,o,c,u,f,g,p;for(const S of e?e.sections:ze)switch(S.kind){case"prologue":i=lr(i,tt(I.createUnparsedPrologue(S.data),S));break;case"emitHelpers":s=lr(s,PW().get(S.data));break;case"no-default-lib":p=!0;break;case"reference":o=lr(o,{pos:-1,end:-1,fileName:S.data});break;case"type":c=lr(c,{pos:-1,end:-1,fileName:S.data});break;case"type-import":c=lr(c,{pos:-1,end:-1,fileName:S.data,resolutionMode:99});break;case"type-require":c=lr(c,{pos:-1,end:-1,fileName:S.data,resolutionMode:1});break;case"lib":u=lr(u,{pos:-1,end:-1,fileName:S.data});break;case"prepend":let T;for(const C of S.texts)(!t||C.kind!=="internal")&&(T=lr(T,tt(I.createUnparsedTextLike(C.data,C.kind==="internal"),C)));f=Dn(f,T),g=lr(g,I.createUnparsedPrepend(S.data,T??ze));break;case"internal":if(t){g||(g=[]);break}case"text":g=lr(g,tt(I.createUnparsedTextLike(S.data,S.kind==="internal"),S));break;default:E.assertNever(S)}if(!g){const S=I.createUnparsedTextLike(void 0,!1);TE(S,0,typeof r=="function"?r():r),g=[S]}const y=wm.createUnparsedSource(i??ze,void 0,g);return tC(i,y),tC(g,y),tC(f,y),y.hasNoDefaultLib=p,y.helpers=s,y.referencedFiles=o||ze,y.typeReferenceDirectives=c,y.libReferenceDirectives=u||ze,y}function AFe(e){let t,r;for(const s of e.sections)switch(s.kind){case"internal":case"text":t=lr(t,tt(I.createUnparsedTextLike(s.data,s.kind==="internal"),s));break;case"no-default-lib":case"reference":case"type":case"type-import":case"type-require":case"lib":r=lr(r,tt(I.createUnparsedSyntheticReference(s),s));break;case"prologue":case"emitHelpers":case"prepend":break;default:E.assertNever(s)}const i=I.createUnparsedSource(ze,r,t??ze);return tC(r,i),tC(t,i),i.helpers=Yt(e.sources&&e.sources.helpers,s=>PW().get(s)),i}function Oye(e,t,r,i,s,o){return ns(e)?SW(void 0,e,r,i,void 0,t,s,o):bW(e,t,r,i,s,o)}function bW(e,t,r,i,s,o,c,u){const f=wm.createInputFiles();f.javascriptPath=t,f.javascriptMapPath=r,f.declarationPath=i,f.declarationMapPath=s,f.buildInfoPath=o;const g=new Map,p=C=>{if(C===void 0)return;let w=g.get(C);return w===void 0&&(w=e(C),g.set(C,w!==void 0?w:!1)),w!==!1?w:void 0},y=C=>{const w=p(C);return w!==void 0?w:`/* Input file ${C} was missing */\r +`};let S;return Object.defineProperties(f,{javascriptText:{get:()=>y(t)},javascriptMapText:{get:()=>p(r)},declarationText:{get:()=>y(E.checkDefined(i))},declarationMapText:{get:()=>p(s)},buildInfo:{get:()=>{if(S===void 0&&o)if(c?.getBuildInfo)S=c.getBuildInfo(o,u.configFilePath)??!1;else{const C=p(o);S=C!==void 0?XO(o,C)??!1:!1}return S||void 0}}}),f}function SW(e,t,r,i,s,o,c,u,f,g,p){const y=wm.createInputFiles();return y.javascriptPath=e,y.javascriptText=t,y.javascriptMapPath=r,y.javascriptMapText=i,y.declarationPath=s,y.declarationText=o,y.declarationMapPath=c,y.declarationMapText=u,y.buildInfoPath=f,y.buildInfo=g,y.oldFileOfCurrentEmit=p,y}function Lye(e,t,r){return new(Rye||(Rye=Al.getSourceMapSourceConstructor()))(e,t,r)}function rn(e,t){if(e.original!==t&&(e.original=t,t)){const r=t.emitNode;r&&(e.emitNode=NFe(r,e.emitNode))}return e}function NFe(e,t){const{flags:r,internalFlags:i,leadingComments:s,trailingComments:o,commentRange:c,sourceMapRange:u,tokenSourceMapRanges:f,constantValue:g,helpers:p,startsOnNewLine:y,snippetElement:S,classThis:T,assignedName:C}=e;if(t||(t={}),r&&(t.flags=r),i&&(t.internalFlags=i&-9),s&&(t.leadingComments=Dn(s.slice(),t.leadingComments)),o&&(t.trailingComments=Dn(o.slice(),t.trailingComments)),c&&(t.commentRange=c),u&&(t.sourceMapRange=u),f&&(t.tokenSourceMapRanges=IFe(f,t.tokenSourceMapRanges)),g!==void 0&&(t.constantValue=g),p)for(const w of p)t.helpers=Bg(t.helpers,w);return y!==void 0&&(t.startsOnNewLine=y),S!==void 0&&(t.snippetElement=S),T&&(t.classThis=T),C&&(t.assignedName=C),t}function IFe(e,t){t||(t=[]);for(const r in e)t[r]=e[r];return t}var rF,TW,Ore,Uh,Lre,H8,Mye,I,Rye,FFe=Nt({"src/compiler/factory/nodeFactory.ts"(){"use strict";Ns(),rF=0,TW=(e=>(e[e.None=0]="None",e[e.NoParenthesizerRules=1]="NoParenthesizerRules",e[e.NoNodeConverters=2]="NoNodeConverters",e[e.NoIndentationOnFreshPropertyAccess=4]="NoIndentationOnFreshPropertyAccess",e[e.NoOriginalNode=8]="NoOriginalNode",e))(TW||{}),Ore=[],Lre={},H8=Are(),Mye={createBaseSourceFileNode:e=>tF(H8.createBaseSourceFileNode(e)),createBaseIdentifierNode:e=>tF(H8.createBaseIdentifierNode(e)),createBasePrivateIdentifierNode:e=>tF(H8.createBasePrivateIdentifierNode(e)),createBaseTokenNode:e=>tF(H8.createBaseTokenNode(e)),createBaseNode:e=>tF(H8.createBaseNode(e))},I=V8(4,Mye)}});function nu(e){if(e.emitNode)E.assert(!(e.emitNode.internalFlags&8),"Invalid attempt to mutate an immutable node.");else{if(P4(e)){if(e.kind===312)return e.emitNode={annotatedNodes:[e]};const t=Or(ss(Or(e)))??E.fail("Could not determine parsed source file.");nu(t).annotatedNodes.push(e)}e.emitNode={}}return e.emitNode}function xW(e){var t,r;const i=(r=(t=Or(ss(e)))==null?void 0:t.emitNode)==null?void 0:r.annotatedNodes;if(i)for(const s of i)s.emitNode=void 0}function G8(e){const t=nu(e);return t.flags|=3072,t.leadingComments=void 0,t.trailingComments=void 0,e}function Vr(e,t){return nu(e).flags=t,e}function Cm(e,t){const r=nu(e);return r.flags=r.flags|t,e}function $8(e,t){return nu(e).internalFlags=t,e}function xT(e,t){const r=nu(e);return r.internalFlags=r.internalFlags|t,e}function c1(e){var t;return((t=e.emitNode)==null?void 0:t.sourceMapRange)??e}function ya(e,t){return nu(e).sourceMapRange=t,e}function jye(e,t){var r,i;return(i=(r=e.emitNode)==null?void 0:r.tokenSourceMapRanges)==null?void 0:i[t]}function Mre(e,t,r){const i=nu(e),s=i.tokenSourceMapRanges??(i.tokenSourceMapRanges=[]);return s[t]=r,e}function AE(e){var t;return(t=e.emitNode)==null?void 0:t.startsOnNewLine}function nF(e,t){return nu(e).startsOnNewLine=t,e}function Fd(e){var t;return((t=e.emitNode)==null?void 0:t.commentRange)??e}function Ac(e,t){return nu(e).commentRange=t,e}function sC(e){var t;return(t=e.emitNode)==null?void 0:t.leadingComments}function l1(e,t){return nu(e).leadingComments=t,e}function NE(e,t,r,i){return l1(e,lr(sC(e),{kind:t,pos:-1,end:-1,hasTrailingNewLine:i,text:r}))}function X8(e){var t;return(t=e.emitNode)==null?void 0:t.trailingComments}function kT(e,t){return nu(e).trailingComments=t,e}function iF(e,t,r,i){return kT(e,lr(X8(e),{kind:t,pos:-1,end:-1,hasTrailingNewLine:i,text:r}))}function Rre(e,t){l1(e,sC(t)),kT(e,X8(t));const r=nu(t);return r.leadingComments=void 0,r.trailingComments=void 0,e}function jre(e){var t;return(t=e.emitNode)==null?void 0:t.constantValue}function Bre(e,t){const r=nu(e);return r.constantValue=t,e}function CT(e,t){const r=nu(e);return r.helpers=lr(r.helpers,t),e}function Yg(e,t){if(ut(t)){const r=nu(e);for(const i of t)r.helpers=Bg(r.helpers,i)}return e}function Bye(e,t){var r;const i=(r=e.emitNode)==null?void 0:r.helpers;return i?HD(i,t):!1}function sF(e){var t;return(t=e.emitNode)==null?void 0:t.helpers}function Jre(e,t,r){const i=e.emitNode,s=i&&i.helpers;if(!ut(s))return;const o=nu(t);let c=0;for(let u=0;u0&&(s[u-c]=f)}c>0&&(s.length-=c)}function kW(e){var t;return(t=e.emitNode)==null?void 0:t.snippetElement}function CW(e,t){const r=nu(e);return r.snippetElement=t,e}function EW(e){return nu(e).internalFlags|=4,e}function zre(e,t){const r=nu(e);return r.typeNode=t,e}function Wre(e){var t;return(t=e.emitNode)==null?void 0:t.typeNode}function Vh(e,t){return nu(e).identifierTypeArguments=t,e}function kb(e){var t;return(t=e.emitNode)==null?void 0:t.identifierTypeArguments}function Q8(e,t){return nu(e).autoGenerate=t,e}function Jye(e){var t;return(t=e.emitNode)==null?void 0:t.autoGenerate}function Ure(e,t){return nu(e).generatedImportReference=t,e}function Vre(e){var t;return(t=e.emitNode)==null?void 0:t.generatedImportReference}var OFe=Nt({"src/compiler/factory/emitNode.ts"(){"use strict";Ns()}});function qre(e){const t=e.factory,r=Vu(()=>$8(t.createTrue(),8)),i=Vu(()=>$8(t.createFalse(),8));return{getUnscopedHelperName:s,createDecorateHelper:o,createMetadataHelper:c,createParamHelper:u,createESDecorateHelper:w,createRunInitializersHelper:D,createAssignHelper:O,createAwaitHelper:z,createAsyncGeneratorHelper:W,createAsyncDelegatorHelper:X,createAsyncValuesHelper:J,createRestHelper:ie,createAwaiterHelper:B,createExtendsHelper:Y,createTemplateObjectHelper:ae,createSpreadArrayHelper:_e,createPropKeyHelper:$,createSetFunctionNameHelper:H,createValuesHelper:K,createReadHelper:oe,createGeneratorHelper:Se,createCreateBindingHelper:se,createImportStarHelper:Z,createImportStarCallbackHelper:ve,createImportDefaultHelper:Te,createExportStarHelper:Me,createClassPrivateFieldGetHelper:ke,createClassPrivateFieldSetHelper:he,createClassPrivateFieldInHelper:be,createAddDisposableResourceHelper:lt,createDisposeResourcesHelper:pt};function s(me){return Vr(t.createIdentifier(me),8196)}function o(me,Oe,Xe,it){e.requestEmitHelper(aF);const mt=[];return mt.push(t.createArrayLiteralExpression(me,!0)),mt.push(Oe),Xe&&(mt.push(Xe),it&&mt.push(it)),t.createCallExpression(s("__decorate"),void 0,mt)}function c(me,Oe){return e.requestEmitHelper(oF),t.createCallExpression(s("__metadata"),void 0,[t.createStringLiteral(me),Oe])}function u(me,Oe,Xe){return e.requestEmitHelper(cF),tt(t.createCallExpression(s("__param"),void 0,[t.createNumericLiteral(Oe+""),me]),Xe)}function f(me){const Oe=[t.createPropertyAssignment(t.createIdentifier("kind"),t.createStringLiteral("class")),t.createPropertyAssignment(t.createIdentifier("name"),me.name),t.createPropertyAssignment(t.createIdentifier("metadata"),me.metadata)];return t.createObjectLiteralExpression(Oe)}function g(me){const Oe=me.computed?t.createElementAccessExpression(t.createIdentifier("obj"),me.name):t.createPropertyAccessExpression(t.createIdentifier("obj"),me.name);return t.createPropertyAssignment("get",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,t.createIdentifier("obj"))],void 0,void 0,Oe))}function p(me){const Oe=me.computed?t.createElementAccessExpression(t.createIdentifier("obj"),me.name):t.createPropertyAccessExpression(t.createIdentifier("obj"),me.name);return t.createPropertyAssignment("set",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,t.createIdentifier("obj")),t.createParameterDeclaration(void 0,void 0,t.createIdentifier("value"))],void 0,void 0,t.createBlock([t.createExpressionStatement(t.createAssignment(Oe,t.createIdentifier("value")))])))}function y(me){const Oe=me.computed?me.name:Ie(me.name)?t.createStringLiteralFromNode(me.name):me.name;return t.createPropertyAssignment("has",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,t.createIdentifier("obj"))],void 0,void 0,t.createBinaryExpression(Oe,103,t.createIdentifier("obj"))))}function S(me,Oe){const Xe=[];return Xe.push(y(me)),Oe.get&&Xe.push(g(me)),Oe.set&&Xe.push(p(me)),t.createObjectLiteralExpression(Xe)}function T(me){const Oe=[t.createPropertyAssignment(t.createIdentifier("kind"),t.createStringLiteral(me.kind)),t.createPropertyAssignment(t.createIdentifier("name"),me.name.computed?me.name.name:t.createStringLiteralFromNode(me.name.name)),t.createPropertyAssignment(t.createIdentifier("static"),me.static?t.createTrue():t.createFalse()),t.createPropertyAssignment(t.createIdentifier("private"),me.private?t.createTrue():t.createFalse()),t.createPropertyAssignment(t.createIdentifier("access"),S(me.name,me.access)),t.createPropertyAssignment(t.createIdentifier("metadata"),me.metadata)];return t.createObjectLiteralExpression(Oe)}function C(me){return me.kind==="class"?f(me):T(me)}function w(me,Oe,Xe,it,mt,Je){return e.requestEmitHelper(lF),t.createCallExpression(s("__esDecorate"),void 0,[me??t.createNull(),Oe??t.createNull(),Xe,C(it),mt,Je])}function D(me,Oe,Xe){return e.requestEmitHelper(uF),t.createCallExpression(s("__runInitializers"),void 0,Xe?[me,Oe,Xe]:[me,Oe])}function O(me){return Da(e.getCompilerOptions())>=2?t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"assign"),void 0,me):(e.requestEmitHelper(_F),t.createCallExpression(s("__assign"),void 0,me))}function z(me){return e.requestEmitHelper(ET),t.createCallExpression(s("__await"),void 0,[me])}function W(me,Oe){return e.requestEmitHelper(ET),e.requestEmitHelper(fF),(me.emitNode||(me.emitNode={})).flags|=1572864,t.createCallExpression(s("__asyncGenerator"),void 0,[Oe?t.createThis():t.createVoidZero(),t.createIdentifier("arguments"),me])}function X(me){return e.requestEmitHelper(ET),e.requestEmitHelper(pF),t.createCallExpression(s("__asyncDelegator"),void 0,[me])}function J(me){return e.requestEmitHelper(dF),t.createCallExpression(s("__asyncValues"),void 0,[me])}function ie(me,Oe,Xe,it){e.requestEmitHelper(mF);const mt=[];let Je=0;for(let ot=0;ot{let i="";for(let s=0;se.name))}function IE(e,t){return Rs(e)&&Ie(e.expression)&&(da(e.expression)&8192)!==0&&e.expression.escapedText===t}var wW,aF,oF,cF,lF,uF,_F,ET,fF,pF,dF,mF,gF,hF,yF,vF,bF,SF,TF,xF,kF,aC,CF,Y8,EF,DF,PF,wF,AF,NF,IF,zye,Z8,K8,LFe=Nt({"src/compiler/factory/emitHelpers.ts"(){"use strict";Ns(),wW=(e=>(e.Field="f",e.Method="m",e.Accessor="a",e))(wW||{}),aF={name:"typescript:decorate",importName:"__decorate",scoped:!1,priority:2,text:` + var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + };`},oF={name:"typescript:metadata",importName:"__metadata",scoped:!1,priority:3,text:` + var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + };`},cF={name:"typescript:param",importName:"__param",scoped:!1,priority:4,text:` + var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + };`},lF={name:"typescript:esDecorate",importName:"__esDecorate",scoped:!1,priority:2,text:` + var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + };`},uF={name:"typescript:runInitializers",importName:"__runInitializers",scoped:!1,priority:2,text:` + var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + };`},_F={name:"typescript:assign",importName:"__assign",scoped:!1,priority:1,text:` + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + };`},ET={name:"typescript:await",importName:"__await",scoped:!1,text:` + var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }`},fF={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:!1,dependencies:[ET],text:` + var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + };`},pF={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:!1,dependencies:[ET],text:` + var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } + };`},dF={name:"typescript:asyncValues",importName:"__asyncValues",scoped:!1,text:` + var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + };`},mF={name:"typescript:rest",importName:"__rest",scoped:!1,text:` + var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + };`},gF={name:"typescript:awaiter",importName:"__awaiter",scoped:!1,priority:5,text:` + var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + };`},hF={name:"typescript:extends",importName:"__extends",scoped:!1,priority:0,text:` + var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })();`},yF={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:!1,priority:0,text:` + var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + };`},vF={name:"typescript:read",importName:"__read",scoped:!1,text:` + var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + };`},bF={name:"typescript:spreadArray",importName:"__spreadArray",scoped:!1,text:` + var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + };`},SF={name:"typescript:propKey",importName:"__propKey",scoped:!1,text:` + var __propKey = (this && this.__propKey) || function (x) { + return typeof x === "symbol" ? x : "".concat(x); + };`},TF={name:"typescript:setFunctionName",importName:"__setFunctionName",scoped:!1,text:` + var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + };`},xF={name:"typescript:values",importName:"__values",scoped:!1,text:` + var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + };`},kF={name:"typescript:generator",importName:"__generator",scoped:!1,priority:6,text:` + var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + };`},aC={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:!1,priority:1,text:` + var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }));`},CF={name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:!1,priority:1,text:` + var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + });`},Y8={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:!1,dependencies:[aC,CF],priority:2,text:` + var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + };`},EF={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:!1,text:` + var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + };`},DF={name:"typescript:export-star",importName:"__exportStar",scoped:!1,dependencies:[aC],priority:2,text:` + var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + };`},PF={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:!1,text:` + var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + };`},wF={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:!1,text:` + var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + };`},AF={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:!1,text:` + var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + };`},NF={name:"typescript:addDisposableResource",importName:"__addDisposableResource",scoped:!1,text:` + var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + };`},IF={name:"typescript:disposeResources",importName:"__disposeResources",scoped:!1,text:` + var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) { + return function (env) { + function fail(e) { + env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + function next() { + while (env.stack.length) { + var rec = env.stack.pop(); + try { + var result = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + catch (e) { + fail(e); + } + } + if (env.hasError) throw env.error; + } + return next(); + }; + })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + });`},Z8={name:"typescript:async-super",scoped:!0,text:DW` + const ${"_superIndex"} = name => super[name];`},K8={name:"typescript:advanced-async-super",scoped:!0,text:DW` + const ${"_superIndex"} = (function (geti, seti) { + const cache = Object.create(null); + return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); + })(name => super[name], (name, value) => super[name] = value);`}}});function A_(e){return e.kind===9}function FF(e){return e.kind===10}function ra(e){return e.kind===11}function DT(e){return e.kind===12}function AW(e){return e.kind===14}function PT(e){return e.kind===15}function oC(e){return e.kind===16}function Gre(e){return e.kind===17}function NW(e){return e.kind===18}function OF(e){return e.kind===26}function $re(e){return e.kind===28}function IW(e){return e.kind===40}function FW(e){return e.kind===41}function ew(e){return e.kind===42}function tw(e){return e.kind===54}function Y0(e){return e.kind===58}function Xre(e){return e.kind===59}function LF(e){return e.kind===29}function Qre(e){return e.kind===39}function Ie(e){return e.kind===80}function Ti(e){return e.kind===81}function wT(e){return e.kind===95}function MF(e){return e.kind===90}function FE(e){return e.kind===134}function Yre(e){return e.kind===131}function OW(e){return e.kind===135}function Zre(e){return e.kind===148}function AT(e){return e.kind===126}function Kre(e){return e.kind===128}function ene(e){return e.kind===164}function tne(e){return e.kind===129}function OE(e){return e.kind===108}function LE(e){return e.kind===102}function rne(e){return e.kind===84}function h_(e){return e.kind===166}function xa(e){return e.kind===167}function Uo(e){return e.kind===168}function us(e){return e.kind===169}function ql(e){return e.kind===170}function ff(e){return e.kind===171}function Es(e){return e.kind===172}function fg(e){return e.kind===173}function mc(e){return e.kind===174}function Go(e){return e.kind===175}function gc(e){return e.kind===176}function pf(e){return e.kind===177}function N_(e){return e.kind===178}function cC(e){return e.kind===179}function rw(e){return e.kind===180}function Cb(e){return e.kind===181}function RF(e){return e.kind===182}function mp(e){return e.kind===183}function pg(e){return e.kind===184}function ME(e){return e.kind===185}function lC(e){return e.kind===186}function X_(e){return e.kind===187}function jF(e){return e.kind===188}function uC(e){return e.kind===189}function RE(e){return e.kind===202}function LW(e){return e.kind===190}function MW(e){return e.kind===191}function u1(e){return e.kind===192}function _C(e){return e.kind===193}function fC(e){return e.kind===194}function NT(e){return e.kind===195}function IT(e){return e.kind===196}function BF(e){return e.kind===197}function FT(e){return e.kind===198}function OT(e){return e.kind===199}function jE(e){return e.kind===200}function _1(e){return e.kind===201}function Zg(e){return e.kind===205}function nne(e){return e.kind===204}function Wye(e){return e.kind===203}function jp(e){return e.kind===206}function Eb(e){return e.kind===207}function Pa(e){return e.kind===208}function Lu(e){return e.kind===209}function ma(e){return e.kind===210}function bn(e){return e.kind===211}function mo(e){return e.kind===212}function Rs(e){return e.kind===213}function Wv(e){return e.kind===214}function Db(e){return e.kind===215}function ine(e){return e.kind===216}function y_(e){return e.kind===217}function ro(e){return e.kind===218}function go(e){return e.kind===219}function sne(e){return e.kind===220}function pC(e){return e.kind===221}function LT(e){return e.kind===222}function Z0(e){return e.kind===223}function f1(e){return e.kind===224}function RW(e){return e.kind===225}function Gr(e){return e.kind===226}function dC(e){return e.kind===227}function JF(e){return e.kind===228}function zF(e){return e.kind===229}function Od(e){return e.kind===230}function Nl(e){return e.kind===231}function dl(e){return e.kind===232}function qh(e){return e.kind===233}function nw(e){return e.kind===234}function ane(e){return e.kind===238}function MT(e){return e.kind===235}function BE(e){return e.kind===236}function Uye(e){return e.kind===237}function WF(e){return e.kind===360}function JE(e){return e.kind===361}function zE(e){return e.kind===239}function one(e){return e.kind===240}function Ss(e){return e.kind===241}function ec(e){return e.kind===243}function jW(e){return e.kind===242}function kl(e){return e.kind===244}function Pb(e){return e.kind===245}function Vye(e){return e.kind===246}function qye(e){return e.kind===247}function wb(e){return e.kind===248}function UF(e){return e.kind===249}function iw(e){return e.kind===250}function Hye(e){return e.kind===251}function Gye(e){return e.kind===252}function Bp(e){return e.kind===253}function cne(e){return e.kind===254}function sw(e){return e.kind===255}function Uv(e){return e.kind===256}function BW(e){return e.kind===257}function Ab(e){return e.kind===258}function $ye(e){return e.kind===259}function Ei(e){return e.kind===260}function ml(e){return e.kind===261}function Zc(e){return e.kind===262}function Vc(e){return e.kind===263}function Mu(e){return e.kind===264}function Jp(e){return e.kind===265}function p1(e){return e.kind===266}function vc(e){return e.kind===267}function Ld(e){return e.kind===268}function WE(e){return e.kind===269}function aw(e){return e.kind===270}function Hl(e){return e.kind===271}function gl(e){return e.kind===272}function Em(e){return e.kind===273}function Xye(e){return e.kind===302}function lne(e){return e.kind===300}function Qye(e){return e.kind===301}function VF(e){return e.kind===300}function une(e){return e.kind===301}function K0(e){return e.kind===274}function Dm(e){return e.kind===280}function Kg(e){return e.kind===275}function v_(e){return e.kind===276}function cc(e){return e.kind===277}function qc(e){return e.kind===278}function gp(e){return e.kind===279}function vu(e){return e.kind===281}function Yye(e){return e.kind===282}function JW(e){return e.kind===359}function RT(e){return e.kind===362}function Pm(e){return e.kind===283}function dg(e){return e.kind===284}function Nb(e){return e.kind===285}function Md(e){return e.kind===286}function Vv(e){return e.kind===287}function qv(e){return e.kind===288}function jT(e){return e.kind===289}function _ne(e){return e.kind===290}function Rd(e){return e.kind===291}function Hv(e){return e.kind===292}function BT(e){return e.kind===293}function UE(e){return e.kind===294}function sd(e){return e.kind===295}function mC(e){return e.kind===296}function ow(e){return e.kind===297}function Q_(e){return e.kind===298}function Gv(e){return e.kind===299}function Hc(e){return e.kind===303}function Y_(e){return e.kind===304}function Hh(e){return e.kind===305}function $v(e){return e.kind===306}function fne(e){return e.kind===308}function Ai(e){return e.kind===312}function zW(e){return e.kind===313}function Ib(e){return e.kind===314}function Fb(e){return e.kind===316}function VE(e){return e.kind===317}function d1(e){return e.kind===318}function pne(e){return e.kind===331}function dne(e){return e.kind===332}function Zye(e){return e.kind===333}function mne(e){return e.kind===319}function gne(e){return e.kind===320}function gC(e){return e.kind===321}function qF(e){return e.kind===322}function WW(e){return e.kind===323}function hC(e){return e.kind===324}function HF(e){return e.kind===325}function Kye(e){return e.kind===326}function zp(e){return e.kind===327}function JT(e){return e.kind===329}function m1(e){return e.kind===330}function yC(e){return e.kind===335}function e1e(e){return e.kind===337}function hne(e){return e.kind===339}function UW(e){return e.kind===345}function VW(e){return e.kind===340}function qW(e){return e.kind===341}function HW(e){return e.kind===342}function GW(e){return e.kind===343}function GF(e){return e.kind===344}function vC(e){return e.kind===346}function $W(e){return e.kind===338}function t1e(e){return e.kind===354}function cw(e){return e.kind===347}function ad(e){return e.kind===348}function $F(e){return e.kind===349}function yne(e){return e.kind===350}function qE(e){return e.kind===351}function od(e){return e.kind===352}function bC(e){return e.kind===353}function r1e(e){return e.kind===334}function vne(e){return e.kind===355}function XW(e){return e.kind===336}function XF(e){return e.kind===357}function n1e(e){return e.kind===356}function SC(e){return e.kind===358}var MFe=Nt({"src/compiler/factory/nodeTests.ts"(){"use strict";Ns()}});function lw(e){return e.createExportDeclaration(void 0,!1,e.createNamedExports([]),void 0)}function Ob(e,t,r,i){if(xa(r))return tt(e.createElementAccessExpression(t,r.expression),i);{const s=tt(tg(r)?e.createPropertyAccessExpression(t,r):e.createElementAccessExpression(t,r),r);return Cm(s,128),s}}function bne(e,t){const r=wm.createIdentifier(e||"React");return ga(r,ss(t)),r}function Sne(e,t,r){if(h_(t)){const i=Sne(e,t.left,r),s=e.createIdentifier(an(t.right));return s.escapedText=t.right.escapedText,e.createPropertyAccessExpression(i,s)}else return bne(an(t),r)}function QW(e,t,r,i){return t?Sne(e,t,i):e.createPropertyAccessExpression(bne(r,i),"createElement")}function RFe(e,t,r,i){return t?Sne(e,t,i):e.createPropertyAccessExpression(bne(r,i),"Fragment")}function Tne(e,t,r,i,s,o){const c=[r];if(i&&c.push(i),s&&s.length>0)if(i||c.push(e.createNull()),s.length>1)for(const u of s)Ru(u),c.push(u);else c.push(s[0]);return tt(e.createCallExpression(t,void 0,c),o)}function xne(e,t,r,i,s,o,c){const f=[RFe(e,r,i,o),e.createNull()];if(s&&s.length>0)if(s.length>1)for(const g of s)Ru(g),f.push(g);else f.push(s[0]);return tt(e.createCallExpression(QW(e,t,i,o),void 0,f),c)}function YW(e,t,r){if(ml(t)){const i=ba(t.declarations),s=e.updateVariableDeclaration(i,i.name,void 0,void 0,r);return tt(e.createVariableStatement(void 0,e.updateVariableDeclarationList(t,[s])),t)}else{const i=tt(e.createAssignment(t,r),t);return tt(e.createExpressionStatement(i),t)}}function i1e(e,t,r){return Ss(t)?e.updateBlock(t,tt(e.createNodeArray([r,...t.statements]),t.statements)):e.createBlock(e.createNodeArray([t,r]),!0)}function uw(e,t){if(h_(t)){const r=uw(e,t.left),i=ga(tt(e.cloneNode(t.right),t.right),t.right.parent);return tt(e.createPropertyAccessExpression(r,i),t)}else return ga(tt(e.cloneNode(t),t),t.parent)}function ZW(e,t){return Ie(t)?e.createStringLiteralFromNode(t):xa(t)?ga(tt(e.cloneNode(t.expression),t.expression),t.expression.parent):ga(tt(e.cloneNode(t),t),t.parent)}function jFe(e,t,r,i,s){const{firstAccessor:o,getAccessor:c,setAccessor:u}=vb(t,r);if(r===o)return tt(e.createObjectDefinePropertyCall(i,ZW(e,r.name),e.createPropertyDescriptor({enumerable:e.createFalse(),configurable:!0,get:c&&tt(rn(e.createFunctionExpression(hv(c),void 0,void 0,void 0,c.parameters,void 0,c.body),c),c),set:u&&tt(rn(e.createFunctionExpression(hv(u),void 0,void 0,void 0,u.parameters,void 0,u.body),u),u)},!s)),o)}function BFe(e,t,r){return rn(tt(e.createAssignment(Ob(e,r,t.name,t.name),t.initializer),t),t)}function JFe(e,t,r){return rn(tt(e.createAssignment(Ob(e,r,t.name,t.name),e.cloneNode(t.name)),t),t)}function zFe(e,t,r){return rn(tt(e.createAssignment(Ob(e,r,t.name,t.name),rn(tt(e.createFunctionExpression(hv(t),t.asteriskToken,void 0,void 0,t.parameters,void 0,t.body),t),t)),t),t)}function kne(e,t,r,i){switch(r.name&&Ti(r.name)&&E.failBadSyntaxKind(r.name,"Private identifiers are not allowed in object literals."),r.kind){case 177:case 178:return jFe(e,t.properties,r,i,!!t.multiLine);case 303:return BFe(e,r,i);case 304:return JFe(e,r,i);case 174:return zFe(e,r,i)}}function QF(e,t,r,i,s){const o=t.operator;E.assert(o===46||o===47,"Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");const c=e.createTempVariable(i);r=e.createAssignment(c,r),tt(r,t.operand);let u=f1(t)?e.createPrefixUnaryExpression(o,c):e.createPostfixUnaryExpression(c,o);return tt(u,t),s&&(u=e.createAssignment(s,u),tt(u,t)),r=e.createComma(r,u),tt(r,t),RW(t)&&(r=e.createComma(r,c),tt(r,t)),r}function KW(e){return(da(e)&65536)!==0}function eh(e){return(da(e)&32768)!==0}function YF(e){return(da(e)&16384)!==0}function s1e(e){return ra(e.expression)&&e.expression.text==="use strict"}function eU(e){for(const t of e)if(Lp(t)){if(s1e(t))return t}else break}function Cne(e){const t=bl(e);return t!==void 0&&Lp(t)&&s1e(t)}function _w(e){return e.kind===226&&e.operatorToken.kind===28}function HE(e){return _w(e)||JE(e)}function GE(e){return y_(e)&&Hr(e)&&!!Qy(e)}function ZF(e){const t=Yy(e);return E.assertIsDefined(t),t}function KF(e,t=15){switch(e.kind){case 217:return t&16&&GE(e)?!1:(t&1)!==0;case 216:case 234:case 233:case 238:return(t&2)!==0;case 235:return(t&4)!==0;case 360:return(t&8)!==0}return!1}function bc(e,t=15){for(;KF(e,t);)e=e.expression;return e}function Ene(e,t=15){let r=e.parent;for(;KF(r,t);)r=r.parent,E.assert(r);return r}function a1e(e){return bc(e,6)}function Ru(e){return nF(e,!0)}function fw(e){const t=Zo(e,Ai),r=t&&t.emitNode;return r&&r.externalHelpersModuleName}function Dne(e){const t=Zo(e,Ai),r=t&&t.emitNode;return!!r&&(!!r.externalHelpersModuleName||!!r.externalHelpers)}function tU(e,t,r,i,s,o,c){if(i.importHelpers&&sT(r,i)){let u;const f=Ul(i);if(f>=5&&f<=99||r.impliedNodeFormat===99){const g=sF(r);if(g){const p=[];for(const y of g)if(!y.scoped){const S=y.importName;S&&tp(p,S)}if(ut(p)){p.sort(Du),u=e.createNamedImports(Yt(p,T=>wI(r,T)?e.createImportSpecifier(!1,void 0,e.createIdentifier(T)):e.createImportSpecifier(!1,e.createIdentifier(T),t.getUnscopedHelperName(T))));const y=Zo(r,Ai),S=nu(y);S.externalHelpers=!0}}}else{const g=Pne(e,r,i,s,o||c);g&&(u=e.createNamespaceImport(g))}if(u){const g=e.createImportDeclaration(void 0,e.createImportClause(!1,void 0,u),e.createStringLiteral(X0),void 0);return xT(g,2),g}}}function Pne(e,t,r,i,s){if(r.importHelpers&&sT(t,r)){const o=fw(t);if(o)return o;const c=Ul(r);let u=(i||xm(r)&&s)&&c!==4&&(c<5||t.impliedNodeFormat===1);if(!u){const f=sF(t);if(f){for(const g of f)if(!g.scoped){u=!0;break}}}if(u){const f=Zo(t,Ai),g=nu(f);return g.externalHelpersModuleName||(g.externalHelpersModuleName=e.createUniqueName(X0))}}}function TC(e,t,r){const i=jk(t);if(i&&!oT(t)&&!NI(t)){const s=i.name;return Eo(s)?s:e.createIdentifier(Tv(r,s)||an(s))}if(t.kind===272&&t.importClause||t.kind===278&&t.moduleSpecifier)return e.getGeneratedNameForNode(t)}function zT(e,t,r,i,s,o){const c=Rk(t);if(c&&ra(c))return UFe(t,i,e,s,o)||WFe(e,c,r)||e.cloneNode(c)}function WFe(e,t,r){const i=r.renamedDependencies&&r.renamedDependencies.get(t.text);return i?e.createStringLiteral(i):void 0}function pw(e,t,r,i){if(t){if(t.moduleName)return e.createStringLiteral(t.moduleName);if(!t.isDeclarationFile&&to(i))return e.createStringLiteral(hz(r,t.fileName))}}function UFe(e,t,r,i,s){return pw(r,i.getExternalModuleFileFromDeclaration(e),t,s)}function dw(e){if(xP(e))return e.initializer;if(Hc(e)){const t=e.initializer;return sl(t,!0)?t.right:void 0}if(Y_(e))return e.objectAssignmentInitializer;if(sl(e,!0))return e.right;if(Od(e))return dw(e.expression)}function ey(e){if(xP(e))return e.name;if(qg(e)){switch(e.kind){case 303:return ey(e.initializer);case 304:return e.name;case 305:return ey(e.expression)}return}return sl(e,!0)?ey(e.left):Od(e)?ey(e.expression):e}function eO(e){switch(e.kind){case 169:case 208:return e.dotDotDotToken;case 230:case 305:return e}}function rU(e){const t=tO(e);return E.assert(!!t||Hh(e),"Invalid property name for binding element."),t}function tO(e){switch(e.kind){case 208:if(e.propertyName){const r=e.propertyName;return Ti(r)?E.failBadSyntaxKind(r):xa(r)&&o1e(r.expression)?r.expression:r}break;case 303:if(e.name){const r=e.name;return Ti(r)?E.failBadSyntaxKind(r):xa(r)&&o1e(r.expression)?r.expression:r}break;case 305:return e.name&&Ti(e.name)?E.failBadSyntaxKind(e.name):e.name}const t=ey(e);if(t&&wc(t))return t}function o1e(e){const t=e.kind;return t===11||t===9}function xC(e){switch(e.kind){case 206:case 207:case 209:return e.elements;case 210:return e.properties}}function nU(e){if(e){let t=e;for(;;){if(Ie(t)||!t.body)return Ie(t)?t:t.name;t=t.body}}}function c1e(e){const t=e.kind;return t===176||t===178}function wne(e){const t=e.kind;return t===176||t===177||t===178}function iU(e){const t=e.kind;return t===303||t===304||t===262||t===176||t===181||t===175||t===282||t===243||t===264||t===265||t===266||t===267||t===271||t===272||t===270||t===278||t===277}function Ane(e){const t=e.kind;return t===175||t===303||t===304||t===282||t===270}function Nne(e){return Y0(e)||tw(e)}function Ine(e){return Ie(e)||BF(e)}function Fne(e){return Zre(e)||IW(e)||FW(e)}function One(e){return Y0(e)||IW(e)||FW(e)}function Lne(e){return Ie(e)||ra(e)}function l1e(e){const t=e.kind;return t===106||t===112||t===97||vv(e)||f1(e)}function VFe(e){return e===43}function qFe(e){return e===42||e===44||e===45}function HFe(e){return VFe(e)||qFe(e)}function GFe(e){return e===40||e===41}function $Fe(e){return GFe(e)||HFe(e)}function XFe(e){return e===48||e===49||e===50}function sU(e){return XFe(e)||$Fe(e)}function QFe(e){return e===30||e===33||e===32||e===34||e===104||e===103}function YFe(e){return QFe(e)||sU(e)}function ZFe(e){return e===35||e===37||e===36||e===38}function KFe(e){return ZFe(e)||YFe(e)}function eOe(e){return e===51||e===52||e===53}function tOe(e){return eOe(e)||KFe(e)}function rOe(e){return e===56||e===57}function nOe(e){return rOe(e)||tOe(e)}function iOe(e){return e===61||nOe(e)||Bh(e)}function sOe(e){return iOe(e)||e===28}function Mne(e){return sOe(e.kind)}function rO(e,t,r,i,s,o){const c=new f1e(e,t,r,i,s,o);return u;function u(f,g){const p={value:void 0},y=[oU.enter],S=[f],T=[void 0];let C=0;for(;y[C]!==oU.done;)C=y[C](c,C,y,S,T,p,g);return E.assertEqual(C,0),p.value}}function u1e(e){return e===95||e===90}function mw(e){const t=e.kind;return u1e(t)}function _1e(e){const t=e.kind;return Oh(t)&&!u1e(t)}function Rne(e,t){if(t!==void 0)return t.length===0?t:tt(e.createNodeArray([],t.hasTrailingComma),t)}function gw(e){var t;const r=e.emitNode.autoGenerate;if(r.flags&4){const i=r.id;let s=e,o=s.original;for(;o;){s=o;const c=(t=s.emitNode)==null?void 0:t.autoGenerate;if(tg(s)&&(c===void 0||c.flags&4&&c.id!==i))break;o=s.original}return s}return e}function kC(e,t){return typeof e=="object"?g1(!1,e.prefix,e.node,e.suffix,t):typeof e=="string"?e.length>0&&e.charCodeAt(0)===35?e.slice(1):e:""}function aOe(e,t){return typeof e=="string"?e:oOe(e,E.checkDefined(t))}function oOe(e,t){return rb(e)?t(e).slice(1):Eo(e)?t(e):Ti(e)?e.escapedText.slice(1):an(e)}function g1(e,t,r,i,s){return t=kC(t,s),i=kC(i,s),r=aOe(r,s),`${e?"#":""}${t}${r}${i}`}function aU(e,t,r,i){return e.updatePropertyDeclaration(t,r,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage"),void 0,void 0,i)}function jne(e,t,r,i,s=e.createThis()){return e.createGetAccessorDeclaration(r,i,[],void 0,e.createBlock([e.createReturnStatement(e.createPropertyAccessExpression(s,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")))]))}function Bne(e,t,r,i,s=e.createThis()){return e.createSetAccessorDeclaration(r,i,[e.createParameterDeclaration(void 0,void 0,"value")],e.createBlock([e.createExpressionStatement(e.createAssignment(e.createPropertyAccessExpression(s,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")),e.createIdentifier("value")))]))}function nO(e){let t=e.expression;for(;;){if(t=bc(t),JE(t)){t=Sa(t.elements);continue}if(_w(t)){t=t.right;continue}if(sl(t,!0)&&Eo(t.left))return t;break}}function cOe(e){return y_(e)&&Po(e)&&!e.emitNode}function iO(e,t){if(cOe(e))iO(e.expression,t);else if(_w(e))iO(e.left,t),iO(e.right,t);else if(JE(e))for(const r of e.elements)iO(r,t);else t.push(e)}function Jne(e){const t=[];return iO(e,t),t}function hw(e){if(e.transformFlags&65536)return!0;if(e.transformFlags&128)for(const t of xC(e)){const r=ey(t);if(r&&L4(r)&&(r.transformFlags&65536||r.transformFlags&128&&hw(r)))return!0}return!1}var oU,f1e,lOe=Nt({"src/compiler/factory/utilities.ts"(){"use strict";Ns(),(e=>{function t(p,y,S,T,C,w,D){const O=y>0?C[y-1]:void 0;return E.assertEqual(S[y],t),C[y]=p.onEnter(T[y],O,D),S[y]=u(p,t),y}e.enter=t;function r(p,y,S,T,C,w,D){E.assertEqual(S[y],r),E.assertIsDefined(p.onLeft),S[y]=u(p,r);const O=p.onLeft(T[y].left,C[y],T[y]);return O?(g(y,T,O),f(y,S,T,C,O)):y}e.left=r;function i(p,y,S,T,C,w,D){return E.assertEqual(S[y],i),E.assertIsDefined(p.onOperator),S[y]=u(p,i),p.onOperator(T[y].operatorToken,C[y],T[y]),y}e.operator=i;function s(p,y,S,T,C,w,D){E.assertEqual(S[y],s),E.assertIsDefined(p.onRight),S[y]=u(p,s);const O=p.onRight(T[y].right,C[y],T[y]);return O?(g(y,T,O),f(y,S,T,C,O)):y}e.right=s;function o(p,y,S,T,C,w,D){E.assertEqual(S[y],o),S[y]=u(p,o);const O=p.onExit(T[y],C[y]);if(y>0){if(y--,p.foldState){const z=S[y]===o?"right":"left";C[y]=p.foldState(C[y],O,z)}}else w.value=O;return y}e.exit=o;function c(p,y,S,T,C,w,D){return E.assertEqual(S[y],c),y}e.done=c;function u(p,y){switch(y){case t:if(p.onLeft)return r;case r:if(p.onOperator)return i;case i:if(p.onRight)return s;case s:return o;case o:return c;case c:return c;default:E.fail("Invalid state")}}e.nextState=u;function f(p,y,S,T,C){return p++,y[p]=t,S[p]=C,T[p]=void 0,p}function g(p,y,S){if(E.shouldAssert(2))for(;p>=0;)E.assert(y[p]!==S,"Circular traversal detected."),p--}})(oU||(oU={})),f1e=class{constructor(e,t,r,i,s,o){this.onEnter=e,this.onLeft=t,this.onOperator=r,this.onRight=i,this.onExit=s,this.foldState=o}}}});function tt(e,t){return t?km(e,t.pos,t.end):e}function Wp(e){const t=e.kind;return t===168||t===169||t===171||t===172||t===173||t===174||t===176||t===177||t===178||t===181||t===185||t===218||t===219||t===231||t===243||t===262||t===263||t===264||t===265||t===266||t===267||t===271||t===272||t===277||t===278}function Lb(e){const t=e.kind;return t===169||t===172||t===174||t===177||t===178||t===231||t===263}var uOe=Nt({"src/compiler/factory/utilitiesPublic.ts"(){"use strict";Ns()}});function Mt(e,t){return t&&e(t)}function gi(e,t,r){if(r){if(t)return t(r);for(const i of r){const s=e(i);if(s)return s}}}function cU(e,t){return e.charCodeAt(t+1)===42&&e.charCodeAt(t+2)===42&&e.charCodeAt(t+3)!==47}function yw(e){return Zt(e.statements,_Oe)||fOe(e)}function _Oe(e){return Wp(e)&&pOe(e,95)||Hl(e)&&Pm(e.moduleReference)||gl(e)||cc(e)||qc(e)?e:void 0}function fOe(e){return e.flags&8388608?p1e(e):void 0}function p1e(e){return dOe(e)?e:ds(e,p1e)}function pOe(e,t){return ut(e.modifiers,r=>r.kind===t)}function dOe(e){return BE(e)&&e.keywordToken===102&&e.name.escapedText==="meta"}function d1e(e,t,r){return gi(t,r,e.typeParameters)||gi(t,r,e.parameters)||Mt(t,e.type)}function m1e(e,t,r){return gi(t,r,e.types)}function g1e(e,t,r){return Mt(t,e.type)}function h1e(e,t,r){return gi(t,r,e.elements)}function y1e(e,t,r){return Mt(t,e.expression)||Mt(t,e.questionDotToken)||gi(t,r,e.typeArguments)||gi(t,r,e.arguments)}function v1e(e,t,r){return gi(t,r,e.statements)}function b1e(e,t,r){return Mt(t,e.label)}function S1e(e,t,r){return gi(t,r,e.modifiers)||Mt(t,e.name)||gi(t,r,e.typeParameters)||gi(t,r,e.heritageClauses)||gi(t,r,e.members)}function T1e(e,t,r){return gi(t,r,e.elements)}function x1e(e,t,r){return Mt(t,e.propertyName)||Mt(t,e.name)}function k1e(e,t,r){return Mt(t,e.tagName)||gi(t,r,e.typeArguments)||Mt(t,e.attributes)}function $E(e,t,r){return Mt(t,e.type)}function C1e(e,t,r){return Mt(t,e.tagName)||(e.isNameFirst?Mt(t,e.name)||Mt(t,e.typeExpression):Mt(t,e.typeExpression)||Mt(t,e.name))||(typeof e.comment=="string"?void 0:gi(t,r,e.comment))}function XE(e,t,r){return Mt(t,e.tagName)||Mt(t,e.typeExpression)||(typeof e.comment=="string"?void 0:gi(t,r,e.comment))}function zne(e,t,r){return Mt(t,e.name)}function CC(e,t,r){return Mt(t,e.tagName)||(typeof e.comment=="string"?void 0:gi(t,r,e.comment))}function mOe(e,t,r){return Mt(t,e.expression)}function ds(e,t,r){if(e===void 0||e.kind<=165)return;const i=L1e[e.kind];return i===void 0?void 0:i(e,t,r)}function QE(e,t,r){const i=E1e(e),s=[];for(;s.length=0;--u)i.push(o[u]),s.push(c)}else{const u=t(o,c);if(u){if(u==="skip")continue;return u}if(o.kind>=166)for(const f of E1e(o))i.push(f),s.push(o)}}}function E1e(e){const t=[];return ds(e,r,r),t;function r(i){t.unshift(i)}}function D1e(e){e.externalModuleIndicator=yw(e)}function vw(e,t,r,i=!1,s){var o,c,u,f;(o=Jr)==null||o.push(Jr.Phase.Parse,"createSourceFile",{path:e},!0),ko("beforeParse");let g;(c=Pu)==null||c.logStartParseSourceFile(e);const{languageVersion:p,setExternalModuleIndicator:y,impliedNodeFormat:S,jsDocParsingMode:T}=typeof r=="object"?r:{languageVersion:r};if(p===100)g=y1.parseSourceFile(e,t,p,void 0,i,6,Ca,T);else{const C=S===void 0?y:w=>(w.impliedNodeFormat=S,(y||D1e)(w));g=y1.parseSourceFile(e,t,p,void 0,i,s,C,T)}return(u=Pu)==null||u.logStopParseSourceFile(),ko("afterParse"),cf("Parse","beforeParse","afterParse"),(f=Jr)==null||f.pop(),g}function WT(e,t){return y1.parseIsolatedEntityName(e,t)}function bw(e,t){return y1.parseJsonText(e,t)}function Nc(e){return e.externalModuleIndicator!==void 0}function lU(e,t,r,i=!1){const s=pU.updateSourceFile(e,t,r,i);return s.flags|=e.flags&12582912,s}function Wne(e,t,r){const i=y1.JSDocParser.parseIsolatedJSDocComment(e,t,r);return i&&i.jsDoc&&y1.fixupParentReferences(i.jsDoc),i}function P1e(e,t,r){return y1.JSDocParser.parseJSDocTypeExpressionForTests(e,t,r)}function Il(e){return Jc(e,z8)||Ho(e,".ts")&&Pc(e).includes(".d.")}function gOe(e,t,r,i){if(e){if(e==="import")return 99;if(e==="require")return 1;i(t,r-t,d.resolution_mode_should_be_either_require_or_import)}}function uU(e,t){const r=[];for(const i of Km(t,0)||ze){const s=t.substring(i.pos,i.end);yOe(r,i,s)}e.pragmas=new Map;for(const i of r){if(e.pragmas.has(i.name)){const s=e.pragmas.get(i.name);s instanceof Array?s.push(i.args):e.pragmas.set(i.name,[s,i.args]);continue}e.pragmas.set(i.name,i.args)}}function _U(e,t){e.checkJsDirective=void 0,e.referencedFiles=[],e.typeReferenceDirectives=[],e.libReferenceDirectives=[],e.amdDependencies=[],e.hasNoDefaultLib=!1,e.pragmas.forEach((r,i)=>{switch(i){case"reference":{const s=e.referencedFiles,o=e.typeReferenceDirectives,c=e.libReferenceDirectives;Zt($S(r),u=>{const{types:f,lib:g,path:p,["resolution-mode"]:y}=u.arguments;if(u.arguments["no-default-lib"])e.hasNoDefaultLib=!0;else if(f){const S=gOe(y,f.pos,f.end,t);o.push({pos:f.pos,end:f.end,fileName:f.value,...S?{resolutionMode:S}:{}})}else g?c.push({pos:g.pos,end:g.end,fileName:g.value}):p?s.push({pos:p.pos,end:p.end,fileName:p.value}):t(u.range.pos,u.range.end-u.range.pos,d.Invalid_reference_directive_syntax)});break}case"amd-dependency":{e.amdDependencies=Yt($S(r),s=>({name:s.arguments.name,path:s.arguments.path}));break}case"amd-module":{if(r instanceof Array)for(const s of r)e.moduleName&&t(s.range.pos,s.range.end-s.range.pos,d.An_AMD_module_cannot_have_multiple_name_assignments),e.moduleName=s.arguments.name;else e.moduleName=r.arguments.name;break}case"ts-nocheck":case"ts-check":{Zt($S(r),s=>{(!e.checkJsDirective||s.range.pos>e.checkJsDirective.pos)&&(e.checkJsDirective={enabled:i==="ts-check",end:s.range.end,pos:s.range.pos})});break}case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:E.fail("Unhandled pragma kind")}})}function hOe(e){if(dU.has(e))return dU.get(e);const t=new RegExp(`(\\s${e}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`,"im");return dU.set(e,t),t}function yOe(e,t,r){const i=t.kind===2&&M1e.exec(r);if(i){const o=i[1].toLowerCase(),c=ZD[o];if(!c||!(c.kind&1))return;if(c.args){const u={};for(const f of c.args){const p=hOe(f.name).exec(r);if(!p&&!f.optional)return;if(p){const y=p[2]||p[3];if(f.captureSpan){const S=t.pos+p.index+p[1].length+1;u[f.name]={value:y,pos:S,end:S+y.length}}else u[f.name]=y}}e.push({name:o,args:{arguments:u,range:t}})}else e.push({name:o,args:{arguments:{},range:t}});return}const s=t.kind===2&&R1e.exec(r);if(s)return w1e(e,t,2,s);if(t.kind===3){const o=/@(\S+)(\s+.*)?$/gim;let c;for(;c=o.exec(r);)w1e(e,t,4,c)}}function w1e(e,t,r,i){if(!i)return;const s=i[1].toLowerCase(),o=ZD[s];if(!o||!(o.kind&r))return;const c=i[2],u=vOe(o,c);u!=="fail"&&e.push({name:s,args:{arguments:u,range:t}})}function vOe(e,t){if(!t)return{};if(!e.args)return{};const r=t.trim().split(/\s+/),i={};for(let s=0;snew(O1e||(O1e=Al.getSourceFileConstructor()))(e,-1,-1),createBaseIdentifierNode:e=>new(I1e||(I1e=Al.getIdentifierConstructor()))(e,-1,-1),createBasePrivateIdentifierNode:e=>new(F1e||(F1e=Al.getPrivateIdentifierConstructor()))(e,-1,-1),createBaseTokenNode:e=>new(N1e||(N1e=Al.getTokenConstructor()))(e,-1,-1),createBaseNode:e=>new(A1e||(A1e=Al.getNodeConstructor()))(e,-1,-1)},wm=V8(1,fU),L1e={166:function(t,r,i){return Mt(r,t.left)||Mt(r,t.right)},168:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.constraint)||Mt(r,t.default)||Mt(r,t.expression)},304:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.questionToken)||Mt(r,t.exclamationToken)||Mt(r,t.equalsToken)||Mt(r,t.objectAssignmentInitializer)},305:function(t,r,i){return Mt(r,t.expression)},169:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.dotDotDotToken)||Mt(r,t.name)||Mt(r,t.questionToken)||Mt(r,t.type)||Mt(r,t.initializer)},172:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.questionToken)||Mt(r,t.exclamationToken)||Mt(r,t.type)||Mt(r,t.initializer)},171:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.questionToken)||Mt(r,t.type)||Mt(r,t.initializer)},303:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.questionToken)||Mt(r,t.exclamationToken)||Mt(r,t.initializer)},260:function(t,r,i){return Mt(r,t.name)||Mt(r,t.exclamationToken)||Mt(r,t.type)||Mt(r,t.initializer)},208:function(t,r,i){return Mt(r,t.dotDotDotToken)||Mt(r,t.propertyName)||Mt(r,t.name)||Mt(r,t.initializer)},181:function(t,r,i){return gi(r,i,t.modifiers)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)},185:function(t,r,i){return gi(r,i,t.modifiers)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)},184:function(t,r,i){return gi(r,i,t.modifiers)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)},179:d1e,180:d1e,174:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.asteriskToken)||Mt(r,t.name)||Mt(r,t.questionToken)||Mt(r,t.exclamationToken)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)||Mt(r,t.body)},173:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.questionToken)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)},176:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)||Mt(r,t.body)},177:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)||Mt(r,t.body)},178:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)||Mt(r,t.body)},262:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.asteriskToken)||Mt(r,t.name)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)||Mt(r,t.body)},218:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.asteriskToken)||Mt(r,t.name)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)||Mt(r,t.body)},219:function(t,r,i){return gi(r,i,t.modifiers)||gi(r,i,t.typeParameters)||gi(r,i,t.parameters)||Mt(r,t.type)||Mt(r,t.equalsGreaterThanToken)||Mt(r,t.body)},175:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.body)},183:function(t,r,i){return Mt(r,t.typeName)||gi(r,i,t.typeArguments)},182:function(t,r,i){return Mt(r,t.assertsModifier)||Mt(r,t.parameterName)||Mt(r,t.type)},186:function(t,r,i){return Mt(r,t.exprName)||gi(r,i,t.typeArguments)},187:function(t,r,i){return gi(r,i,t.members)},188:function(t,r,i){return Mt(r,t.elementType)},189:function(t,r,i){return gi(r,i,t.elements)},192:m1e,193:m1e,194:function(t,r,i){return Mt(r,t.checkType)||Mt(r,t.extendsType)||Mt(r,t.trueType)||Mt(r,t.falseType)},195:function(t,r,i){return Mt(r,t.typeParameter)},205:function(t,r,i){return Mt(r,t.argument)||Mt(r,t.attributes)||Mt(r,t.qualifier)||gi(r,i,t.typeArguments)},302:function(t,r,i){return Mt(r,t.assertClause)},196:g1e,198:g1e,199:function(t,r,i){return Mt(r,t.objectType)||Mt(r,t.indexType)},200:function(t,r,i){return Mt(r,t.readonlyToken)||Mt(r,t.typeParameter)||Mt(r,t.nameType)||Mt(r,t.questionToken)||Mt(r,t.type)||gi(r,i,t.members)},201:function(t,r,i){return Mt(r,t.literal)},202:function(t,r,i){return Mt(r,t.dotDotDotToken)||Mt(r,t.name)||Mt(r,t.questionToken)||Mt(r,t.type)},206:h1e,207:h1e,209:function(t,r,i){return gi(r,i,t.elements)},210:function(t,r,i){return gi(r,i,t.properties)},211:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.questionDotToken)||Mt(r,t.name)},212:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.questionDotToken)||Mt(r,t.argumentExpression)},213:y1e,214:y1e,215:function(t,r,i){return Mt(r,t.tag)||Mt(r,t.questionDotToken)||gi(r,i,t.typeArguments)||Mt(r,t.template)},216:function(t,r,i){return Mt(r,t.type)||Mt(r,t.expression)},217:function(t,r,i){return Mt(r,t.expression)},220:function(t,r,i){return Mt(r,t.expression)},221:function(t,r,i){return Mt(r,t.expression)},222:function(t,r,i){return Mt(r,t.expression)},224:function(t,r,i){return Mt(r,t.operand)},229:function(t,r,i){return Mt(r,t.asteriskToken)||Mt(r,t.expression)},223:function(t,r,i){return Mt(r,t.expression)},225:function(t,r,i){return Mt(r,t.operand)},226:function(t,r,i){return Mt(r,t.left)||Mt(r,t.operatorToken)||Mt(r,t.right)},234:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.type)},235:function(t,r,i){return Mt(r,t.expression)},238:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.type)},236:function(t,r,i){return Mt(r,t.name)},227:function(t,r,i){return Mt(r,t.condition)||Mt(r,t.questionToken)||Mt(r,t.whenTrue)||Mt(r,t.colonToken)||Mt(r,t.whenFalse)},230:function(t,r,i){return Mt(r,t.expression)},241:v1e,268:v1e,312:function(t,r,i){return gi(r,i,t.statements)||Mt(r,t.endOfFileToken)},243:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.declarationList)},261:function(t,r,i){return gi(r,i,t.declarations)},244:function(t,r,i){return Mt(r,t.expression)},245:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.thenStatement)||Mt(r,t.elseStatement)},246:function(t,r,i){return Mt(r,t.statement)||Mt(r,t.expression)},247:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.statement)},248:function(t,r,i){return Mt(r,t.initializer)||Mt(r,t.condition)||Mt(r,t.incrementor)||Mt(r,t.statement)},249:function(t,r,i){return Mt(r,t.initializer)||Mt(r,t.expression)||Mt(r,t.statement)},250:function(t,r,i){return Mt(r,t.awaitModifier)||Mt(r,t.initializer)||Mt(r,t.expression)||Mt(r,t.statement)},251:b1e,252:b1e,253:function(t,r,i){return Mt(r,t.expression)},254:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.statement)},255:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.caseBlock)},269:function(t,r,i){return gi(r,i,t.clauses)},296:function(t,r,i){return Mt(r,t.expression)||gi(r,i,t.statements)},297:function(t,r,i){return gi(r,i,t.statements)},256:function(t,r,i){return Mt(r,t.label)||Mt(r,t.statement)},257:function(t,r,i){return Mt(r,t.expression)},258:function(t,r,i){return Mt(r,t.tryBlock)||Mt(r,t.catchClause)||Mt(r,t.finallyBlock)},299:function(t,r,i){return Mt(r,t.variableDeclaration)||Mt(r,t.block)},170:function(t,r,i){return Mt(r,t.expression)},263:S1e,231:S1e,264:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||gi(r,i,t.typeParameters)||gi(r,i,t.heritageClauses)||gi(r,i,t.members)},265:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||gi(r,i,t.typeParameters)||Mt(r,t.type)},266:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||gi(r,i,t.members)},306:function(t,r,i){return Mt(r,t.name)||Mt(r,t.initializer)},267:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.body)},271:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)||Mt(r,t.moduleReference)},272:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.importClause)||Mt(r,t.moduleSpecifier)||Mt(r,t.attributes)},273:function(t,r,i){return Mt(r,t.name)||Mt(r,t.namedBindings)},300:function(t,r,i){return gi(r,i,t.elements)},301:function(t,r,i){return Mt(r,t.name)||Mt(r,t.value)},270:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.name)},274:function(t,r,i){return Mt(r,t.name)},280:function(t,r,i){return Mt(r,t.name)},275:T1e,279:T1e,278:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.exportClause)||Mt(r,t.moduleSpecifier)||Mt(r,t.attributes)},276:x1e,281:x1e,277:function(t,r,i){return gi(r,i,t.modifiers)||Mt(r,t.expression)},228:function(t,r,i){return Mt(r,t.head)||gi(r,i,t.templateSpans)},239:function(t,r,i){return Mt(r,t.expression)||Mt(r,t.literal)},203:function(t,r,i){return Mt(r,t.head)||gi(r,i,t.templateSpans)},204:function(t,r,i){return Mt(r,t.type)||Mt(r,t.literal)},167:function(t,r,i){return Mt(r,t.expression)},298:function(t,r,i){return gi(r,i,t.types)},233:function(t,r,i){return Mt(r,t.expression)||gi(r,i,t.typeArguments)},283:function(t,r,i){return Mt(r,t.expression)},282:function(t,r,i){return gi(r,i,t.modifiers)},361:function(t,r,i){return gi(r,i,t.elements)},284:function(t,r,i){return Mt(r,t.openingElement)||gi(r,i,t.children)||Mt(r,t.closingElement)},288:function(t,r,i){return Mt(r,t.openingFragment)||gi(r,i,t.children)||Mt(r,t.closingFragment)},285:k1e,286:k1e,292:function(t,r,i){return gi(r,i,t.properties)},291:function(t,r,i){return Mt(r,t.name)||Mt(r,t.initializer)},293:function(t,r,i){return Mt(r,t.expression)},294:function(t,r,i){return Mt(r,t.dotDotDotToken)||Mt(r,t.expression)},287:function(t,r,i){return Mt(r,t.tagName)},295:function(t,r,i){return Mt(r,t.namespace)||Mt(r,t.name)},190:$E,191:$E,316:$E,322:$E,321:$E,323:$E,325:$E,324:function(t,r,i){return gi(r,i,t.parameters)||Mt(r,t.type)},327:function(t,r,i){return(typeof t.comment=="string"?void 0:gi(r,i,t.comment))||gi(r,i,t.tags)},354:function(t,r,i){return Mt(r,t.tagName)||Mt(r,t.name)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment))},317:function(t,r,i){return Mt(r,t.name)},318:function(t,r,i){return Mt(r,t.left)||Mt(r,t.right)},348:C1e,355:C1e,337:function(t,r,i){return Mt(r,t.tagName)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment))},336:function(t,r,i){return Mt(r,t.tagName)||Mt(r,t.class)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment))},335:function(t,r,i){return Mt(r,t.tagName)||Mt(r,t.class)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment))},352:function(t,r,i){return Mt(r,t.tagName)||Mt(r,t.constraint)||gi(r,i,t.typeParameters)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment))},353:function(t,r,i){return Mt(r,t.tagName)||(t.typeExpression&&t.typeExpression.kind===316?Mt(r,t.typeExpression)||Mt(r,t.fullName)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment)):Mt(r,t.fullName)||Mt(r,t.typeExpression)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment)))},345:function(t,r,i){return Mt(r,t.tagName)||Mt(r,t.fullName)||Mt(r,t.typeExpression)||(typeof t.comment=="string"?void 0:gi(r,i,t.comment))},349:XE,351:XE,350:XE,347:XE,357:XE,356:XE,346:XE,330:function(t,r,i){return Zt(t.typeParameters,r)||Zt(t.parameters,r)||Mt(r,t.type)},331:zne,332:zne,333:zne,329:function(t,r,i){return Zt(t.jsDocPropertyTags,r)},334:CC,339:CC,340:CC,341:CC,342:CC,343:CC,338:CC,344:CC,360:mOe},(e=>{var t=Ih(99,!0),r=40960,i,s,o,c,u;function f(q){return Je++,q}var g={createBaseSourceFileNode:q=>f(new u(q,0,0)),createBaseIdentifierNode:q=>f(new o(q,0,0)),createBasePrivateIdentifierNode:q=>f(new c(q,0,0)),createBaseTokenNode:q=>f(new s(q,0,0)),createBaseNode:q=>f(new i(q,0,0))},p=V8(11,g),{createNodeArray:y,createNumericLiteral:S,createStringLiteral:T,createLiteralLikeNode:C,createIdentifier:w,createPrivateIdentifier:D,createToken:O,createArrayLiteralExpression:z,createObjectLiteralExpression:W,createPropertyAccessExpression:X,createPropertyAccessChain:J,createElementAccessExpression:ie,createElementAccessChain:B,createCallExpression:Y,createCallChain:ae,createNewExpression:_e,createParenthesizedExpression:$,createBlock:H,createVariableStatement:K,createExpressionStatement:oe,createIfStatement:Se,createWhileStatement:se,createForStatement:Z,createForOfStatement:ve,createVariableDeclaration:Te,createVariableDeclarationList:Me}=p,ke,he,be,lt,pt,me,Oe,Xe,it,mt,Je,ot,Bt,Ht,br,zr,ar=!0,Jt=!1;function It(q,ge,Ae,et,wt=!1,rr,vn,di=0){var ci;if(rr=j5(q,rr),rr===6){const Li=Fi(q,ge,Ae,et,wt);return xw(Li,(ci=Li.statements[0])==null?void 0:ci.expression,Li.parseDiagnostics,!1,void 0),Li.referencedFiles=ze,Li.typeReferenceDirectives=ze,Li.libReferenceDirectives=ze,Li.amdDependencies=ze,Li.hasNoDefaultLib=!1,Li.pragmas=F7,Li}ei(q,ge,Ae,et,rr,di);const Yn=Qe(Ae,wt,rr,vn||D1e,di);return zi(),Yn}e.parseSourceFile=It;function Nn(q,ge){ei("",q,ge,void 0,1,0),Fe();const Ae=Q(!0),et=M()===1&&!Oe.length;return zi(),et?Ae:void 0}e.parseIsolatedEntityName=Nn;function Fi(q,ge,Ae=2,et,wt=!1){ei(q,ge,Ae,et,6,0),he=zr,Fe();const rr=ee();let vn,di;if(M()===1)vn=rs([],rr,rr),di=Ic();else{let Li;for(;M()!==1;){let Ia;switch(M()){case 23:Ia=oh();break;case 112:case 97:case 106:Ia=Ic();break;case 41:wr(()=>Fe()===9&&Fe()!==59)?Ia=qd():Ia=z1();break;case 9:case 11:if(wr(()=>Fe()!==59)){Ia=jn();break}default:Ia=z1();break}Li&&es(Li)?Li.push(Ia):Li?Li=[Li,Ia]:(Li=Ia,M()!==1&&er(d.Unexpected_token))}const Za=es(Li)?qt(z(Li),rr):E.checkDefined(Li),La=oe(Za);qt(La,rr),vn=rs([La],rr),di=yo(1,d.Unexpected_token)}const ci=Tr(q,2,6,!1,vn,di,he,Ca);wt&&yr(ci),ci.nodeCount=Je,ci.identifierCount=Bt,ci.identifiers=ot,ci.parseDiagnostics=yT(Oe,ci),Xe&&(ci.jsDocDiagnostics=yT(Xe,ci));const Yn=ci;return zi(),Yn}e.parseJsonText=Fi;function ei(q,ge,Ae,et,wt,rr){switch(i=Al.getNodeConstructor(),s=Al.getTokenConstructor(),o=Al.getIdentifierConstructor(),c=Al.getPrivateIdentifierConstructor(),u=Al.getSourceFileConstructor(),ke=qs(q),be=ge,lt=Ae,it=et,pt=wt,me=D8(wt),Oe=[],Ht=0,ot=new Map,Bt=0,Je=0,he=0,ar=!0,pt){case 1:case 2:zr=524288;break;case 6:zr=134742016;break;default:zr=0;break}Jt=!1,t.setText(be),t.setOnError(ce),t.setScriptTarget(lt),t.setLanguageVariant(me),t.setScriptKind(pt),t.setJSDocParsingMode(rr)}function zi(){t.clearCommentDirectives(),t.setText(""),t.setOnError(void 0),t.setScriptKind(0),t.setJSDocParsingMode(0),be=void 0,lt=void 0,it=void 0,pt=void 0,me=void 0,he=0,Oe=void 0,Xe=void 0,Ht=0,ot=void 0,br=void 0,ar=!0}function Qe(q,ge,Ae,et,wt){const rr=Il(ke);rr&&(zr|=33554432),he=zr,Fe();const vn=Fs(0,Ef);E.assert(M()===1);const di=ue(),ci=Dr(Ic(),di),Yn=Tr(ke,q,Ae,rr,vn,ci,he,et);return uU(Yn,be),_U(Yn,Li),Yn.commentDirectives=t.getCommentDirectives(),Yn.nodeCount=Je,Yn.identifierCount=Bt,Yn.identifiers=ot,Yn.parseDiagnostics=yT(Oe,Yn),Yn.jsDocParsingMode=wt,Xe&&(Yn.jsDocDiagnostics=yT(Xe,Yn)),ge&&yr(Yn),Yn;function Li(Za,La,Ia){Oe.push(Zk(ke,be,Za,La,Ia))}}let ur=!1;function Dr(q,ge){if(!ge)return q;E.assert(!q.jsDoc);const Ae=Ii(zJ(q,be),et=>DN.parseJSDocComment(q,et.pos,et.end-et.pos));return Ae.length&&(q.jsDoc=Ae),ur&&(ur=!1,q.flags|=536870912),q}function Ft(q){const ge=it,Ae=pU.createSyntaxCursor(q);it={currentNode:Li};const et=[],wt=Oe;Oe=[];let rr=0,vn=ci(q.statements,0);for(;vn!==-1;){const Za=q.statements[rr],La=q.statements[vn];Dn(et,q.statements,rr,vn),rr=Yn(q.statements,vn);const Ia=Dc(wt,Xp=>Xp.start>=Za.pos),$f=Ia>=0?Dc(wt,Xp=>Xp.start>=La.pos,Ia):-1;Ia>=0&&Dn(Oe,wt,Ia,$f>=0?$f:void 0),Ki(()=>{const Xp=zr;for(zr|=65536,t.resetTokenState(La.pos),Fe();M()!==1;){const by=t.getTokenFullStart(),Ig=uc(0,Ef);if(et.push(Ig),by===t.getTokenFullStart()&&Fe(),rr>=0){const El=q.statements[rr];if(Ig.end===El.pos)break;Ig.end>El.pos&&(rr=Yn(q.statements,rr+1))}}zr=Xp},2),vn=rr>=0?ci(q.statements,rr):-1}if(rr>=0){const Za=q.statements[rr];Dn(et,q.statements,rr);const La=Dc(wt,Ia=>Ia.start>=Za.pos);La>=0&&Dn(Oe,wt,La)}return it=ge,p.updateSourceFile(q,tt(y(et),q.statements));function di(Za){return!(Za.flags&65536)&&!!(Za.transformFlags&67108864)}function ci(Za,La){for(let Ia=La;Ia118}function Is(){return M()===80?!0:M()===127&&Dt()||M()===135&&Qt()?!1:M()>118}function Cr(q,ge,Ae=!0){return M()===q?(Ae&&Fe(),!0):(ge?er(ge):er(d._0_expected,Hs(q)),!1)}const Tc=Object.keys(_P).filter(q=>q.length>2);function os(q){if(Db(q)){U(la(be,q.template.pos),q.template.end,d.Module_declaration_names_may_only_use_or_quoted_strings);return}const ge=Ie(q)?an(q):void 0;if(!ge||!lf(ge,lt)){er(d._0_expected,Hs(27));return}const Ae=la(be,q.pos);switch(ge){case"const":case"let":case"var":U(Ae,q.end,d.Variable_declaration_not_allowed_at_this_location);return;case"declare":return;case"interface":Ga(d.Interface_name_cannot_be_0,d.Interface_must_be_given_a_name,19);return;case"is":U(Ae,t.getTokenStart(),d.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);return;case"module":case"namespace":Ga(d.Namespace_name_cannot_be_0,d.Namespace_must_be_given_a_name,19);return;case"type":Ga(d.Type_alias_name_cannot_be_0,d.Type_alias_must_be_given_a_name,64);return}const et=m4(ge,Tc,wt=>wt)??rc(ge);if(et){U(Ae,q.end,d.Unknown_keyword_or_identifier_Did_you_mean_0,et);return}M()!==0&&U(Ae,q.end,d.Unexpected_keyword_or_identifier)}function Ga(q,ge,Ae){M()===Ae?er(ge):er(q,t.getTokenValue())}function rc(q){for(const ge of Tc)if(q.length>ge.length+2&&Qi(q,ge))return`${ge} ${q.slice(ge.length)}`}function Vo(q,ge,Ae){if(M()===60&&!t.hasPrecedingLineBreak()){er(d.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);return}if(M()===21){er(d.Cannot_start_a_function_call_in_a_type_annotation),Fe();return}if(ge&&!Fc()){Ae?er(d._0_expected,Hs(27)):er(d.Expected_for_property_initializer);return}if(!$o()){if(Ae){er(d._0_expected,Hs(27));return}os(q)}}function cl(q){return M()===q?(vt(),!0):(E.assert(s5(q)),er(d._0_expected,Hs(q)),!1)}function Ro(q,ge,Ae,et){if(M()===ge){Fe();return}const wt=er(d._0_expected,Hs(ge));Ae&&wt&&ua(wt,Zk(ke,be,et,1,d.The_parser_expected_to_find_a_1_to_match_the_0_token_here,Hs(q),Hs(ge)))}function hs(q){return M()===q?(Fe(),!0):!1}function Ws(q){if(M()===q)return Ic()}function el(q){if(M()===q)return Hp()}function yo(q,ge,Ae){return Ws(q)||No(q,!1,ge||d._0_expected,Ae||Hs(q))}function Us(q){const ge=el(q);return ge||(E.assert(s5(q)),No(q,!1,d._0_expected,Hs(q)))}function Ic(){const q=ee(),ge=M();return Fe(),qt(O(ge),q)}function Hp(){const q=ee(),ge=M();return vt(),qt(O(ge),q)}function Fc(){return M()===27?!0:M()===20||M()===1||t.hasPrecedingLineBreak()}function $o(){return Fc()?(M()===27&&Fe(),!0):!1}function Ao(){return $o()||Cr(27)}function rs(q,ge,Ae,et){const wt=y(q,et);return km(wt,ge,Ae??t.getTokenFullStart()),wt}function qt(q,ge,Ae){return km(q,ge,Ae??t.getTokenFullStart()),zr&&(q.flags|=zr),Jt&&(Jt=!1,q.flags|=262144),q}function No(q,ge,Ae,...et){ge?or(t.getTokenFullStart(),0,Ae,...et):Ae&&er(Ae,...et);const wt=ee(),rr=q===80?w("",void 0):M0(q)?p.createTemplateLiteralLikeNode(q,"","",void 0):q===9?S("",void 0):q===11?T("",void 0):q===282?p.createMissingDeclaration():O(q);return qt(rr,wt)}function $c(q){let ge=ot.get(q);return ge===void 0&&ot.set(q,ge=q),ge}function ju(q,ge,Ae){if(q){Bt++;const di=ee(),ci=M(),Yn=$c(t.getTokenValue()),Li=t.hasExtendedUnicodeEscape();return De(),qt(w(Yn,ci,Li),di)}if(M()===81)return er(Ae||d.Private_identifiers_are_not_allowed_outside_class_bodies),ju(!0);if(M()===0&&t.tryScan(()=>t.reScanInvalidIdentifier()===80))return ju(!0);Bt++;const et=M()===1,wt=t.isReservedWord(),rr=t.getTokenText(),vn=wt?d.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:d.Identifier_expected;return No(80,et,ge||vn,rr)}function u_(q){return ju(ia(),void 0,q)}function vo(q,ge){return ju(Is(),q,ge)}function xc(q){return ju(wu(M()),q)}function A(){return(t.hasUnicodeEscape()||t.hasExtendedUnicodeEscape())&&er(d.Unicode_escape_sequence_cannot_appear_here),ju(wu(M()))}function Pe(){return wu(M())||M()===11||M()===9}function qe(){return wu(M())||M()===11}function Tt(q){if(M()===11||M()===9){const ge=jn();return ge.text=$c(ge.text),ge}return q&&M()===23?En():M()===81?$r():xc()}function dr(){return Tt(!0)}function En(){const q=ee();Cr(23);const ge=Ce(Ol);return Cr(24),qt(p.createComputedPropertyName(ge),q)}function $r(){const q=ee(),ge=D($c(t.getTokenValue()));return Fe(),qt(ge,q)}function yn(q){return M()===q&&_i(Tn)}function li(){return Fe(),t.hasPrecedingLineBreak()?!1:no()}function Tn(){switch(M()){case 87:return Fe()===94;case 95:return Fe(),M()===90?wr(rl):M()===156?wr(lc):va();case 90:return rl();case 126:case 139:case 153:return Fe(),no();default:return li()}}function va(){return M()===60||M()!==42&&M()!==130&&M()!==19&&no()}function lc(){return Fe(),va()}function tl(){return Oh(M())&&_i(Tn)}function no(){return M()===23||M()===19||M()===42||M()===26||Pe()}function rl(){return Fe(),M()===86||M()===100||M()===120||M()===60||M()===128&&wr(P6)||M()===134&&wr(lo)}function Xa(q,ge){if(hc(q))return!0;switch(q){case 0:case 1:case 3:return!(M()===27&&ge)&&wx();case 2:return M()===84||M()===90;case 4:return wr(cy);case 5:return wr(d0)||M()===27&&!ge;case 6:return M()===23||Pe();case 12:switch(M()){case 23:case 42:case 26:case 25:return!0;default:return Pe()}case 18:return Pe();case 9:return M()===23||M()===26||Pe();case 24:return qe();case 7:return M()===19?wr(hl):ge?Is()&&!$l():c0()&&!$l();case 8:return Na();case 10:return M()===28||M()===26||Na();case 19:return M()===103||M()===87||Is();case 15:switch(M()){case 28:case 25:return!0}case 11:return M()===26||Tg();case 16:return We(!1);case 17:return We(!0);case 20:case 21:return M()===28||Ud();case 22:return k();case 23:return M()===161&&wr(Ix)?!1:wu(M());case 13:return wu(M())||M()===19;case 14:return!0;case 25:return!0;case 26:return E.fail("ParsingContext.Count used as a context");default:E.assertNever(q,"Non-exhaustive case in 'isListElement'.")}}function hl(){if(E.assert(M()===19),Fe()===20){const q=Fe();return q===28||q===19||q===96||q===119}return!0}function $u(){return Fe(),Is()}function xu(){return Fe(),wu(M())}function Bf(){return Fe(),SK(M())}function $l(){return M()===119||M()===96?wr(ye):!1}function ye(){return Fe(),Tg()}function St(){return Fe(),Ud()}function Fr(q){if(M()===1)return!0;switch(q){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return M()===20;case 3:return M()===20||M()===84||M()===90;case 7:return M()===19||M()===96||M()===119;case 8:return Wi();case 19:return M()===32||M()===21||M()===19||M()===96||M()===119;case 11:return M()===22||M()===27;case 15:case 21:case 10:return M()===24;case 17:case 16:case 18:return M()===22||M()===24;case 20:return M()!==28;case 22:return M()===19||M()===20;case 13:return M()===32||M()===44;case 14:return M()===30&&wr(mr);default:return!1}}function Wi(){return!!(Fc()||lS(M())||M()===39)}function Ps(){E.assert(Ht,"Missing parsing context");for(let q=0;q<26;q++)if(Ht&1<=0)}function bg(q){return q===6?d.An_enum_member_name_must_be_followed_by_a_or:void 0}function L_(){const q=rs([],ee());return q.isMissingList=!0,q}function zf(q){return!!q.isMissingList}function Qu(q,ge,Ae,et){if(Cr(Ae)){const wt=ou(q,ge);return Cr(et),wt}return L_()}function Q(q,ge){const Ae=ee();let et=q?xc(ge):vo(ge);for(;hs(25)&&M()!==30;)et=qt(p.createQualifiedName(et,Et(q,!1,!0)),Ae);return et}function Ye(q,ge){return qt(p.createQualifiedName(q,ge),q.pos)}function Et(q,ge,Ae){if(t.hasPrecedingLineBreak()&&wu(M())&&wr(py))return No(80,!0,d.Identifier_expected);if(M()===81){const et=$r();return ge?et:No(80,!0,d.Identifier_expected)}return q?Ae?xc():A():vo()}function Pt(q){const ge=ee(),Ae=[];let et;do et=Rn(q),Ae.push(et);while(et.literal.kind===17);return rs(Ae,ge)}function L(q){const ge=ee();return qt(p.createTemplateExpression(Oi(q),Pt(q)),ge)}function pe(){const q=ee();return qt(p.createTemplateLiteralType(Oi(!1),Ze()),q)}function Ze(){const q=ee(),ge=[];let Ae;do Ae=At(),ge.push(Ae);while(Ae.literal.kind===17);return rs(ge,q)}function At(){const q=ee();return qt(p.createTemplateLiteralTypeSpan(Cl(),Mr(!1)),q)}function Mr(q){return M()===20?(Zr(q),sa()):yo(18,d._0_expected,Hs(20))}function Rn(q){const ge=ee();return qt(p.createTemplateSpan(Ce(Ol),Mr(q)),ge)}function jn(){return Xo(M())}function Oi(q){!q&&t.getTokenFlags()&26656&&Zr(!1);const ge=Xo(M());return E.assert(ge.kind===16,"Template head has wrong token kind"),ge}function sa(){const q=Xo(M());return E.assert(q.kind===17||q.kind===18,"Template fragment has wrong token kind"),q}function aa(q){const ge=q===15||q===18,Ae=t.getTokenText();return Ae.substring(1,Ae.length-(t.isUnterminated()?0:ge?1:2))}function Xo(q){const ge=ee(),Ae=M0(q)?p.createTemplateLiteralLikeNode(q,t.getTokenValue(),aa(q),t.getTokenFlags()&7176):q===9?S(t.getTokenValue(),t.getNumericLiteralFlags()):q===11?T(t.getTokenValue(),void 0,t.hasExtendedUnicodeEscape()):I4(q)?C(q,t.getTokenValue()):E.fail();return t.hasExtendedUnicodeEscape()&&(Ae.hasExtendedUnicodeEscape=!0),t.isUnterminated()&&(Ae.isUnterminated=!0),Fe(),qt(Ae,ge)}function Xl(){return Q(!0,d.Type_expected)}function ll(){if(!t.hasPrecedingLineBreak()&&gn()===30)return Qu(20,Cl,30,32)}function kf(){const q=ee();return qt(p.createTypeReferenceNode(Xl(),ll()),q)}function _a(q){switch(q.kind){case 183:return sc(q.typeName);case 184:case 185:{const{parameters:ge,type:Ae}=q;return zf(ge)||_a(Ae)}case 196:return _a(q.type);default:return!1}}function vp(q){return Fe(),qt(p.createTypePredicateNode(void 0,q,Cl()),q.pos)}function Cf(){const q=ee();return Fe(),qt(p.createThisTypeNode(),q)}function Sg(){const q=ee();return Fe(),qt(p.createJSDocAllType(),q)}function Om(){const q=ee();return Fe(),qt(p.createJSDocNonNullableType(d2(),!1),q)}function ki(){const q=ee();return Fe(),M()===28||M()===20||M()===22||M()===32||M()===64||M()===52?qt(p.createJSDocUnknownType(),q):qt(p.createJSDocNullableType(Cl(),!1),q)}function ay(){const q=ee(),ge=ue();if(wr(ii)){Fe();const Ae=fn(36),et=xr(59,!1);return Dr(qt(p.createJSDocFunctionType(Ae,et),q),ge)}return qt(p.createTypeReferenceNode(xc(),void 0),q)}function oy(){const q=ee();let ge;return(M()===110||M()===105)&&(ge=xc(),Cr(59)),qt(p.createParameterDeclaration(void 0,void 0,ge,void 0,fd(),void 0),q)}function fd(){t.setInJSDocType(!0);const q=ee();if(hs(144)){const et=p.createJSDocNamepathType(void 0);e:for(;;)switch(M()){case 20:case 1:case 28:case 5:break e;default:vt()}return t.setInJSDocType(!1),qt(et,q)}const ge=hs(26);let Ae=O1();return t.setInJSDocType(!1),ge&&(Ae=qt(p.createJSDocVariadicType(Ae),q)),M()===64?(Fe(),qt(p.createJSDocOptionalType(Ae),q)):Ae}function u2(){const q=ee();Cr(114);const ge=Q(!0),Ae=t.hasPrecedingLineBreak()?void 0:yy();return qt(p.createTypeQueryNode(ge,Ae),q)}function i0(){const q=ee(),ge=lu(!1,!0),Ae=vo();let et,wt;hs(96)&&(Ud()||!Tg()?et=Cl():wt=_c());const rr=hs(64)?Cl():void 0,vn=p.createTypeParameterDeclaration(ge,Ae,et,rr);return vn.expression=wt,qt(vn,q)}function Ee(){if(M()===30)return Qu(19,i0,30,32)}function We(q){return M()===26||Na()||Oh(M())||M()===60||Ud(!q)}function bt(q){const ge=cn(d.Private_identifiers_cannot_be_used_as_parameters);return IP(ge)===0&&!ut(q)&&Oh(M())&&Fe(),ge}function Rt(){return ia()||M()===23||M()===19}function tr(q){return nr(q)}function Rr(q){return nr(q,!1)}function nr(q,ge=!0){const Ae=ee(),et=ue(),wt=q?we(()=>lu(!0)):Be(()=>lu(!0));if(M()===110){const ci=p.createParameterDeclaration(wt,void 0,ju(!0),void 0,o0(),void 0),Yn=bl(wt);return Yn&&j(Yn,d.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters),Dr(qt(ci,Ae),et)}const rr=ar;ar=!1;const vn=Ws(26);if(!ge&&!Rt())return;const di=Dr(qt(p.createParameterDeclaration(wt,vn,bt(wt),Ws(58),o0(),Uf()),Ae),et);return ar=rr,di}function xr(q,ge){if(ni(q,ge))return rt(O1)}function ni(q,ge){return q===39?(Cr(q),!0):hs(59)?!0:ge&&M()===39?(er(d._0_expected,Hs(59)),Fe(),!0):!1}function _n(q,ge){const Ae=Dt(),et=Qt();ji(!!(q&1)),$i(!!(q&2));const wt=q&32?ou(17,oy):ou(16,()=>ge?tr(et):Rr(et));return ji(Ae),$i(et),wt}function fn(q){if(!Cr(21))return L_();const ge=_n(q,!0);return Cr(22),ge}function on(){hs(28)||Ao()}function wi(q){const ge=ee(),Ae=ue();q===180&&Cr(105);const et=Ee(),wt=fn(4),rr=xr(59,!0);on();const vn=q===179?p.createCallSignature(et,wt,rr):p.createConstructSignature(et,wt,rr);return Dr(qt(vn,ge),Ae)}function Qa(){return M()===23&&wr(Va)}function Va(){if(Fe(),M()===26||M()===24)return!0;if(Oh(M())){if(Fe(),Is())return!0}else if(Is())Fe();else return!1;return M()===59||M()===28?!0:M()!==58?!1:(Fe(),M()===59||M()===28||M()===24)}function M_(q,ge,Ae){const et=Qu(16,()=>tr(!1),23,24),wt=o0();on();const rr=p.createIndexSignature(Ae,et,wt);return Dr(qt(rr,q),ge)}function A1(q,ge,Ae){const et=dr(),wt=Ws(58);let rr;if(M()===21||M()===30){const vn=Ee(),di=fn(4),ci=xr(59,!0);rr=p.createMethodSignature(Ae,et,wt,vn,di,ci)}else{const vn=o0();rr=p.createPropertySignature(Ae,et,wt,vn),M()===64&&(rr.initializer=Uf())}return on(),Dr(qt(rr,q),ge)}function cy(){if(M()===21||M()===30||M()===139||M()===153)return!0;let q=!1;for(;Oh(M());)q=!0,Fe();return M()===23?!0:(Pe()&&(q=!0,Fe()),q?M()===21||M()===30||M()===58||M()===59||M()===28||Fc():!1)}function sh(){if(M()===21||M()===30)return wi(179);if(M()===105&&wr(ly))return wi(180);const q=ee(),ge=ue(),Ae=lu(!1);return yn(139)?Cp(q,ge,Ae,177,4):yn(153)?Cp(q,ge,Ae,178,4):Qa()?M_(q,ge,Ae):A1(q,ge,Ae)}function ly(){return Fe(),M()===21||M()===30}function Kb(){return Fe()===25}function _2(){switch(Fe()){case 21:case 30:case 25:return!0}return!1}function eS(){const q=ee();return qt(p.createTypeLiteralNode(tS()),q)}function tS(){let q;return Cr(19)?(q=Fs(4,sh),Cr(20)):q=L_(),q}function Z3(){return Fe(),M()===40||M()===41?Fe()===148:(M()===148&&Fe(),M()===23&&$u()&&Fe()===103)}function gx(){const q=ee(),ge=xc();Cr(103);const Ae=Cl();return qt(p.createTypeParameterDeclaration(void 0,ge,Ae,void 0),q)}function g6(){const q=ee();Cr(19);let ge;(M()===148||M()===40||M()===41)&&(ge=Ic(),ge.kind!==148&&Cr(148)),Cr(23);const Ae=gx(),et=hs(130)?Cl():void 0;Cr(24);let wt;(M()===58||M()===40||M()===41)&&(wt=Ic(),wt.kind!==58&&Cr(58));const rr=o0();Ao();const vn=Fs(4,sh);return Cr(20),qt(p.createMappedTypeNode(ge,Ae,et,wt,rr,vn),q)}function N1(){const q=ee();if(hs(26))return qt(p.createRestTypeNode(Cl()),q);const ge=Cl();if(gC(ge)&&ge.pos===ge.type.pos){const Ae=p.createOptionalTypeNode(ge.type);return tt(Ae,ge),Ae.flags=ge.flags,Ae}return ge}function hx(){return Fe()===59||M()===58&&Fe()===59}function yx(){return M()===26?wu(Fe())&&hx():wu(M())&&hx()}function h6(){if(wr(yx)){const q=ee(),ge=ue(),Ae=Ws(26),et=xc(),wt=Ws(58);Cr(59);const rr=N1(),vn=p.createNamedTupleMember(Ae,et,wt,rr);return Dr(qt(vn,q),ge)}return N1()}function rS(){const q=ee();return qt(p.createTupleTypeNode(Qu(21,h6,23,24)),q)}function y6(){const q=ee();Cr(21);const ge=Cl();return Cr(22),qt(p.createParenthesizedType(ge),q)}function vx(){let q;if(M()===128){const ge=ee();Fe();const Ae=qt(O(128),ge);q=rs([Ae],ge)}return q}function bx(){const q=ee(),ge=ue(),Ae=vx(),et=hs(105);E.assert(!Ae||et,"Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");const wt=Ee(),rr=fn(4),vn=xr(39,!1),di=et?p.createConstructorTypeNode(Ae,wt,rr,vn):p.createFunctionTypeNode(wt,rr,vn);return Dr(qt(di,q),ge)}function nS(){const q=Ic();return M()===25?void 0:q}function f2(q){const ge=ee();q&&Fe();let Ae=M()===112||M()===97||M()===106?Ic():Xo(M());return q&&(Ae=qt(p.createPrefixUnaryExpression(41,Ae),ge)),qt(p.createLiteralTypeNode(Ae),ge)}function p2(){return Fe(),M()===102}function I1(){he|=4194304;const q=ee(),ge=hs(114);Cr(102),Cr(21);const Ae=Cl();let et;if(hs(28)){const vn=t.getTokenStart();Cr(19);const di=M();if(di===118||di===132?Fe():er(d._0_expected,Hs(118)),Cr(59),et=X1(di,!0),!Cr(20)){const ci=Mo(Oe);ci&&ci.code===d._0_expected.code&&ua(ci,Zk(ke,be,vn,1,d.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}}Cr(22);const wt=hs(25)?Xl():void 0,rr=ll();return qt(p.createImportTypeNode(Ae,et,wt,rr,ge),q)}function s0(){return Fe(),M()===9||M()===10}function d2(){switch(M()){case 133:case 159:case 154:case 150:case 163:case 155:case 136:case 157:case 146:case 151:return _i(nS)||kf();case 67:t.reScanAsteriskEqualsToken();case 42:return Sg();case 61:t.reScanQuestionToken();case 58:return ki();case 100:return ay();case 54:return Om();case 15:case 11:case 9:case 10:case 112:case 97:case 106:return f2();case 41:return wr(s0)?f2(!0):kf();case 116:return Ic();case 110:{const q=Cf();return M()===142&&!t.hasPrecedingLineBreak()?vp(q):q}case 114:return wr(p2)?I1():u2();case 19:return wr(Z3)?g6():eS();case 23:return rS();case 21:return y6();case 102:return I1();case 131:return wr(py)?L1():kf();case 16:return pe();default:return kf()}}function Ud(q){switch(M()){case 133:case 159:case 154:case 150:case 163:case 136:case 148:case 155:case 158:case 116:case 157:case 106:case 110:case 114:case 146:case 19:case 23:case 30:case 52:case 51:case 105:case 11:case 9:case 10:case 112:case 97:case 151:case 42:case 58:case 54:case 26:case 140:case 102:case 131:case 15:case 16:return!0;case 100:return!q;case 41:return!q&&wr(s0);case 21:return!q&&wr(wa);default:return Is()}}function wa(){return Fe(),M()===22||We(!1)||Ud()}function iS(){const q=ee();let ge=d2();for(;!t.hasPrecedingLineBreak();)switch(M()){case 54:Fe(),ge=qt(p.createJSDocNonNullableType(ge,!0),q);break;case 58:if(wr(St))return ge;Fe(),ge=qt(p.createJSDocNullableType(ge,!0),q);break;case 23:if(Cr(23),Ud()){const Ae=Cl();Cr(24),ge=qt(p.createIndexedAccessTypeNode(ge,Ae),q)}else Cr(24),ge=qt(p.createArrayTypeNode(ge),q);break;default:return ge}return ge}function v6(q){const ge=ee();return Cr(q),qt(p.createTypeOperatorNode(q,Wf()),ge)}function uy(){if(hs(96)){const q=ft(Cl);if(st()||M()!==58)return q}}function a0(){const q=ee(),ge=vo(),Ae=_i(uy),et=p.createTypeParameterDeclaration(void 0,ge,Ae);return qt(et,q)}function Lm(){const q=ee();return Cr(140),qt(p.createInferTypeNode(a0()),q)}function Wf(){const q=M();switch(q){case 143:case 158:case 148:return v6(q);case 140:return Lm()}return rt(iS)}function R_(q){if(Sx()){const ge=bx();let Ae;return pg(ge)?Ae=q?d.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:d.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:Ae=q?d.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:d.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type,j(ge,Ae),ge}}function Yu(q,ge,Ae){const et=ee(),wt=q===52,rr=hs(q);let vn=rr&&R_(wt)||ge();if(M()===q||rr){const di=[vn];for(;hs(q);)di.push(R_(wt)||ge());vn=qt(Ae(rs(di,et)),et)}return vn}function K_(){return Yu(51,Wf,p.createIntersectionTypeNode)}function F1(){return Yu(52,K_,p.createUnionTypeNode)}function b6(){return Fe(),M()===105}function Sx(){return M()===30||M()===21&&wr(m2)?!0:M()===105||M()===128&&wr(b6)}function sS(){if(Oh(M())&&lu(!1),Is()||M()===110)return Fe(),!0;if(M()===23||M()===19){const q=Oe.length;return cn(),q===Oe.length}return!1}function m2(){return Fe(),!!(M()===22||M()===26||sS()&&(M()===59||M()===28||M()===58||M()===64||M()===22&&(Fe(),M()===39)))}function O1(){const q=ee(),ge=Is()&&_i(aS),Ae=Cl();return ge?qt(p.createTypePredicateNode(void 0,ge,Ae),q):Ae}function aS(){const q=vo();if(M()===142&&!t.hasPrecedingLineBreak())return Fe(),q}function L1(){const q=ee(),ge=yo(131),Ae=M()===110?Cf():vo(),et=hs(142)?Cl():void 0;return qt(p.createTypePredicateNode(ge,Ae,et),q)}function Cl(){if(zr&81920)return Qs(81920,Cl);if(Sx())return bx();const q=ee(),ge=F1();if(!st()&&!t.hasPrecedingLineBreak()&&hs(96)){const Ae=ft(Cl);Cr(58);const et=rt(Cl);Cr(59);const wt=rt(Cl);return qt(p.createConditionalTypeNode(ge,Ae,et,wt),q)}return ge}function o0(){return hs(59)?Cl():void 0}function c0(){switch(M()){case 110:case 108:case 106:case 112:case 97:case 9:case 10:case 11:case 15:case 16:case 21:case 23:case 19:case 100:case 86:case 105:case 44:case 69:case 80:return!0;case 102:return wr(_2);default:return Is()}}function Tg(){if(c0())return!0;switch(M()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 46:case 47:case 30:case 135:case 127:case 81:case 60:return!0;default:return uS()?!0:Is()}}function je(){return M()!==19&&M()!==100&&M()!==86&&M()!==60&&Tg()}function Ol(){const q=Ct();q&&Di(!1);const ge=ee();let Ae=Bu(!0),et;for(;et=Ws(28);)Ae=yi(Ae,et,Bu(!0),ge);return q&&Di(!0),Ae}function Uf(){return hs(64)?Bu(!0):void 0}function Bu(q){if(S6())return M1();const ge=K3(q)||cS(q);if(ge)return ge;const Ae=ee(),et=ue(),wt=kg(0);return wt.kind===80&&M()===39?xg(Ae,wt,q,et,void 0):m_(wt)&&Bh(Wt())?yi(wt,Ic(),Bu(q),Ae):dd(wt,Ae,q)}function S6(){return M()===127?Dt()?!0:wr(w6):!1}function l0(){return Fe(),!t.hasPrecedingLineBreak()&&Is()}function M1(){const q=ee();return Fe(),!t.hasPrecedingLineBreak()&&(M()===42||Tg())?qt(p.createYieldExpression(Ws(42),Bu(!0)),q):qt(p.createYieldExpression(void 0,void 0),q)}function xg(q,ge,Ae,et,wt){E.assert(M()===39,"parseSimpleArrowFunctionExpression should only have been called if we had a =>");const rr=p.createParameterDeclaration(void 0,void 0,ge,void 0,void 0,void 0);qt(rr,ge.pos);const vn=rs([rr],rr.pos,rr.end),di=yo(39),ci=bp(!!wt,Ae),Yn=p.createArrowFunction(wt,void 0,vn,void 0,di,ci);return Dr(qt(Yn,q),et)}function K3(q){const ge=Aa();if(ge!==0)return ge===1?h2(!0,!0):_i(()=>oS(q))}function Aa(){return M()===21||M()===30||M()===134?wr(pd):M()===39?1:0}function pd(){if(M()===134&&(Fe(),t.hasPrecedingLineBreak()||M()!==21&&M()!==30))return 0;const q=M(),ge=Fe();if(q===21){if(ge===22)switch(Fe()){case 39:case 59:case 19:return 1;default:return 0}if(ge===23||ge===19)return 2;if(ge===26)return 1;if(Oh(ge)&&ge!==134&&wr($u))return Fe()===130?0:1;if(!Is()&&ge!==110)return 0;switch(Fe()){case 59:return 1;case 58:return Fe(),M()===59||M()===28||M()===64||M()===22?1:0;case 28:case 64:case 22:return 2}return 0}else return E.assert(q===30),!Is()&&M()!==87?0:me===1?wr(()=>{hs(87);const et=Fe();if(et===96)switch(Fe()){case 64:case 32:case 44:return!1;default:return!0}else if(et===28||et===64)return!0;return!1})?1:0:2}function oS(q){const ge=t.getTokenStart();if(br?.has(ge))return;const Ae=h2(!1,q);return Ae||(br||(br=new Set)).add(ge),Ae}function cS(q){if(M()===134&&wr(g2)===1){const ge=ee(),Ae=ue(),et=G1(),wt=kg(0);return xg(ge,wt,q,Ae,et)}}function g2(){if(M()===134){if(Fe(),t.hasPrecedingLineBreak()||M()===39)return 0;const q=kg(0);if(!t.hasPrecedingLineBreak()&&q.kind===80&&M()===39)return 1}return 0}function h2(q,ge){const Ae=ee(),et=ue(),wt=G1(),rr=ut(wt,FE)?2:0,vn=Ee();let di;if(Cr(21)){if(q)di=_n(rr,q);else{const by=_n(rr,q);if(!by)return;di=by}if(!Cr(22)&&!q)return}else{if(!q)return;di=L_()}const ci=M()===59,Yn=xr(59,!1);if(Yn&&!q&&_a(Yn))return;let Li=Yn;for(;Li?.kind===196;)Li=Li.type;const Za=Li&&hC(Li);if(!q&&M()!==39&&(Za||M()!==19))return;const La=M(),Ia=yo(39),$f=La===39||La===19?bp(ut(wt,FE),ge):vo();if(!ge&&ci&&M()!==59)return;const Xp=p.createArrowFunction(wt,vn,di,Yn,Ia,$f);return Dr(qt(Xp,Ae),et)}function bp(q,ge){if(M()===19)return fy(q?2:0);if(M()!==27&&M()!==100&&M()!==86&&wx()&&!je())return fy(16|(q?2:0));const Ae=ar;ar=!1;const et=q?we(()=>Bu(ge)):Be(()=>Bu(ge));return ar=Ae,et}function dd(q,ge,Ae){const et=Ws(58);if(!et)return q;let wt;return qt(p.createConditionalExpression(q,et,Qs(r,()=>Bu(!1)),wt=yo(59),ip(wt)?Bu(Ae):No(80,!1,d._0_expected,Hs(59))),ge)}function kg(q){const ge=ee(),Ae=_c();return Vd(q,Ae,ge)}function lS(q){return q===103||q===165}function Vd(q,ge,Ae){for(;;){Wt();const et=m8(M());if(!(M()===43?et>=q:et>q)||M()===103&&Re())break;if(M()===130||M()===152){if(t.hasPrecedingLineBreak())break;{const rr=M();Fe(),ge=rr===152?T6(ge,Cl()):Wn(ge,Cl())}}else ge=yi(ge,Ic(),kg(et),Ae)}return ge}function uS(){return Re()&&M()===103?!1:m8(M())>0}function T6(q,ge){return qt(p.createSatisfiesExpression(q,ge),q.pos)}function yi(q,ge,Ae,et){return qt(p.createBinaryExpression(q,ge,Ae),et)}function Wn(q,ge){return qt(p.createAsExpression(q,ge),q.pos)}function qd(){const q=ee();return qt(p.createPrefixUnaryExpression(M(),Ve(Ju)),q)}function S_(){const q=ee();return qt(p.createDeleteExpression(Ve(Ju)),q)}function x6(){const q=ee();return qt(p.createTypeOfExpression(Ve(Ju)),q)}function u0(){const q=ee();return qt(p.createVoidExpression(Ve(Ju)),q)}function k6(){return M()===135?Qt()?!0:wr(w6):!1}function y2(){const q=ee();return qt(p.createAwaitExpression(Ve(Ju)),q)}function _c(){if(ah()){const Ae=ee(),et=Mm();return M()===43?Vd(m8(M()),et,Ae):et}const q=M(),ge=Ju();if(M()===43){const Ae=la(be,ge.pos),{end:et}=ge;ge.kind===216?U(Ae,et,d.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):(E.assert(s5(q)),U(Ae,et,d.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,Hs(q)))}return ge}function Ju(){switch(M()){case 40:case 41:case 55:case 54:return qd();case 91:return S_();case 114:return x6();case 116:return u0();case 30:return me===1?Eg(!0,void 0,void 0,!0):j1();case 135:if(k6())return y2();default:return Mm()}}function ah(){switch(M()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 135:return!1;case 30:if(me!==1)return!1;default:return!0}}function Mm(){if(M()===46||M()===47){const ge=ee();return qt(p.createPrefixUnaryExpression(M(),Ve(Cg)),ge)}else if(me===1&&M()===30&&wr(Bf))return Eg(!0);const q=Cg();if(E.assert(m_(q)),(M()===46||M()===47)&&!t.hasPrecedingLineBreak()){const ge=M();return Fe(),qt(p.createPostfixUnaryExpression(q,ge),q.pos)}return q}function Cg(){const q=ee();let ge;return M()===102?wr(ly)?(he|=4194304,ge=Ic()):wr(Kb)?(Fe(),Fe(),ge=qt(p.createMetaProperty(102,xc()),q),he|=8388608):ge=Gp():ge=M()===108?R1():Gp(),Tp(q,ge)}function Gp(){const q=ee(),ge=yl();return Yi(q,ge,!0)}function R1(){const q=ee();let ge=Ic();if(M()===30){const Ae=ee(),et=_i(b2);et!==void 0&&(U(Ae,ee(),d.super_may_not_use_type_arguments),__()||(ge=p.createExpressionWithTypeArguments(ge,et)))}return M()===21||M()===25||M()===23?ge:(yo(25,d.super_must_be_followed_by_an_argument_list_or_member_access),qt(X(ge,Et(!0,!0,!0)),q))}function Eg(q,ge,Ae,et=!1){const wt=ee(),rr=jm(q);let vn;if(rr.kind===286){let di=E6(rr),ci;const Yn=di[di.length-1];if(Yn?.kind===284&&!h1(Yn.openingElement.tagName,Yn.closingElement.tagName)&&h1(rr.tagName,Yn.closingElement.tagName)){const Li=Yn.children.end,Za=qt(p.createJsxElement(Yn.openingElement,Yn.children,qt(p.createJsxClosingElement(qt(w(""),Li,Li)),Li,Li)),Yn.openingElement.pos,Li);di=rs([...di.slice(0,di.length-1),Za],di.pos,Li),ci=Yn.closingElement}else ci=kx(rr,q),h1(rr.tagName,ci.tagName)||(Ae&&Md(Ae)&&h1(ci.tagName,Ae.tagName)?j(rr.tagName,d.JSX_element_0_has_no_corresponding_closing_tag,j4(be,rr.tagName)):j(ci.tagName,d.Expected_corresponding_JSX_closing_tag_for_0,j4(be,rr.tagName)));vn=qt(p.createJsxElement(rr,di,ci),wt)}else rr.kind===289?vn=qt(p.createJsxFragment(rr,E6(rr),Sp(q)),wt):(E.assert(rr.kind===285),vn=rr);if(!et&&q&&M()===30){const di=typeof ge>"u"?vn.pos:ge,ci=_i(()=>Eg(!0,di));if(ci){const Yn=No(28,!1);return TE(Yn,ci.pos,0),U(la(be,di),ci.end,d.JSX_expressions_must_have_one_parent_element),qt(p.createBinaryExpression(vn,Yn,ci),wt)}}return vn}function C6(){const q=ee(),ge=p.createJsxText(t.getTokenValue(),mt===13);return mt=t.scanJsxToken(),qt(ge,q)}function Rm(q,ge){switch(ge){case 1:if(jT(q))j(q,d.JSX_fragment_has_no_corresponding_closing_tag);else{const Ae=q.tagName,et=Math.min(la(be,Ae.pos),Ae.end);U(et,Ae.end,d.JSX_element_0_has_no_corresponding_closing_tag,j4(be,q.tagName))}return;case 31:case 7:return;case 12:case 13:return C6();case 19:return Tx(!1);case 30:return Eg(!1,void 0,q);default:return E.assertNever(ge)}}function E6(q){const ge=[],Ae=ee(),et=Ht;for(Ht|=16384;;){const wt=Rm(q,mt=t.reScanJsxToken());if(!wt||(ge.push(wt),Md(q)&&wt?.kind===284&&!h1(wt.openingElement.tagName,wt.closingElement.tagName)&&h1(q.tagName,wt.closingElement.tagName)))break}return Ht=et,rs(ge,Ae)}function Hd(){const q=ee();return qt(p.createJsxAttributes(Fs(13,eD)),q)}function jm(q){const ge=ee();if(Cr(30),M()===32)return Ni(),qt(p.createJsxOpeningFragment(),ge);const Ae=_0(),et=zr&524288?void 0:yy(),wt=Hd();let rr;return M()===32?(Ni(),rr=p.createJsxOpeningElement(Ae,et,wt)):(Cr(44),Cr(32,void 0,!1)&&(q?Fe():Ni()),rr=p.createJsxSelfClosingElement(Ae,et,wt)),qt(rr,ge)}function _0(){const q=ee(),ge=D6();if(sd(ge))return ge;let Ae=ge;for(;hs(25);)Ae=qt(X(Ae,Et(!0,!1,!1)),q);return Ae}function D6(){const q=ee();Ln();const ge=M()===110,Ae=A();return hs(59)?(Ln(),qt(p.createJsxNamespacedName(Ae,A()),q)):ge?qt(p.createToken(110),q):Ae}function Tx(q){const ge=ee();if(!Cr(19))return;let Ae,et;return M()!==20&&(q||(Ae=Ws(26)),et=Ol()),q?Cr(20):Cr(20,void 0,!1)&&Ni(),qt(p.createJsxExpression(Ae,et),ge)}function eD(){if(M()===19)return v2();const q=ee();return qt(p.createJsxAttribute(io(),xx()),q)}function xx(){if(M()===64){if(Cn()===11)return jn();if(M()===19)return Tx(!0);if(M()===30)return Eg(!0);er(d.or_JSX_element_expected)}}function io(){const q=ee();Ln();const ge=A();return hs(59)?(Ln(),qt(p.createJsxNamespacedName(ge,A()),q)):ge}function v2(){const q=ee();Cr(19),Cr(26);const ge=Ol();return Cr(20),qt(p.createJsxSpreadAttribute(ge),q)}function kx(q,ge){const Ae=ee();Cr(31);const et=_0();return Cr(32,void 0,!1)&&(ge||!h1(q.tagName,et)?Fe():Ni()),qt(p.createJsxClosingElement(et),Ae)}function Sp(q){const ge=ee();return Cr(31),Cr(32,d.Expected_corresponding_closing_tag_for_JSX_fragment,!1)&&(q?Fe():Ni()),qt(p.createJsxJsxClosingFragment(),ge)}function j1(){E.assert(me!==1,"Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments.");const q=ee();Cr(30);const ge=Cl();Cr(32);const Ae=Ju();return qt(p.createTypeAssertion(ge,Ae),q)}function Cx(){return Fe(),wu(M())||M()===23||__()}function tD(){return M()===29&&wr(Cx)}function _S(q){if(q.flags&64)return!0;if(MT(q)){let ge=q.expression;for(;MT(ge)&&!(ge.flags&64);)ge=ge.expression;if(ge.flags&64){for(;MT(q);)q.flags|=64,q=q.expression;return!0}}return!1}function Kr(q,ge,Ae){const et=Et(!0,!0,!0),wt=Ae||_S(ge),rr=wt?J(ge,Ae,et):X(ge,et);if(wt&&Ti(rr.name)&&j(rr.name,d.An_optional_chain_cannot_contain_private_identifiers),qh(ge)&&ge.typeArguments){const vn=ge.typeArguments.pos-1,di=la(be,ge.typeArguments.end)+1;U(vn,di,d.An_instantiation_expression_cannot_be_followed_by_a_property_access)}return qt(rr,q)}function Ql(q,ge,Ae){let et;if(M()===24)et=No(80,!0,d.An_element_access_expression_should_take_an_argument);else{const rr=Ce(Ol);_f(rr)&&(rr.text=$c(rr.text)),et=rr}Cr(24);const wt=Ae||_S(ge)?B(ge,Ae,et):ie(ge,et);return qt(wt,q)}function Yi(q,ge,Ae){for(;;){let et,wt=!1;if(Ae&&tD()?(et=yo(29),wt=wu(M())):wt=hs(25),wt){ge=Kr(q,ge,et);continue}if((et||!Ct())&&hs(23)){ge=Ql(q,ge,et);continue}if(__()){ge=!et&&ge.kind===233?Gd(q,ge.expression,et,ge.typeArguments):Gd(q,ge,et,void 0);continue}if(!et){if(M()===54&&!t.hasPrecedingLineBreak()){Fe(),ge=qt(p.createNonNullExpression(ge),q);continue}const rr=_i(b2);if(rr){ge=qt(p.createExpressionWithTypeArguments(ge,rr),q);continue}}return ge}}function __(){return M()===15||M()===16}function Gd(q,ge,Ae,et){const wt=p.createTaggedTemplateExpression(ge,et,M()===15?(Zr(!0),jn()):L(!0));return(Ae||ge.flags&64)&&(wt.flags|=64),wt.questionDotToken=Ae,qt(wt,q)}function Tp(q,ge){for(;;){ge=Yi(q,ge,!0);let Ae;const et=Ws(29);if(et&&(Ae=_i(b2),__())){ge=Gd(q,ge,et,Ae);continue}if(Ae||M()===21){!et&&ge.kind===233&&(Ae=ge.typeArguments,ge=ge.expression);const wt=Ur(),rr=et||_S(ge)?ae(ge,et,Ae,wt):Y(ge,Ae,wt);ge=qt(rr,q);continue}if(et){const wt=No(80,!1,d.Identifier_expected);ge=qt(J(ge,et,wt),q)}break}return ge}function Ur(){Cr(21);const q=ou(11,Ex);return Cr(22),q}function b2(){if(zr&524288||gn()!==30)return;Fe();const q=ou(20,Cl);if(Wt()===32)return Fe(),q&&B1()?q:void 0}function B1(){switch(M()){case 21:case 15:case 16:return!0;case 30:case 32:case 40:case 41:return!1}return t.hasPrecedingLineBreak()||uS()||!Tg()}function yl(){switch(M()){case 15:t.getTokenFlags()&26656&&Zr(!1);case 9:case 10:case 11:return jn();case 110:case 108:case 106:case 112:case 97:return Ic();case 21:return $d();case 23:return oh();case 19:return z1();case 134:if(!wr(lo))break;return Dg();case 60:return gS();case 86:return I6();case 100:return Dg();case 105:return fS();case 44:case 69:if(Lr()===14)return jn();break;case 16:return L(!1);case 81:return $r()}return vo(d.Expression_expected)}function $d(){const q=ee(),ge=ue();Cr(21);const Ae=Ce(Ol);return Cr(22),Dr(qt($(Ae),q),ge)}function Xd(){const q=ee();Cr(26);const ge=Bu(!0);return qt(p.createSpreadElement(ge),q)}function _y(){return M()===26?Xd():M()===28?qt(p.createOmittedExpression(),ee()):Bu(!0)}function Ex(){return Qs(r,_y)}function oh(){const q=ee(),ge=t.getTokenStart(),Ae=Cr(23),et=t.hasPrecedingLineBreak(),wt=ou(15,_y);return Ro(23,24,Ae,ge),qt(z(wt,et),q)}function J1(){const q=ee(),ge=ue();if(Ws(26)){const Li=Bu(!0);return Dr(qt(p.createSpreadAssignment(Li),q),ge)}const Ae=lu(!0);if(yn(139))return Cp(q,ge,Ae,177,0);if(yn(153))return Cp(q,ge,Ae,178,0);const et=Ws(42),wt=Is(),rr=dr(),vn=Ws(58),di=Ws(54);if(et||M()===21||M()===30)return kp(q,ge,Ae,et,rr,vn,di);let ci;if(wt&&M()!==59){const Li=Ws(64),Za=Li?Ce(()=>Bu(!0)):void 0;ci=p.createShorthandPropertyAssignment(rr,Za),ci.equalsToken=Li}else{Cr(59);const Li=Ce(()=>Bu(!0));ci=p.createPropertyAssignment(rr,Li)}return ci.modifiers=Ae,ci.questionToken=vn,ci.exclamationToken=di,Dr(qt(ci,q),ge)}function z1(){const q=ee(),ge=t.getTokenStart(),Ae=Cr(19),et=t.hasPrecedingLineBreak(),wt=ou(12,J1,!0);return Ro(19,20,Ae,ge),qt(W(wt,et),q)}function Dg(){const q=Ct();Di(!1);const ge=ee(),Ae=ue(),et=lu(!1);Cr(100);const wt=Ws(42),rr=wt?1:0,vn=ut(et,FE)?2:0,di=rr&&vn?gt(Bm):rr?dt(Bm):vn?we(Bm):Bm(),ci=Ee(),Yn=fn(rr|vn),Li=xr(59,!1),Za=fy(rr|vn);Di(q);const La=p.createFunctionExpression(et,wt,di,ci,Yn,Li,Za);return Dr(qt(La,ge),Ae)}function Bm(){return ia()?u_():void 0}function fS(){const q=ee();if(Cr(105),hs(25)){const rr=xc();return qt(p.createMetaProperty(105,rr),q)}const ge=ee();let Ae=Yi(ge,yl(),!1),et;Ae.kind===233&&(et=Ae.typeArguments,Ae=Ae.expression),M()===29&&er(d.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0,j4(be,Ae));const wt=M()===21?Ur():void 0;return qt(_e(Ae,et,wt),q)}function ch(q,ge){const Ae=ee(),et=ue(),wt=t.getTokenStart(),rr=Cr(19,ge);if(rr||q){const vn=t.hasPrecedingLineBreak(),di=Fs(1,Ef);Ro(19,20,rr,wt);const ci=Dr(qt(H(di,vn),Ae),et);return M()===64&&(er(d.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses),Fe()),ci}else{const vn=L_();return Dr(qt(H(vn,void 0),Ae),et)}}function fy(q,ge){const Ae=Dt();ji(!!(q&1));const et=Qt();$i(!!(q&2));const wt=ar;ar=!1;const rr=Ct();rr&&Di(!1);const vn=ch(!!(q&16),ge);return rr&&Di(!0),ar=wt,ji(Ae),$i(et),vn}function S2(){const q=ee(),ge=ue();return Cr(27),Dr(qt(p.createEmptyStatement(),q),ge)}function Dx(){const q=ee(),ge=ue();Cr(101);const Ae=t.getTokenStart(),et=Cr(21),wt=Ce(Ol);Ro(21,22,et,Ae);const rr=Ef(),vn=hs(93)?Ef():void 0;return Dr(qt(Se(wt,rr,vn),q),ge)}function pS(){const q=ee(),ge=ue();Cr(92);const Ae=Ef();Cr(117);const et=t.getTokenStart(),wt=Cr(21),rr=Ce(Ol);return Ro(21,22,wt,et),hs(27),Dr(qt(p.createDoStatement(Ae,rr),q),ge)}function T2(){const q=ee(),ge=ue();Cr(117);const Ae=t.getTokenStart(),et=Cr(21),wt=Ce(Ol);Ro(21,22,et,Ae);const rr=Ef();return Dr(qt(se(wt,rr),q),ge)}function Vf(){const q=ee(),ge=ue();Cr(99);const Ae=Ws(135);Cr(21);let et;M()!==27&&(M()===115||M()===121||M()===87||M()===160&&wr(lh)||M()===135&&wr(Ax)?et=E2(!0):et=Ue(Ol));let wt;if(Ae?Cr(165):hs(165)){const rr=Ce(()=>Bu(!0));Cr(22),wt=ve(Ae,et,rr,Ef())}else if(hs(103)){const rr=Ce(Ol);Cr(22),wt=p.createForInStatement(et,rr,Ef())}else{Cr(27);const rr=M()!==27&&M()!==22?Ce(Ol):void 0;Cr(27);const vn=M()!==22?Ce(Ol):void 0;Cr(22),wt=Z(et,rr,vn,Ef())}return Dr(qt(wt,q),ge)}function W1(q){const ge=ee(),Ae=ue();Cr(q===252?83:88);const et=Fc()?void 0:vo();Ao();const wt=q===252?p.createBreakStatement(et):p.createContinueStatement(et);return Dr(qt(wt,ge),Ae)}function Cc(){const q=ee(),ge=ue();Cr(107);const Ae=Fc()?void 0:Ce(Ol);return Ao(),Dr(qt(p.createReturnStatement(Ae),q),ge)}function ul(){const q=ee(),ge=ue();Cr(118);const Ae=t.getTokenStart(),et=Cr(21),wt=Ce(Ol);Ro(21,22,et,Ae);const rr=Ds(67108864,Ef);return Dr(qt(p.createWithStatement(wt,rr),q),ge)}function Px(){const q=ee(),ge=ue();Cr(84);const Ae=Ce(Ol);Cr(59);const et=Fs(3,Ef);return Dr(qt(p.createCaseClause(Ae,et),q),ge)}function cu(){const q=ee();Cr(90),Cr(59);const ge=Fs(3,Ef);return qt(p.createDefaultClause(ge),q)}function T_(){return M()===84?Px():cu()}function x2(){const q=ee();Cr(19);const ge=Fs(2,T_);return Cr(20),qt(p.createCaseBlock(ge),q)}function qf(){const q=ee(),ge=ue();Cr(109),Cr(21);const Ae=Ce(Ol);Cr(22);const et=x2();return Dr(qt(p.createSwitchStatement(Ae,et),q),ge)}function U1(){const q=ee(),ge=ue();Cr(111);let Ae=t.hasPrecedingLineBreak()?void 0:Ce(Ol);return Ae===void 0&&(Bt++,Ae=qt(w(""),ee())),$o()||os(Ae),Dr(qt(p.createThrowStatement(Ae),q),ge)}function f0(){const q=ee(),ge=ue();Cr(113);const Ae=ch(!1),et=M()===85?Ll():void 0;let wt;return(!et||M()===98)&&(Cr(98,d.catch_or_finally_expected),wt=ch(!1)),Dr(qt(p.createTryStatement(Ae,et,wt),q),ge)}function Ll(){const q=ee();Cr(85);let ge;hs(21)?(ge=f_(),Cr(22)):ge=void 0;const Ae=ch(!1);return qt(p.createCatchClause(ge,Ae),q)}function dS(){const q=ee(),ge=ue();return Cr(89),Ao(),Dr(qt(p.createDebuggerStatement(),q),ge)}function xp(){const q=ee();let ge=ue(),Ae;const et=M()===21,wt=Ce(Ol);return Ie(wt)&&hs(59)?Ae=p.createLabeledStatement(wt,Ef()):($o()||os(wt),Ae=oe(wt),et&&(ge=!1)),Dr(qt(Ae,q),ge)}function py(){return Fe(),wu(M())&&!t.hasPrecedingLineBreak()}function P6(){return Fe(),M()===86&&!t.hasPrecedingLineBreak()}function lo(){return Fe(),M()===100&&!t.hasPrecedingLineBreak()}function w6(){return Fe(),(wu(M())||M()===9||M()===10||M()===11)&&!t.hasPrecedingLineBreak()}function mS(){for(;;)switch(M()){case 115:case 121:case 87:case 100:case 86:case 94:return!0;case 160:return ef();case 135:return dy();case 120:case 156:return l0();case 144:case 145:return Fx();case 128:case 129:case 134:case 138:case 123:case 124:case 125:case 148:const q=M();if(Fe(),t.hasPrecedingLineBreak())return!1;if(q===138&&M()===156)return!0;continue;case 162:return Fe(),M()===19||M()===80||M()===95;case 102:return Fe(),M()===11||M()===42||M()===19||wu(M());case 95:let ge=Fe();if(ge===156&&(ge=wr(Fe)),ge===64||ge===42||ge===19||ge===90||ge===130||ge===60)return!0;continue;case 126:Fe();continue;default:return!1}}function V1(){return wr(mS)}function wx(){switch(M()){case 60:case 27:case 19:case 115:case 121:case 160:case 100:case 86:case 94:case 101:case 92:case 117:case 99:case 88:case 83:case 107:case 118:case 109:case 111:case 113:case 89:case 85:case 98:return!0;case 102:return V1()||wr(_2);case 87:case 95:return V1();case 134:case 138:case 120:case 144:case 145:case 156:case 162:return!0;case 129:case 125:case 123:case 124:case 126:case 148:return V1()||!wr(py);default:return Tg()}}function Zu(){return Fe(),ia()||M()===19||M()===23}function Pg(){return wr(Zu)}function lh(){return k2(!0)}function k2(q){return Fe(),q&&M()===165?!1:(ia()||M()===19)&&!t.hasPrecedingLineBreak()}function ef(){return wr(k2)}function Ax(q){return Fe()===160?k2(q):!1}function dy(){return wr(Ax)}function Ef(){switch(M()){case 27:return S2();case 19:return ch(!1);case 115:return H1(ee(),ue(),void 0);case 121:if(Pg())return H1(ee(),ue(),void 0);break;case 135:if(dy())return H1(ee(),ue(),void 0);break;case 160:if(ef())return H1(ee(),ue(),void 0);break;case 100:return D2(ee(),ue(),void 0);case 86:return Gf(ee(),ue(),void 0);case 101:return Dx();case 92:return pS();case 117:return T2();case 99:return Vf();case 88:return W1(251);case 83:return W1(252);case 107:return Cc();case 118:return ul();case 109:return qf();case 111:return U1();case 113:case 85:case 98:return f0();case 89:return dS();case 60:return p0();case 134:case 120:case 156:case 144:case 145:case 138:case 87:case 94:case 95:case 102:case 123:case 124:case 125:case 128:case 129:case 126:case 148:case 162:if(V1())return p0();break}return xp()}function C2(q){return q.kind===138}function p0(){const q=ee(),ge=ue(),Ae=lu(!0);if(ut(Ae,C2)){const wt=rD(q);if(wt)return wt;for(const rr of Ae)rr.flags|=33554432;return Ds(33554432,()=>Nx(q,ge,Ae))}else return Nx(q,ge,Ae)}function rD(q){return Ds(33554432,()=>{const ge=hc(Ht,q);if(ge)return jo(ge)})}function Nx(q,ge,Ae){switch(M()){case 115:case 121:case 87:case 160:case 135:return H1(q,ge,Ae);case 100:return D2(q,ge,Ae);case 86:return Gf(q,ge,Ae);case 120:return at(q,ge,Ae);case 156:return Gt(q,ge,Ae);case 94:return hi(q,ge,Ae);case 162:case 144:case 145:return x_(q,ge,Ae);case 102:return m0(q,ge,Ae);case 95:switch(Fe(),M()){case 90:case 64:return qM(q,ge,Ae);case 130:return vy(q,ge,Ae);default:return Q1(q,ge,Ae)}default:if(Ae){const et=No(282,!0,d.Declaration_expected);return SE(et,q),et.modifiers=Ae,et}return}}function Ix(){return Fe()===11}function Fx(){return Fe(),!t.hasPrecedingLineBreak()&&(Is()||M()===11)}function q1(q,ge){if(M()!==19){if(q&4){on();return}if(Fc()){Ao();return}}return fy(q,ge)}function j_(){const q=ee();if(M()===28)return qt(p.createOmittedExpression(),q);const ge=Ws(26),Ae=cn(),et=Uf();return qt(p.createBindingElement(ge,void 0,Ae,et),q)}function wg(){const q=ee(),ge=Ws(26),Ae=ia();let et=dr(),wt;Ae&&M()!==59?(wt=et,et=void 0):(Cr(59),wt=cn());const rr=Uf();return qt(p.createBindingElement(ge,et,wt,rr),q)}function Ox(){const q=ee();Cr(19);const ge=Ce(()=>ou(9,wg));return Cr(20),qt(p.createObjectBindingPattern(ge),q)}function Lx(){const q=ee();Cr(23);const ge=Ce(()=>ou(10,j_));return Cr(24),qt(p.createArrayBindingPattern(ge),q)}function Na(){return M()===19||M()===23||M()===81||ia()}function cn(q){return M()===23?Lx():M()===19?Ox():u_(q)}function tf(){return f_(!0)}function f_(q){const ge=ee(),Ae=ue(),et=cn(d.Private_identifiers_are_not_allowed_in_variable_declarations);let wt;q&&et.kind===80&&M()===54&&!t.hasPrecedingLineBreak()&&(wt=Ic());const rr=o0(),vn=lS(M())?void 0:Uf(),di=Te(et,wt,rr,vn);return Dr(qt(di,ge),Ae)}function E2(q){const ge=ee();let Ae=0;switch(M()){case 115:break;case 121:Ae|=1;break;case 87:Ae|=2;break;case 160:Ae|=4;break;case 135:E.assert(dy()),Ae|=6,Fe();break;default:E.fail()}Fe();let et;if(M()===165&&wr(A6))et=L_();else{const wt=Re();Pi(q),et=ou(8,q?f_:tf),Pi(wt)}return qt(Me(et,Ae),ge)}function A6(){return $u()&&Fe()===22}function H1(q,ge,Ae){const et=E2(!1);Ao();const wt=K(Ae,et);return Dr(qt(wt,q),ge)}function D2(q,ge,Ae){const et=Qt(),wt=Nd(Ae);Cr(100);const rr=Ws(42),vn=wt&2048?Bm():u_(),di=rr?1:0,ci=wt&1024?2:0,Yn=Ee();wt&32&&$i(!0);const Li=fn(di|ci),Za=xr(59,!1),La=q1(di|ci,d.or_expected);$i(et);const Ia=p.createFunctionDeclaration(Ae,rr,vn,Yn,Li,Za,La);return Dr(qt(Ia,q),ge)}function my(){if(M()===137)return Cr(137);if(M()===11&&wr(Fe)===21)return _i(()=>{const q=jn();return q.text==="constructor"?q:void 0})}function Df(q,ge,Ae){return _i(()=>{if(my()){const et=Ee(),wt=fn(0),rr=xr(59,!1),vn=q1(0,d.or_expected),di=p.createConstructorDeclaration(Ae,wt,vn);return di.typeParameters=et,di.type=rr,Dr(qt(di,q),ge)}})}function kp(q,ge,Ae,et,wt,rr,vn,di){const ci=et?1:0,Yn=ut(Ae,FE)?2:0,Li=Ee(),Za=fn(ci|Yn),La=xr(59,!1),Ia=q1(ci|Yn,di),$f=p.createMethodDeclaration(Ae,et,wt,rr,Li,Za,La,Ia);return $f.exclamationToken=vn,Dr(qt($f,q),ge)}function gy(q,ge,Ae,et,wt){const rr=!wt&&!t.hasPrecedingLineBreak()?Ws(54):void 0,vn=o0(),di=Qs(90112,Uf);Vo(et,vn,di);const ci=p.createPropertyDeclaration(Ae,et,wt||rr,vn,di);return Dr(qt(ci,q),ge)}function $p(q,ge,Ae){const et=Ws(42),wt=dr(),rr=Ws(58);return et||M()===21||M()===30?kp(q,ge,Ae,et,wt,rr,void 0,d.or_expected):gy(q,ge,Ae,wt,rr)}function Cp(q,ge,Ae,et,wt){const rr=dr(),vn=Ee(),di=fn(0),ci=xr(59,!1),Yn=q1(wt),Li=et===177?p.createGetAccessorDeclaration(Ae,rr,di,ci,Yn):p.createSetAccessorDeclaration(Ae,rr,di,Yn);return Li.typeParameters=vn,N_(Li)&&(Li.type=ci),Dr(qt(Li,q),ge)}function d0(){let q;if(M()===60)return!0;for(;Oh(M());){if(q=M(),_J(q))return!0;Fe()}if(M()===42||(Pe()&&(q=M(),Fe()),M()===23))return!0;if(q!==void 0){if(!a_(q)||q===153||q===139)return!0;switch(M()){case 21:case 30:case 54:case 59:case 64:case 58:return!0;default:return Fc()}}return!1}function P2(q,ge,Ae){yo(126);const et=Lc(),wt=Dr(qt(p.createClassStaticBlockDeclaration(et),q),ge);return wt.modifiers=Ae,wt}function Lc(){const q=Dt(),ge=Qt();ji(!1),$i(!0);const Ae=ch(!1);return ji(q),$i(ge),Ae}function nD(){if(Qt()&&M()===135){const q=ee(),ge=vo(d.Expression_expected);Fe();const Ae=Yi(q,ge,!0);return Tp(q,Ae)}return Cg()}function Hf(){const q=ee();if(!hs(60))return;const ge=fe(nD);return qt(p.createDecorator(ge),q)}function N6(q,ge,Ae){const et=ee(),wt=M();if(M()===87&&ge){if(!_i(li))return}else{if(Ae&&M()===126&&wr(Yd))return;if(q&&M()===126)return;if(!tl())return}return qt(O(wt),et)}function lu(q,ge,Ae){const et=ee();let wt,rr,vn,di=!1,ci=!1,Yn=!1;if(q&&M()===60)for(;rr=Hf();)wt=lr(wt,rr);for(;vn=N6(di,ge,Ae);)vn.kind===126&&(di=!0),wt=lr(wt,vn),ci=!0;if(ci&&q&&M()===60)for(;rr=Hf();)wt=lr(wt,rr),Yn=!0;if(Yn)for(;vn=N6(di,ge,Ae);)vn.kind===126&&(di=!0),wt=lr(wt,vn);return wt&&rs(wt,et)}function G1(){let q;if(M()===134){const ge=ee();Fe();const Ae=qt(O(134),ge);q=rs([Ae],ge)}return q}function w2(){const q=ee(),ge=ue();if(M()===27)return Fe(),Dr(qt(p.createSemicolonClassElement(),q),ge);const Ae=lu(!0,!0,!0);if(M()===126&&wr(Yd))return P2(q,ge,Ae);if(yn(139))return Cp(q,ge,Ae,177,0);if(yn(153))return Cp(q,ge,Ae,178,0);if(M()===137||M()===11){const et=Df(q,ge,Ae);if(et)return et}if(Qa())return M_(q,ge,Ae);if(wu(M())||M()===11||M()===9||M()===42||M()===23)if(ut(Ae,C2)){for(const wt of Ae)wt.flags|=33554432;return Ds(33554432,()=>$p(q,ge,Ae))}else return $p(q,ge,Ae);if(Ae){const et=No(80,!0,d.Declaration_expected);return gy(q,ge,Ae,et,void 0)}return E.fail("Should not have attempted to parse class member declaration.")}function gS(){const q=ee(),ge=ue(),Ae=lu(!0);if(M()===86)return Qo(q,ge,Ae,231);const et=No(282,!0,d.Expression_expected);return SE(et,q),et.modifiers=Ae,et}function I6(){return Qo(ee(),ue(),void 0,231)}function Gf(q,ge,Ae){return Qo(q,ge,Ae,263)}function Qo(q,ge,Ae,et){const wt=Qt();Cr(86);const rr=Qd(),vn=Ee();ut(Ae,wT)&&$i(!0);const di=Ag();let ci;Cr(19)?(ci=te(),Cr(20)):ci=L_(),$i(wt);const Yn=et===263?p.createClassDeclaration(Ae,rr,vn,di,ci):p.createClassExpression(Ae,rr,vn,di,ci);return Dr(qt(Yn,q),ge)}function Qd(){return ia()&&!hy()?ju(ia()):void 0}function hy(){return M()===119&&wr(xu)}function Ag(){if(k())return Fs(22,$1)}function $1(){const q=ee(),ge=M();E.assert(ge===96||ge===119),Fe();const Ae=ou(7,F6);return qt(p.createHeritageClause(ge,Ae),q)}function F6(){const q=ee(),ge=Cg();if(ge.kind===233)return ge;const Ae=yy();return qt(p.createExpressionWithTypeArguments(ge,Ae),q)}function yy(){return M()===30?Qu(20,Cl,30,32):void 0}function k(){return M()===96||M()===119}function te(){return Fs(5,w2)}function at(q,ge,Ae){Cr(120);const et=vo(),wt=Ee(),rr=Ag(),vn=tS(),di=p.createInterfaceDeclaration(Ae,et,wt,rr,vn);return Dr(qt(di,q),ge)}function Gt(q,ge,Ae){Cr(156),t.hasPrecedingLineBreak()&&er(d.Line_break_not_permitted_here);const et=vo(),wt=Ee();Cr(64);const rr=M()===141&&_i(nS)||Cl();Ao();const vn=p.createTypeAliasDeclaration(Ae,et,wt,rr);return Dr(qt(vn,q),ge)}function pn(){const q=ee(),ge=ue(),Ae=dr(),et=Ce(Uf);return Dr(qt(p.createEnumMember(Ae,et),q),ge)}function hi(q,ge,Ae){Cr(94);const et=vo();let wt;Cr(19)?(wt=G(()=>ou(6,pn)),Cr(20)):wt=L_();const rr=p.createEnumDeclaration(Ae,et,wt);return Dr(qt(rr,q),ge)}function ri(){const q=ee();let ge;return Cr(19)?(ge=Fs(1,Ef),Cr(20)):ge=L_(),qt(p.createModuleBlock(ge),q)}function Mi(q,ge,Ae,et){const wt=et&32,rr=et&8?xc():vo(),vn=hs(25)?Mi(ee(),!1,void 0,8|wt):ri(),di=p.createModuleDeclaration(Ae,rr,vn,et);return Dr(qt(di,q),ge)}function ws(q,ge,Ae){let et=0,wt;M()===162?(wt=vo(),et|=2048):(wt=jn(),wt.text=$c(wt.text));let rr;M()===19?rr=ri():Ao();const vn=p.createModuleDeclaration(Ae,wt,rr,et);return Dr(qt(vn,q),ge)}function x_(q,ge,Ae){let et=0;if(M()===162)return ws(q,ge,Ae);if(hs(145))et|=32;else if(Cr(144),M()===11)return ws(q,ge,Ae);return Mi(q,ge,Ae,et)}function B_(){return M()===149&&wr(ii)}function ii(){return Fe()===21}function Yd(){return Fe()===19}function mr(){return Fe()===44}function vy(q,ge,Ae){Cr(130),Cr(145);const et=vo();Ao();const wt=p.createNamespaceExportDeclaration(et);return wt.modifiers=Ae,Dr(qt(wt,q),ge)}function m0(q,ge,Ae){Cr(102);const et=t.getTokenFullStart();let wt;Is()&&(wt=vo());let rr=!1;if(M()!==161&&wt?.escapedText==="type"&&(Is()||Mx())&&(rr=!0,wt=Is()?vo():void 0),wt&&!yS())return Jm(q,ge,Ae,wt,rr);let vn;(wt||M()===42||M()===19)&&(vn=g0(wt,et,rr),Cr(161));const di=Rx(),ci=M();let Yn;(ci===118||ci===132)&&!t.hasPrecedingLineBreak()&&(Yn=X1(ci)),Ao();const Li=p.createImportDeclaration(Ae,vn,di,Yn);return Dr(qt(Li,q),ge)}function hS(){const q=ee(),ge=wu(M())?xc():Xo(11);Cr(59);const Ae=Bu(!0);return qt(p.createImportAttribute(ge,Ae),q)}function X1(q,ge){const Ae=ee();ge||Cr(q);const et=t.getTokenStart();if(Cr(19)){const wt=t.hasPrecedingLineBreak(),rr=ou(24,hS,!0);if(!Cr(20)){const vn=Mo(Oe);vn&&vn.code===d._0_expected.code&&ua(vn,Zk(ke,be,et,1,d.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}return qt(p.createImportAttributes(rr,wt,q),Ae)}else{const wt=rs([],ee(),void 0,!1);return qt(p.createImportAttributes(wt,!1,q),Ae)}}function Mx(){return M()===42||M()===19}function yS(){return M()===28||M()===161}function Jm(q,ge,Ae,et,wt){Cr(64);const rr=Ng();Ao();const vn=p.createImportEqualsDeclaration(Ae,wt,et,rr);return Dr(qt(vn,q),ge)}function g0(q,ge,Ae){let et;return(!q||hs(28))&&(et=M()===42?EN():iD(275)),qt(p.createImportClause(Ae,q,et),ge)}function Ng(){return B_()?O6():Q(!1)}function O6(){const q=ee();Cr(149),Cr(21);const ge=Rx();return Cr(22),qt(p.createExternalModuleReference(ge),q)}function Rx(){if(M()===11){const q=jn();return q.text=$c(q.text),q}else return Ol()}function EN(){const q=ee();Cr(42),Cr(130);const ge=vo();return qt(p.createNamespaceImport(ge),q)}function iD(q){const ge=ee(),Ae=q===275?p.createNamedImports(Qu(23,uh,19,20)):p.createNamedExports(Qu(23,zm,19,20));return qt(Ae,ge)}function zm(){const q=ue();return Dr(L6(281),q)}function uh(){return L6(276)}function L6(q){const ge=ee();let Ae=a_(M())&&!Is(),et=t.getTokenStart(),wt=t.getTokenEnd(),rr=!1,vn,di=!0,ci=xc();if(ci.escapedText==="type")if(M()===130){const Za=xc();if(M()===130){const La=xc();wu(M())?(rr=!0,vn=Za,ci=Li(),di=!1):(vn=ci,ci=La,di=!1)}else wu(M())?(vn=ci,di=!1,ci=Li()):(rr=!0,ci=Za)}else wu(M())&&(rr=!0,ci=Li());di&&M()===130&&(vn=ci,Cr(130),ci=Li()),q===276&&Ae&&U(et,wt,d.Identifier_expected);const Yn=q===276?p.createImportSpecifier(rr,vn,ci):p.createExportSpecifier(rr,vn,ci);return qt(Yn,ge);function Li(){return Ae=a_(M())&&!Is(),et=t.getTokenStart(),wt=t.getTokenEnd(),xc()}}function Wm(q){return qt(p.createNamespaceExport(xc()),q)}function Q1(q,ge,Ae){const et=Qt();$i(!0);let wt,rr,vn;const di=hs(156),ci=ee();hs(42)?(hs(130)&&(wt=Wm(ci)),Cr(161),rr=Rx()):(wt=iD(279),(M()===161||M()===11&&!t.hasPrecedingLineBreak())&&(Cr(161),rr=Rx()));const Yn=M();rr&&(Yn===118||Yn===132)&&!t.hasPrecedingLineBreak()&&(vn=X1(Yn)),Ao(),$i(et);const Li=p.createExportDeclaration(Ae,di,wt,rr,vn);return Dr(qt(Li,q),ge)}function qM(q,ge,Ae){const et=Qt();$i(!0);let wt;hs(64)?wt=!0:Cr(90);const rr=Bu(!0);Ao(),$i(et);const vn=p.createExportAssignment(Ae,wt,rr);return Dr(qt(vn,q),ge)}let Zd;(q=>{q[q.SourceElements=0]="SourceElements",q[q.BlockStatements=1]="BlockStatements",q[q.SwitchClauses=2]="SwitchClauses",q[q.SwitchClauseStatements=3]="SwitchClauseStatements",q[q.TypeMembers=4]="TypeMembers",q[q.ClassMembers=5]="ClassMembers",q[q.EnumMembers=6]="EnumMembers",q[q.HeritageClauseElement=7]="HeritageClauseElement",q[q.VariableDeclarations=8]="VariableDeclarations",q[q.ObjectBindingElements=9]="ObjectBindingElements",q[q.ArrayBindingElements=10]="ArrayBindingElements",q[q.ArgumentExpressions=11]="ArgumentExpressions",q[q.ObjectLiteralMembers=12]="ObjectLiteralMembers",q[q.JsxAttributes=13]="JsxAttributes",q[q.JsxChildren=14]="JsxChildren",q[q.ArrayLiteralMembers=15]="ArrayLiteralMembers",q[q.Parameters=16]="Parameters",q[q.JSDocParameters=17]="JSDocParameters",q[q.RestProperties=18]="RestProperties",q[q.TypeParameters=19]="TypeParameters",q[q.TypeArguments=20]="TypeArguments",q[q.TupleElementTypes=21]="TupleElementTypes",q[q.HeritageClauses=22]="HeritageClauses",q[q.ImportOrExportSpecifiers=23]="ImportOrExportSpecifiers",q[q.ImportAttributes=24]="ImportAttributes",q[q.JSDocComment=25]="JSDocComment",q[q.Count=26]="Count"})(Zd||(Zd={}));let vS;(q=>{q[q.False=0]="False",q[q.True=1]="True",q[q.Unknown=2]="Unknown"})(vS||(vS={}));let DN;(q=>{function ge(Yn,Li,Za){ei("file.js",Yn,99,void 0,1,0),t.setText(Yn,Li,Za),mt=t.scan();const La=Ae(),Ia=Tr("file.js",99,1,!1,[],O(1),0,Ca),$f=yT(Oe,Ia);return Xe&&(Ia.jsDocDiagnostics=yT(Xe,Ia)),zi(),La?{jsDocTypeExpression:La,diagnostics:$f}:void 0}q.parseJSDocTypeExpressionForTests=ge;function Ae(Yn){const Li=ee(),Za=(Yn?hs:Cr)(19),La=Ds(16777216,fd);(!Yn||Za)&&cl(20);const Ia=p.createJSDocTypeExpression(La);return yr(Ia),qt(Ia,Li)}q.parseJSDocTypeExpression=Ae;function et(){const Yn=ee(),Li=hs(19),Za=ee();let La=Q(!1);for(;M()===81;)On(),vt(),La=qt(p.createJSDocMemberName(La,vo()),Za);Li&&cl(20);const Ia=p.createJSDocNameReference(La);return yr(Ia),qt(Ia,Yn)}q.parseJSDocNameReference=et;function wt(Yn,Li,Za){ei("",Yn,99,void 0,1,0);const La=Ds(16777216,()=>ci(Li,Za)),$f=yT(Oe,{languageVariant:0,text:Yn});return zi(),La?{jsDoc:La,diagnostics:$f}:void 0}q.parseIsolatedJSDocComment=wt;function rr(Yn,Li,Za){const La=mt,Ia=Oe.length,$f=Jt,Xp=Ds(16777216,()=>ci(Li,Za));return ga(Xp,Yn),zr&524288&&(Xe||(Xe=[]),Xe.push(...Oe)),mt=La,Oe.length=Ia,Jt=$f,Xp}q.parseJSDocComment=rr;let vn;(Yn=>{Yn[Yn.BeginningOfLine=0]="BeginningOfLine",Yn[Yn.SawAsterisk=1]="SawAsterisk",Yn[Yn.SavingComments=2]="SavingComments",Yn[Yn.SavingBackticks=3]="SavingBackticks"})(vn||(vn={}));let di;(Yn=>{Yn[Yn.Property=1]="Property",Yn[Yn.Parameter=2]="Parameter",Yn[Yn.CallbackParameter=4]="CallbackParameter"})(di||(di={}));function ci(Yn=0,Li){const Za=be,La=Li===void 0?Za.length:Yn+Li;if(Li=La-Yn,E.assert(Yn>=0),E.assert(Yn<=La),E.assert(La<=Za.length),!cU(Za,Yn))return;let Ia,$f,Xp,by,Ig,El=[];const _h=[],sD=Ht;Ht|=1<<25;const M6=t.scanRange(Yn+3,Li-5,R6);return Ht=sD,M6;function R6(){let cr=1,Fn,xn=Yn-(Za.lastIndexOf(` +`,Yn)+1)+4;function fi(Ka){Fn||(Fn=xn),El.push(Ka),xn+=Ka.length}for(vt();A2(5););A2(4)&&(cr=0,xn=0);e:for(;;){switch(M()){case 60:HM(El),Ig||(Ig=ee()),GM(cD(xn)),cr=0,Fn=void 0;break;case 4:El.push(t.getTokenText()),cr=0,xn=0;break;case 42:const Ka=t.getTokenText();cr===1?(cr=2,fi(Ka)):(E.assert(cr===0),cr=1,xn+=Ka.length);break;case 5:E.assert(cr!==2,"whitespace shouldn't come from the scanner while saving top-level comment text");const Xc=t.getTokenText();Fn!==void 0&&xn+Xc.length>Fn&&El.push(Xc.slice(Fn-xn)),xn+=Xc.length;break;case 1:break e;case 82:cr=2,fi(t.getTokenValue());break;case 19:cr=2;const ph=t.getTokenFullStart(),Vm=t.getTokenEnd()-1,Qc=ka(Vm);if(Qc){by||aD(El),_h.push(qt(p.createJSDocText(El.join("")),by??Yn,ph)),_h.push(Qc),El=[],by=t.getTokenEnd();break}default:cr=2,fi(t.getTokenText());break}cr===2?Lt(!1):vt()}const pi=El.join("").trimEnd();_h.length&&pi.length&&_h.push(qt(p.createJSDocText(pi),by??Yn,Ig)),_h.length&&Ia&&E.assertIsDefined(Ig,"having parsed tags implies that the end of the comment span should be set");const Ea=Ia&&rs(Ia,$f,Xp);return qt(p.createJSDocComment(_h.length?rs(_h,Yn,Ig):pi.length?pi:void 0,Ea),Yn,La)}function aD(cr){for(;cr.length&&(cr[0]===` +`||cr[0]==="\r");)cr.shift()}function HM(cr){for(;cr.length;){const Fn=cr[cr.length-1].trimEnd();if(Fn==="")cr.pop();else if(Fn.lengthXc&&(fi.push(h0.slice(Xc-cr)),Ka=2),cr+=h0.length;break;case 19:Ka=2;const PN=t.getTokenFullStart(),z6=t.getTokenEnd()-1,xS=ka(z6);xS?(pi.push(qt(p.createJSDocText(fi.join("")),Ea??xn,PN)),pi.push(xS),fi=[],Ea=t.getTokenEnd()):ph(t.getTokenText());break;case 62:Ka===3?Ka=2:Ka=3,ph(t.getTokenText());break;case 82:Ka!==3&&(Ka=2),ph(t.getTokenValue());break;case 42:if(Ka===0){Ka=1,cr+=1;break}default:Ka!==3&&(Ka=2),ph(t.getTokenText());break}Ka===2||Ka===3?Vm=Lt(Ka===3):Vm=vt()}aD(fi);const Qc=fi.join("").trimEnd();if(pi.length)return Qc.length&&pi.push(qt(p.createJSDocText(Qc),Ea??xn)),rs(pi,xn,t.getTokenEnd());if(Qc.length)return Qc}function ka(cr){const Fn=_i(Mc);if(!Fn)return;vt(),Pf();const xn=ee();let fi=wu(M())?Q(!0):void 0;if(fi)for(;M()===81;)On(),vt(),fi=qt(p.createJSDocMemberName(fi,vo()),xn);const pi=[];for(;M()!==20&&M()!==4&&M()!==1;)pi.push(t.getTokenText()),vt();const Ea=Fn==="link"?p.createJSDocLink:Fn==="linkcode"?p.createJSDocLinkCode:p.createJSDocLinkPlain;return qt(Ea(fi,pi.join("")),cr,t.getTokenEnd())}function Mc(){if(fh(),M()===19&&vt()===60&&wu(vt())){const cr=t.getTokenValue();if(Sy(cr))return cr}}function Sy(cr){return cr==="link"||cr==="linkcode"||cr==="linkplain"}function bS(cr,Fn,xn,fi){return qt(p.createJSDocUnknownTag(Fn,Xf(cr,ee(),xn,fi)),cr)}function GM(cr){cr&&(Ia?Ia.push(cr):(Ia=[cr],$f=cr.pos),Xp=cr.end)}function Um(){return fh(),M()===19?Ae():void 0}function jx(){const cr=A2(23);cr&&Pf();const Fn=A2(62),xn=uD();return Fn&&Us(62),cr&&(Pf(),Ws(64)&&Ol(),Cr(24)),{name:xn,isBracketed:cr}}function v(cr){switch(cr.kind){case 151:return!0;case 188:return v(cr.elementType);default:return mp(cr)&&Ie(cr.typeName)&&cr.typeName.escapedText==="Object"&&!cr.typeArguments}}function P(cr,Fn,xn,fi){let pi=Um(),Ea=!pi;fh();const{name:Ka,isBracketed:Xc}=jx(),ph=fh();Ea&&!wr(Mc)&&(pi=Um());const Vm=Xf(cr,ee(),fi,ph),Qc=R(pi,Ka,xn,fi);Qc&&(pi=Qc,Ea=!0);const h0=xn===1?p.createJSDocPropertyTag(Fn,Ka,Xc,pi,Ea,Vm):p.createJSDocParameterTag(Fn,Ka,Xc,pi,Ea,Vm);return qt(h0,cr)}function R(cr,Fn,xn,fi){if(cr&&v(cr.type)){const pi=ee();let Ea,Ka;for(;Ea=_i(()=>Br(xn,fi,Fn));)Ea.kind===348||Ea.kind===355?Ka=lr(Ka,Ea):Ea.kind===352&&j(Ea.tagName,d.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);if(Ka){const Xc=qt(p.createJSDocTypeLiteral(Ka,cr.type.kind===188),pi);return qt(p.createJSDocTypeExpression(Xc),pi)}}}function re(cr,Fn,xn,fi){ut(Ia,$F)&&U(Fn.pos,t.getTokenStart(),d._0_tag_already_specified,bi(Fn.escapedText));const pi=Um();return qt(p.createJSDocReturnTag(Fn,pi,Xf(cr,ee(),xn,fi)),cr)}function Le(cr,Fn,xn,fi){ut(Ia,qE)&&U(Fn.pos,t.getTokenStart(),d._0_tag_already_specified,bi(Fn.escapedText));const pi=Ae(!0),Ea=xn!==void 0&&fi!==void 0?Xf(cr,ee(),xn,fi):void 0;return qt(p.createJSDocTypeTag(Fn,pi,Ea),cr)}function Ot(cr,Fn,xn,fi){const Ea=M()===23||wr(()=>vt()===60&&wu(vt())&&Sy(t.getTokenValue()))?void 0:et(),Ka=xn!==void 0&&fi!==void 0?Xf(cr,ee(),xn,fi):void 0;return qt(p.createJSDocSeeTag(Fn,Ea,Ka),cr)}function en(cr,Fn,xn,fi){const pi=Um(),Ea=Xf(cr,ee(),xn,fi);return qt(p.createJSDocThrowsTag(Fn,pi,Ea),cr)}function Zi(cr,Fn,xn,fi){const pi=ee(),Ea=za();let Ka=t.getTokenFullStart();const Xc=Xf(cr,Ka,xn,fi);Xc||(Ka=t.getTokenFullStart());const ph=typeof Xc!="string"?rs(Xi([qt(Ea,pi,Ka)],Xc),pi):Ea.text+Xc;return qt(p.createJSDocAuthorTag(Fn,ph),cr)}function za(){const cr=[];let Fn=!1,xn=t.getToken();for(;xn!==1&&xn!==4;){if(xn===30)Fn=!0;else{if(xn===60&&!Fn)break;if(xn===32&&Fn){cr.push(t.getTokenText()),t.resetTokenState(t.getTokenEnd());break}}cr.push(t.getTokenText()),xn=vt()}return p.createJSDocText(cr.join(""))}function wf(cr,Fn,xn,fi){const pi=Y1();return qt(p.createJSDocImplementsTag(Fn,pi,Xf(cr,ee(),xn,fi)),cr)}function Ty(cr,Fn,xn,fi){const pi=Y1();return qt(p.createJSDocAugmentsTag(Fn,pi,Xf(cr,ee(),xn,fi)),cr)}function xy(cr,Fn,xn,fi){const pi=Ae(!1),Ea=xn!==void 0&&fi!==void 0?Xf(cr,ee(),xn,fi):void 0;return qt(p.createJSDocSatisfiesTag(Fn,pi,Ea),cr)}function Y1(){const cr=hs(19),Fn=ee(),xn=LQ();t.setInJSDocType(!0);const fi=yy();t.setInJSDocType(!1);const pi=p.createExpressionWithTypeArguments(xn,fi),Ea=qt(pi,Fn);return cr&&Cr(20),Ea}function LQ(){const cr=ee();let Fn=N2();for(;hs(25);){const xn=N2();Fn=qt(X(Fn,xn),cr)}return Fn}function SS(cr,Fn,xn,fi,pi){return qt(Fn(xn,Xf(cr,ee(),fi,pi)),cr)}function lD(cr,Fn,xn,fi){const pi=Ae(!0);return Pf(),qt(p.createJSDocThisTag(Fn,pi,Xf(cr,ee(),xn,fi)),cr)}function Dpe(cr,Fn,xn,fi){const pi=Ae(!0);return Pf(),qt(p.createJSDocEnumTag(Fn,pi,Xf(cr,ee(),xn,fi)),cr)}function MQ(cr,Fn,xn,fi){let pi=Um();fh();const Ea=$M();Pf();let Ka=j6(xn),Xc;if(!pi||v(pi.type)){let Vm,Qc,h0,PN=!1;for(;(Vm=_i(()=>TS(xn)))&&Vm.kind!==352;)if(PN=!0,Vm.kind===351)if(Qc){const z6=er(d.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);z6&&ua(z6,Zk(ke,be,0,0,d.The_tag_was_first_specified_here));break}else Qc=Vm;else h0=lr(h0,Vm);if(PN){const z6=pi&&pi.type.kind===188,xS=p.createJSDocTypeLiteral(h0,z6);pi=Qc&&Qc.typeExpression&&!v(Qc.typeExpression.type)?Qc.typeExpression:qt(xS,cr),Xc=pi.end}}Xc=Xc||Ka!==void 0?ee():(Ea??pi??Fn).end,Ka||(Ka=Xf(cr,Xc,xn,fi));const ph=p.createJSDocTypedefTag(Fn,pi,Ea,Ka);return qt(ph,cr,Xc)}function $M(cr){const Fn=t.getTokenStart();if(!wu(M()))return;const xn=N2();if(hs(25)){const fi=$M(!0),pi=p.createModuleDeclaration(void 0,xn,fi,cr?8:void 0);return qt(pi,Fn)}return cr&&(xn.flags|=4096),xn}function Ppe(cr){const Fn=ee();let xn,fi;for(;xn=_i(()=>Br(4,cr));){if(xn.kind===352){j(xn.tagName,d.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);break}fi=lr(fi,xn)}return rs(fi||[],Fn)}function RQ(cr,Fn){const xn=Ppe(Fn),fi=_i(()=>{if(A2(60)){const pi=cD(Fn);if(pi&&pi.kind===349)return pi}});return qt(p.createJSDocSignature(void 0,xn,fi),cr)}function B6(cr,Fn,xn,fi){const pi=$M();Pf();let Ea=j6(xn);const Ka=RQ(cr,xn);Ea||(Ea=Xf(cr,ee(),xn,fi));const Xc=Ea!==void 0?ee():Ka.end;return qt(p.createJSDocCallbackTag(Fn,Ka,pi,Ea),cr,Xc)}function jQ(cr,Fn,xn,fi){Pf();let pi=j6(xn);const Ea=RQ(cr,xn);pi||(pi=Xf(cr,ee(),xn,fi));const Ka=pi!==void 0?ee():Ea.end;return qt(p.createJSDocOverloadTag(Fn,Ea,pi),cr,Ka)}function wpe(cr,Fn){for(;!Ie(cr)||!Ie(Fn);)if(!Ie(cr)&&!Ie(Fn)&&cr.right.escapedText===Fn.right.escapedText)cr=cr.left,Fn=Fn.left;else return!1;return cr.escapedText===Fn.escapedText}function TS(cr){return Br(1,cr)}function Br(cr,Fn,xn){let fi=!0,pi=!1;for(;;)switch(vt()){case 60:if(fi){const Ea=ky(cr,Fn);return Ea&&(Ea.kind===348||Ea.kind===355)&&xn&&(Ie(Ea.name)||!wpe(xn,Ea.name.left))?!1:Ea}pi=!1;break;case 4:fi=!0,pi=!1;break;case 42:pi&&(fi=!1),pi=!0;break;case 80:fi=!1;break;case 1:return!1}}function ky(cr,Fn){E.assert(M()===60);const xn=t.getTokenFullStart();vt();const fi=N2(),pi=fh();let Ea;switch(fi.escapedText){case"type":return cr===1&&Le(xn,fi);case"prop":case"property":Ea=1;break;case"arg":case"argument":case"param":Ea=6;break;case"template":return Bx(xn,fi,Fn,pi);default:return!1}return cr&Ea?P(xn,fi,cr,Fn):!1}function Z1(){const cr=ee(),Fn=A2(23);Fn&&Pf();const xn=N2(d.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);let fi;if(Fn&&(Pf(),Cr(64),fi=Ds(16777216,fd),Cr(24)),!sc(xn))return qt(p.createTypeParameterDeclaration(void 0,xn,void 0,fi),cr)}function J6(){const cr=ee(),Fn=[];do{Pf();const xn=Z1();xn!==void 0&&Fn.push(xn),fh()}while(A2(28));return rs(Fn,cr)}function Bx(cr,Fn,xn,fi){const pi=M()===19?Ae():void 0,Ea=J6();return qt(p.createJSDocTemplateTag(Fn,pi,Ea,Xf(cr,ee(),xn,fi)),cr)}function A2(cr){return M()===cr?(vt(),!0):!1}function uD(){let cr=N2();for(hs(23)&&Cr(24);hs(25);){const Fn=N2();hs(23)&&Cr(24),cr=Ye(cr,Fn)}return cr}function N2(cr){if(!wu(M()))return No(80,!cr,cr||d.Identifier_expected);Bt++;const Fn=t.getTokenStart(),xn=t.getTokenEnd(),fi=M(),pi=$c(t.getTokenValue()),Ea=qt(w(pi,fi),Fn,xn);return vt(),Ea}}})(DN=e.JSDocParser||(e.JSDocParser={}))})(y1||(y1={})),(e=>{function t(T,C,w,D){if(D=D||E.shouldAssert(2),p(T,C,w,D),NK(w))return T;if(T.statements.length===0)return y1.parseSourceFile(T.fileName,C,T.languageVersion,void 0,!0,T.scriptKind,T.setExternalModuleIndicator,T.jsDocParsingMode);const O=T;E.assert(!O.hasBeenIncrementallyParsed),O.hasBeenIncrementallyParsed=!0,y1.fixupParentReferences(O);const z=T.text,W=y(T),X=f(T,w);p(T,C,X,D),E.assert(X.span.start<=w.span.start),E.assert(yc(X.span)===yc(w.span)),E.assert(yc(D4(X))===yc(D4(w)));const J=D4(X).length-X.span.length;u(O,X.span.start,yc(X.span),yc(D4(X)),J,z,C,D);const ie=y1.parseSourceFile(T.fileName,C,T.languageVersion,W,!0,T.scriptKind,T.setExternalModuleIndicator,T.jsDocParsingMode);return ie.commentDirectives=r(T.commentDirectives,ie.commentDirectives,X.span.start,yc(X.span),J,z,C,D),ie.impliedNodeFormat=T.impliedNodeFormat,ie}e.updateSourceFile=t;function r(T,C,w,D,O,z,W,X){if(!T)return C;let J,ie=!1;for(const Y of T){const{range:ae,type:_e}=Y;if(ae.endD){B();const $={range:{pos:ae.pos+O,end:ae.end+O},type:_e};J=lr(J,$),X&&E.assert(z.substring(ae.pos,ae.end)===W.substring($.range.pos,$.range.end))}}return B(),J;function B(){ie||(ie=!0,J?C&&J.push(...C):J=C)}}function i(T,C,w,D,O,z){C?X(T):W(T);return;function W(J){let ie="";if(z&&s(J)&&(ie=D.substring(J.pos,J.end)),J._children&&(J._children=void 0),km(J,J.pos+w,J.end+w),z&&s(J)&&E.assert(ie===O.substring(J.pos,J.end)),ds(J,W,X),q_(J))for(const B of J.jsDoc)W(B);c(J,z)}function X(J){J._children=void 0,km(J,J.pos+w,J.end+w);for(const ie of J)W(ie)}}function s(T){switch(T.kind){case 11:case 9:case 80:return!0}return!1}function o(T,C,w,D,O){E.assert(T.end>=C,"Adjusting an element that was entirely before the change range"),E.assert(T.pos<=w,"Adjusting an element that was entirely after the change range"),E.assert(T.pos<=T.end);const z=Math.min(T.pos,D),W=T.end>=w?T.end+O:Math.min(T.end,D);E.assert(z<=W),T.parent&&(E.assertGreaterThanOrEqual(z,T.parent.pos),E.assertLessThanOrEqual(W,T.parent.end)),km(T,z,W)}function c(T,C){if(C){let w=T.pos;const D=O=>{E.assert(O.pos>=w),w=O.end};if(q_(T))for(const O of T.jsDoc)D(O);ds(T,D),E.assert(w<=T.end)}}function u(T,C,w,D,O,z,W,X){J(T);return;function J(B){if(E.assert(B.pos<=B.end),B.pos>w){i(B,!1,O,z,W,X);return}const Y=B.end;if(Y>=C){if(B.intersectsChange=!0,B._children=void 0,o(B,C,w,D,O),ds(B,J,ie),q_(B))for(const ae of B.jsDoc)J(ae);c(B,X);return}E.assert(Yw){i(B,!0,O,z,W,X);return}const Y=B.end;if(Y>=C){B.intersectsChange=!0,B._children=void 0,o(B,C,w,D,O);for(const ae of B)J(ae);return}E.assert(Y0&&W<=1;W++){const X=g(T,D);E.assert(X.pos<=D);const J=X.pos;D=Math.max(0,J-1)}const O=zc(D,yc(C.span)),z=C.newLength+(C.span.start-D);return mP(O,z)}function g(T,C){let w=T,D;if(ds(T,z),D){const W=O(D);W.pos>w.pos&&(w=W)}return w;function O(W){for(;;){const X=Fz(W);if(X)W=X;else return W}}function z(W){if(!sc(W))if(W.pos<=C){if(W.pos>=w.pos&&(w=W),CC),!0}}function p(T,C,w,D){const O=T.text;if(w&&(E.assert(O.length-w.span.length+w.newLength===C.length),D||E.shouldAssert(3))){const z=O.substr(0,w.span.start),W=C.substr(0,w.span.start);E.assert(z===W);const X=O.substring(yc(w.span),O.length),J=C.substring(yc(D4(w)),C.length);E.assert(X===J)}}function y(T){let C=T.statements,w=0;E.assert(w=ie.pos&&W=ie.pos&&W{T[T.Value=-1]="Value"})(S||(S={}))})(pU||(pU={})),dU=new Map,M1e=/^\/\/\/\s*<(\S+)\s.*?\/>/im,R1e=/^\/\/\/?\s*@([^\s:]+)(.*)\s*$/im}});function sO(e){const t=new Map,r=new Map;return Zt(e,i=>{t.set(i.name.toLowerCase(),i),i.shortName&&r.set(i.shortName,i.name)}),{optionsNameMap:t,shortOptionNames:r}}function EC(){return Sve||(Sve=sO(mg))}function Une(e){return j1e(e,dc)}function j1e(e,t){const r=fs(e.type.keys()),i=(e.deprecatedKeys?r.filter(s=>!e.deprecatedKeys.has(s)):r).map(s=>`'${s}'`).join(", ");return t(d.Argument_for_0_option_must_be_Colon_1,`--${e.name}`,i)}function aO(e,t,r){return gve(e,(t??"").trim(),r)}function Vne(e,t="",r){if(t=t.trim(),Qi(t,"-"))return;if(e.type==="listOrElement"&&!t.includes(","))return UT(e,t,r);if(t==="")return[];const i=t.split(",");switch(e.element.type){case"number":return Ii(i,s=>UT(e.element,parseInt(s),r));case"string":return Ii(i,s=>UT(e.element,s||"",r));case"boolean":case"object":return E.fail(`List of ${e.element.type} is not yet supported.`);default:return Ii(i,s=>aO(e.element,s,r))}}function B1e(e){return e.name}function qne(e,t,r,i,s){var o;if((o=t.alternateMode)!=null&&o.getOptionsNameMap().optionsNameMap.has(e.toLowerCase()))return v1(s,i,t.alternateMode.diagnostic,e);const c=m4(e,t.optionDeclarations,B1e);return c?v1(s,i,t.unknownDidYouMeanDiagnostic,r||e,c.name):v1(s,i,t.unknownOptionDiagnostic,r||e)}function mU(e,t,r){const i={};let s;const o=[],c=[];return u(t),{options:i,watchOptions:s,fileNames:o,errors:c};function u(g){let p=0;for(;pBl.readFile(T)));if(!ns(p)){c.push(p);return}const y=[];let S=0;for(;;){for(;S=p.length)break;const T=S;if(p.charCodeAt(T)===34){for(S++;S32;)S++;y.push(p.substring(T,S))}}u(y)}}function J1e(e,t,r,i,s,o){if(i.isTSConfigOnly){const c=e[t];c==="null"?(s[i.name]=void 0,t++):i.type==="boolean"?c==="false"?(s[i.name]=UT(i,!1,o),t++):(c==="true"&&t++,o.push(dc(d.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,i.name))):(o.push(dc(d.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,i.name)),c&&!Qi(c,"-")&&t++)}else if(!e[t]&&i.type!=="boolean"&&o.push(dc(r.optionTypeMismatchDiagnostic,i.name,vU(i))),e[t]!=="null")switch(i.type){case"number":s[i.name]=UT(i,parseInt(e[t]),o),t++;break;case"boolean":const c=e[t];s[i.name]=UT(i,c!=="false",o),(c==="false"||c==="true")&&t++;break;case"string":s[i.name]=UT(i,e[t]||"",o),t++;break;case"list":const u=Vne(i,e[t],o);s[i.name]=u||[],u&&t++;break;case"listOrElement":E.fail("listOrElement not supported here");break;default:s[i.name]=aO(i,e[t],o),t++;break}else s[i.name]=void 0,t++;return t}function z1e(e,t){return mU(Nw,e,t)}function gU(e,t){return Hne(EC,e,t)}function Hne(e,t,r=!1){t=t.toLowerCase();const{optionsNameMap:i,shortOptionNames:s}=e();if(r){const o=s.get(t);o!==void 0&&(t=o)}return i.get(t)}function W1e(){return xve||(xve=sO(fO))}function U1e(e){const{options:t,watchOptions:r,fileNames:i,errors:s}=mU(Cve,e),o=t;return i.length===0&&i.push("."),o.clean&&o.force&&s.push(dc(d.Options_0_and_1_cannot_be_combined,"clean","force")),o.clean&&o.verbose&&s.push(dc(d.Options_0_and_1_cannot_be_combined,"clean","verbose")),o.clean&&o.watch&&s.push(dc(d.Options_0_and_1_cannot_be_combined,"clean","watch")),o.watch&&o.dry&&s.push(dc(d.Options_0_and_1_cannot_be_combined,"watch","dry")),{buildOptions:o,watchOptions:r,projects:i,errors:s}}function V1e(e,...t){return Ms(dc(e,...t).messageText,ns)}function Sw(e,t,r,i,s,o){const c=YE(e,g=>r.readFile(g));if(!ns(c)){r.onUnRecoverableConfigFileDiagnostic(c);return}const u=bw(e,c),f=r.getCurrentDirectory();return u.path=fo(e,f,tu(r.useCaseSensitiveFileNames)),u.resolvedPath=u.path,u.originalFileName=u.fileName,kw(u,r,is(qn(e),f),t,is(e,f),void 0,o,i,s)}function Tw(e,t){const r=YE(e,t);return ns(r)?hU(e,r):{config:{},error:r}}function hU(e,t){const r=bw(e,t);return{config:X1e(r,r.parseDiagnostics,void 0),error:r.parseDiagnostics.length?r.parseDiagnostics[0]:void 0}}function Gne(e,t){const r=YE(e,t);return ns(r)?bw(e,r):{fileName:e,parseDiagnostics:[r]}}function YE(e,t){let r;try{r=t(e)}catch(i){return dc(d.Cannot_read_file_0_Colon_1,e,i.message)}return r===void 0?dc(d.Cannot_read_file_0,e):r}function yU(e){return Ph(e,B1e)}function q1e(){return Eve||(Eve=sO(DC))}function H1e(){return Dve||(Dve=yU(mg))}function G1e(){return Pve||(Pve=yU(DC))}function $1e(){return wve||(wve=yU(Aw))}function SOe(){return oie===void 0&&(oie={name:void 0,type:"object",elementOptions:yU([iie,sie,aie,Iw,{name:"references",type:"list",element:{name:"references",type:"object"},category:d.Projects},{name:"files",type:"list",element:{name:"files",type:"string"},category:d.File_Management},{name:"include",type:"list",element:{name:"include",type:"string"},category:d.File_Management,defaultValueDescription:d.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk},{name:"exclude",type:"list",element:{name:"exclude",type:"string"},category:d.File_Management,defaultValueDescription:d.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified},Ew])}),oie}function X1e(e,t,r){var i;const s=(i=e.statements[0])==null?void 0:i.expression;if(s&&s.kind!==210){if(t.push(sp(e,s,d.The_root_value_of_a_0_file_must_be_an_object,Pc(e.fileName)==="jsconfig.json"?"jsconfig.json":"tsconfig.json")),Lu(s)){const o=kn(s.elements,ma);if(o)return xw(e,o,t,!0,r)}return{}}return xw(e,s,t,!0,r)}function $ne(e,t){var r;return xw(e,(r=e.statements[0])==null?void 0:r.expression,t,!0,void 0)}function xw(e,t,r,i,s){if(!t)return i?{}:void 0;return u(t,s?.rootOptions);function o(g,p){var y;const S=i?{}:void 0;for(const T of g.properties){if(T.kind!==303){r.push(sp(e,T,d.Property_assignment_expected));continue}T.questionToken&&r.push(sp(e,T.questionToken,d.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),f(T.name)||r.push(sp(e,T.name,d.String_literal_with_double_quotes_expected));const C=RP(T.name)?void 0:Dk(T.name),w=C&&bi(C),D=w?(y=p?.elementOptions)==null?void 0:y.get(w):void 0,O=u(T.initializer,D);typeof w<"u"&&(i&&(S[w]=O),s?.onPropertySet(w,O,T,p,D))}return S}function c(g,p){if(!i){g.forEach(y=>u(y,p));return}return wn(g.map(y=>u(y,p)),y=>y!==void 0)}function u(g,p){switch(g.kind){case 112:return!0;case 97:return!1;case 106:return null;case 11:return f(g)||r.push(sp(e,g,d.String_literal_with_double_quotes_expected)),g.text;case 9:return Number(g.text);case 224:if(g.operator!==41||g.operand.kind!==9)break;return-Number(g.operand.text);case 210:return o(g,p);case 209:return c(g.elements,p&&p.element)}p?r.push(sp(e,g,d.Compiler_option_0_requires_a_value_of_type_1,p.name,vU(p))):r.push(sp(e,g,d.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal))}function f(g){return ra(g)&&KI(g,e)}}function vU(e){return e.type==="listOrElement"?`${vU(e.element)} or Array`:e.type==="list"?"Array":ns(e.type)?e.type:"string"}function Q1e(e,t){if(e){if(Cw(t))return!e.disallowNullOrUndefined;if(e.type==="list")return es(t);if(e.type==="listOrElement")return es(t)||Q1e(e.element,t);const r=ns(e.type)?e.type:"string";return typeof t===r}return!1}function Y1e(e,t,r){var i,s,o;const c=tu(r.useCaseSensitiveFileNames),u=Yt(wn(e.fileNames,(s=(i=e.options.configFile)==null?void 0:i.configFileSpecs)!=null&&s.validatedIncludeSpecs?xOe(t,e.options.configFile.configFileSpecs.validatedIncludeSpecs,e.options.configFile.configFileSpecs.validatedExcludeSpecs,r):zg),y=>iP(is(t,r.getCurrentDirectory()),is(y,r.getCurrentDirectory()),c)),f=TU(e.options,{configFilePath:is(t,r.getCurrentDirectory()),useCaseSensitiveFileNames:r.useCaseSensitiveFileNames}),g=e.watchOptions&&kOe(e.watchOptions);return{compilerOptions:{...bU(f),showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0},watchOptions:g&&bU(g),references:Yt(e.projectReferences,y=>({...y,path:y.originalPath?y.originalPath:"",originalPath:void 0})),files:Ir(u)?u:void 0,...(o=e.options.configFile)!=null&&o.configFileSpecs?{include:TOe(e.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:e.options.configFile.configFileSpecs.validatedExcludeSpecs}:{},compileOnSave:e.compileOnSave?!0:void 0}}function bU(e){return{...fs(e.entries()).reduce((t,r)=>({...t,[r[0]]:r[1]}),{})}}function TOe(e){if(Ir(e)){if(Ir(e)!==1)return e;if(e[0]!==mO)return e}}function xOe(e,t,r,i){if(!t)return zg;const s=R5(e,r,t,i.useCaseSensitiveFileNames,i.getCurrentDirectory()),o=s.excludePattern&&G0(s.excludePattern,i.useCaseSensitiveFileNames),c=s.includeFilePattern&&G0(s.includeFilePattern,i.useCaseSensitiveFileNames);return c?o?u=>!(c.test(u)&&!o.test(u)):u=>!c.test(u):o?u=>o.test(u):zg}function Z1e(e){switch(e.type){case"string":case"number":case"boolean":case"object":return;case"list":case"listOrElement":return Z1e(e.element);default:return e.type}}function SU(e,t){return zl(t,(r,i)=>{if(r===e)return i})}function TU(e,t){return K1e(e,EC(),t)}function kOe(e){return K1e(e,q1e())}function K1e(e,{optionsNameMap:t},r){const i=new Map,s=r&&tu(r.useCaseSensitiveFileNames);for(const o in e)if(Ya(e,o)){if(t.has(o)&&(t.get(o).category===d.Command_line_Options||t.get(o).category===d.Output_Formatting))continue;const c=e[o],u=t.get(o.toLowerCase());if(u){E.assert(u.type!=="listOrElement");const f=Z1e(u);f?u.type==="list"?i.set(o,c.map(g=>SU(g,f))):i.set(o,SU(c,f)):r&&u.isFilePath?i.set(o,iP(r.configFilePath,is(c,qn(r.configFilePath)),s)):i.set(o,c)}}return i}function eve(e,t){const r=tve(e);return s();function i(o){return Array(o+1).join(" ")}function s(){const o=[],c=i(2);return DU.forEach(u=>{if(!r.has(u.name))return;const f=r.get(u.name),g=eie(u);f!==g?o.push(`${c}${u.name}: ${f}`):Ya(pO,u.name)&&o.push(`${c}${u.name}: ${g}`)}),o.join(t)+t}}function tve(e){const t=k7(e,pO);return TU(t)}function rve(e,t,r){const i=tve(e);return c();function s(u){return Array(u+1).join(" ")}function o({category:u,name:f,isCommandLineOnly:g}){const p=[d.Command_line_Options,d.Editor_Support,d.Compiler_Diagnostics,d.Backwards_Compatibility,d.Watch_and_Build_Modes,d.Output_Formatting];return!g&&u!==void 0&&(!p.includes(u)||i.has(f))}function c(){const u=new Map;u.set(d.Projects,[]),u.set(d.Language_and_Environment,[]),u.set(d.Modules,[]),u.set(d.JavaScript_Support,[]),u.set(d.Emit,[]),u.set(d.Interop_Constraints,[]),u.set(d.Type_Checking,[]),u.set(d.Completeness,[]);for(const T of mg)if(o(T)){let C=u.get(T.category);C||u.set(T.category,C=[]),C.push(T)}let f=0,g=0;const p=[];u.forEach((T,C)=>{p.length!==0&&p.push({value:""}),p.push({value:`/* ${ls(C)} */`});for(const w of T){let D;i.has(w.name)?D=`"${w.name}": ${JSON.stringify(i.get(w.name))}${(g+=1)===i.size?"":","}`:D=`// "${w.name}": ${JSON.stringify(eie(w))},`,p.push({value:D,description:`/* ${w.description&&ls(w.description)||w.name} */`}),f=Math.max(D.length,f)}});const y=s(2),S=[];S.push("{"),S.push(`${y}"compilerOptions": {`),S.push(`${y}${y}/* ${ls(d.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`),S.push("");for(const T of p){const{value:C,description:w=""}=T;S.push(C&&`${y}${y}${C}${w&&s(f-C.length+2)+w}`)}if(t.length){S.push(`${y}},`),S.push(`${y}"files": [`);for(let T=0;Ttypeof se=="object","object"),ae=X(J("files"));if(ae){const se=Y==="no-prop"||es(Y)&&Y.length===0,Z=Ya(S,"extends");if(ae.length===0&&se&&!Z)if(t){const ve=c||"tsconfig.json",Te=d.The_files_list_in_config_file_0_is_empty,Me=WP(t,"files",he=>he.initializer),ke=v1(t,Me,Te,ve);p.push(ke)}else B(d.The_files_list_in_config_file_0_is_empty,c||"tsconfig.json")}let _e=X(J("include"));const $=J("exclude");let H=!1,K=X($);if($==="no-prop"&&S.compilerOptions){const se=S.compilerOptions.outDir,Z=S.compilerOptions.declarationDir;(se||Z)&&(K=[se,Z].filter(ve=>!!ve))}ae===void 0&&_e===void 0&&(_e=[mO],H=!0);let oe,Se;return _e&&(oe=bve(_e,p,!0,t,"include")),K&&(Se=bve(K,p,!1,t,"exclude")),{filesSpecs:ae,includeSpecs:_e,excludeSpecs:K,validatedFilesSpec:wn(ae,ns),validatedIncludeSpecs:oe,validatedExcludeSpecs:Se,pathPatterns:void 0,isDefaultIncludeSpec:H}}function z(Y){const ae=KE(w,Y,T,r,f);return ove(ae,ZE(S),u)&&p.push(ave(w,c)),ae}function W(Y){let ae;const _e=ie("references",$=>typeof $=="object","object");if(es(_e))for(const $ of _e)typeof $.path!="string"?B(d.Compiler_option_0_requires_a_value_of_type_1,"reference.path","string"):(ae||(ae=[])).push({path:is($.path,Y),originalPath:$.path,prepend:$.prepend,circular:$.circular});return ae}function X(Y){return es(Y)?Y:void 0}function J(Y){return ie(Y,ns,"string")}function ie(Y,ae,_e){if(Ya(S,Y)&&!Cw(S[Y]))if(es(S[Y])){const $=S[Y];return!t&&!qi($,ae)&&p.push(dc(d.Compiler_option_0_requires_a_value_of_type_1,Y,_e)),$}else return B(d.Compiler_option_0_requires_a_value_of_type_1,Y,"Array"),"not-array";return"no-prop"}function B(Y,...ae){t||p.push(dc(Y,...ae))}}function EOe(e){return e.code===d.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code}function ave({includeSpecs:e,excludeSpecs:t},r){return dc(d.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,r||"tsconfig.json",JSON.stringify(e||[]),JSON.stringify(t||[]))}function ove(e,t,r){return e.length===0&&t&&(!r||r.length===0)}function ZE(e){return!Ya(e,"files")&&!Ya(e,"references")}function oO(e,t,r,i,s){const o=i.length;return ove(e,s)?i.push(ave(r,t)):lj(i,c=>!EOe(c)),o!==i.length}function DOe(e){return!!e.options}function cve(e,t,r,i,s,o,c,u){var f;i=du(i);const g=is(s||"",i);if(o.includes(g))return c.push(dc(d.Circularity_detected_while_resolving_configuration_Colon_0,[...o,g].join(" -> "))),{raw:e||$ne(t,c)};const p=e?POe(e,r,i,s,c):wOe(t,r,i,s,c);if((f=p.options)!=null&&f.paths&&(p.options.pathsBasePath=i),p.extendedConfigPath){o=o.concat([g]);const S={options:{}};ns(p.extendedConfigPath)?y(S,p.extendedConfigPath):p.extendedConfigPath.forEach(T=>y(S,T)),!p.raw.include&&S.include&&(p.raw.include=S.include),!p.raw.exclude&&S.exclude&&(p.raw.exclude=S.exclude),!p.raw.files&&S.files&&(p.raw.files=S.files),p.raw.compileOnSave===void 0&&S.compileOnSave&&(p.raw.compileOnSave=S.compileOnSave),t&&S.extendedSourceFiles&&(t.extendedSourceFiles=fs(S.extendedSourceFiles.keys())),p.options=f4(S.options,p.options),p.watchOptions=p.watchOptions&&S.watchOptions?f4(S.watchOptions,p.watchOptions):p.watchOptions||S.watchOptions}return p;function y(S,T){const C=AOe(t,T,r,o,c,u,S);if(C&&DOe(C)){const w=C.raw;let D;const O=z=>{w[z]&&(S[z]=Yt(w[z],W=>C_(W)?W:Hn(D||(D=T4(qn(T),i,tu(r.useCaseSensitiveFileNames))),W)))};O("include"),O("exclude"),O("files"),w.compileOnSave!==void 0&&(S.compileOnSave=w.compileOnSave),f4(S.options,C.options),S.watchOptions=S.watchOptions&&C.watchOptions?f4({},S.watchOptions,C.watchOptions):S.watchOptions||C.watchOptions}}}function POe(e,t,r,i,s){Ya(e,"excludes")&&s.push(dc(d.Unknown_option_excludes_Did_you_mean_exclude));const o=dve(e.compilerOptions,r,s,i),c=mve(e.typeAcquisition,r,s,i),u=IOe(e.watchOptions,r,s);e.compileOnSave=NOe(e,r,s);const f=e.extends||e.extends===""?lve(e.extends,t,r,i,s):void 0;return{raw:e,options:o,watchOptions:u,typeAcquisition:c,extendedConfigPath:f}}function lve(e,t,r,i,s,o,c,u){let f;const g=i?ive(i,r):r;if(ns(e))f=uve(e,t,g,s,c,u);else if(es(e)){f=[];for(let p=0;pz.name===T)&&(g=lr(g,w.name))))}}function uve(e,t,r,i,s,o){if(e=du(e),C_(e)||Qi(e,"./")||Qi(e,"../")){let u=is(e,r);if(!t.fileExists(u)&&!fc(u,".json")&&(u=`${u}.json`,!t.fileExists(u))){i.push(v1(o,s,d.File_0_not_found,e));return}return u}const c=gie(e,Hn(r,"tsconfig.json"),t);if(c.resolvedModule)return c.resolvedModule.resolvedFileName;e===""?i.push(v1(o,s,d.Compiler_option_0_cannot_be_given_an_empty_string,"extends")):i.push(v1(o,s,d.File_0_not_found,e))}function AOe(e,t,r,i,s,o,c){const u=r.useCaseSensitiveFileNames?t:xd(t);let f,g,p;if(o&&(f=o.get(u))?{extendedResult:g,extendedConfig:p}=f:(g=Gne(t,y=>r.readFile(y)),g.parseDiagnostics.length||(p=cve(void 0,g,r,qn(t),Pc(t),i,s,o)),o&&o.set(u,{extendedResult:g,extendedConfig:p})),e&&((c.extendedSourceFiles??(c.extendedSourceFiles=new Set)).add(g.fileName),g.extendedSourceFiles))for(const y of g.extendedSourceFiles)c.extendedSourceFiles.add(y);if(g.parseDiagnostics.length){s.push(...g.parseDiagnostics);return}return p}function NOe(e,t,r){if(!Ya(e,Ew.name))return!1;const i=Mb(Ew,e.compileOnSave,t,r);return typeof i=="boolean"&&i}function _ve(e,t,r){const i=[];return{options:dve(e,t,i,r),errors:i}}function fve(e,t,r){const i=[];return{options:mve(e,t,i,r),errors:i}}function pve(e){return e&&Pc(e)==="jsconfig.json"?{allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0}:{}}function dve(e,t,r,i){const s=pve(i);return Xne(H1e(),e,t,s,Nw,r),i&&(s.configFilePath=du(i)),s}function CU(e){return{enable:!!e&&Pc(e)==="jsconfig.json",include:[],exclude:[]}}function mve(e,t,r,i){const s=CU(i);return Xne($1e(),e,t,s,nie,r),s}function IOe(e,t,r){return Xne(G1e(),e,t,void 0,dO,r)}function Xne(e,t,r,i,s,o){if(t){for(const c in t){const u=e.get(c);u?(i||(i={}))[u.name]=Mb(u,t[c],r,o):o.push(qne(c,s))}return i}}function v1(e,t,r,...i){return e&&t?sp(e,t,r,...i):dc(r,...i)}function Mb(e,t,r,i,s,o,c){if(e.isCommandLineOnly){i.push(v1(c,s?.name,d.Option_0_can_only_be_specified_on_command_line,e.name));return}if(Q1e(e,t)){const u=e.type;if(u==="list"&&es(t))return hve(e,t,r,i,s,o,c);if(u==="listOrElement")return es(t)?hve(e,t,r,i,s,o,c):Mb(e.element,t,r,i,s,o,c);if(!ns(e.type))return gve(e,t,i,o,c);const f=UT(e,t,i,o,c);return Cw(f)?f:FOe(e,r,f)}else i.push(v1(c,o,d.Compiler_option_0_requires_a_value_of_type_1,e.name,vU(e)))}function FOe(e,t,r){return e.isFilePath&&(r=is(r,t),r===""&&(r=".")),r}function UT(e,t,r,i,s){var o;if(Cw(t))return;const c=(o=e.extraValidation)==null?void 0:o.call(e,t);if(!c)return t;r.push(v1(s,i,...c))}function gve(e,t,r,i,s){if(Cw(t))return;const o=t.toLowerCase(),c=e.type.get(o);if(c!==void 0)return UT(e,c,r,i,s);r.push(j1e(e,(u,...f)=>v1(s,i,u,...f)))}function hve(e,t,r,i,s,o,c){return wn(Yt(t,(u,f)=>Mb(e.element,u,r,i,s,o?.elements[f],c)),u=>e.listPreserveFalsyValues?!0:!!u)}function KE(e,t,r,i,s=ze){t=qs(t);const o=tu(i.useCaseSensitiveFileNames),c=new Map,u=new Map,f=new Map,{validatedFilesSpec:g,validatedIncludeSpecs:p,validatedExcludeSpecs:y}=e,S=hE(r,s),T=N8(r,S);if(g)for(const O of g){const z=is(O,t);c.set(o(z),z)}let C;if(p&&p.length>0)for(const O of i.readDirectory(t,Np(T),y,p,void 0)){if(Ho(O,".json")){if(!C){const X=p.filter(ie=>fc(ie,".json")),J=Yt(M5(X,t,"files"),ie=>`^${ie}$`);C=J?J.map(ie=>G0(ie,i.useCaseSensitiveFileNames)):ze}if(Dc(C,X=>X.test(O))!==-1){const X=o(O);!c.has(X)&&!f.has(X)&&f.set(X,O)}continue}if(MOe(O,c,u,S,o))continue;ROe(O,u,S,o);const z=o(O);!c.has(z)&&!u.has(z)&&u.set(z,O)}const w=fs(c.values()),D=fs(u.values());return w.concat(D,fs(f.values()))}function Qne(e,t,r,i,s){const{validatedFilesSpec:o,validatedIncludeSpecs:c,validatedExcludeSpecs:u}=t;if(!Ir(c)||!Ir(u))return!1;r=qs(r);const f=tu(i);if(o){for(const g of o)if(f(is(g,r))===e)return!1}return vve(e,u,i,s,r)}function yve(e){const t=Qi(e,"**/")?0:e.indexOf("/**/");return t===-1?!1:(fc(e,"/..")?e.length:e.lastIndexOf("/../"))>t}function cO(e,t,r,i){return vve(e,wn(t,s=>!yve(s)),r,i)}function vve(e,t,r,i,s){const o=gE(t,Hn(qs(i),s),"exclude"),c=o&&G0(o,r);return c?c.test(e)?!0:!ZS(e)&&c.test(Sl(e)):!1}function bve(e,t,r,i,s){return e.filter(c=>{if(!ns(c))return!1;const u=Yne(c,r);return u!==void 0&&t.push(o(...u)),u===void 0});function o(c,u){const f=zI(i,s,u);return v1(i,f,c,u)}}function Yne(e,t){if(E.assert(typeof e=="string"),t&&Ave.test(e))return[d.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,e];if(yve(e))return[d.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,e]}function OOe({validatedIncludeSpecs:e,validatedExcludeSpecs:t},r,i){const s=gE(t,r,"exclude"),o=s&&new RegExp(s,i?"":"i"),c={};if(e!==void 0){const u=[];for(const f of e){const g=qs(Hn(r,f));if(o&&o.test(g))continue;const p=LOe(g,i);if(p){const{key:y,flags:S}=p,T=c[y];(T===void 0||TJc(e,c)?c:void 0);if(!o)return!1;for(const c of o){if(Ho(e,c)&&(c!==".ts"||!Ho(e,".d.ts")))return!1;const u=s(a1(e,c));if(t.has(u)||r.has(u)){if(c===".d.ts"&&(Ho(e,".js")||Ho(e,".jsx")))continue;return!0}}return!1}function ROe(e,t,r,i){const s=Zt(r,o=>Jc(e,o)?o:void 0);if(s)for(let o=s.length-1;o>=0;o--){const c=s[o];if(Ho(e,c))return;const u=i(a1(e,c));t.delete(u)}}function Zne(e){const t={};for(const r in e)if(Ya(e,r)){const i=gU(r);i!==void 0&&(t[r]=Kne(e[r],i))}return t}function Kne(e,t){if(e===void 0)return e;switch(t.type){case"object":return"";case"string":return"";case"number":return typeof e=="number"?e:"";case"boolean":return typeof e=="boolean"?e:"";case"listOrElement":if(!es(e))return Kne(e,t.element);case"list":const r=t.element;return es(e)?Ii(e,i=>Kne(i,r)):"";default:return zl(t.type,(i,s)=>{if(i===e)return s})}}function eie(e){switch(e.type){case"number":return 1;case"boolean":return!0;case"string":const t=e.defaultValueDescription;return e.isFilePath?`./${t&&typeof t=="string"?t:""}`:"";case"list":return[];case"listOrElement":return eie(e.element);case"object":return{};default:const r=T7(e.type.keys());return r!==void 0?r:E.fail("Expected 'option.type' to have entries.")}}var Ew,tie,e3,rie,Dw,lO,DC,Pw,ww,EU,DU,mg,PU,wU,AU,uO,_O,NU,IU,FU,fO,Aw,Sve,Tve,pO,Nw,xve,kve,Cve,nie,Eve,dO,Dve,Pve,wve,Iw,iie,sie,aie,oie,mO,Ave,Nve,jOe=Nt({"src/compiler/commandLineParser.ts"(){"use strict";Ns(),Ew={name:"compileOnSave",type:"boolean",defaultValueDescription:!1},tie=new Map(Object.entries({preserve:1,"react-native":3,react:2,"react-jsx":4,"react-jsxdev":5})),e3=new Map(c4(tie.entries(),([e,t])=>[""+t,e])),rie=[["es5","lib.es5.d.ts"],["es6","lib.es2015.d.ts"],["es2015","lib.es2015.d.ts"],["es7","lib.es2016.d.ts"],["es2016","lib.es2016.d.ts"],["es2017","lib.es2017.d.ts"],["es2018","lib.es2018.d.ts"],["es2019","lib.es2019.d.ts"],["es2020","lib.es2020.d.ts"],["es2021","lib.es2021.d.ts"],["es2022","lib.es2022.d.ts"],["es2023","lib.es2023.d.ts"],["esnext","lib.esnext.d.ts"],["dom","lib.dom.d.ts"],["dom.iterable","lib.dom.iterable.d.ts"],["webworker","lib.webworker.d.ts"],["webworker.importscripts","lib.webworker.importscripts.d.ts"],["webworker.iterable","lib.webworker.iterable.d.ts"],["scripthost","lib.scripthost.d.ts"],["es2015.core","lib.es2015.core.d.ts"],["es2015.collection","lib.es2015.collection.d.ts"],["es2015.generator","lib.es2015.generator.d.ts"],["es2015.iterable","lib.es2015.iterable.d.ts"],["es2015.promise","lib.es2015.promise.d.ts"],["es2015.proxy","lib.es2015.proxy.d.ts"],["es2015.reflect","lib.es2015.reflect.d.ts"],["es2015.symbol","lib.es2015.symbol.d.ts"],["es2015.symbol.wellknown","lib.es2015.symbol.wellknown.d.ts"],["es2016.array.include","lib.es2016.array.include.d.ts"],["es2017.date","lib.es2017.date.d.ts"],["es2017.object","lib.es2017.object.d.ts"],["es2017.sharedmemory","lib.es2017.sharedmemory.d.ts"],["es2017.string","lib.es2017.string.d.ts"],["es2017.intl","lib.es2017.intl.d.ts"],["es2017.typedarrays","lib.es2017.typedarrays.d.ts"],["es2018.asyncgenerator","lib.es2018.asyncgenerator.d.ts"],["es2018.asynciterable","lib.es2018.asynciterable.d.ts"],["es2018.intl","lib.es2018.intl.d.ts"],["es2018.promise","lib.es2018.promise.d.ts"],["es2018.regexp","lib.es2018.regexp.d.ts"],["es2019.array","lib.es2019.array.d.ts"],["es2019.object","lib.es2019.object.d.ts"],["es2019.string","lib.es2019.string.d.ts"],["es2019.symbol","lib.es2019.symbol.d.ts"],["es2019.intl","lib.es2019.intl.d.ts"],["es2020.bigint","lib.es2020.bigint.d.ts"],["es2020.date","lib.es2020.date.d.ts"],["es2020.promise","lib.es2020.promise.d.ts"],["es2020.sharedmemory","lib.es2020.sharedmemory.d.ts"],["es2020.string","lib.es2020.string.d.ts"],["es2020.symbol.wellknown","lib.es2020.symbol.wellknown.d.ts"],["es2020.intl","lib.es2020.intl.d.ts"],["es2020.number","lib.es2020.number.d.ts"],["es2021.promise","lib.es2021.promise.d.ts"],["es2021.string","lib.es2021.string.d.ts"],["es2021.weakref","lib.es2021.weakref.d.ts"],["es2021.intl","lib.es2021.intl.d.ts"],["es2022.array","lib.es2022.array.d.ts"],["es2022.error","lib.es2022.error.d.ts"],["es2022.intl","lib.es2022.intl.d.ts"],["es2022.object","lib.es2022.object.d.ts"],["es2022.sharedmemory","lib.es2022.sharedmemory.d.ts"],["es2022.string","lib.es2022.string.d.ts"],["es2022.regexp","lib.es2022.regexp.d.ts"],["es2023.array","lib.es2023.array.d.ts"],["es2023.collection","lib.es2023.collection.d.ts"],["esnext.array","lib.es2023.array.d.ts"],["esnext.collection","lib.es2023.collection.d.ts"],["esnext.symbol","lib.es2019.symbol.d.ts"],["esnext.asynciterable","lib.es2018.asynciterable.d.ts"],["esnext.intl","lib.esnext.intl.d.ts"],["esnext.disposable","lib.esnext.disposable.d.ts"],["esnext.bigint","lib.es2020.bigint.d.ts"],["esnext.string","lib.es2022.string.d.ts"],["esnext.promise","lib.es2021.promise.d.ts"],["esnext.weakref","lib.es2021.weakref.d.ts"],["esnext.decorators","lib.esnext.decorators.d.ts"],["decorators","lib.decorators.d.ts"],["decorators.legacy","lib.decorators.legacy.d.ts"]],Dw=rie.map(e=>e[0]),lO=new Map(rie),DC=[{name:"watchFile",type:new Map(Object.entries({fixedpollinginterval:0,prioritypollinginterval:1,dynamicprioritypolling:2,fixedchunksizepolling:3,usefsevents:4,usefseventsonparentdirectory:5})),category:d.Watch_and_Build_Modes,description:d.Specify_how_the_TypeScript_watch_mode_works,defaultValueDescription:4},{name:"watchDirectory",type:new Map(Object.entries({usefsevents:0,fixedpollinginterval:1,dynamicprioritypolling:2,fixedchunksizepolling:3})),category:d.Watch_and_Build_Modes,description:d.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,defaultValueDescription:0},{name:"fallbackPolling",type:new Map(Object.entries({fixedinterval:0,priorityinterval:1,dynamicpriority:2,fixedchunksize:3})),category:d.Watch_and_Build_Modes,description:d.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,defaultValueDescription:1},{name:"synchronousWatchDirectory",type:"boolean",category:d.Watch_and_Build_Modes,description:d.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,defaultValueDescription:!1},{name:"excludeDirectories",type:"list",element:{name:"excludeDirectory",type:"string",isFilePath:!0,extraValidation:Yne},category:d.Watch_and_Build_Modes,description:d.Remove_a_list_of_directories_from_the_watch_process},{name:"excludeFiles",type:"list",element:{name:"excludeFile",type:"string",isFilePath:!0,extraValidation:Yne},category:d.Watch_and_Build_Modes,description:d.Remove_a_list_of_files_from_the_watch_mode_s_processing}],Pw=[{name:"help",shortName:"h",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:d.Command_line_Options,description:d.Print_this_message,defaultValueDescription:!1},{name:"help",shortName:"?",type:"boolean",isCommandLineOnly:!0,category:d.Command_line_Options,defaultValueDescription:!1},{name:"watch",shortName:"w",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:d.Command_line_Options,description:d.Watch_input_files,defaultValueDescription:!1},{name:"preserveWatchOutput",type:"boolean",showInSimplifiedHelpView:!1,category:d.Output_Formatting,description:d.Disable_wiping_the_console_in_watch_mode,defaultValueDescription:!1},{name:"listFiles",type:"boolean",category:d.Compiler_Diagnostics,description:d.Print_all_of_the_files_read_during_the_compilation,defaultValueDescription:!1},{name:"explainFiles",type:"boolean",category:d.Compiler_Diagnostics,description:d.Print_files_read_during_the_compilation_including_why_it_was_included,defaultValueDescription:!1},{name:"listEmittedFiles",type:"boolean",category:d.Compiler_Diagnostics,description:d.Print_the_names_of_emitted_files_after_a_compilation,defaultValueDescription:!1},{name:"pretty",type:"boolean",showInSimplifiedHelpView:!0,category:d.Output_Formatting,description:d.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,defaultValueDescription:!0},{name:"traceResolution",type:"boolean",category:d.Compiler_Diagnostics,description:d.Log_paths_used_during_the_moduleResolution_process,defaultValueDescription:!1},{name:"diagnostics",type:"boolean",category:d.Compiler_Diagnostics,description:d.Output_compiler_performance_information_after_building,defaultValueDescription:!1},{name:"extendedDiagnostics",type:"boolean",category:d.Compiler_Diagnostics,description:d.Output_more_detailed_compiler_performance_information_after_building,defaultValueDescription:!1},{name:"generateCpuProfile",type:"string",isFilePath:!0,paramType:d.FILE_OR_DIRECTORY,category:d.Compiler_Diagnostics,description:d.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,defaultValueDescription:"profile.cpuprofile"},{name:"generateTrace",type:"string",isFilePath:!0,isCommandLineOnly:!0,paramType:d.DIRECTORY,category:d.Compiler_Diagnostics,description:d.Generates_an_event_trace_and_a_list_of_types},{name:"incremental",shortName:"i",type:"boolean",category:d.Projects,description:d.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,transpileOptionValue:void 0,defaultValueDescription:d.false_unless_composite_is_set},{name:"declaration",shortName:"d",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.Emit,transpileOptionValue:void 0,description:d.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,defaultValueDescription:d.false_unless_composite_is_set},{name:"declarationMap",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.Emit,transpileOptionValue:void 0,defaultValueDescription:!1,description:d.Create_sourcemaps_for_d_ts_files},{name:"emitDeclarationOnly",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.Emit,description:d.Only_output_d_ts_files_and_not_JavaScript_files,transpileOptionValue:void 0,defaultValueDescription:!1},{name:"sourceMap",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.Emit,defaultValueDescription:!1,description:d.Create_source_map_files_for_emitted_JavaScript_files},{name:"inlineSourceMap",type:"boolean",affectsBuildInfo:!0,category:d.Emit,description:d.Include_sourcemap_files_inside_the_emitted_JavaScript,defaultValueDescription:!1},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,category:d.Watch_and_Build_Modes,description:d.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,defaultValueDescription:!1},{name:"locale",type:"string",category:d.Command_line_Options,isCommandLineOnly:!0,description:d.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,defaultValueDescription:d.Platform_specific}],ww={name:"target",shortName:"t",type:new Map(Object.entries({es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,es2022:9,esnext:99})),affectsSourceFile:!0,affectsModuleResolution:!0,affectsEmit:!0,affectsBuildInfo:!0,paramType:d.VERSION,showInSimplifiedHelpView:!0,category:d.Language_and_Environment,description:d.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,defaultValueDescription:1},EU={name:"module",shortName:"m",type:new Map(Object.entries({none:0,commonjs:1,amd:2,system:4,umd:3,es6:5,es2015:5,es2020:6,es2022:7,esnext:99,node16:100,nodenext:199})),affectsSourceFile:!0,affectsModuleResolution:!0,affectsEmit:!0,affectsBuildInfo:!0,paramType:d.KIND,showInSimplifiedHelpView:!0,category:d.Modules,description:d.Specify_what_module_code_is_generated,defaultValueDescription:void 0},DU=[{name:"all",type:"boolean",showInSimplifiedHelpView:!0,category:d.Command_line_Options,description:d.Show_all_compiler_options,defaultValueDescription:!1},{name:"version",shortName:"v",type:"boolean",showInSimplifiedHelpView:!0,category:d.Command_line_Options,description:d.Print_the_compiler_s_version,defaultValueDescription:!1},{name:"init",type:"boolean",showInSimplifiedHelpView:!0,category:d.Command_line_Options,description:d.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,defaultValueDescription:!1},{name:"project",shortName:"p",type:"string",isFilePath:!0,showInSimplifiedHelpView:!0,category:d.Command_line_Options,paramType:d.FILE_OR_DIRECTORY,description:d.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json},{name:"build",type:"boolean",shortName:"b",showInSimplifiedHelpView:!0,category:d.Command_line_Options,description:d.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,defaultValueDescription:!1},{name:"showConfig",type:"boolean",showInSimplifiedHelpView:!0,category:d.Command_line_Options,isCommandLineOnly:!0,description:d.Print_the_final_configuration_instead_of_building,defaultValueDescription:!1},{name:"listFilesOnly",type:"boolean",category:d.Command_line_Options,isCommandLineOnly:!0,description:d.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,defaultValueDescription:!1},ww,EU,{name:"lib",type:"list",element:{name:"lib",type:lO,defaultValueDescription:void 0},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:d.Language_and_Environment,description:d.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,transpileOptionValue:void 0},{name:"allowJs",type:"boolean",allowJsFlag:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.JavaScript_Support,description:d.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,defaultValueDescription:!1},{name:"checkJs",type:"boolean",affectsModuleResolution:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.JavaScript_Support,description:d.Enable_error_reporting_in_type_checked_JavaScript_files,defaultValueDescription:!1},{name:"jsx",type:tie,affectsSourceFile:!0,affectsEmit:!0,affectsBuildInfo:!0,affectsModuleResolution:!0,affectsSemanticDiagnostics:!0,paramType:d.KIND,showInSimplifiedHelpView:!0,category:d.Language_and_Environment,description:d.Specify_what_JSX_code_is_generated,defaultValueDescription:void 0},{name:"outFile",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:d.FILE,showInSimplifiedHelpView:!0,category:d.Emit,description:d.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,transpileOptionValue:void 0},{name:"outDir",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:d.DIRECTORY,showInSimplifiedHelpView:!0,category:d.Emit,description:d.Specify_an_output_folder_for_all_emitted_files},{name:"rootDir",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:d.LOCATION,category:d.Modules,description:d.Specify_the_root_folder_within_your_source_files,defaultValueDescription:d.Computed_from_the_list_of_input_files},{name:"composite",type:"boolean",affectsBuildInfo:!0,isTSConfigOnly:!0,category:d.Projects,transpileOptionValue:void 0,defaultValueDescription:!1,description:d.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references},{name:"tsBuildInfoFile",type:"string",affectsEmit:!0,affectsBuildInfo:!0,isFilePath:!0,paramType:d.FILE,category:d.Projects,transpileOptionValue:void 0,defaultValueDescription:".tsbuildinfo",description:d.Specify_the_path_to_tsbuildinfo_incremental_compilation_file},{name:"removeComments",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.Emit,defaultValueDescription:!1,description:d.Disable_emitting_comments},{name:"noEmit",type:"boolean",showInSimplifiedHelpView:!0,category:d.Emit,description:d.Disable_emitting_files_from_a_compilation,transpileOptionValue:void 0,defaultValueDescription:!1},{name:"importHelpers",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,defaultValueDescription:!1},{name:"importsNotUsedAsValues",type:new Map(Object.entries({remove:0,preserve:1,error:2})),affectsEmit:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,defaultValueDescription:0},{name:"downlevelIteration",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,defaultValueDescription:!1},{name:"isolatedModules",type:"boolean",category:d.Interop_Constraints,description:d.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,transpileOptionValue:!0,defaultValueDescription:!1},{name:"verbatimModuleSyntax",type:"boolean",category:d.Interop_Constraints,description:d.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting,defaultValueDescription:!1},{name:"strict",type:"boolean",affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.Type_Checking,description:d.Enable_all_strict_type_checking_options,defaultValueDescription:!1},{name:"noImplicitAny",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,defaultValueDescription:d.false_unless_strict_is_set},{name:"strictNullChecks",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.When_type_checking_take_into_account_null_and_undefined,defaultValueDescription:d.false_unless_strict_is_set},{name:"strictFunctionTypes",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,defaultValueDescription:d.false_unless_strict_is_set},{name:"strictBindCallApply",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,defaultValueDescription:d.false_unless_strict_is_set},{name:"strictPropertyInitialization",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,defaultValueDescription:d.false_unless_strict_is_set},{name:"noImplicitThis",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.Enable_error_reporting_when_this_is_given_the_type_any,defaultValueDescription:d.false_unless_strict_is_set},{name:"useUnknownInCatchVariables",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.Default_catch_clause_variables_as_unknown_instead_of_any,defaultValueDescription:d.false_unless_strict_is_set},{name:"alwaysStrict",type:"boolean",affectsSourceFile:!0,affectsEmit:!0,affectsBuildInfo:!0,strictFlag:!0,category:d.Type_Checking,description:d.Ensure_use_strict_is_always_emitted,defaultValueDescription:d.false_unless_strict_is_set},{name:"noUnusedLocals",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Enable_error_reporting_when_local_variables_aren_t_read,defaultValueDescription:!1},{name:"noUnusedParameters",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Raise_an_error_when_a_function_parameter_isn_t_read,defaultValueDescription:!1},{name:"exactOptionalPropertyTypes",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Interpret_optional_property_types_as_written_rather_than_adding_undefined,defaultValueDescription:!1},{name:"noImplicitReturns",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,defaultValueDescription:!1},{name:"noFallthroughCasesInSwitch",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,defaultValueDescription:!1},{name:"noUncheckedIndexedAccess",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Add_undefined_to_a_type_when_accessed_using_an_index,defaultValueDescription:!1},{name:"noImplicitOverride",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,defaultValueDescription:!1},{name:"noPropertyAccessFromIndexSignature",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!1,category:d.Type_Checking,description:d.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,defaultValueDescription:!1},{name:"moduleResolution",type:new Map(Object.entries({node10:2,node:2,classic:1,node16:3,nodenext:99,bundler:100})),deprecatedKeys:new Set(["node"]),affectsSourceFile:!0,affectsModuleResolution:!0,paramType:d.STRATEGY,category:d.Modules,description:d.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,defaultValueDescription:d.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node},{name:"baseUrl",type:"string",affectsModuleResolution:!0,isFilePath:!0,category:d.Modules,description:d.Specify_the_base_directory_to_resolve_non_relative_module_names},{name:"paths",type:"object",affectsModuleResolution:!0,isTSConfigOnly:!0,category:d.Modules,description:d.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,transpileOptionValue:void 0},{name:"rootDirs",type:"list",isTSConfigOnly:!0,element:{name:"rootDirs",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:d.Modules,description:d.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,transpileOptionValue:void 0,defaultValueDescription:d.Computed_from_the_list_of_input_files},{name:"typeRoots",type:"list",element:{name:"typeRoots",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:d.Modules,description:d.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types},{name:"types",type:"list",element:{name:"types",type:"string"},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:d.Modules,description:d.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,transpileOptionValue:void 0},{name:"allowSyntheticDefaultImports",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Interop_Constraints,description:d.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,defaultValueDescription:d.module_system_or_esModuleInterop},{name:"esModuleInterop",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,showInSimplifiedHelpView:!0,category:d.Interop_Constraints,description:d.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,defaultValueDescription:!1},{name:"preserveSymlinks",type:"boolean",category:d.Interop_Constraints,description:d.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,defaultValueDescription:!1},{name:"allowUmdGlobalAccess",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Modules,description:d.Allow_accessing_UMD_globals_from_modules,defaultValueDescription:!1},{name:"moduleSuffixes",type:"list",element:{name:"suffix",type:"string"},listPreserveFalsyValues:!0,affectsModuleResolution:!0,category:d.Modules,description:d.List_of_file_name_suffixes_to_search_when_resolving_a_module},{name:"allowImportingTsExtensions",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Modules,description:d.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,defaultValueDescription:!1,transpileOptionValue:void 0},{name:"resolvePackageJsonExports",type:"boolean",affectsModuleResolution:!0,category:d.Modules,description:d.Use_the_package_json_exports_field_when_resolving_package_imports,defaultValueDescription:d.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false},{name:"resolvePackageJsonImports",type:"boolean",affectsModuleResolution:!0,category:d.Modules,description:d.Use_the_package_json_imports_field_when_resolving_imports,defaultValueDescription:d.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false},{name:"customConditions",type:"list",element:{name:"condition",type:"string"},affectsModuleResolution:!0,category:d.Modules,description:d.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports},{name:"sourceRoot",type:"string",affectsEmit:!0,affectsBuildInfo:!0,paramType:d.LOCATION,category:d.Emit,description:d.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code},{name:"mapRoot",type:"string",affectsEmit:!0,affectsBuildInfo:!0,paramType:d.LOCATION,category:d.Emit,description:d.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations},{name:"inlineSources",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,defaultValueDescription:!1},{name:"experimentalDecorators",type:"boolean",affectsEmit:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Language_and_Environment,description:d.Enable_experimental_support_for_legacy_experimental_decorators,defaultValueDescription:!1},{name:"emitDecoratorMetadata",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,category:d.Language_and_Environment,description:d.Emit_design_type_metadata_for_decorated_declarations_in_source_files,defaultValueDescription:!1},{name:"jsxFactory",type:"string",category:d.Language_and_Environment,description:d.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h,defaultValueDescription:"`React.createElement`"},{name:"jsxFragmentFactory",type:"string",category:d.Language_and_Environment,description:d.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,defaultValueDescription:"React.Fragment"},{name:"jsxImportSource",type:"string",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,affectsModuleResolution:!0,category:d.Language_and_Environment,description:d.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,defaultValueDescription:"react"},{name:"resolveJsonModule",type:"boolean",affectsModuleResolution:!0,category:d.Modules,description:d.Enable_importing_json_files,defaultValueDescription:!1},{name:"allowArbitraryExtensions",type:"boolean",affectsProgramStructure:!0,category:d.Modules,description:d.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,defaultValueDescription:!1},{name:"out",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!1,category:d.Backwards_Compatibility,paramType:d.FILE,transpileOptionValue:void 0,description:d.Deprecated_setting_Use_outFile_instead},{name:"reactNamespace",type:"string",affectsEmit:!0,affectsBuildInfo:!0,category:d.Language_and_Environment,description:d.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,defaultValueDescription:"`React`"},{name:"skipDefaultLibCheck",type:"boolean",affectsBuildInfo:!0,category:d.Completeness,description:d.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,defaultValueDescription:!1},{name:"charset",type:"string",category:d.Backwards_Compatibility,description:d.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,defaultValueDescription:"utf8"},{name:"emitBOM",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,defaultValueDescription:!1},{name:"newLine",type:new Map(Object.entries({crlf:0,lf:1})),affectsEmit:!0,affectsBuildInfo:!0,paramType:d.NEWLINE,category:d.Emit,description:d.Set_the_newline_character_for_emitting_files,defaultValueDescription:"lf"},{name:"noErrorTruncation",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Output_Formatting,description:d.Disable_truncating_types_in_error_messages,defaultValueDescription:!1},{name:"noLib",type:"boolean",category:d.Language_and_Environment,affectsProgramStructure:!0,description:d.Disable_including_any_library_files_including_the_default_lib_d_ts,transpileOptionValue:!0,defaultValueDescription:!1},{name:"noResolve",type:"boolean",affectsModuleResolution:!0,category:d.Modules,description:d.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project,transpileOptionValue:!0,defaultValueDescription:!1},{name:"stripInternal",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,defaultValueDescription:!1},{name:"disableSizeLimit",type:"boolean",affectsProgramStructure:!0,category:d.Editor_Support,description:d.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,defaultValueDescription:!1},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean",isTSConfigOnly:!0,category:d.Projects,description:d.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,defaultValueDescription:!1},{name:"disableSolutionSearching",type:"boolean",isTSConfigOnly:!0,category:d.Projects,description:d.Opt_a_project_out_of_multi_project_reference_checking_when_editing,defaultValueDescription:!1},{name:"disableReferencedProjectLoad",type:"boolean",isTSConfigOnly:!0,category:d.Projects,description:d.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,defaultValueDescription:!1},{name:"noImplicitUseStrict",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Backwards_Compatibility,description:d.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,defaultValueDescription:!1},{name:"noEmitHelpers",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,defaultValueDescription:!1},{name:"noEmitOnError",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,transpileOptionValue:void 0,description:d.Disable_emitting_files_if_any_type_checking_errors_are_reported,defaultValueDescription:!1},{name:"preserveConstEnums",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Disable_erasing_const_enum_declarations_in_generated_code,defaultValueDescription:!1},{name:"declarationDir",type:"string",affectsEmit:!0,affectsBuildInfo:!0,affectsDeclarationPath:!0,isFilePath:!0,paramType:d.DIRECTORY,category:d.Emit,transpileOptionValue:void 0,description:d.Specify_the_output_directory_for_generated_declaration_files},{name:"skipLibCheck",type:"boolean",affectsBuildInfo:!0,category:d.Completeness,description:d.Skip_type_checking_all_d_ts_files,defaultValueDescription:!1},{name:"allowUnusedLabels",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Disable_error_reporting_for_unused_labels,defaultValueDescription:void 0},{name:"allowUnreachableCode",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Type_Checking,description:d.Disable_error_reporting_for_unreachable_code,defaultValueDescription:void 0},{name:"suppressExcessPropertyErrors",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Backwards_Compatibility,description:d.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,defaultValueDescription:!1},{name:"suppressImplicitAnyIndexErrors",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Backwards_Compatibility,description:d.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,defaultValueDescription:!1},{name:"forceConsistentCasingInFileNames",type:"boolean",affectsModuleResolution:!0,category:d.Interop_Constraints,description:d.Ensure_that_casing_is_correct_in_imports,defaultValueDescription:!0},{name:"maxNodeModuleJsDepth",type:"number",affectsModuleResolution:!0,category:d.JavaScript_Support,description:d.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,defaultValueDescription:0},{name:"noStrictGenericChecks",type:"boolean",affectsSemanticDiagnostics:!0,affectsBuildInfo:!0,category:d.Backwards_Compatibility,description:d.Disable_strict_checking_of_generic_signatures_in_function_types,defaultValueDescription:!1},{name:"useDefineForClassFields",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsBuildInfo:!0,category:d.Language_and_Environment,description:d.Emit_ECMAScript_standard_compliant_class_fields,defaultValueDescription:d.true_for_ES2022_and_above_including_ESNext},{name:"preserveValueImports",type:"boolean",affectsEmit:!0,affectsBuildInfo:!0,category:d.Emit,description:d.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,defaultValueDescription:!1},{name:"keyofStringsOnly",type:"boolean",category:d.Backwards_Compatibility,description:d.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,defaultValueDescription:!1},{name:"plugins",type:"list",isTSConfigOnly:!0,element:{name:"plugin",type:"object"},description:d.Specify_a_list_of_language_service_plugins_to_include,category:d.Editor_Support},{name:"moduleDetection",type:new Map(Object.entries({auto:2,legacy:1,force:3})),affectsSourceFile:!0,affectsModuleResolution:!0,description:d.Control_what_method_is_used_to_detect_module_format_JS_files,category:d.Language_and_Environment,defaultValueDescription:d.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules},{name:"ignoreDeprecations",type:"string",defaultValueDescription:void 0}],mg=[...Pw,...DU],PU=mg.filter(e=>!!e.affectsSemanticDiagnostics),wU=mg.filter(e=>!!e.affectsEmit),AU=mg.filter(e=>!!e.affectsDeclarationPath),uO=mg.filter(e=>!!e.affectsModuleResolution),_O=mg.filter(e=>!!e.affectsSourceFile||!!e.affectsBindDiagnostics),NU=mg.filter(e=>!!e.affectsProgramStructure),IU=mg.filter(e=>Ya(e,"transpileOptionValue")),FU=[{name:"verbose",shortName:"v",category:d.Command_line_Options,description:d.Enable_verbose_logging,type:"boolean",defaultValueDescription:!1},{name:"dry",shortName:"d",category:d.Command_line_Options,description:d.Show_what_would_be_built_or_deleted_if_specified_with_clean,type:"boolean",defaultValueDescription:!1},{name:"force",shortName:"f",category:d.Command_line_Options,description:d.Build_all_projects_including_those_that_appear_to_be_up_to_date,type:"boolean",defaultValueDescription:!1},{name:"clean",category:d.Command_line_Options,description:d.Delete_the_outputs_of_all_projects,type:"boolean",defaultValueDescription:!1}],fO=[...Pw,...FU],Aw=[{name:"enable",type:"boolean",defaultValueDescription:!1},{name:"include",type:"list",element:{name:"include",type:"string"}},{name:"exclude",type:"list",element:{name:"exclude",type:"string"}},{name:"disableFilenameBasedTypeAcquisition",type:"boolean",defaultValueDescription:!1}],Tve={diagnostic:d.Compiler_option_0_may_only_be_used_with_build,getOptionsNameMap:W1e},pO={module:1,target:3,strict:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,skipLibCheck:!0},Nw={alternateMode:Tve,getOptionsNameMap:EC,optionDeclarations:mg,unknownOptionDiagnostic:d.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:d.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:d.Compiler_option_0_expects_an_argument},kve={diagnostic:d.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:EC},Cve={alternateMode:kve,getOptionsNameMap:W1e,optionDeclarations:fO,unknownOptionDiagnostic:d.Unknown_build_option_0,unknownDidYouMeanDiagnostic:d.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:d.Build_option_0_requires_a_value_of_type_1},nie={optionDeclarations:Aw,unknownOptionDiagnostic:d.Unknown_type_acquisition_option_0,unknownDidYouMeanDiagnostic:d.Unknown_type_acquisition_option_0_Did_you_mean_1},dO={getOptionsNameMap:q1e,optionDeclarations:DC,unknownOptionDiagnostic:d.Unknown_watch_option_0,unknownDidYouMeanDiagnostic:d.Unknown_watch_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:d.Watch_option_0_requires_a_value_of_type_1},Iw={name:"extends",type:"listOrElement",element:{name:"extends",type:"string"},category:d.File_Management,disallowNullOrUndefined:!0},iie={name:"compilerOptions",type:"object",elementOptions:H1e(),extraKeyDiagnostics:Nw},sie={name:"watchOptions",type:"object",elementOptions:G1e(),extraKeyDiagnostics:dO},aie={name:"typeAcquisition",type:"object",elementOptions:$1e(),extraKeyDiagnostics:nie},mO="**/*",Ave=/(^|\/)\*\*\/?$/,Nve=/^[^*?]*(?=\/[^/]*[*?])/}});function Gi(e,t,...r){e.trace(Lz(t,...r))}function th(e,t){return!!e.traceResolution&&t.trace!==void 0}function VT(e,t){let r;if(t&&e){const i=e.contents.packageJsonContent;typeof i.name=="string"&&typeof i.version=="string"&&(r={name:i.name,subModuleName:t.path.slice(e.packageDirectory.length+Co.length),version:i.version})}return t&&{path:t.path,extension:t.ext,packageId:r,resolvedUsingTsExtension:t.resolvedUsingTsExtension}}function OU(e){return VT(void 0,e)}function Ive(e){if(e)return E.assert(e.packageId===void 0),{path:e.path,ext:e.extension,resolvedUsingTsExtension:e.resolvedUsingTsExtension}}function gO(e){const t=[];return e&1&&t.push("TypeScript"),e&2&&t.push("JavaScript"),e&4&&t.push("Declaration"),e&8&&t.push("JSON"),t.join(", ")}function BOe(e){const t=[];return e&1&&t.push(...W8),e&2&&t.push(...iC),e&4&&t.push(...z8),e&8&&t.push(".json"),t}function cie(e){if(e)return E.assert(z5(e.extension)),{fileName:e.path,packageId:e.packageId}}function Fve(e,t,r,i,s,o,c,u,f){if(!c.resultFromCache&&!c.compilerOptions.preserveSymlinks&&t&&r&&!t.originalPath&&!Tl(e)){const{resolvedFileName:g,originalPath:p}=Mve(t.path,c.host,c.traceEnabled);p&&(t={...t,path:g,originalPath:p})}return Ove(t,r,i,s,o,c.resultFromCache,u,f)}function Ove(e,t,r,i,s,o,c,u){return o?c?.isReadonly?{...o,failedLookupLocations:lie(o.failedLookupLocations,r),affectingLocations:lie(o.affectingLocations,i),resolutionDiagnostics:lie(o.resolutionDiagnostics,s)}:(o.failedLookupLocations=PC(o.failedLookupLocations,r),o.affectingLocations=PC(o.affectingLocations,i),o.resolutionDiagnostics=PC(o.resolutionDiagnostics,s),o):{resolvedModule:e&&{resolvedFileName:e.path,originalPath:e.originalPath===!0?void 0:e.originalPath,extension:e.extension,isExternalLibraryImport:t,packageId:e.packageId,resolvedUsingTsExtension:!!e.resolvedUsingTsExtension},failedLookupLocations:t3(r),affectingLocations:t3(i),resolutionDiagnostics:t3(s),node10Result:u}}function t3(e){return e.length?e:void 0}function PC(e,t){return t?.length?e?.length?(e.push(...t),e):t:e}function lie(e,t){return e?.length?t.length?[...e,...t]:e.slice():t3(t)}function Lve(e,t,r,i){if(!Ya(e,t)){i.traceEnabled&&Gi(i.host,d.package_json_does_not_have_a_0_field,t);return}const s=e[t];if(typeof s!==r||s===null){i.traceEnabled&&Gi(i.host,d.Expected_type_of_0_field_in_package_json_to_be_1_got_2,t,r,s===null?"null":typeof s);return}return s}function LU(e,t,r,i){const s=Lve(e,t,"string",i);if(s===void 0)return;if(!s){i.traceEnabled&&Gi(i.host,d.package_json_had_a_falsy_0_field,t);return}const o=qs(Hn(r,s));return i.traceEnabled&&Gi(i.host,d.package_json_has_0_field_1_that_references_2,t,s,o),o}function JOe(e,t,r){return LU(e,"typings",t,r)||LU(e,"types",t,r)}function zOe(e,t,r){return LU(e,"tsconfig",t,r)}function WOe(e,t,r){return LU(e,"main",t,r)}function UOe(e,t){const r=Lve(e,"typesVersions","object",t);if(r!==void 0)return t.traceEnabled&&Gi(t.host,d.package_json_has_a_typesVersions_field_with_version_specific_path_mappings),r}function VOe(e,t){const r=UOe(e,t);if(r===void 0)return;if(t.traceEnabled)for(const c in r)Ya(r,c)&&!GD.tryParse(c)&&Gi(t.host,d.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range,c);const i=hO(r);if(!i){t.traceEnabled&&Gi(t.host,d.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0,rk);return}const{version:s,paths:o}=i;if(typeof o!="object"){t.traceEnabled&&Gi(t.host,d.Expected_type_of_0_field_in_package_json_to_be_1_got_2,`typesVersions['${s}']`,"object",typeof o);return}return i}function hO(e){kie||(kie=new Ip(Qm));for(const t in e){if(!Ya(e,t))continue;const r=GD.tryParse(t);if(r!==void 0&&r.test(kie))return{version:t,paths:e[t]}}}function r3(e,t){if(e.typeRoots)return e.typeRoots;let r;if(e.configFilePath?r=qn(e.configFilePath):t.getCurrentDirectory&&(r=t.getCurrentDirectory()),r!==void 0)return qOe(r)}function qOe(e){let t;return kd(qs(e),r=>{const i=Hn(r,n2e);(t??(t=[])).push(i)}),t}function HOe(e,t,r){const i=typeof r.useCaseSensitiveFileNames=="function"?r.useCaseSensitiveFileNames():r.useCaseSensitiveFileNames;return qy(e,t,!i)===0}function Mve(e,t,r){const i=i9e(e,t,r),s=HOe(e,i,t);return{resolvedFileName:s?e:i,originalPath:s?void 0:e}}function Rve(e,t,r){const i=fc(e,"/node_modules/@types")||fc(e,"/node_modules/@types/")?e2e(t,r):t;return Hn(e,i)}function uie(e,t,r,i,s,o,c){E.assert(typeof e=="string","Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");const u=th(r,i);s&&(r=s.commandLine.options);const f=t?qn(t):void 0;let g=f?o?.getFromDirectoryCache(e,c,f,s):void 0;if(!g&&f&&!Tl(e)&&(g=o?.getFromNonRelativeNameCache(e,c,f,s)),g)return u&&(Gi(i,d.Resolving_type_reference_directive_0_containing_file_1,e,t),s&&Gi(i,d.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName),Gi(i,d.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1,e,f),J(g)),g;const p=r3(r,i);u&&(t===void 0?p===void 0?Gi(i,d.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set,e):Gi(i,d.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1,e,p):p===void 0?Gi(i,d.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set,e,t):Gi(i,d.Resolving_type_reference_directive_0_containing_file_1_root_directory_2,e,t,p),s&&Gi(i,d.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName));const y=[],S=[];let T=_ie(r);c!==void 0&&(T|=30);const C=Vl(r);c===99&&3<=C&&C<=99&&(T|=32);const w=T&8?Xv(r,c):[],D=[],O={compilerOptions:r,host:i,traceEnabled:u,failedLookupLocations:y,affectingLocations:S,packageJsonInfoCache:o,features:T,conditions:w,requestContainingDirectory:f,reportDiagnostic:Y=>void D.push(Y),isConfigLookup:!1,candidateIsFromPackageJsonField:!1};let z=ie(),W=!0;z||(z=B(),W=!1);let X;if(z){const{fileName:Y,packageId:ae}=z;let _e=Y,$;r.preserveSymlinks||({resolvedFileName:_e,originalPath:$}=Mve(Y,i,u)),X={primary:W,resolvedFileName:_e,originalPath:$,packageId:ae,isExternalLibraryImport:HT(Y)}}return g={resolvedTypeReferenceDirective:X,failedLookupLocations:t3(y),affectingLocations:t3(S),resolutionDiagnostics:t3(D)},f&&o&&!o.isReadonly&&(o.getOrCreateCacheForDirectory(f,s).set(e,c,g),Tl(e)||o.getOrCreateCacheForNonRelativeName(e,c,s).set(f,g)),u&&J(g),g;function J(Y){var ae;(ae=Y.resolvedTypeReferenceDirective)!=null&&ae.resolvedFileName?Y.resolvedTypeReferenceDirective.packageId?Gi(i,d.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3,e,Y.resolvedTypeReferenceDirective.resolvedFileName,z0(Y.resolvedTypeReferenceDirective.packageId),Y.resolvedTypeReferenceDirective.primary):Gi(i,d.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2,e,Y.resolvedTypeReferenceDirective.resolvedFileName,Y.resolvedTypeReferenceDirective.primary):Gi(i,d.Type_reference_directive_0_was_not_resolved,e)}function ie(){if(p&&p.length)return u&&Gi(i,d.Resolving_with_primary_search_path_0,p.join(", ")),ic(p,Y=>{const ae=Rve(Y,e,O),_e=td(Y,i);if(!_e&&u&&Gi(i,d.Directory_0_does_not_exist_skipping_all_lookups_in_it,Y),r.typeRoots){const $=NC(4,ae,!_e,O);if($){const H=Ow($.path),K=H?Qv(H,!1,O):void 0;return cie(VT(K,$))}}return cie(vie(4,ae,!_e,O))});u&&Gi(i,d.Root_directory_cannot_be_determined_skipping_primary_search_paths)}function B(){const Y=t&&qn(t);if(Y!==void 0){let ae;if(!r.typeRoots||!fc(t,jC))if(u&&Gi(i,d.Looking_up_in_node_modules_folder_initial_location_0,Y),Tl(e)){const{path:_e}=Uve(Y,e);ae=JU(4,_e,!1,O,!0)}else{const _e=Qve(4,e,Y,O,void 0,void 0);ae=_e&&_e.value}else u&&Gi(i,d.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder);return cie(ae)}else u&&Gi(i,d.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder)}}function _ie(e){let t=0;switch(Vl(e)){case 3:t=30;break;case 99:t=30;break;case 100:t=30;break}return e.resolvePackageJsonExports?t|=8:e.resolvePackageJsonExports===!1&&(t&=-9),e.resolvePackageJsonImports?t|=2:e.resolvePackageJsonImports===!1&&(t&=-3),t}function Xv(e,t){const r=Vl(e);if(t===void 0){if(r===100)t=99;else if(r===2)return[]}const i=t===99?["import"]:["require"];return e.noDtsResolution||i.push("types"),r!==100&&i.push("node"),Xi(i,e.customConditions)}function MU(e,t,r,i,s){const o=Lw(s?.getPackageJsonInfoCache(),i,r);return kd(t,c=>{if(Pc(c)!=="node_modules"){const u=Hn(c,"node_modules"),f=Hn(u,e);return Qv(f,!1,o)}})}function yO(e,t){if(e.types)return e.types;const r=[];if(t.directoryExists&&t.getDirectories){const i=r3(e,t);if(i){for(const s of i)if(t.directoryExists(s))for(const o of t.getDirectories(s)){const c=qs(o),u=Hn(s,c,"package.json");if(!(t.fileExists(u)&&lE(u,t).typings===null)){const g=Pc(c);g.charCodeAt(0)!==46&&r.push(g)}}}}return r}function fie(e){var t;if(e===null||typeof e!="object")return""+e;if(es(e))return`[${(t=e.map(i=>fie(i)))==null?void 0:t.join(",")}]`;let r="{";for(const i in e)Ya(e,i)&&(r+=`${i}: ${fie(e[i])}`);return r+"}"}function RU(e,t){return t.map(r=>fie(I5(e,r))).join("|")+`|${e.pathsBasePath}`}function jU(e,t){const r=new Map,i=new Map;let s=new Map;return e&&r.set(e,s),{getMapOfCacheRedirects:o,getOrCreateMapOfCacheRedirects:c,update:u,clear:g,getOwnMap:()=>s};function o(y){return y?f(y.commandLine.options,!1):s}function c(y){return y?f(y.commandLine.options,!0):s}function u(y){e!==y&&(e?s=f(y,!0):r.set(y,s),e=y)}function f(y,S){let T=r.get(y);if(T)return T;const C=p(y);if(T=i.get(C),!T){if(e){const w=p(e);w===C?T=s:i.has(w)||i.set(w,s)}S&&(T??(T=new Map)),T&&i.set(C,T)}return T&&r.set(y,T),T}function g(){const y=e&&t.get(e);s.clear(),r.clear(),t.clear(),i.clear(),e&&(y&&t.set(e,y),r.set(e,s))}function p(y){let S=t.get(y);return S||t.set(y,S=RU(y,uO)),S}}function GOe(e,t){let r;return{getPackageJsonInfo:i,setPackageJsonInfo:s,clear:o,entries:c,getInternalMap:u};function i(f){return r?.get(fo(f,e,t))}function s(f,g){(r||(r=new Map)).set(fo(f,e,t),g)}function o(){r=void 0}function c(){const f=r?.entries();return f?fs(f):[]}function u(){return r}}function jve(e,t,r,i){const s=e.getOrCreateMapOfCacheRedirects(t);let o=s.get(r);return o||(o=i(),s.set(r,o)),o}function $Oe(e,t,r,i){const s=jU(r,i);return{getFromDirectoryCache:f,getOrCreateCacheForDirectory:u,clear:o,update:c,directoryToModuleNameMap:s};function o(){s.clear()}function c(g){s.update(g)}function u(g,p){const y=fo(g,e,t);return jve(s,p,y,()=>qT())}function f(g,p,y,S){var T,C;const w=fo(y,e,t);return(C=(T=s.getMapOfCacheRedirects(S))==null?void 0:T.get(w))==null?void 0:C.get(g,p)}}function n3(e,t){return t===void 0?e:`${t}|${e}`}function qT(){const e=new Map,t=new Map,r={get(s,o){return e.get(i(s,o))},set(s,o,c){return e.set(i(s,o),c),r},delete(s,o){return e.delete(i(s,o)),r},has(s,o){return e.has(i(s,o))},forEach(s){return e.forEach((o,c)=>{const[u,f]=t.get(c);return s(o,u,f)})},size(){return e.size}};return r;function i(s,o){const c=n3(s,o);return t.set(c,[s,o]),c}}function XOe(e){return e.resolvedModule&&(e.resolvedModule.originalPath||e.resolvedModule.resolvedFileName)}function QOe(e){return e.resolvedTypeReferenceDirective&&(e.resolvedTypeReferenceDirective.originalPath||e.resolvedTypeReferenceDirective.resolvedFileName)}function YOe(e,t,r,i,s){const o=jU(r,s);return{getFromNonRelativeNameCache:f,getOrCreateCacheForNonRelativeName:g,clear:c,update:u};function c(){o.clear()}function u(y){o.update(y)}function f(y,S,T,C){var w,D;return E.assert(!Tl(y)),(D=(w=o.getMapOfCacheRedirects(C))==null?void 0:w.get(n3(y,S)))==null?void 0:D.get(T)}function g(y,S,T){return E.assert(!Tl(y)),jve(o,T,n3(y,S),p)}function p(){const y=new Map;return{get:S,set:T};function S(w){return y.get(fo(w,e,t))}function T(w,D){const O=fo(w,e,t);if(y.has(O))return;y.set(O,D);const z=i(D),W=z&&C(O,z);let X=O;for(;X!==W;){const J=qn(X);if(J===X||y.has(J))break;y.set(J,D),X=J}}function C(w,D){const O=fo(qn(D),e,t);let z=0;const W=Math.min(w.length,O.length);for(;zi,clearAllExceptPackageJsonInfoCache:g,optionsToRedirectsKey:o};function f(){g(),i.clear()}function g(){c.clear(),u.clear()}function p(y){c.update(y),u.update(y)}}function wC(e,t,r,i,s){const o=Bve(e,t,r,i,XOe,s);return o.getOrCreateCacheForModuleName=(c,u,f)=>o.getOrCreateCacheForNonRelativeName(c,u,f),o}function vO(e,t,r,i,s){return Bve(e,t,r,i,QOe,s)}function BU(e){return{moduleResolution:2,traceResolution:e.traceResolution}}function bO(e,t,r,i,s){return AC(e,t,BU(r),i,s)}function Jve(e,t,r,i){const s=qn(t);return r.getFromDirectoryCache(e,i,s,void 0)}function AC(e,t,r,i,s,o,c){var u,f,g;const p=th(r,i);o&&(r=o.commandLine.options),p&&(Gi(i,d.Resolving_module_0_from_1,e,t),o&&Gi(i,d.Using_compiler_options_of_project_reference_redirect_0,o.sourceFile.fileName));const y=qn(t);let S=s?.getFromDirectoryCache(e,c,y,o);if(S)p&&Gi(i,d.Resolution_for_module_0_was_found_in_cache_from_location_1,e,y);else{let T=r.moduleResolution;if(T===void 0){switch(Ul(r)){case 1:T=2;break;case 100:T=3;break;case 199:T=99;break;default:T=1;break}p&&Gi(i,d.Module_resolution_kind_is_not_specified_using_0,uk[T])}else p&&Gi(i,d.Explicitly_specified_module_resolution_kind_Colon_0,uk[T]);switch((u=Pu)==null||u.logStartResolveModule(e),T){case 3:S=t9e(e,t,r,i,s,o,c);break;case 99:S=r9e(e,t,r,i,s,o,c);break;case 2:S=mie(e,t,r,i,s,o,c?Xv(r,c):void 0);break;case 1:S=Tie(e,t,r,i,s,o);break;case 100:S=die(e,t,r,i,s,o,c?Xv(r,c):void 0);break;default:return E.fail(`Unexpected moduleResolution: ${T}`)}S&&S.resolvedModule&&((f=Pu)==null||f.logInfoEvent(`Module "${e}" resolved to "${S.resolvedModule.resolvedFileName}"`)),(g=Pu)==null||g.logStopResolveModule(S&&S.resolvedModule?""+S.resolvedModule.resolvedFileName:"null"),s&&!s.isReadonly&&(s.getOrCreateCacheForDirectory(y,o).set(e,c,S),Tl(e)||s.getOrCreateCacheForNonRelativeName(e,c,o).set(y,S))}return p&&(S.resolvedModule?S.resolvedModule.packageId?Gi(i,d.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2,e,S.resolvedModule.resolvedFileName,z0(S.resolvedModule.packageId)):Gi(i,d.Module_name_0_was_successfully_resolved_to_1,e,S.resolvedModule.resolvedFileName):Gi(i,d.Module_name_0_was_not_resolved,e)),S}function zve(e,t,r,i,s){const o=ZOe(e,t,i,s);return o?o.value:Tl(t)?KOe(e,t,r,i,s):e9e(e,t,i,s)}function ZOe(e,t,r,i){var s;const{baseUrl:o,paths:c,configFile:u}=i.compilerOptions;if(c&&!U_(t)){i.traceEnabled&&(o&&Gi(i.host,d.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,o,t),Gi(i.host,d.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,t));const f=p5(i.compilerOptions,i.host),g=u?.configFileSpecs?(s=u.configFileSpecs).pathPatterns||(s.pathPatterns=J5(c)):void 0;return Sie(e,t,f,c,g,r,!1,i)}}function KOe(e,t,r,i,s){if(!s.compilerOptions.rootDirs)return;s.traceEnabled&&Gi(s.host,d.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,t);const o=qs(Hn(r,t));let c,u;for(const f of s.compilerOptions.rootDirs){let g=qs(f);fc(g,Co)||(g+=Co);const p=Qi(o,g)&&(u===void 0||u.lengthvoid z.push(B),isConfigLookup:u,candidateIsFromPackageJsonField:!1};C&&bT(O)&&Gi(s,d.Resolving_in_0_mode_with_conditions_1,e&32?"ESM":"CJS",W.conditions.map(B=>`'${B}'`).join(", "));let X;if(O===2){const B=c&5,Y=c&-6;X=B&&ie(B,W)||Y&&ie(Y,W)||void 0}else X=ie(c,W);let J;if((p=X?.value)!=null&&p.isExternalLibraryImport&&!u&&c&5&&e&8&&!Tl(t)&&!bie(5,X.value.resolved.extension)&&g?.includes("import")){b1(W,d.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);const B={...W,features:W.features&-9,reportDiagnostic:Ca},Y=ie(c&5,B);(y=Y?.value)!=null&&y.isExternalLibraryImport&&(J=Y.value.resolved.path)}return Fve(t,(S=X?.value)==null?void 0:S.resolved,(T=X?.value)==null?void 0:T.isExternalLibraryImport,w,D,z,W,o,J);function ie(B,Y){const _e=zve(B,t,r,($,H,K,oe)=>JU($,H,K,oe,!0),Y);if(_e)return df({resolved:_e,isExternalLibraryImport:HT(_e.path)});if(Tl(t)){const{path:$,parts:H}=Uve(r,t),K=JU(B,$,!1,Y,!0);return K&&df({resolved:K,isExternalLibraryImport:_s(H,"node_modules")})}else{let $;if(e&2&&Qi(t,"#")&&($=l9e(B,t,r,Y,o,f)),!$&&e&4&&($=c9e(B,t,r,Y,o,f)),!$){if(t.includes(":")){C&&Gi(s,d.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1,t,gO(B));return}C&&Gi(s,d.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1,t,gO(B)),$=Qve(B,t,r,Y,o,f)}return B&4&&($??($=r2e(t,Y))),$&&{value:$.value&&{resolved:$.value,isExternalLibraryImport:!0}}}}}function Uve(e,t){const r=Hn(e,t),i=fl(r),s=Mo(i);return{path:s==="."||s===".."?Sl(qs(r)):qs(r),parts:i}}function i9e(e,t,r){if(!t.realpath)return e;const i=qs(t.realpath(e));return r&&Gi(t,d.Resolving_real_path_for_0_result_1,e,i),i}function JU(e,t,r,i,s){if(i.traceEnabled&&Gi(i.host,d.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1,t,gO(e)),!Nh(t)){if(!r){const c=qn(t);td(c,i.host)||(i.traceEnabled&&Gi(i.host,d.Directory_0_does_not_exist_skipping_all_lookups_in_it,c),r=!0)}const o=NC(e,t,r,i);if(o){const c=s?Ow(o.path):void 0,u=c?Qv(c,!1,i):void 0;return VT(u,o)}}if(r||td(t,i.host)||(i.traceEnabled&&Gi(i.host,d.Directory_0_does_not_exist_skipping_all_lookups_in_it,t),r=!0),!(i.features&32))return vie(e,t,r,i,s)}function HT(e){return e.includes(Am)}function Ow(e,t){const r=qs(e),i=r.lastIndexOf(Am);if(i===-1)return;const s=i+Am.length;let o=Vve(r,s,t);return r.charCodeAt(s)===64&&(o=Vve(r,o,t)),r.slice(0,o)}function Vve(e,t,r){const i=e.indexOf(Co,t+1);return i===-1?r?e.length:t:i}function hie(e,t,r,i){return OU(NC(e,t,r,i))}function NC(e,t,r,i){const s=qve(e,t,r,i);if(s)return s;if(!(i.features&32)){const o=Hve(t,e,"",r,i);if(o)return o}}function qve(e,t,r,i){if(!Pc(t).includes("."))return;let o=Ou(t);o===t&&(o=t.substring(0,t.lastIndexOf(".")));const c=t.substring(o.length);return i.traceEnabled&&Gi(i.host,d.File_name_0_has_a_1_extension_stripping_it,t,c),Hve(o,e,c,r,i)}function yie(e,t,r,i){return e&1&&Jc(t,W8)||e&4&&Jc(t,z8)?SO(t,r,i)!==void 0?{path:t,ext:b5(t),resolvedUsingTsExtension:void 0}:void 0:i.isConfigLookup&&e===8&&Ho(t,".json")?SO(t,r,i)!==void 0?{path:t,ext:".json",resolvedUsingTsExtension:void 0}:void 0:qve(e,t,r,i)}function Hve(e,t,r,i,s){if(!i){const c=qn(e);c&&(i=!td(c,s.host))}switch(r){case".mjs":case".mts":case".d.mts":return t&1&&o(".mts",r===".mts"||r===".d.mts")||t&4&&o(".d.mts",r===".mts"||r===".d.mts")||t&2&&o(".mjs")||void 0;case".cjs":case".cts":case".d.cts":return t&1&&o(".cts",r===".cts"||r===".d.cts")||t&4&&o(".d.cts",r===".cts"||r===".d.cts")||t&2&&o(".cjs")||void 0;case".json":return t&4&&o(".d.json.ts")||t&8&&o(".json")||void 0;case".tsx":case".jsx":return t&1&&(o(".tsx",r===".tsx")||o(".ts",r===".tsx"))||t&4&&o(".d.ts",r===".tsx")||t&2&&(o(".jsx")||o(".js"))||void 0;case".ts":case".d.ts":case".js":case"":return t&1&&(o(".ts",r===".ts"||r===".d.ts")||o(".tsx",r===".ts"||r===".d.ts"))||t&4&&o(".d.ts",r===".ts"||r===".d.ts")||t&2&&(o(".js")||o(".jsx"))||s.isConfigLookup&&o(".json")||void 0;default:return t&4&&!Il(e+r)&&o(`.d${r}.ts`)||void 0}function o(c,u){const f=SO(e+c,i,s);return f===void 0?void 0:{path:f,ext:c,resolvedUsingTsExtension:!s.candidateIsFromPackageJsonField&&u}}}function SO(e,t,r){var i;if(!((i=r.compilerOptions.moduleSuffixes)!=null&&i.length))return Gve(e,t,r);const s=ug(e)??"",o=s?F8(e,s):e;return Zt(r.compilerOptions.moduleSuffixes,c=>Gve(o+c+s,t,r))}function Gve(e,t,r){var i;if(!t){if(r.host.fileExists(e))return r.traceEnabled&&Gi(r.host,d.File_0_exists_use_it_as_a_name_resolution_result,e),e;r.traceEnabled&&Gi(r.host,d.File_0_does_not_exist,e)}(i=r.failedLookupLocations)==null||i.push(e)}function vie(e,t,r,i,s=!0){const o=s?Qv(t,r,i):void 0,c=o&&o.contents.packageJsonContent,u=o&&TO(o,i);return VT(o,WU(e,t,r,i,c,u))}function zU(e,t,r,i,s){if(!s&&e.contents.resolvedEntrypoints!==void 0)return e.contents.resolvedEntrypoints;let o;const c=5|(s?2:0),u=_ie(t),f=Lw(i?.getPackageJsonInfoCache(),r,t);f.conditions=Xv(t),f.requestContainingDirectory=e.packageDirectory;const g=WU(c,e.packageDirectory,!1,f,e.contents.packageJsonContent,TO(e,f));if(o=lr(o,g?.path),u&8&&e.contents.packageJsonContent.exports){const p=VS([Xv(t,99),Xv(t,1)],Zp);for(const y of p){const S={...f,failedLookupLocations:[],conditions:y,host:r},T=s9e(e,e.contents.packageJsonContent.exports,S,c);if(T)for(const C of T)o=Bg(o,C.path)}}return e.contents.resolvedEntrypoints=o||!1}function s9e(e,t,r,i){let s;if(es(t))for(const c of t)o(c);else if(typeof t=="object"&&t!==null&&xO(t))for(const c in t)o(t[c]);else o(t);return s;function o(c){var u,f;if(typeof c=="string"&&Qi(c,"./"))if(c.includes("*")&&r.host.readDirectory){if(c.indexOf("*")!==c.lastIndexOf("*"))return!1;r.host.readDirectory(e.packageDirectory,BOe(i),void 0,[Il(c)?c.replace("*","**/*"):nP(c.replace("*","**/*"),v8(c))]).forEach(g=>{s=Bg(s,{path:g,ext:S4(g),resolvedUsingTsExtension:void 0})})}else{const g=fl(c).slice(2);if(g.includes("..")||g.includes(".")||g.includes("node_modules"))return!1;const p=Hn(e.packageDirectory,c),y=is(p,(f=(u=r.host).getCurrentDirectory)==null?void 0:f.call(u)),S=yie(i,y,!1,r);if(S)return s=Bg(s,S,(T,C)=>T.path===C.path),!0}else if(Array.isArray(c)){for(const g of c)if(o(g))return!0}else if(typeof c=="object"&&c!==null)return Zt(Jg(c),g=>{if(g==="default"||_s(r.conditions,g)||jw(r.conditions,g))return o(c[g]),!0})}}function Lw(e,t,r){return{host:t,compilerOptions:r,traceEnabled:th(r,t),failedLookupLocations:void 0,affectingLocations:void 0,packageJsonInfoCache:e,features:0,conditions:ze,requestContainingDirectory:void 0,reportDiagnostic:Ca,isConfigLookup:!1,candidateIsFromPackageJsonField:!1}}function Mw(e,t){const r=fl(e);for(r.pop();r.length>0;){const i=Qv(N0(r),!1,t);if(i)return i;r.pop()}}function TO(e,t){return e.contents.versionPaths===void 0&&(e.contents.versionPaths=VOe(e.contents.packageJsonContent,t)||!1),e.contents.versionPaths||void 0}function Qv(e,t,r){var i,s,o,c,u,f;const{host:g,traceEnabled:p}=r,y=Hn(e,"package.json");if(t){(i=r.failedLookupLocations)==null||i.push(y);return}const S=(s=r.packageJsonInfoCache)==null?void 0:s.getPackageJsonInfo(y);if(S!==void 0){if(typeof S!="boolean")return p&&Gi(g,d.File_0_exists_according_to_earlier_cached_lookups,y),(o=r.affectingLocations)==null||o.push(y),S.packageDirectory===e?S:{packageDirectory:e,contents:S.contents};S&&p&&Gi(g,d.File_0_does_not_exist_according_to_earlier_cached_lookups,y),(c=r.failedLookupLocations)==null||c.push(y);return}const T=td(e,g);if(T&&g.fileExists(y)){const C=lE(y,g);p&&Gi(g,d.Found_package_json_at_0,y);const w={packageDirectory:e,contents:{packageJsonContent:C,versionPaths:void 0,resolvedEntrypoints:void 0}};return r.packageJsonInfoCache&&!r.packageJsonInfoCache.isReadonly&&r.packageJsonInfoCache.setPackageJsonInfo(y,w),(u=r.affectingLocations)==null||u.push(y),w}else T&&p&&Gi(g,d.File_0_does_not_exist,y),r.packageJsonInfoCache&&!r.packageJsonInfoCache.isReadonly&&r.packageJsonInfoCache.setPackageJsonInfo(y,T),(f=r.failedLookupLocations)==null||f.push(y)}function WU(e,t,r,i,s,o){let c;s&&(i.isConfigLookup?c=zOe(s,t,i):c=e&4&&JOe(s,t,i)||e&7&&WOe(s,t,i)||void 0);const u=(S,T,C,w)=>{const D=SO(T,C,w);if(D){const J=a9e(S,D);if(J)return OU(J);w.traceEnabled&&Gi(w.host,d.File_0_has_an_unsupported_extension_so_skipping_it,D)}const O=S===4?5:S,z=w.features,W=w.candidateIsFromPackageJsonField;w.candidateIsFromPackageJsonField=!0,s?.type!=="module"&&(w.features&=-33);const X=JU(O,T,C,w,!1);return w.features=z,w.candidateIsFromPackageJsonField=W,X},f=c?!td(qn(c),i.host):void 0,g=r||!td(t,i.host),p=Hn(t,i.isConfigLookup?"tsconfig":"index");if(o&&(!c||dm(t,c))){const S=mm(t,c||p,!1);i.traceEnabled&&Gi(i.host,d.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,o.version,Qm,S);const T=Sie(e,S,t,o.paths,void 0,u,f||g,i);if(T)return Ive(T.value)}const y=c&&Ive(u(e,c,f,i));if(y)return y;if(!(i.features&32))return NC(e,p,g,i)}function a9e(e,t,r){const i=ug(t);return i!==void 0&&bie(e,i)?{path:t,ext:i,resolvedUsingTsExtension:r}:void 0}function bie(e,t){return e&2&&(t===".js"||t===".jsx"||t===".mjs"||t===".cjs")||e&1&&(t===".ts"||t===".tsx"||t===".mts"||t===".cts")||e&4&&(t===".d.ts"||t===".d.mts"||t===".d.cts")||e&8&&t===".json"||!1}function Rw(e){let t=e.indexOf(Co);return e[0]==="@"&&(t=e.indexOf(Co,t+1)),t===-1?{packageName:e,rest:""}:{packageName:e.slice(0,t),rest:e.slice(t+1)}}function xO(e){return qi(Jg(e),t=>Qi(t,"."))}function o9e(e){return!ut(Jg(e),t=>Qi(t,"."))}function c9e(e,t,r,i,s,o){var c,u;const f=is(Hn(r,"dummy"),(u=(c=i.host).getCurrentDirectory)==null?void 0:u.call(c)),g=Mw(f,i);if(!g||!g.contents.packageJsonContent.exports||typeof g.contents.packageJsonContent.name!="string")return;const p=fl(t),y=fl(g.contents.packageJsonContent.name);if(!qi(y,(D,O)=>p[O]===D))return;const S=p.slice(y.length),T=Ir(S)?`.${Co}${S.join(Co)}`:".";if(s1(i.compilerOptions)&&!HT(r))return UU(g,e,T,i,s,o);const C=e&5,w=e&-6;return UU(g,C,T,i,s,o)||UU(g,w,T,i,s,o)}function UU(e,t,r,i,s,o){if(e.contents.packageJsonContent.exports){if(r==="."){let c;if(typeof e.contents.packageJsonContent.exports=="string"||Array.isArray(e.contents.packageJsonContent.exports)||typeof e.contents.packageJsonContent.exports=="object"&&o9e(e.contents.packageJsonContent.exports)?c=e.contents.packageJsonContent.exports:Ya(e.contents.packageJsonContent.exports,".")&&(c=e.contents.packageJsonContent.exports["."]),c)return Xve(t,i,s,o,r,e,!1)(c,"",!1,".")}else if(xO(e.contents.packageJsonContent.exports)){if(typeof e.contents.packageJsonContent.exports!="object")return i.traceEnabled&&Gi(i.host,d.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,r,e.packageDirectory),df(void 0);const c=$ve(t,i,s,o,r,e.contents.packageJsonContent.exports,e,!1);if(c)return c}return i.traceEnabled&&Gi(i.host,d.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,r,e.packageDirectory),df(void 0)}}function l9e(e,t,r,i,s,o){var c,u;if(t==="#"||Qi(t,"#/"))return i.traceEnabled&&Gi(i.host,d.Invalid_import_specifier_0_has_no_possible_resolutions,t),df(void 0);const f=is(Hn(r,"dummy"),(u=(c=i.host).getCurrentDirectory)==null?void 0:u.call(c)),g=Mw(f,i);if(!g)return i.traceEnabled&&Gi(i.host,d.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve,f),df(void 0);if(!g.contents.packageJsonContent.imports)return i.traceEnabled&&Gi(i.host,d.package_json_scope_0_has_no_imports_defined,g.packageDirectory),df(void 0);const p=$ve(e,i,s,o,t,g.contents.packageJsonContent.imports,g,!0);return p||(i.traceEnabled&&Gi(i.host,d.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1,t,g.packageDirectory),df(void 0))}function VU(e,t){const r=e.indexOf("*"),i=t.indexOf("*"),s=r===-1?e.length:r+1,o=i===-1?t.length:i+1;return s>o?-1:o>s||r===-1?1:i===-1||e.length>t.length?-1:t.length>e.length?1:0}function $ve(e,t,r,i,s,o,c,u){const f=Xve(e,t,r,i,s,c,u);if(!fc(s,Co)&&!s.includes("*")&&Ya(o,s)){const y=o[s];return f(y,"",!1,s)}const g=qS(wn(Jg(o),y=>y.includes("*")||fc(y,"/")),VU);for(const y of g)if(t.features&16&&p(y,s)){const S=o[y],T=y.indexOf("*"),C=s.substring(y.substring(0,T).length,s.length-(y.length-1-T));return f(S,C,!0,y)}else if(fc(y,"*")&&Qi(s,y.substring(0,y.length-1))){const S=o[y],T=s.substring(y.length-1);return f(S,T,!0,y)}else if(Qi(s,y)){const S=o[y],T=s.substring(y.length);return f(S,T,!1,y)}function p(y,S){if(fc(y,"*"))return!1;const T=y.indexOf("*");return T===-1?!1:Qi(S,y.substring(0,T))&&fc(S,y.substring(T+1))}}function Xve(e,t,r,i,s,o,c){return u;function u(f,g,p,y){if(typeof f=="string"){if(!p&&g.length>0&&!fc(f,"/"))return t.traceEnabled&&Gi(t.host,d.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,s),df(void 0);if(!Qi(f,"./")){if(c&&!Qi(f,"../")&&!Qi(f,"/")&&!C_(f)){const J=p?f.replace(/\*/g,g):f+g;b1(t,d.Using_0_subpath_1_with_target_2,"imports",y,J),b1(t,d.Resolving_module_0_from_1,J,o.packageDirectory+"/");const ie=Fw(t.features,J,o.packageDirectory+"/",t.compilerOptions,t.host,r,e,!1,i,t.conditions);return df(ie.resolvedModule?{path:ie.resolvedModule.resolvedFileName,extension:ie.resolvedModule.extension,packageId:ie.resolvedModule.packageId,originalPath:ie.resolvedModule.originalPath,resolvedUsingTsExtension:ie.resolvedModule.resolvedUsingTsExtension}:void 0)}return t.traceEnabled&&Gi(t.host,d.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,s),df(void 0)}const D=(U_(f)?fl(f).slice(1):fl(f)).slice(1);if(D.includes("..")||D.includes(".")||D.includes("node_modules"))return t.traceEnabled&&Gi(t.host,d.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,s),df(void 0);const O=Hn(o.packageDirectory,f),z=fl(g);if(z.includes("..")||z.includes(".")||z.includes("node_modules"))return t.traceEnabled&&Gi(t.host,d.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,s),df(void 0);t.traceEnabled&&Gi(t.host,d.Using_0_subpath_1_with_target_2,c?"imports":"exports",y,p?f.replace(/\*/g,g):f+g);const W=S(p?O.replace(/\*/g,g):O+g),X=C(W,g,Hn(o.packageDirectory,"package.json"),c);return X||df(VT(o,yie(e,W,!1,t)))}else if(typeof f=="object"&&f!==null)if(Array.isArray(f)){if(!Ir(f))return t.traceEnabled&&Gi(t.host,d.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,s),df(void 0);for(const w of f){const D=u(w,g,p,y);if(D)return D}}else{b1(t,d.Entering_conditional_exports);for(const w of Jg(f))if(w==="default"||t.conditions.includes(w)||jw(t.conditions,w)){b1(t,d.Matched_0_condition_1,c?"imports":"exports",w);const D=f[w],O=u(D,g,p,y);if(O)return b1(t,d.Resolved_under_condition_0,w),b1(t,d.Exiting_conditional_exports),O;b1(t,d.Failed_to_resolve_under_condition_0,w)}else b1(t,d.Saw_non_matching_condition_0,w);b1(t,d.Exiting_conditional_exports);return}else if(f===null)return t.traceEnabled&&Gi(t.host,d.package_json_scope_0_explicitly_maps_specifier_1_to_null,o.packageDirectory,s),df(void 0);return t.traceEnabled&&Gi(t.host,d.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,s),df(void 0);function S(w){var D,O;return w===void 0?w:is(w,(O=(D=t.host).getCurrentDirectory)==null?void 0:O.call(D))}function T(w,D){return Sl(Hn(w,D))}function C(w,D,O,z){var W,X,J,ie;if(!t.isConfigLookup&&(t.compilerOptions.declarationDir||t.compilerOptions.outDir)&&!w.includes("/node_modules/")&&(!t.compilerOptions.configFile||dm(o.packageDirectory,S(t.compilerOptions.configFile.fileName),!qU(t)))){const Y=jh({useCaseSensitiveFileNames:()=>qU(t)}),ae=[];if(t.compilerOptions.rootDir||t.compilerOptions.composite&&t.compilerOptions.configFilePath){const _e=S(g3(t.compilerOptions,()=>[],((X=(W=t.host).getCurrentDirectory)==null?void 0:X.call(W))||"",Y));ae.push(_e)}else if(t.requestContainingDirectory){const _e=S(Hn(t.requestContainingDirectory,"index.ts")),$=S(g3(t.compilerOptions,()=>[_e,S(O)],((ie=(J=t.host).getCurrentDirectory)==null?void 0:ie.call(J))||"",Y));ae.push($);let H=Sl($);for(;H&&H.length>1;){const K=fl(H);K.pop();const oe=N0(K);ae.unshift(oe),H=Sl(oe)}}ae.length>1&&t.reportDiagnostic(dc(z?d.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:d.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,D===""?".":D,O));for(const _e of ae){const $=B(_e);for(const H of $)if(dm(H,w,!qU(t))){const K=w.slice(H.length+1),oe=Hn(_e,K),Se=[".mjs",".cjs",".js",".json",".d.mts",".d.cts",".d.ts"];for(const se of Se)if(Ho(oe,se)){const Z=yte(oe);for(const ve of Z){if(!bie(e,ve))continue;const Te=nP(oe,ve,se,!qU(t));if(t.host.fileExists(Te))return df(VT(o,yie(e,Te,!1,t)))}}}}}return;function B(Y){var ae,_e;const $=t.compilerOptions.configFile?((_e=(ae=t.host).getCurrentDirectory)==null?void 0:_e.call(ae))||"":Y,H=[];return t.compilerOptions.declarationDir&&H.push(S(T($,t.compilerOptions.declarationDir))),t.compilerOptions.outDir&&t.compilerOptions.outDir!==t.compilerOptions.declarationDir&&H.push(S(T($,t.compilerOptions.outDir))),H}}}}function jw(e,t){if(!e.includes("types")||!Qi(t,"types@"))return!1;const r=GD.tryParse(t.substring(6));return r?r.test(Qm):!1}function Qve(e,t,r,i,s,o){return Yve(e,t,r,i,!1,s,o)}function u9e(e,t,r){return Yve(4,e,t,r,!0,void 0,void 0)}function Yve(e,t,r,i,s,o,c){const u=i.features===0?void 0:i.features&32?99:1,f=e&5,g=e&-6;if(f){b1(i,d.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0,gO(f));const y=p(f);if(y)return y}if(g&&!s)return b1(i,d.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0,gO(g)),p(g);function p(y){return kd(du(r),S=>{if(Pc(S)!=="node_modules"){const T=t2e(o,t,u,S,c,i);return T||df(Zve(y,t,S,i,s,o,c))}})}}function Zve(e,t,r,i,s,o,c){const u=Hn(r,"node_modules"),f=td(u,i.host);if(!f&&i.traceEnabled&&Gi(i.host,d.Directory_0_does_not_exist_skipping_all_lookups_in_it,u),!s){const g=Kve(e,t,u,f,i,o,c);if(g)return g}if(e&4){const g=Hn(u,"@types");let p=f;return f&&!td(g,i.host)&&(i.traceEnabled&&Gi(i.host,d.Directory_0_does_not_exist_skipping_all_lookups_in_it,g),p=!1),Kve(4,e2e(t,i),g,p,i,o,c)}}function Kve(e,t,r,i,s,o,c){var u,f;const g=qs(Hn(r,t)),{packageName:p,rest:y}=Rw(t),S=Hn(r,p);let T,C=Qv(g,!i,s);if(y!==""&&C&&(!(s.features&8)||!Ya(((u=T=Qv(S,!i,s))==null?void 0:u.contents.packageJsonContent)??ze,"exports"))){const O=NC(e,g,!i,s);if(O)return OU(O);const z=WU(e,g,!i,s,C.contents.packageJsonContent,TO(C,s));return VT(C,z)}const w=(O,z,W,X)=>{let J=(y||!(X.features&32))&&NC(O,z,W,X)||WU(O,z,W,X,C&&C.contents.packageJsonContent,C&&TO(C,X));return!J&&C&&(C.contents.packageJsonContent.exports===void 0||C.contents.packageJsonContent.exports===null)&&X.features&32&&(J=NC(O,Hn(z,"index.js"),W,X)),VT(C,J)};if(y!==""&&(C=T??Qv(S,!i,s)),C&&C.contents.packageJsonContent.exports&&s.features&8)return(f=UU(C,e,Hn(".",y),s,o,c))==null?void 0:f.value;const D=y!==""&&C?TO(C,s):void 0;if(D){s.traceEnabled&&Gi(s.host,d.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,D.version,Qm,y);const O=i&&td(S,s.host),z=Sie(e,y,S,D.paths,void 0,w,!O,s);if(z)return z.value}return w(e,g,!i,s)}function Sie(e,t,r,i,s,o,c,u){s||(s=J5(i));const f=qz(s,t);if(f){const g=ns(f)?void 0:KZ(f,t),p=ns(f)?f:ZZ(f);return u.traceEnabled&&Gi(u.host,d.Module_name_0_matched_pattern_1,t,p),{value:Zt(i[p],S=>{const T=g?S.replace("*",g):S,C=qs(Hn(r,T));u.traceEnabled&&Gi(u.host,d.Trying_substitution_0_candidate_module_location_Colon_1,S,T);const w=ug(S);if(w!==void 0){const D=SO(C,c,u);if(D!==void 0)return OU({path:D,ext:w,resolvedUsingTsExtension:void 0})}return o(e,C,c||!td(qn(C),u.host),u)})}}}function e2e(e,t){const r=IC(e);return t.traceEnabled&&r!==e&&Gi(t.host,d.Scoped_package_detected_looking_in_0,r),r}function kO(e){return`@types/${IC(e)}`}function IC(e){if(Qi(e,"@")){const t=e.replace(Co,GU);if(t!==e)return t.slice(1)}return e}function i3(e){const t=g4(e,"@types/");return t!==e?Bw(t):e}function Bw(e){return e.includes(GU)?"@"+e.replace(GU,Co):e}function t2e(e,t,r,i,s,o){const c=e&&e.getFromNonRelativeNameCache(t,r,i,s);if(c)return o.traceEnabled&&Gi(o.host,d.Resolution_for_module_0_was_found_in_cache_from_location_1,t,i),o.resultFromCache=c,{value:c.resolvedModule&&{path:c.resolvedModule.resolvedFileName,originalPath:c.resolvedModule.originalPath||!0,extension:c.resolvedModule.extension,packageId:c.resolvedModule.packageId,resolvedUsingTsExtension:c.resolvedModule.resolvedUsingTsExtension}}}function Tie(e,t,r,i,s,o){const c=th(r,i),u=[],f=[],g=qn(t),p=[],y={compilerOptions:r,host:i,traceEnabled:c,failedLookupLocations:u,affectingLocations:f,packageJsonInfoCache:s,features:0,conditions:[],requestContainingDirectory:g,reportDiagnostic:C=>void p.push(C),isConfigLookup:!1,candidateIsFromPackageJsonField:!1},S=T(5)||T(2|(r.resolveJsonModule?8:0));return Fve(e,S&&S.value,S?.value&&HT(S.value.path),u,f,p,y,s);function T(C){const w=zve(C,e,g,hie,y);if(w)return{value:w};if(Tl(e)){const D=qs(Hn(g,e));return df(hie(C,D,!1,y))}else{const D=kd(g,O=>{const z=t2e(s,e,void 0,O,o,y);if(z)return z;const W=qs(Hn(O,e));return df(hie(C,W,!1,y))});if(D)return D;if(C&5){let O=u9e(e,g,y);return C&4&&(O??(O=r2e(e,y))),O}}}}function r2e(e,t){if(t.compilerOptions.typeRoots)for(const r of t.compilerOptions.typeRoots){const i=Rve(r,e,t),s=td(r,t.host);!s&&t.traceEnabled&&Gi(t.host,d.Directory_0_does_not_exist_skipping_all_lookups_in_it,r);const o=NC(4,i,!s,t);if(o){const u=Ow(o.path),f=u?Qv(u,!1,t):void 0;return df(VT(f,o))}const c=vie(4,i,!s,t);if(c)return df(c)}}function FC(e,t){return!!e.allowImportingTsExtensions||t&&Il(t)}function xie(e,t,r,i,s,o){const c=th(r,i);c&&Gi(i,d.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2,t,e,s);const u=[],f=[],g=[],p={compilerOptions:r,host:i,traceEnabled:c,failedLookupLocations:u,affectingLocations:f,packageJsonInfoCache:o,features:0,conditions:[],requestContainingDirectory:void 0,reportDiagnostic:S=>void g.push(S),isConfigLookup:!1,candidateIsFromPackageJsonField:!1},y=Zve(4,e,s,p,!1,void 0,void 0);return Ove(y,!0,u,f,g,p.resultFromCache,void 0)}function df(e){return e!==void 0?{value:e}:void 0}function b1(e,t,...r){e.traceEnabled&&Gi(e.host,t,...r)}function qU(e){return e.host.useCaseSensitiveFileNames?typeof e.host.useCaseSensitiveFileNames=="boolean"?e.host.useCaseSensitiveFileNames:e.host.useCaseSensitiveFileNames():!0}var kie,n2e,HU,Am,GU,_9e=Nt({"src/compiler/moduleNameResolver.ts"(){"use strict";Ns(),n2e=Hn("node_modules","@types"),HU=(e=>(e[e.None=0]="None",e[e.Imports=2]="Imports",e[e.SelfName=4]="SelfName",e[e.Exports=8]="Exports",e[e.ExportsPatternTrailers=16]="ExportsPatternTrailers",e[e.AllFeatures=30]="AllFeatures",e[e.Node16Default=30]="Node16Default",e[e.NodeNextDefault=30]="NodeNextDefault",e[e.BundlerDefault=30]="BundlerDefault",e[e.EsmMode=32]="EsmMode",e))(HU||{}),Am="/node_modules/",GU="__"}});function rh(e,t){return e.body&&!e.body.parent&&(ga(e.body,e),$0(e.body,!1)),e.body?Cie(e.body,t):1}function Cie(e,t=new Map){const r=Oa(e);if(t.has(r))return t.get(r)||0;t.set(r,void 0);const i=f9e(e,t);return t.set(r,i),i}function f9e(e,t){switch(e.kind){case 264:case 265:return 0;case 266:if(Cv(e))return 2;break;case 272:case 271:if(!In(e,32))return 0;break;case 278:const r=e;if(!r.moduleSpecifier&&r.exportClause&&r.exportClause.kind===279){let i=0;for(const s of r.exportClause.elements){const o=p9e(s,t);if(o>i&&(i=o),i===1)return i}return i}break;case 268:{let i=0;return ds(e,s=>{const o=Cie(s,t);switch(o){case 0:return;case 2:i=2;return;case 1:return i=1,!0;default:E.assertNever(o)}}),i}case 267:return rh(e,t);case 80:if(e.flags&4096)return 0}return 1}function p9e(e,t){const r=e.propertyName||e.name;let i=e.parent;for(;i;){if(Ss(i)||Ld(i)||Ai(i)){const s=i.statements;let o;for(const c of s)if(gP(c,r)){c.parent||(ga(c,i),$0(c,!1));const u=Cie(c,t);if((o===void 0||u>o)&&(o=u),o===1)return o;c.kind===271&&(o=1)}if(o!==void 0)return o}i=i.parent}return 1}function GT(e){return E.attachFlowNodeDebugInfo(e),e}function Eie(e,t){var r,i;ko("beforeBind"),(r=Pu)==null||r.logStartBindFile(""+e.fileName),s2e(e,t),(i=Pu)==null||i.logStopBindFile(),ko("afterBind"),cf("Bind","beforeBind","afterBind")}function d9e(){var e,t,r,i,s,o,c,u,f,g,p,y,S,T,C,w,D,O,z,W,X,J,ie=!1,B=0,Y,ae,_e={flags:1},$={flags:1},H=U();return oe;function K(L,pe,...Ze){return sp(Or(L)||e,L,pe,...Ze)}function oe(L,pe){var Ze,At;e=L,t=pe,r=Da(t),J=Se(e,pe),ae=new Set,B=0,Y=Al.getSymbolConstructor(),E.attachFlowNodeDebugInfo(_e),E.attachFlowNodeDebugInfo($),e.locals||((Ze=Jr)==null||Ze.push(Jr.Phase.Bind,"bindSourceFile",{path:e.path},!0),qe(e),(At=Jr)==null||At.pop(),e.symbolCount=B,e.classifiableNames=ae,Ro()),e=void 0,t=void 0,r=void 0,i=void 0,s=void 0,o=void 0,c=void 0,u=void 0,f=void 0,g=!1,p=void 0,y=void 0,S=void 0,T=void 0,C=void 0,w=void 0,D=void 0,z=void 0,W=!1,ie=!1,X=0}function Se(L,pe){return fp(pe,"alwaysStrict")&&!L.isDeclarationFile?!0:!!L.externalModuleIndicator}function se(L,pe){return B++,new Y(L,pe)}function Z(L,pe,Ze){L.flags|=Ze,pe.symbol=L,L.declarations=Bg(L.declarations,pe),Ze&1955&&!L.exports&&(L.exports=zs()),Ze&6240&&!L.members&&(L.members=zs()),L.constEnumOnlyModule&&L.flags&304&&(L.constEnumOnlyModule=!1),Ze&111551&&r8(L,pe)}function ve(L){if(L.kind===277)return L.isExportEquals?"export=":"default";const pe=as(L);if(pe){if(ru(L)){const Ze=cp(pe);return Dd(L)?"__global":`"${Ze}"`}if(pe.kind===167){const Ze=pe.expression;if(_f(Ze))return zo(Ze.text);if(c5(Ze))return Hs(Ze.operator)+Ze.operand.text;E.fail("Only computed properties with literal names have declaration names")}if(Ti(pe)){const Ze=wl(L);if(!Ze)return;const At=Ze.symbol;return f8(At,pe.escapedText)}return sd(pe)?TT(pe):wd(pe)?K4(pe):void 0}switch(L.kind){case 176:return"__constructor";case 184:case 179:case 330:return"__call";case 185:case 180:return"__new";case 181:return"__index";case 278:return"__export";case 312:return"export=";case 226:if(ac(L)===2)return"export=";E.fail("Unknown binary declaration kind");break;case 324:return Bk(L)?"__new":"__call";case 169:return E.assert(L.parent.kind===324,"Impossible parameter parent kind",()=>`parent is: ${E.formatSyntaxKind(L.parent.kind)}, expected JSDocFunctionType`),"arg"+L.parent.parameters.indexOf(L)}}function Te(L){return Au(L)?eo(L.name):bi(E.checkDefined(ve(L)))}function Me(L,pe,Ze,At,Mr,Rn,jn){E.assert(jn||!V0(Ze));const Oi=In(Ze,2048)||vu(Ze)&&Ze.name.escapedText==="default",sa=jn?"__computed":Oi&&pe?"default":ve(Ze);let aa;if(sa===void 0)aa=se(0,"__missing");else if(aa=L.get(sa),At&2885600&&ae.add(sa),!aa)L.set(sa,aa=se(0,sa)),Rn&&(aa.isReplaceableByMethod=!0);else{if(Rn&&!aa.isReplaceableByMethod)return aa;if(aa.flags&Mr){if(aa.isReplaceableByMethod)L.set(sa,aa=se(0,sa));else if(!(At&3&&aa.flags&67108864)){Au(Ze)&&ga(Ze.name,Ze);let Xo=aa.flags&2?d.Cannot_redeclare_block_scoped_variable_0:d.Duplicate_identifier_0,Xl=!0;(aa.flags&384||At&384)&&(Xo=d.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations,Xl=!1);let ll=!1;Ir(aa.declarations)&&(Oi||aa.declarations&&aa.declarations.length&&Ze.kind===277&&!Ze.isExportEquals)&&(Xo=d.A_module_cannot_have_multiple_default_exports,Xl=!1,ll=!0);const kf=[];Jp(Ze)&&sc(Ze.type)&&In(Ze,32)&&aa.flags&2887656&&kf.push(K(Ze,d.Did_you_mean_0,`export type { ${bi(Ze.name.escapedText)} }`));const _a=as(Ze)||Ze;Zt(aa.declarations,(Cf,Sg)=>{const Om=as(Cf)||Cf,ki=Xl?K(Om,Xo,Te(Cf)):K(Om,Xo);e.bindDiagnostics.push(ll?ua(ki,K(_a,Sg===0?d.Another_export_default_is_here:d.and_here)):ki),ll&&kf.push(K(Om,d.The_first_export_default_is_here))});const vp=Xl?K(_a,Xo,Te(Ze)):K(_a,Xo);e.bindDiagnostics.push(ua(vp,...kf)),aa=se(0,sa)}}}return Z(aa,Ze,At),aa.parent?E.assert(aa.parent===pe,"Existing symbol parent should match new one"):aa.parent=pe,aa}function ke(L,pe,Ze){const At=!!(gv(L)&32)||he(L);if(pe&2097152)return L.kind===281||L.kind===271&&At?Me(s.symbol.exports,s.symbol,L,pe,Ze):(E.assertNode(s,hm),Me(s.locals,void 0,L,pe,Ze));if(op(L)&&E.assert(Hr(L)),!ru(L)&&(At||s.flags&128)){if(!hm(s)||!s.locals||In(L,2048)&&!ve(L))return Me(s.symbol.exports,s.symbol,L,pe,Ze);const Mr=pe&111551?1048576:0,Rn=Me(s.locals,void 0,L,Mr,Ze);return Rn.exportSymbol=Me(s.symbol.exports,s.symbol,L,pe,Ze),L.localSymbol=Rn,Rn}else return E.assertNode(s,hm),Me(s.locals,void 0,L,pe,Ze)}function he(L){if(L.parent&&vc(L)&&(L=L.parent),!op(L))return!1;if(!cw(L)&&L.fullName)return!0;const pe=as(L);return pe?!!(x8(pe.parent)&&nc(pe.parent)||hu(pe.parent)&&gv(pe.parent)&32):!1}function be(L,pe){const Ze=s,At=o,Mr=c;if(pe&1?(L.kind!==219&&(o=s),s=c=L,pe&32&&(s.locals=zs(),Ni(s))):pe&2&&(c=L,pe&32&&(c.locals=void 0)),pe&4){const Rn=p,jn=y,Oi=S,sa=T,aa=D,Xo=z,Xl=W,ll=pe&16&&!In(L,1024)&&!L.asteriskToken&&!!_b(L)||L.kind===175;ll||(p=GT({flags:2}),pe&144&&(p.node=L)),T=ll||L.kind===176||Hr(L)&&(L.kind===262||L.kind===218)?br():void 0,D=void 0,y=void 0,S=void 0,z=void 0,W=!1,Oe(L),L.flags&=-5633,!(p.flags&1)&&pe&8&&ip(L.body)&&(L.flags|=512,W&&(L.flags|=1024),L.endFlowNode=p),L.kind===312&&(L.flags|=X,L.endFlowNode=p),T&&(It(T,p),p=Qe(T),(L.kind===176||L.kind===175||Hr(L)&&(L.kind===262||L.kind===218))&&(L.returnFlowNode=p)),ll||(p=Rn),y=jn,S=Oi,T=sa,D=aa,z=Xo,W=Xl}else pe&64?(g=!1,Oe(L),E.assertNotNode(L,Ie),L.flags=g?L.flags|256:L.flags&-257):Oe(L);s=Ze,o=At,c=Mr}function lt(L){pt(L,pe=>pe.kind===262?qe(pe):void 0),pt(L,pe=>pe.kind!==262?qe(pe):void 0)}function pt(L,pe=qe){L!==void 0&&Zt(L,pe)}function me(L){ds(L,qe,pt)}function Oe(L){const pe=ie;if(ie=!1,Pt(L)){me(L),Tt(L),ie=pe;return}switch(L.kind>=243&&L.kind<=259&&!t.allowUnreachableCode&&(L.flowNode=p),L.kind){case 247:Di(L);break;case 246:$i(L);break;case 248:Qs(L);break;case 249:case 250:Ds(L);break;case 245:Ce(L);break;case 253:case 257:Ue(L);break;case 252:case 251:dt(L);break;case 258:fe(L);break;case 255:we(L);break;case 269:Be(L);break;case 296:gt(L);break;case 244:G(L);break;case 256:Dt(L);break;case 224:Qt(L);break;case 225:er(L);break;case 226:if(Jh(L)){ie=pe,or(L);return}H(L);break;case 220:j(L);break;case 227:ce(L);break;case 260:ue(L);break;case 211:case 212:On(L);break;case 213:Ln(L);break;case 235:gn(L);break;case 353:case 345:case 347:Fe(L);break;case 312:{lt(L.statements),qe(L.endOfFileToken);break}case 241:case 268:lt(L.statements);break;case 208:M(L);break;case 169:De(L);break;case 210:case 209:case 303:case 230:ie=pe;default:me(L);break}Tt(L),ie=pe}function Xe(L){switch(L.kind){case 80:case 81:case 110:case 211:case 212:return mt(L);case 213:return Je(L);case 217:case 235:return Xe(L.expression);case 226:return Bt(L);case 224:return L.operator===54&&Xe(L.operand);case 221:return Xe(L.expression)}return!1}function it(L){return oE(L)||(bn(L)||MT(L)||y_(L))&&it(L.expression)||Gr(L)&&L.operatorToken.kind===28&&it(L.right)||mo(L)&&(_f(L.argumentExpression)||oc(L.argumentExpression))&&it(L.expression)||sl(L)&&it(L.left)}function mt(L){return it(L)||gu(L)&&mt(L.expression)}function Je(L){if(L.arguments){for(const pe of L.arguments)if(mt(pe))return!0}return!!(L.expression.kind===211&&mt(L.expression.expression))}function ot(L,pe){return pC(L)&&Ht(L.expression)&&Ja(pe)}function Bt(L){switch(L.operatorToken.kind){case 64:case 76:case 77:case 78:return mt(L.left);case 35:case 36:case 37:case 38:return Ht(L.left)||Ht(L.right)||ot(L.right,L.left)||ot(L.left,L.right)||O4(L.right)&&Xe(L.left)||O4(L.left)&&Xe(L.right);case 104:return Ht(L.left);case 103:return Xe(L.right);case 28:return Xe(L.right)}return!1}function Ht(L){switch(L.kind){case 217:return Ht(L.expression);case 226:switch(L.operatorToken.kind){case 64:return Ht(L.left);case 28:return Ht(L.right)}}return mt(L)}function br(){return GT({flags:4,antecedents:void 0})}function zr(){return GT({flags:8,antecedents:void 0})}function ar(L,pe,Ze){return GT({flags:1024,target:L,antecedents:pe,antecedent:Ze})}function Jt(L){L.flags|=L.flags&2048?4096:2048}function It(L,pe){!(pe.flags&1)&&!_s(L.antecedents,pe)&&((L.antecedents||(L.antecedents=[])).push(pe),Jt(pe))}function Nn(L,pe,Ze){return pe.flags&1?pe:Ze?(Ze.kind===112&&L&64||Ze.kind===97&&L&32)&&!fI(Ze)&&!sJ(Ze.parent)?_e:Xe(Ze)?(Jt(pe),GT({flags:L,antecedent:pe,node:Ze})):pe:L&32?pe:_e}function Fi(L,pe,Ze,At){return Jt(L),GT({flags:128,antecedent:L,switchStatement:pe,clauseStart:Ze,clauseEnd:At})}function ei(L,pe,Ze){Jt(pe);const At=GT({flags:L,antecedent:pe,node:Ze});return D&&It(D,At),At}function zi(L,pe){return Jt(L),GT({flags:512,antecedent:L,node:pe})}function Qe(L){const pe=L.antecedents;return pe?pe.length===1?pe[0]:L:_e}function ur(L){const pe=L.parent;switch(pe.kind){case 245:case 247:case 246:return pe.expression===L;case 248:case 227:return pe.condition===L}return!1}function Dr(L){for(;;)if(L.kind===217)L=L.expression;else if(L.kind===224&&L.operator===54)L=L.operand;else return S8(L)}function Ft(L){return xz(Ha(L))}function yr(L){for(;y_(L.parent)||f1(L.parent)&&L.parent.operator===54;)L=L.parent;return!ur(L)&&!Dr(L.parent)&&!(gu(L.parent)&&L.parent.expression===L)}function Tr(L,pe,Ze,At){const Mr=C,Rn=w;C=Ze,w=At,L(pe),C=Mr,w=Rn}function Xr(L,pe,Ze){Tr(qe,L,pe,Ze),(!L||!Ft(L)&&!Dr(L)&&!(gu(L)&&A4(L)))&&(It(pe,Nn(32,p,L)),It(Ze,Nn(64,p,L)))}function Pi(L,pe,Ze){const At=y,Mr=S;y=pe,S=Ze,qe(L),y=At,S=Mr}function ji(L,pe){let Ze=z;for(;Ze&&L.parent.kind===256;)Ze.continueTarget=pe,Ze=Ze.next,L=L.parent;return pe}function Di(L){const pe=ji(L,zr()),Ze=br(),At=br();It(pe,p),p=pe,Xr(L.expression,Ze,At),p=Qe(Ze),Pi(L.statement,At,pe),It(pe,p),p=Qe(At)}function $i(L){const pe=zr(),Ze=ji(L,br()),At=br();It(pe,p),p=pe,Pi(L.statement,At,Ze),It(Ze,p),p=Qe(Ze),Xr(L.expression,pe,At),p=Qe(At)}function Qs(L){const pe=ji(L,zr()),Ze=br(),At=br();qe(L.initializer),It(pe,p),p=pe,Xr(L.condition,Ze,At),p=Qe(Ze),Pi(L.statement,At,pe),qe(L.incrementor),It(pe,p),p=Qe(At)}function Ds(L){const pe=ji(L,zr()),Ze=br();qe(L.expression),It(pe,p),p=pe,L.kind===250&&qe(L.awaitModifier),It(Ze,p),qe(L.initializer),L.initializer.kind!==261&&st(L.initializer),Pi(L.statement,Ze,pe),It(pe,p),p=Qe(Ze)}function Ce(L){const pe=br(),Ze=br(),At=br();Xr(L.expression,pe,Ze),p=Qe(pe),qe(L.thenStatement),It(At,p),p=Qe(Ze),qe(L.elseStatement),It(At,p),p=Qe(At)}function Ue(L){qe(L.expression),L.kind===253&&(W=!0,T&&It(T,p)),p=_e}function rt(L){for(let pe=z;pe;pe=pe.next)if(pe.name===L)return pe}function ft(L,pe,Ze){const At=L.kind===252?pe:Ze;At&&(It(At,p),p=_e)}function dt(L){if(qe(L.label),L.label){const pe=rt(L.label.escapedText);pe&&(pe.referenced=!0,ft(L,pe.breakTarget,pe.continueTarget))}else ft(L,y,S)}function fe(L){const pe=T,Ze=D,At=br(),Mr=br();let Rn=br();if(L.finallyBlock&&(T=Mr),It(Rn,p),D=Rn,qe(L.tryBlock),It(At,p),L.catchClause&&(p=Qe(Rn),Rn=br(),It(Rn,p),D=Rn,qe(L.catchClause),It(At,p)),T=pe,D=Ze,L.finallyBlock){const jn=br();jn.antecedents=Xi(Xi(At.antecedents,Rn.antecedents),Mr.antecedents),p=jn,qe(L.finallyBlock),p.flags&1?p=_e:(T&&Mr.antecedents&&It(T,ar(jn,Mr.antecedents,p)),D&&Rn.antecedents&&It(D,ar(jn,Rn.antecedents,p)),p=At.antecedents?ar(jn,At.antecedents,p):_e)}else p=Qe(At)}function we(L){const pe=br();qe(L.expression);const Ze=y,At=O;y=pe,O=p,qe(L.caseBlock),It(pe,p);const Mr=Zt(L.caseBlock.clauses,Rn=>Rn.kind===297);L.possiblyExhaustive=!Mr&&!pe.antecedents,Mr||It(pe,Fi(O,L,0,0)),y=Ze,O=At,p=Qe(pe)}function Be(L){const pe=L.clauses,Ze=L.parent.expression.kind===112||Xe(L.parent.expression);let At=_e;for(let Mr=0;Mrqc(Ze)||cc(Ze))}function ia(L){L.flags&33554432&&!_i(L)?L.flags|=128:L.flags&=-129}function Is(L){if(ia(L),ru(L))if(In(L,32)&&vo(L,d.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible),NJ(L))Cr(L);else{let pe;if(L.name.kind===11){const{text:At}=L.name;pe=Kk(At),pe===void 0&&vo(L.name,d.Pattern_0_can_have_at_most_one_Asterisk_character,At)}const Ze=Cn(L,512,110735);e.patternAmbientModules=lr(e.patternAmbientModules,pe&&!ns(pe)?{pattern:pe,symbol:Ze}:void 0)}else{const pe=Cr(L);if(pe!==0){const{symbol:Ze}=L;Ze.constEnumOnlyModule=!(Ze.flags&304)&&pe===2&&Ze.constEnumOnlyModule!==!1}}}function Cr(L){const pe=rh(L),Ze=pe!==0;return Cn(L,Ze?512:1024,Ze?110735:0),pe}function Tc(L){const pe=se(131072,ve(L));Z(pe,L,131072);const Ze=se(2048,"__type");Z(Ze,L,2048),Ze.members=zs(),Ze.members.set(pe.escapedName,pe)}function os(L){return Vo(L,4096,"__object")}function Ga(L){return Vo(L,4096,"__jsxAttributes")}function rc(L,pe,Ze){return Cn(L,pe,Ze)}function Vo(L,pe,Ze){const At=se(pe,Ze);return pe&106508&&(At.parent=s.symbol),Z(At,L,pe),At}function cl(L,pe,Ze){switch(c.kind){case 267:ke(L,pe,Ze);break;case 312:if(H_(s)){ke(L,pe,Ze);break}default:E.assertNode(c,hm),c.locals||(c.locals=zs(),Ni(c)),Me(c.locals,void 0,L,pe,Ze)}}function Ro(){if(!f)return;const L=s,pe=u,Ze=c,At=i,Mr=p;for(const Rn of f){const jn=Rn.parent.parent;s=jJ(jn)||e,c=bm(jn)||e,p=GT({flags:2}),i=Rn,qe(Rn.typeExpression);const Oi=as(Rn);if((cw(Rn)||!Rn.fullName)&&Oi&&x8(Oi.parent)){const sa=nc(Oi.parent);if(sa){qo(e.symbol,Oi.parent,sa,!!Ar(Oi,Xo=>bn(Xo)&&Xo.name.escapedText==="prototype"),!1);const aa=s;switch(e8(Oi.parent)){case 1:case 2:H_(e)?s=e:s=void 0;break;case 4:s=Oi.parent.expression;break;case 3:s=Oi.parent.expression.name;break;case 5:s=Yv(e,Oi.parent.expression)?e:bn(Oi.parent.expression)?Oi.parent.expression.name:Oi.parent.expression;break;case 0:return E.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}s&&ke(Rn,524288,788968),s=aa}}else cw(Rn)||!Rn.fullName||Rn.fullName.kind===80?(i=Rn.parent,cl(Rn,524288,788968)):qe(Rn.fullName)}s=L,u=pe,c=Ze,i=At,p=Mr}function hs(L){if(!e.parseDiagnostics.length&&!(L.flags&33554432)&&!(L.flags&16777216)&&!ute(L)){const pe=Xy(L);if(pe===void 0)return;J&&pe>=119&&pe<=127?e.bindDiagnostics.push(K(L,Ws(L),eo(L))):pe===135?Nc(e)&&VI(L)?e.bindDiagnostics.push(K(L,d.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,eo(L))):L.flags&65536&&e.bindDiagnostics.push(K(L,d.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,eo(L))):pe===127&&L.flags&16384&&e.bindDiagnostics.push(K(L,d.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,eo(L)))}}function Ws(L){return wl(L)?d.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:e.externalModuleIndicator?d.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:d.Identifier_expected_0_is_a_reserved_word_in_strict_mode}function el(L){L.escapedText==="#constructor"&&(e.parseDiagnostics.length||e.bindDiagnostics.push(K(L,d.constructor_is_a_reserved_word,eo(L))))}function yo(L){J&&m_(L.left)&&Bh(L.operatorToken.kind)&&Fc(L,L.left)}function Us(L){J&&L.variableDeclaration&&Fc(L,L.variableDeclaration.name)}function Ic(L){if(J&&L.expression.kind===80){const pe=kv(e,L.expression);e.bindDiagnostics.push(xl(e,pe.start,pe.length,d.delete_cannot_be_called_on_an_identifier_in_strict_mode))}}function Hp(L){return Ie(L)&&(L.escapedText==="eval"||L.escapedText==="arguments")}function Fc(L,pe){if(pe&&pe.kind===80){const Ze=pe;if(Hp(Ze)){const At=kv(e,pe);e.bindDiagnostics.push(xl(e,At.start,At.length,$o(L),an(Ze)))}}}function $o(L){return wl(L)?d.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:e.externalModuleIndicator?d.Invalid_use_of_0_Modules_are_automatically_in_strict_mode:d.Invalid_use_of_0_in_strict_mode}function Ao(L){J&&Fc(L,L.name)}function rs(L){return wl(L)?d.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:e.externalModuleIndicator?d.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:d.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5}function qt(L){if(r<2&&c.kind!==312&&c.kind!==267&&!yk(c)){const pe=kv(e,L);e.bindDiagnostics.push(xl(e,pe.start,pe.length,rs(L)))}}function No(L){J&&Fc(L,L.operand)}function $c(L){J&&(L.operator===46||L.operator===47)&&Fc(L,L.operand)}function ju(L){J&&vo(L,d.with_statements_are_not_allowed_in_strict_mode)}function u_(L){J&&Da(t)>=2&&(pee(L.statement)||ec(L.statement))&&vo(L.label,d.A_label_is_not_allowed_here)}function vo(L,pe,...Ze){const At=Sm(e,L.pos);e.bindDiagnostics.push(xl(e,At.start,At.length,pe,...Ze))}function xc(L,pe,Ze){A(L,pe,pe,Ze)}function A(L,pe,Ze,At){Pe(L,{pos:cb(pe,e),end:Ze.end},At)}function Pe(L,pe,Ze){const At=xl(e,pe.pos,pe.end-pe.pos,Ze);L?e.bindDiagnostics.push(At):e.bindSuggestionDiagnostics=lr(e.bindSuggestionDiagnostics,{...At,category:2})}function qe(L){if(!L)return;ga(L,i),Jr&&(L.tracingPath=e.path);const pe=J;if($r(L),L.kind>165){const Ze=i;i=L;const At=$U(L);At===0?Oe(L):be(L,At),i=Ze}else{const Ze=i;L.kind===1&&(i=L),Tt(L),i=Ze}J=pe}function Tt(L){if(q_(L))if(Hr(L))for(const pe of L.jsDoc)qe(pe);else for(const pe of L.jsDoc)ga(pe,L),$0(pe,!1)}function dr(L){if(!J)for(const pe of L){if(!Lp(pe))return;if(En(pe)){J=!0;return}}}function En(L){const pe=Tv(e,L.expression);return pe==='"use strict"'||pe==="'use strict'"}function $r(L){switch(L.kind){case 80:if(L.flags&4096){let jn=L.parent;for(;jn&&!op(jn);)jn=jn.parent;cl(jn,524288,788968);break}case 110:return p&&(ct(L)||i.kind===304)&&(L.flowNode=p),hs(L);case 166:p&&XI(L)&&(L.flowNode=p);break;case 236:case 108:L.flowNode=p;break;case 81:return el(L);case 211:case 212:const pe=L;p&&it(pe)&&(pe.flowNode=p),nte(pe)&&Fr(pe),Hr(pe)&&e.commonJsModuleIndicator&&ag(pe)&&!CO(c,"module")&&Me(e.locals,void 0,pe.expression,134217729,111550);break;case 226:switch(ac(L)){case 1:$u(L);break;case 2:xu(L);break;case 3:Fs(L.left,L);break;case 6:Wi(L);break;case 4:$l(L);break;case 5:const jn=L.left.expression;if(Hr(L)&&Ie(jn)){const Oi=CO(c,jn.escapedText);if(qI(Oi?.valueDeclaration)){$l(L);break}}hc(L);break;case 0:break;default:E.fail("Unknown binary expression special property assignment kind")}return yo(L);case 299:return Us(L);case 220:return Ic(L);case 225:return No(L);case 224:return $c(L);case 254:return ju(L);case 256:return u_(L);case 197:g=!0;return;case 182:break;case 168:return Ye(L);case 169:return bg(L);case 260:return ou(L);case 208:return L.flowNode=p,ou(L);case 172:case 171:return yn(L);case 303:case 304:return Qu(L,4,0);case 306:return Qu(L,8,900095);case 179:case 180:case 181:return Cn(L,131072,0);case 174:case 173:return Qu(L,8192|(L.questionToken?16777216:0),Mp(L)?0:103359);case 262:return L_(L);case 176:return Cn(L,16384,0);case 177:return Qu(L,32768,46015);case 178:return Qu(L,65536,78783);case 184:case 324:case 330:case 185:return Tc(L);case 187:case 329:case 200:return li(L);case 339:return vt(L);case 210:return os(L);case 218:case 219:return zf(L);case 213:switch(ac(L)){case 7:return uc(L);case 8:return hl(L);case 9:return Ps(L);case 0:break;default:return E.fail("Unknown call expression assignment declaration kind")}Hr(L)&&vg(L);break;case 231:case 263:return J=!0,Fm(L);case 264:return cl(L,64,788872);case 265:return cl(L,524288,788968);case 266:return n0(L);case 267:return Is(L);case 292:return Ga(L);case 291:return rc(L,4,0);case 271:case 274:case 276:case 281:return Cn(L,2097152,2097152);case 270:return tl(L);case 273:return rl(L);case 278:return no(L);case 277:return lc(L);case 312:return dr(L.statements),Tn();case 241:if(!yk(L.parent))return;case 268:return dr(L.statements);case 348:if(L.parent.kind===330)return bg(L);if(L.parent.kind!==329)break;case 355:const Mr=L,Rn=Mr.isBracketed||Mr.typeExpression&&Mr.typeExpression.type.kind===323?16777220:4;return Cn(Mr,Rn,0);case 353:case 345:case 347:return(f||(f=[])).push(L);case 346:return qe(L.typeExpression)}}function yn(L){const pe=n_(L),Ze=pe?98304:4,At=pe?13247:0;return Qu(L,Ze|(L.questionToken?16777216:0),At)}function li(L){return Vo(L,2048,"__type")}function Tn(){if(ia(e),Nc(e))va();else if(ap(e)){va();const L=e.symbol;Me(e.symbol.exports,e.symbol,e,4,67108863),e.symbol=L}}function va(){Vo(e,512,`"${Ou(e.fileName)}"`)}function lc(L){if(!s.symbol||!s.symbol.exports)Vo(L,111551,ve(L));else{const pe=zk(L)?2097152:4,Ze=Me(s.symbol.exports,s.symbol,L,pe,67108863);L.isExportEquals&&r8(Ze,L)}}function tl(L){ut(L.modifiers)&&e.bindDiagnostics.push(K(L,d.Modifiers_cannot_appear_here));const pe=Ai(L.parent)?Nc(L.parent)?L.parent.isDeclarationFile?void 0:d.Global_module_exports_may_only_appear_in_declaration_files:d.Global_module_exports_may_only_appear_in_module_files:d.Global_module_exports_may_only_appear_at_top_level;pe?e.bindDiagnostics.push(K(L,pe)):(e.symbol.globalExports=e.symbol.globalExports||zs(),Me(e.symbol.globalExports,e.symbol,L,2097152,2097152))}function no(L){!s.symbol||!s.symbol.exports?Vo(L,8388608,ve(L)):L.exportClause?Dm(L.exportClause)&&(ga(L.exportClause,L),Me(s.symbol.exports,s.symbol,L.exportClause,2097152,2097152)):Me(s.symbol.exports,s.symbol,L,8388608,0)}function rl(L){L.name&&Cn(L,2097152,2097152)}function Xa(L){return e.externalModuleIndicator&&e.externalModuleIndicator!==!0?!1:(e.commonJsModuleIndicator||(e.commonJsModuleIndicator=L,e.externalModuleIndicator||va()),!0)}function hl(L){if(!Xa(L))return;const pe=Jf(L.arguments[0],void 0,(Ze,At)=>(At&&Z(At,Ze,67110400),At));pe&&Me(pe.exports,pe,L,1048580,0)}function $u(L){if(!Xa(L))return;const pe=Jf(L.left.expression,void 0,(Ze,At)=>(At&&Z(At,Ze,67110400),At));if(pe){const At=u8(L.right)&&(fb(L.left.expression)||ag(L.left.expression))?2097152:1048580;ga(L.left,L),Me(pe.exports,pe,L.left,At,0)}}function xu(L){if(!Xa(L))return;const pe=YP(L.right);if(Dz(pe)||s===e&&Yv(e,pe))return;if(ma(pe)&&qi(pe.properties,Y_)){Zt(pe.properties,Bf);return}const Ze=zk(L)?2097152:1049092,At=Me(e.symbol.exports,e.symbol,L,Ze|67108864,0);r8(At,L)}function Bf(L){Me(e.symbol.exports,e.symbol,L,69206016,0)}function $l(L){if(E.assert(Hr(L)),Gr(L)&&bn(L.left)&&Ti(L.left.name)||bn(L)&&Ti(L.name))return;const Ze=i_(L,!1,!1);switch(Ze.kind){case 262:case 218:let At=Ze.symbol;if(Gr(Ze.parent)&&Ze.parent.operatorToken.kind===64){const jn=Ze.parent.left;wv(jn)&&H0(jn.expression)&&(At=Xu(jn.expression.expression,o))}At&&At.valueDeclaration&&(At.members=At.members||zs(),V0(L)?ye(L,At,At.members):Me(At.members,At,L,67108868,0),Z(At,At.valueDeclaration,32));break;case 176:case 172:case 174:case 177:case 178:case 175:const Mr=Ze.parent,Rn=Ls(Ze)?Mr.symbol.exports:Mr.symbol.members;V0(L)?ye(L,Mr.symbol,Rn):Me(Rn,Mr.symbol,L,67108868,0,!0);break;case 312:if(V0(L))break;Ze.commonJsModuleIndicator?Me(Ze.symbol.exports,Ze.symbol,L,1048580,0):Cn(L,1,111550);break;case 267:break;default:E.failBadSyntaxKind(Ze)}}function ye(L,pe,Ze){Me(Ze,pe,L,4,0,!0,!0),St(L,pe)}function St(L,pe){pe&&(pe.assignmentDeclarationMembers||(pe.assignmentDeclarationMembers=new Map)).set(Oa(L),L)}function Fr(L){L.expression.kind===110?$l(L):wv(L)&&L.parent.parent.kind===312&&(H0(L.expression)?Fs(L,L.parent):jo(L))}function Wi(L){ga(L.left,L),ga(L.right,L),Oc(L.left.expression,L.left,!1,!0)}function Ps(L){const pe=Xu(L.arguments[0].expression);pe&&pe.valueDeclaration&&Z(pe,pe.valueDeclaration,32),kc(L,pe,!0)}function Fs(L,pe){const Ze=L.expression,At=Ze.expression;ga(At,Ze),ga(Ze,L),ga(L,pe),Oc(At,L,!0,!0)}function uc(L){let pe=Xu(L.arguments[0]);const Ze=L.parent.parent.kind===312;pe=qo(pe,L.arguments[0],Ze,!1,!1),kc(L,pe,!1)}function hc(L){var pe;const Ze=Xu(L.left.expression,s)||Xu(L.left.expression,c);if(!Hr(L)&&!ite(Ze))return;const At=dE(L.left);if(!(Ie(At)&&((pe=CO(s,At.escapedText))==null?void 0:pe.flags)&2097152))if(ga(L.left,L),ga(L.right,L),Ie(L.left.expression)&&s===e&&Yv(e,L.left.expression))$u(L);else if(V0(L)){Vo(L,67108868,"__computed");const Mr=qo(Ze,L.left.expression,nc(L.left),!1,!1);St(L,Mr)}else jo(Ms(L.left,db))}function jo(L){E.assert(!Ie(L)),ga(L.expression,L),Oc(L.expression,L,!1,!1)}function qo(L,pe,Ze,At,Mr){return L?.flags&2097152||(Ze&&!At&&(L=Jf(pe,L,(Oi,sa,aa)=>{if(sa)return Z(sa,Oi,67110400),sa;{const Xo=aa?aa.exports:e.jsGlobalAugmentations||(e.jsGlobalAugmentations=zs());return Me(Xo,aa,Oi,67110400,110735)}})),Mr&&L&&L.valueDeclaration&&Z(L,L.valueDeclaration,32)),L}function kc(L,pe,Ze){if(!pe||!yp(pe))return;const At=Ze?pe.members||(pe.members=zs()):pe.exports||(pe.exports=zs());let Mr=0,Rn=0;po(aT(L))?(Mr=8192,Rn=103359):Rs(L)&&pb(L)&&(ut(L.arguments[2].properties,jn=>{const Oi=as(jn);return!!Oi&&Ie(Oi)&&an(Oi)==="set"})&&(Mr|=65540,Rn|=78783),ut(L.arguments[2].properties,jn=>{const Oi=as(jn);return!!Oi&&Ie(Oi)&&an(Oi)==="get"})&&(Mr|=32772,Rn|=46015)),Mr===0&&(Mr=4,Rn=0),Me(At,pe,L,Mr|67108864,Rn&-67108865)}function nc(L){return Gr(L.parent)?xf(L.parent).parent.kind===312:L.parent.parent.kind===312}function Oc(L,pe,Ze,At){let Mr=Xu(L,s)||Xu(L,c);const Rn=nc(pe);Mr=qo(Mr,pe.expression,Rn,Ze,At),kc(pe,Mr,Ze)}function yp(L){if(L.flags&1072)return!0;const pe=L.valueDeclaration;if(pe&&Rs(pe))return!!aT(pe);let Ze=pe?Ei(pe)?pe.initializer:Gr(pe)?pe.right:bn(pe)&&Gr(pe.parent)?pe.parent.right:void 0:void 0;if(Ze=Ze&&YP(Ze),Ze){const At=H0(Ei(pe)?pe.name:Gr(pe)?pe.left:pe);return!!e1(Gr(Ze)&&(Ze.operatorToken.kind===57||Ze.operatorToken.kind===61)?Ze.right:Ze,At)}return!1}function xf(L){for(;Gr(L.parent);)L=L.parent;return L.parent}function Xu(L,pe=s){if(Ie(L))return CO(pe,L.escapedText);{const Ze=Xu(L.expression);return Ze&&Ze.exports&&Ze.exports.get(Gg(L))}}function Jf(L,pe,Ze){if(Yv(e,L))return e.symbol;if(Ie(L))return Ze(L,Xu(L),pe);{const At=Jf(L.expression,pe,Ze),Mr=KP(L);return Ti(Mr)&&E.fail("unexpected PrivateIdentifier"),Ze(Mr,At&&At.exports&&At.exports.get(Gg(L)),At)}}function vg(L){!e.commonJsModuleIndicator&&g_(L,!1)&&Xa(L)}function Fm(L){if(L.kind===263)cl(L,32,899503);else{const Mr=L.name?L.name.escapedText:"__class";Vo(L,32,Mr),L.name&&ae.add(L.name.escapedText)}const{symbol:pe}=L,Ze=se(4194308,"prototype"),At=pe.exports.get(Ze.escapedName);At&&(L.name&&ga(L.name,L),e.bindDiagnostics.push(K(At.declarations[0],d.Duplicate_identifier_0,pc(Ze)))),pe.exports.set(Ze.escapedName,Ze),Ze.parent=pe}function n0(L){return Cv(L)?cl(L,128,899967):cl(L,256,899327)}function ou(L){if(J&&Fc(L,L.name),!As(L.name)){const pe=L.kind===260?L:L.parent.parent;Hr(L)&&N5(t)&&Pv(pe)&&!Qy(L)&&!(gv(L)&32)?Cn(L,2097152,2097152):PJ(L)?cl(L,2,111551):Iv(L)?Cn(L,1,111551):Cn(L,1,111550)}}function bg(L){if(!(L.kind===348&&s.kind!==330)&&(J&&!(L.flags&33554432)&&Fc(L,L.name),As(L.name)?Vo(L,1,"__"+L.parent.parameters.indexOf(L)):Cn(L,1,111551),E_(L,L.parent))){const pe=L.parent.parent;Me(pe.symbol.members,pe.symbol,L,4|(L.questionToken?16777216:0),0)}}function L_(L){!e.isDeclarationFile&&!(L.flags&33554432)&&Z4(L)&&(X|=4096),Ao(L),J?(qt(L),cl(L,16,110991)):Cn(L,16,110991)}function zf(L){!e.isDeclarationFile&&!(L.flags&33554432)&&Z4(L)&&(X|=4096),p&&(L.flowNode=p),Ao(L);const pe=L.name?L.name.escapedText:"__function";return Vo(L,16,pe)}function Qu(L,pe,Ze){return!e.isDeclarationFile&&!(L.flags&33554432)&&Z4(L)&&(X|=4096),p&&JI(L)&&(L.flowNode=p),V0(L)?Vo(L,pe,"__computed"):Cn(L,pe,Ze)}function Q(L){const pe=Ar(L,Ze=>Ze.parent&&fC(Ze.parent)&&Ze.parent.extendsType===Ze);return pe&&pe.parent}function Ye(L){if(od(L.parent)){const pe=i5(L.parent);pe?(E.assertNode(pe,hm),pe.locals??(pe.locals=zs()),Me(pe.locals,void 0,L,262144,526824)):Cn(L,262144,526824)}else if(L.parent.kind===195){const pe=Q(L.parent);pe?(E.assertNode(pe,hm),pe.locals??(pe.locals=zs()),Me(pe.locals,void 0,L,262144,526824)):Vo(L,262144,ve(L))}else Cn(L,262144,526824)}function Et(L){const pe=rh(L);return pe===1||pe===2&&Sb(t)}function Pt(L){if(!(p.flags&1))return!1;if(p===_e&&(wP(L)&&L.kind!==242||L.kind===263||L.kind===267&&Et(L))&&(p=$,!t.allowUnreachableCode)){const Ze=rre(t)&&!(L.flags&33554432)&&(!ec(L)||!!(Fh(L.declarationList)&7)||L.declarationList.declarations.some(At=>!!At.initializer));m9e(L,(At,Mr)=>A(Ze,At,Mr,d.Unreachable_code_detected))}return!0}}function m9e(e,t){if(Ci(e)&&i2e(e)&&Ss(e.parent)){const{statements:r}=e.parent,i=Hz(r,e);pj(i,i2e,(s,o)=>t(i[s],i[o-1]))}else t(e,e)}function i2e(e){return!Zc(e)&&!g9e(e)&&!p1(e)&&!(ec(e)&&!(Fh(e)&7)&&e.declarationList.declarations.some(t=>!t.initializer))}function g9e(e){switch(e.kind){case 264:case 265:return!0;case 267:return rh(e)!==1;case 266:return In(e,4096);default:return!1}}function Yv(e,t){let r=0;const i=C7();for(i.enqueue(t);!i.isEmpty()&&r<100;){if(r++,t=i.dequeue(),fb(t)||ag(t))return!0;if(Ie(t)){const s=CO(e,t.escapedText);if(s&&s.valueDeclaration&&Ei(s.valueDeclaration)&&s.valueDeclaration.initializer){const o=s.valueDeclaration.initializer;i.enqueue(o),sl(o,!0)&&(i.enqueue(o.left),i.enqueue(o.right))}}}return!1}function $U(e){switch(e.kind){case 231:case 263:case 266:case 210:case 187:case 329:case 292:return 1;case 264:return 65;case 267:case 265:case 200:case 181:return 33;case 312:return 37;case 177:case 178:case 174:if(JI(e))return 173;case 176:case 262:case 173:case 179:case 330:case 324:case 184:case 180:case 185:case 175:return 45;case 218:case 219:return 61;case 268:return 4;case 172:return e.initializer?4:0;case 299:case 248:case 249:case 250:case 269:return 34;case 241:return ks(e.parent)||Go(e.parent)?0:34}return 0}function CO(e,t){var r,i,s,o;const c=(i=(r=Jn(e,hm))==null?void 0:r.locals)==null?void 0:i.get(t);if(c)return c.exportSymbol??c;if(Ai(e)&&e.jsGlobalAugmentations&&e.jsGlobalAugmentations.has(t))return e.jsGlobalAugmentations.get(t);if(Ed(e))return(o=(s=e.symbol)==null?void 0:s.exports)==null?void 0:o.get(t)}var XU,QU,s2e,h9e=Nt({"src/compiler/binder.ts"(){"use strict";Ns(),Z2(),XU=(e=>(e[e.NonInstantiated=0]="NonInstantiated",e[e.Instantiated=1]="Instantiated",e[e.ConstEnumOnly=2]="ConstEnumOnly",e))(XU||{}),QU=(e=>(e[e.None=0]="None",e[e.IsContainer=1]="IsContainer",e[e.IsBlockScopedContainer=2]="IsBlockScopedContainer",e[e.IsControlFlowContainer=4]="IsControlFlowContainer",e[e.IsFunctionLike=8]="IsFunctionLike",e[e.IsFunctionExpression=16]="IsFunctionExpression",e[e.HasLocals=32]="HasLocals",e[e.IsInterface=64]="IsInterface",e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor",e))(QU||{}),s2e=d9e()}});function Die(e,t,r,i,s,o,c,u,f,g){return p;function p(y=()=>!0){const S=[],T=[];return{walkType:ae=>{try{return C(ae),{visitedTypes:GS(S),visitedSymbols:GS(T)}}finally{Ym(S),Ym(T)}},walkSymbol:ae=>{try{return Y(ae),{visitedTypes:GS(S),visitedSymbols:GS(T)}}finally{Ym(S),Ym(T)}}};function C(ae){if(!(!ae||S[ae.id]||(S[ae.id]=ae,Y(ae.symbol)))){if(ae.flags&524288){const $=ae,H=$.objectFlags;H&4&&w(ae),H&32&&X(ae),H&3&&ie(ae),H&24&&B($)}ae.flags&262144&&D(ae),ae.flags&3145728&&O(ae),ae.flags&4194304&&z(ae),ae.flags&8388608&&W(ae)}}function w(ae){C(ae.target),Zt(g(ae),C)}function D(ae){C(u(ae))}function O(ae){Zt(ae.types,C)}function z(ae){C(ae.type)}function W(ae){C(ae.objectType),C(ae.indexType),C(ae.constraint)}function X(ae){C(ae.typeParameter),C(ae.constraintType),C(ae.templateType),C(ae.modifiersType)}function J(ae){const _e=t(ae);_e&&C(_e.type),Zt(ae.typeParameters,C);for(const $ of ae.parameters)Y($);C(e(ae)),C(r(ae))}function ie(ae){B(ae),Zt(ae.typeParameters,C),Zt(i(ae),C),C(ae.thisType)}function B(ae){const _e=s(ae);for(const $ of _e.indexInfos)C($.keyType),C($.type);for(const $ of _e.callSignatures)J($);for(const $ of _e.constructSignatures)J($);for(const $ of _e.properties)Y($)}function Y(ae){if(!ae)return!1;const _e=Xs(ae);if(T[_e])return!1;if(T[_e]=ae,!y(ae))return!0;const $=o(ae);return C($),ae.exports&&ae.exports.forEach(Y),Zt(ae.declarations,H=>{if(H.type&&H.type.kind===186){const K=H.type,oe=c(f(K.exprName));Y(oe)}}),!1}}}var y9e=Nt({"src/compiler/symbolWalker.ts"(){"use strict";Ns()}});function YU({importModuleSpecifierPreference:e,importModuleSpecifierEnding:t},r,i,s){const o=c();return{relativePreference:s!==void 0?Tl(s)?0:1:e==="relative"?0:e==="non-relative"?1:e==="project-relative"?3:2,getAllowedEndingsInPreferredOrder:u=>{if((u??i.impliedNodeFormat)===99)return FC(r,i.fileName)?[3,2]:[2];if(Vl(r)===1)return o===2?[2,1]:[1,2];const f=FC(r,i.fileName);switch(o){case 2:return f?[2,3,0,1]:[2,0,1];case 3:return[3,0,2,1];case 1:return f?[1,0,3,2]:[1,0,2];case 0:return f?[0,1,3,2]:[0,1,2];default:E.assertNever(o)}}};function c(){if(s!==void 0){if(jv(s))return 2;if(fc(s,"/index"))return 1}return Vz(t,i.impliedNodeFormat,r,i)}}function v9e(e,t,r,i,s,o,c={}){const u=a2e(e,t,r,i,s,YU({},e,t,o),{},c);if(u!==o)return u}function EO(e,t,r,i,s,o={}){return a2e(e,t,r,i,s,YU({},e,t),{},o)}function b9e(e,t,r,i,s,o={}){const c=Pie(t.path,i),u=d2e(t.path,r,i,s,o);return ic(u,f=>wie(f,c,t,i,e,s,!0,o.overrideImportMode))}function a2e(e,t,r,i,s,o,c,u={}){const f=Pie(r,s),g=d2e(r,i,s,c,u);return ic(g,p=>wie(p,f,t,s,e,c,void 0,u.overrideImportMode))||u2e(i,f,e,s,u.overrideImportMode||t.impliedNodeFormat,o)}function S9e(e,t,r,i,s={}){return o2e(e,t,r,i,s)[0]}function o2e(e,t,r,i,s={}){var o;const c=PI(e);if(!c)return ze;const u=(o=r.getModuleSpecifierCache)==null?void 0:o.call(r),f=u?.get(t.path,c.path,i,s);return[f?.moduleSpecifiers,c,f?.modulePaths,u]}function c2e(e,t,r,i,s,o,c={}){return l2e(e,t,r,i,s,o,c,!1).moduleSpecifiers}function l2e(e,t,r,i,s,o,c={},u){let f=!1;const g=x9e(e,t);if(g)return{moduleSpecifiers:[g],computedWithoutCache:f};let[p,y,S,T]=o2e(e,i,s,o,c);if(p)return{moduleSpecifiers:p,computedWithoutCache:f};if(!y)return{moduleSpecifiers:ze,computedWithoutCache:f};f=!0,S||(S=m2e(i.path,y.originalFileName,s));const C=T9e(S,r,i,s,o,c,u);return T?.set(i.path,y.path,o,c,S,C),{moduleSpecifiers:C,computedWithoutCache:f}}function T9e(e,t,r,i,s,o={},c){const u=Pie(r.path,i),f=YU(s,t,r),g=Zt(e,w=>Zt(i.getFileIncludeReasons().get(fo(w.path,i.getCurrentDirectory(),u.getCanonicalFileName)),D=>{if(D.kind!==3||D.file!==r.path||r.impliedNodeFormat&&r.impliedNodeFormat!==zV(r,D.index))return;const O=c9(r,D.index).text;return f.relativePreference!==1||!U_(O)?O:void 0}));if(g)return[g];const p=ut(e,w=>w.isInNodeModules);let y,S,T,C;for(const w of e){const D=w.isInNodeModules?wie(w,u,r,i,t,s,void 0,o.overrideImportMode):void 0;if(y=lr(y,D),D&&w.isRedirect)return y;if(!D){const O=u2e(w.path,u,t,i,o.overrideImportMode||r.impliedNodeFormat,f,w.isRedirect);if(!O)continue;w.isRedirect?T=lr(T,O):zB(O)?S=lr(S,O):(c||!p||w.isInNodeModules)&&(C=lr(C,O))}}return S?.length?S:T?.length?T:y?.length?y:E.checkDefined(C)}function Pie(e,t){const r=tu(t.useCaseSensitiveFileNames?t.useCaseSensitiveFileNames():!0),i=qn(e);return{getCanonicalFileName:r,importingSourceFileName:e,sourceDirectory:i}}function u2e(e,t,r,i,s,{getAllowedEndingsInPreferredOrder:o,relativePreference:c},u){const{baseUrl:f,paths:g,rootDirs:p}=r;if(u&&!g)return;const{sourceDirectory:y,getCanonicalFileName:S}=t,T=o(s),C=p&&k9e(p,e,y,S,T,r)||Jw(dv(mm(y,e,S)),T,r);if(!f&&!g||c===0)return u?void 0:C;const w=is(p5(r,i)||f,i.getCurrentDirectory()),D=v2e(e,w,S);if(!D)return u?void 0:C;const O=g&&g2e(D,g,T,i,r);if(u)return O;const z=O===void 0&&f!==void 0?Jw(D,T,r):O;if(!z)return C;if(c===1&&!U_(z))return z;if(c===3&&!U_(z)){const W=r.configFilePath?fo(qn(r.configFilePath),i.getCurrentDirectory(),t.getCanonicalFileName):t.getCanonicalFileName(i.getCurrentDirectory()),X=fo(e,W,S),J=Qi(y,W),ie=Qi(X,W);if(J&&!ie||!J&&ie)return z;const B=f2e(i,qn(X));return f2e(i,y)!==B?z:C}return b2e(z)||DO(C)e.fileExists(Hn(r,"package.json"))?!0:void 0)}function p2e(e,t,r,i,s){var o;const c=jh(r),u=r.getCurrentDirectory(),f=r.isSourceOfProjectReferenceRedirect(t)?r.getProjectReferenceRedirect(t):void 0,g=fo(t,u,c),p=r.redirectTargetsMap.get(g)||ze,S=[...f?[f]:ze,t,...p].map(O=>is(O,u));let T=!qi(S,xE);if(!i){const O=Zt(S,z=>!(T&&xE(z))&&s(z,f===z));if(O)return O}const C=(o=r.getSymlinkCache)==null?void 0:o.call(r).getSymlinkedDirectoriesByRealpath(),w=is(t,u);return C&&kd(qn(w),O=>{const z=C.get(Sl(fo(O,u,c)));if(z)return UB(e,O,c)?!1:Zt(S,W=>{if(!UB(W,O,c))return;const X=mm(O,W,c);for(const J of z){const ie=I0(J,X),B=s(ie,W===f);if(T=!0,B)return B}})})||(i?Zt(S,O=>T&&xE(O)?void 0:s(O,O===f)):void 0)}function d2e(e,t,r,i,s={}){var o;const c=fo(t,r.getCurrentDirectory(),jh(r)),u=(o=r.getModuleSpecifierCache)==null?void 0:o.call(r);if(u){const g=u.get(e,c,i,s);if(g?.modulePaths)return g.modulePaths}const f=m2e(e,t,r);return u&&u.setModulePaths(e,c,i,s,f),f}function m2e(e,t,r){const i=jh(r),s=new Map;let o=!1;p2e(e,t,r,!0,(u,f)=>{const g=HT(u);s.set(u,{path:i(u),isRedirect:f,isInNodeModules:g}),o=o||g});const c=[];for(let u=qn(e);s.size!==0;){const f=Sl(u);let g;s.forEach(({path:y,isRedirect:S,isInNodeModules:T},C)=>{Qi(y,f)&&((g||(g=[])).push({path:C,isRedirect:S,isInNodeModules:T}),s.delete(C))}),g&&(g.length>1&&g.sort(_2e),c.push(...g));const p=qn(u);if(p===u)break;u=p}if(s.size){const u=fs(s.values());u.length>1&&u.sort(_2e),c.push(...u)}return c}function x9e(e,t){var r;const i=(r=e.declarations)==null?void 0:r.find(c=>AJ(c)&&(!xv(c)||!Tl(cp(c.name))));if(i)return i.name.text;const o=Ii(e.declarations,c=>{var u,f,g,p;if(!vc(c))return;const y=w(c);if(!((u=y?.parent)!=null&&u.parent&&Ld(y.parent)&&ru(y.parent.parent)&&Ai(y.parent.parent.parent)))return;const S=(p=(g=(f=y.parent.parent.symbol.exports)==null?void 0:f.get("export="))==null?void 0:g.valueDeclaration)==null?void 0:p.expression;if(!S)return;const T=t.getSymbolAtLocation(S);if(!T)return;if((T?.flags&2097152?t.getAliasedSymbol(T):T)===c.symbol)return y.parent.parent;function w(D){for(;D.flags&8;)D=D.parent;return D}})[0];if(o)return o.name.text}function g2e(e,t,r,i,s){for(const c in t)for(const u of t[c]){const f=qs(u),g=f.indexOf("*"),p=r.map(y=>({ending:y,value:Jw(e,[y],s)}));if(ug(f)&&p.push({ending:void 0,value:e}),g!==-1){const y=f.substring(0,g),S=f.substring(g+1);for(const{ending:T,value:C}of p)if(C.length>=y.length+S.length&&Qi(C,y)&&fc(C,S)&&o({ending:T,value:C})){const w=C.substring(y.length,C.length-S.length);if(!U_(w))return c.replace("*",w)}}else if(ut(p,y=>y.ending!==0&&f===y.value)||ut(p,y=>y.ending===0&&f===y.value&&o(y)))return c}function o({ending:c,value:u}){return c!==0||u===Jw(e,[c],s,i)}}function ZU(e,t,r,i,s,o,c=0){if(typeof s=="string"){const u=is(Hn(r,s),void 0),f=Tb(t)?Ou(t)+KU(t,e):void 0;switch(c){case 0:if(qy(t,u)===0||f&&qy(f,u)===0)return{moduleFileToTry:i};break;case 1:if(dm(u,t)){const S=mm(u,t,!1);return{moduleFileToTry:is(Hn(Hn(i,s),S),void 0)}}break;case 2:const g=u.indexOf("*"),p=u.slice(0,g),y=u.slice(g+1);if(Qi(t,p)&&fc(t,y)){const S=t.slice(p.length,t.length-y.length);return{moduleFileToTry:i.replace("*",S)}}if(f&&Qi(f,p)&&fc(f,y)){const S=f.slice(p.length,f.length-y.length);return{moduleFileToTry:i.replace("*",S)}}break}}else{if(Array.isArray(s))return Zt(s,u=>ZU(e,t,r,i,u,o));if(typeof s=="object"&&s!==null){if(xO(s))return Zt(Jg(s),u=>{const f=is(Hn(i,u),void 0),g=fc(u,"/")?1:u.includes("*")?2:0;return ZU(e,t,r,f,s[u],o,g)});for(const u of Jg(s))if(u==="default"||o.includes(u)||jw(o,u)){const f=s[u],g=ZU(e,t,r,i,f,o,c);if(g)return g}}}}function k9e(e,t,r,i,s,o){const c=h2e(t,e,i);if(c===void 0)return;const u=h2e(r,e,i),f=ta(u,p=>Yt(c,y=>dv(mm(p,y,i)))),g=xj(f,I8);if(g)return Jw(g,s,o)}function wie({path:e,isRedirect:t},{getCanonicalFileName:r,sourceDirectory:i},s,o,c,u,f,g){if(!o.fileExists||!o.readFile)return;const p=H5(e);if(!p)return;const S=YU(u,c,s).getAllowedEndingsInPreferredOrder();let T=e,C=!1;if(!f){let X=p.packageRootIndex,J;for(;;){const{moduleFileToTry:ie,packageRootPath:B,blockedByExports:Y,verbatimFromExports:ae}=W(X);if(Vl(c)!==1){if(Y)return;if(ae)return ie}if(B){T=B,C=!0;break}if(J||(J=ie),X=e.indexOf(Co,X+1),X===-1){T=Jw(J,S,c,o);break}}}if(t&&!C)return;const w=o.getGlobalTypingsCacheLocation&&o.getGlobalTypingsCacheLocation(),D=r(T.substring(0,p.topLevelNodeModulesIndex));if(!(Qi(i,D)||w&&Qi(r(w),D)))return;const O=T.substring(p.topLevelPackageNameIndex+1),z=i3(O);return Vl(c)===1&&z===O?void 0:z;function W(X){var J,ie;const B=e.substring(0,X),Y=Hn(B,"package.json");let ae=e,_e=!1;const $=(ie=(J=o.getPackageJsonInfoCache)==null?void 0:J.call(o))==null?void 0:ie.getPackageJsonInfo(Y);if(typeof $=="object"||$===void 0&&o.fileExists(Y)){const H=$?.contents.packageJsonContent||JSON.parse(o.readFile(Y)),K=g||s.impliedNodeFormat;if(Rz(c)){const se=B.substring(p.topLevelPackageNameIndex+1),Z=i3(se),ve=Xv(c,K),Te=H.exports?ZU(c,e,B,Z,H.exports,ve):void 0;if(Te)return{...Tb(Te.moduleFileToTry)?{moduleFileToTry:Ou(Te.moduleFileToTry)+KU(Te.moduleFileToTry,c)}:Te,verbatimFromExports:!0};if(H.exports)return{moduleFileToTry:e,blockedByExports:!0}}const oe=H.typesVersions?hO(H.typesVersions):void 0;if(oe){const se=e.slice(B.length+1),Z=g2e(se,oe.paths,S,o,c);Z===void 0?_e=!0:ae=Hn(B,Z)}const Se=H.typings||H.types||H.main||"index.js";if(ns(Se)&&!(_e&&qz(J5(oe.paths),Se))){const se=fo(Se,B,r),Z=r(ae);if(Ou(se)===Ou(Z))return{packageRootPath:B,moduleFileToTry:ae};if(H.type!=="module"&&!Jc(Z,U8)&&Qi(Z,se)&&qn(Z)===Vy(se)&&Ou(Pc(Z))==="index")return{packageRootPath:B,moduleFileToTry:ae}}}else{const H=r(ae.substring(p.packageRootIndex+1));if(H==="index.d.ts"||H==="index.js"||H==="index.ts"||H==="index.tsx")return{moduleFileToTry:ae,packageRootPath:B}}return{moduleFileToTry:ae}}}function C9e(e,t){if(!e.fileExists)return;const r=Np(hE({allowJs:!0},[{extension:"node",isMixedContent:!1},{extension:"json",isMixedContent:!1,scriptKind:6}]));for(const i of r){const s=t+i;if(e.fileExists(s))return s}}function h2e(e,t,r){return Ii(t,i=>{const s=v2e(e,i,r);return s!==void 0&&b2e(s)?void 0:s})}function Jw(e,t,r,i){if(Jc(e,[".json",".mjs",".cjs"]))return e;const s=Ou(e);if(e===s)return e;const o=t.indexOf(2),c=t.indexOf(3);if(Jc(e,[".mts",".cts"])&&c!==-1&&cg===0||g===1);return f!==-1&&fDO,forEachFileNameOfModule:()=>p2e,getModuleSpecifier:()=>EO,getModuleSpecifiers:()=>c2e,getModuleSpecifiersWithCacheInfo:()=>l2e,getNodeModulesPackageName:()=>b9e,tryGetJSExtensionForFile:()=>KU,tryGetModuleSpecifiersFromCache:()=>S9e,tryGetRealFileNameForNonJsDeclarationFileName:()=>y2e,updateModuleSpecifier:()=>v9e});var Nie=Nt({"src/compiler/_namespaces/ts.moduleSpecifiers.ts"(){"use strict";S2e()}});function E9e(){this.flags=0}function Oa(e){return e.id||(e.id=Oie,Oie++),e.id}function Xs(e){return e.id||(e.id=Fie,Fie++),e.id}function eV(e,t){const r=rh(e);return r===1||t&&r===2}function Iie(e){var t=[],r=n=>{t.push(n)},i,s=new Set,o,c,u=Al.getSymbolConstructor(),f=Al.getTypeConstructor(),g=Al.getSignatureConstructor(),p=0,y=0,S=0,T=0,C=0,w=0,D,O,z=!1,W=zs(),X=[1],J=e.getCompilerOptions(),ie=Da(J),B=Ul(J),Y=!!J.experimentalDecorators,ae=A8(J),_e=ire(J),$=vT(J),H=fp(J,"strictNullChecks"),K=fp(J,"strictFunctionTypes"),oe=fp(J,"strictBindCallApply"),Se=fp(J,"strictPropertyInitialization"),se=fp(J,"noImplicitAny"),Z=fp(J,"noImplicitThis"),ve=fp(J,"useUnknownInCatchVariables"),Te=!!J.keyofStringsOnly,Me=Te?1:0,ke=J.suppressExcessPropertyErrors?0:8192,he=J.exactOptionalPropertyTypes,be=Gat(),lt=Cut(),pt=yS(),me=zs(),Oe=Aa(4,"undefined");Oe.declarations=[];var Xe=Aa(1536,"globalThis",8);Xe.exports=me,Xe.declarations=[],me.set(Xe.escapedName,Xe);var it=Aa(4,"arguments"),mt=Aa(4,"require"),Je=J.verbatimModuleSyntax?"verbatimModuleSyntax":"isolatedModules",ot=!J.verbatimModuleSyntax||!!J.importsNotUsedAsValues,Bt,Ht,br=0,zr,ar=0;const Jt={getNodeCount:()=>Eu(e.getSourceFiles(),(n,a)=>n+a.nodeCount,0),getIdentifierCount:()=>Eu(e.getSourceFiles(),(n,a)=>n+a.identifierCount,0),getSymbolCount:()=>Eu(e.getSourceFiles(),(n,a)=>n+a.symbolCount,y),getTypeCount:()=>p,getInstantiationCount:()=>S,getRelationCacheSizes:()=>({assignable:R_.size,identity:K_.size,subtype:Lm.size,strictSubtype:Wf.size}),isUndefinedSymbol:n=>n===Oe,isArgumentsSymbol:n=>n===it,isUnknownSymbol:n=>n===dt,getMergedSymbol:Na,getDiagnostics:O7e,getGlobalDiagnostics:zlt,getRecursionIdentity:yY,getUnmatchedProperties:rme,getTypeOfSymbolAtLocation:(n,a)=>{const l=ss(a);return l?Bnt(n,l):st},getTypeOfSymbol:Br,getSymbolsOfParameterPropertyDeclaration:(n,a)=>{const l=ss(n,us);return l===void 0?E.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."):(E.assert(E_(l,l.parent)),x6(l,zo(a)))},getDeclaredTypeOfSymbol:bo,getPropertiesOfType:Wa,getPropertyOfType:(n,a)=>Gs(n,zo(a)),getPrivateIdentifierPropertyOfType:(n,a,l)=>{const _=ss(l);if(!_)return;const m=zo(a),h=$Y(m,_);return h?zme(n,h):void 0},getTypeOfPropertyOfType:(n,a)=>q(n,zo(a)),getIndexInfoOfType:(n,a)=>Og(n,a===0?Fe:vt),getIndexInfosOfType:zu,getIndexInfosOfIndexSymbol:Kpe,getSignaturesOfType:Ts,getIndexTypeOfType:(n,a)=>ev(n,a===0?Fe:vt),getIndexType:n=>$m(n),getBaseTypes:Qc,getBaseTypeOfLiteralType:bh,getWidenedType:nf,getTypeFromTypeNode:n=>{const a=ss(n,Si);return a?si(a):st},getParameterType:Sd,getParameterIdentifierInfoAtPosition:_at,getPromisedTypeOfPromise:l7,getAwaitedType:n=>zS(n),getReturnTypeOfSignature:Ma,isNullableType:IR,getNullableType:TY,getNonNullableType:Sh,getNonOptionalType:xY,getTypeArguments:uo,typeToTypeNode:pt.typeToTypeNode,indexInfoToIndexSignatureDeclaration:pt.indexInfoToIndexSignatureDeclaration,signatureToSignatureDeclaration:pt.signatureToSignatureDeclaration,symbolToEntityName:pt.symbolToEntityName,symbolToExpression:pt.symbolToExpression,symbolToNode:pt.symbolToNode,symbolToTypeParameterDeclarations:pt.symbolToTypeParameterDeclarations,symbolToParameterDeclaration:pt.symbolToParameterDeclaration,typeParameterToDeclaration:pt.typeParameterToDeclaration,getSymbolsInScope:(n,a)=>{const l=ss(n);return l?Wlt(l,a):[]},getSymbolAtLocation:n=>{const a=ss(n);return a?Yp(a,!0):void 0},getIndexInfosAtLocation:n=>{const a=ss(n);return a?Qlt(a):void 0},getShorthandAssignmentValueSymbol:n=>{const a=ss(n);return a?Ylt(a):void 0},getExportSpecifierLocalTargetSymbol:n=>{const a=ss(n,vu);return a?Zlt(a):void 0},getExportSymbolOfSymbol(n){return Na(n.exportSymbol||n)},getTypeAtLocation:n=>{const a=ss(n);return a?Zx(a):st},getTypeOfAssignmentPattern:n=>{const a=ss(n,L4);return a&&TZ(a)||st},getPropertySymbolOfDestructuringAssignment:n=>{const a=ss(n,Ie);return a?Klt(a):void 0},signatureToString:(n,a,l,_)=>Yd(n,ss(a),l,_),typeToString:(n,a,l)=>mr(n,ss(a),l),symbolToString:(n,a,l,_)=>ii(n,ss(a),l,_),typePredicateToString:(n,a,l)=>Jm(n,ss(a),l),writeSignature:(n,a,l,_,m)=>Yd(n,ss(a),l,_,m),writeType:(n,a,l,_)=>mr(n,ss(a),l,_),writeSymbol:(n,a,l,_,m)=>ii(n,ss(a),l,_,m),writeTypePredicate:(n,a,l,_)=>Jm(n,ss(a),l,_),getAugmentedPropertiesOfType:Uge,getRootSymbols:W7e,getSymbolOfExpando:rZ,getContextualType:(n,a)=>{const l=ss(n,ct);if(l)return a&4?Fi(l,()=>d_(l,a)):d_(l,a)},getContextualTypeForObjectLiteralElement:n=>{const a=ss(n,qg);return a?Dme(a,void 0):void 0},getContextualTypeForArgumentAtIndex:(n,a)=>{const l=ss(n,Sv);return l&&Eme(l,a)},getContextualTypeForJsxAttribute:n=>{const a=ss(n,bI);return a&&iAe(a,void 0)},isContextSensitive:Zf,getTypeOfPropertyOfContextualType:z2,getFullyQualifiedName:xp,getResolvedSignature:(n,a,l)=>ei(n,a,l,0),getCandidateSignaturesForStringLiteralCompletions:It,getResolvedSignatureForSignatureHelp:(n,a,l)=>Nn(n,()=>ei(n,a,l,16)),getExpandedParameters:cPe,hasEffectiveRestParameter:Xm,containsArgumentsReference:Ype,getConstantValue:n=>{const a=ss(n,G7e);return a?Vge(a):void 0},isValidPropertyAccess:(n,a)=>{const l=ss(n,iee);return!!l&&Sst(l,zo(a))},isValidPropertyAccessForCompletions:(n,a,l)=>{const _=ss(n,bn);return!!_&&OAe(_,a,l)},getSignatureFromDeclaration:n=>{const a=ss(n,ks);return a?Dp(a):void 0},isImplementationOfOverload:n=>{const a=ss(n,ks);return a?q7e(a):void 0},getImmediateAliasedSymbol:Ime,getAliasedSymbol:ul,getEmitResolver:Cl,getExportsOfModule:p0,getExportsAndPropertiesOfModule:rD,forEachExportAndPropertyOfModule:Nx,getSymbolWalker:Die(set,Yf,Ma,Qc,gd,Br,Qp,ku,$_,uo),getAmbientModules:d_t,getJsxIntrinsicTagNamesAt:est,isOptionalParameter:n=>{const a=ss(n,us);return a?ON(a):!1},tryGetMemberInModuleExports:(n,a)=>Ix(zo(n),a),tryGetMemberInModuleExportsAndProperties:(n,a)=>Fx(zo(n),a),tryFindAmbientModule:n=>zQ(n,!0),tryFindAmbientModuleWithoutAugmentations:n=>zQ(n,!1),getApparentType:e_,getUnionType:Mn,isTypeAssignableTo:ca,createAnonymousType:Qo,createSignature:Fg,createSymbol:Aa,createIndexInfo:Gm,getAnyType:()=>G,getStringType:()=>Fe,getStringLiteralType:p_,getNumberType:()=>vt,getNumberLiteralType:vd,getBigIntType:()=>Lt,createPromiseType:WR,createArrayType:uu,getElementTypeOfArrayType:Wde,getBooleanType:()=>On,getFalseType:n=>n?Wt:Lr,getTrueType:n=>n?Zr:gn,getVoidType:()=>Ni,getUndefinedType:()=>j,getNullType:()=>De,getESSymbolType:()=>Ln,getNeverType:()=>Cn,getOptionalType:()=>M,getPromiseType:()=>nR(!1),getPromiseLikeType:()=>XPe(!1),getAsyncIterableType:()=>{const n=YQ(!1);if(n!==rs)return n},isSymbolAccessible:pn,isArrayType:ep,isTupleType:pa,isArrayLikeType:x0,isEmptyAnonymousObjectType:vh,isTypeInvalidDueToUnionDiscriminant:JKe,getExactOptionalProperties:mrt,getAllPossiblePropertiesOfTypes:zKe,getSuggestedSymbolForNonexistentProperty:Vme,getSuggestionForNonexistentProperty:qme,getSuggestedSymbolForNonexistentJSXAttribute:IAe,getSuggestedSymbolForNonexistentSymbol:(n,a,l)=>Hme(n,zo(a),l),getSuggestionForNonexistentSymbol:(n,a,l)=>hst(n,zo(a),l),getSuggestedSymbolForNonexistentModule:QY,getSuggestionForNonexistentExport:yst,getSuggestedSymbolForNonexistentClassMember:NAe,getBaseConstraintOfType:Ku,getDefaultFromTypeParameter:n=>n&&n.flags&262144?ES(n):void 0,resolveName(n,a,l,_){return _c(a,zo(n),l,void 0,void 0,!1,_)},getJsxNamespace:n=>bi(O1(n)),getJsxFragmentFactory:n=>{const a=Hge(n);return a&&bi($_(a).escapedText)},getAccessibleSymbolChain:$1,getTypePredicateOfSignature:Yf,resolveExternalModuleName:n=>{const a=ss(n,ct);return a&&Zu(a,a,!0)},resolveExternalModuleSymbol:ef,tryGetThisTypeAt:(n,a,l)=>{const _=ss(n);return _&&Tme(_,a,l)},getTypeArgumentConstraint:n=>{const a=ss(n,Si);return a&&Cot(a)},getSuggestionDiagnostics:(n,a)=>{const l=ss(n,Ai)||E.fail("Could not determine parsed source file.");if(vE(l,J,e))return ze;let _;try{return i=a,zge(l),E.assert(!!(Wn(l).flags&1)),_=Dn(_,iS.getDiagnostics(l.fileName)),QNe(F7e(l),(m,h,x)=>{!Ck(m)&&!I7e(h,!!(m.flags&33554432))&&(_||(_=[])).push({...x,category:2})}),_||ze}finally{i=void 0}},runWithCancellationToken:(n,a)=>{try{return i=n,a(Jt)}finally{i=void 0}},getLocalTypeParametersOfClassOrInterfaceOrTypeAlias:cr,isDeclarationVisible:uh,isPropertyAccessible:$me,getTypeOnlyAliasDeclaration:qf,getMemberOverrideModifierStatus:nlt,isTypeParameterPossiblyReferenced:lR,typeHasCallOrConstructSignatures:xZ};function It(n,a){const l=new Set,_=[];Fi(a,()=>ei(n,_,void 0,0));for(const m of _)l.add(m);_.length=0,Nn(a,()=>ei(n,_,void 0,0));for(const m of _)l.add(m);return fs(l)}function Nn(n,a){if(n=Ar(n,mJ),n){const l=[],_=[];for(;n;){const h=Wn(n);if(l.push([h,h.resolvedSignature]),h.resolvedSignature=void 0,Jv(n)){const x=yi(cn(n)),N=x.type;_.push([x,N]),x.type=void 0}n=Ar(n.parent,mJ)}const m=a();for(const[h,x]of l)h.resolvedSignature=x;for(const[h,x]of _)h.type=x;return m}return a()}function Fi(n,a){const l=Ar(n,Sv);if(l){let m=n;do Wn(m).skipDirectInference=!0,m=m.parent;while(m&&m!==l)}z=!0;const _=Nn(n,a);if(z=!1,l){let m=n;do Wn(m).skipDirectInference=void 0,m=m.parent;while(m&&m!==l)}return _}function ei(n,a,l,_){const m=ss(n,Sv);Bt=l;const h=m?e4(m,a,_):void 0;return Bt=void 0,h}var zi=new Map,Qe=new Map,ur=new Map,Dr=new Map,Ft=new Map,yr=new Map,Tr=new Map,Xr=new Map,Pi=new Map,ji=new Map,Di=new Map,$i=new Map,Qs=new Map,Ds=new Map,Ce=new Map,Ue=[],rt=new Map,ft=new Set,dt=Aa(4,"unknown"),fe=Aa(0,"__resolving__"),we=new Map,Be=new Map,gt=new Set,G=Lc(1,"any"),ht=Lc(1,"any",262144,"auto"),Dt=Lc(1,"any",void 0,"wildcard"),Re=Lc(1,"any",void 0,"blocked string"),st=Lc(1,"error"),Ct=Lc(1,"unresolved"),Qt=Lc(1,"any",65536,"non-inferrable"),er=Lc(1,"intrinsic"),or=Lc(2,"unknown"),U=Lc(2,"unknown",void 0,"non-null"),j=Lc(32768,"undefined"),ce=H?j:Lc(32768,"undefined",65536,"widening"),ee=Lc(32768,"undefined",void 0,"missing"),ue=he?ee:j,M=Lc(32768,"undefined",void 0,"optional"),De=Lc(65536,"null"),Ve=H?De:Lc(65536,"null",65536,"widening"),Fe=Lc(4,"string"),vt=Lc(8,"number"),Lt=Lc(64,"bigint"),Wt=Lc(512,"false",void 0,"fresh"),Lr=Lc(512,"false"),Zr=Lc(512,"true",void 0,"fresh"),gn=Lc(512,"true");Zr.regularType=gn,Zr.freshType=Zr,gn.regularType=gn,gn.freshType=Zr,Wt.regularType=Lr,Wt.freshType=Wt,Lr.regularType=Lr,Lr.freshType=Wt;var On=Mn([Lr,gn]),Ln=Lc(4096,"symbol"),Ni=Lc(16384,"void"),Cn=Lc(131072,"never"),Ki=Lc(131072,"never",262144,"silent"),wr=Lc(131072,"never",void 0,"implicit"),_i=Lc(131072,"never",void 0,"unreachable"),ia=Lc(67108864,"object"),Is=Mn([Fe,vt]),Cr=Mn([Fe,vt,Ln]),Tc=Te?Fe:Cr,os=Mn([vt,Lt]),Ga=Mn([Fe,vt,On,Lt,De,j]),rc=PS(["",""],[vt]),Vo=cR(n=>n.flags&262144?Wtt(n):n,()=>"(restrictive mapper)"),cl=cR(n=>n.flags&262144?Dt:n,()=>"(permissive mapper)"),Ro=Lc(131072,"never",void 0,"unique literal"),hs=cR(n=>n.flags&262144?Ro:n,()=>"(unique literal mapper)"),Ws,el=cR(n=>(Ws&&(n===u_||n===vo||n===xc)&&Ws(!0),n),()=>"(unmeasurable reporter)"),yo=cR(n=>(Ws&&(n===u_||n===vo||n===xc)&&Ws(!1),n),()=>"(unreliable reporter)"),Us=Qo(void 0,W,ze,ze,ze),Ic=Qo(void 0,W,ze,ze,ze);Ic.objectFlags|=2048;var Hp=Aa(2048,"__type");Hp.members=zs();var Fc=Qo(Hp,W,ze,ze,ze),$o=Qo(void 0,W,ze,ze,ze),Ao=H?Mn([j,De,$o]):or,rs=Qo(void 0,W,ze,ze,ze);rs.instantiations=new Map;var qt=Qo(void 0,W,ze,ze,ze);qt.objectFlags|=262144;var No=Qo(void 0,W,ze,ze,ze),$c=Qo(void 0,W,ze,ze,ze),ju=Qo(void 0,W,ze,ze,ze),u_=lu(),vo=lu();vo.constraint=u_;var xc=lu(),A=lu(),Pe=lu();Pe.constraint=A;var qe=tR(1,"<>",0,G),Tt=Fg(void 0,void 0,void 0,ze,G,void 0,0,0),dr=Fg(void 0,void 0,void 0,ze,st,void 0,0,0),En=Fg(void 0,void 0,void 0,ze,G,void 0,0,0),$r=Fg(void 0,void 0,void 0,ze,Ki,void 0,0,0),yn=Gm(vt,Fe,!0),li=new Map,Tn={get yieldType(){return E.fail("Not supported")},get returnType(){return E.fail("Not supported")},get nextType(){return E.fail("Not supported")}},va=D0(G,G,G),lc=D0(G,G,or),tl=D0(Cn,G,j),no={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:Tet,getGlobalIterableType:YQ,getGlobalIterableIteratorType:xet,getGlobalGeneratorType:ket,resolveIterationType:(n,a)=>zS(n,a,d.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member),mustHaveANextMethodDiagnostic:d.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:d.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:d.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property},rl={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:Cet,getGlobalIterableType:ode,getGlobalIterableIteratorType:Eet,getGlobalGeneratorType:Det,resolveIterationType:(n,a)=>n,mustHaveANextMethodDiagnostic:d.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:d.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:d.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property},Xa,hl=new Map,$u=[],xu,Bf,$l,ye,St,Fr,Wi,Ps,Fs,uc,hc,jo,qo,kc,nc,Oc,yp,xf,Xu,Jf,vg,Fm,n0,ou,bg,L_,zf,Qu,Q,Ye,Et,Pt,L,pe,Ze,At,Mr,Rn,jn,Oi,sa,aa,Xo,Xl,ll,kf,_a,vp,Cf,Sg,Om,ki,ay,oy,fd,u2,i0=new Map,Ee=0,We=0,bt=0,Rt=!1,tr=0,Rr,nr,xr,ni=[],_n=[],fn=[],on=0,wi=[],Qa=[],Va=0,M_=p_(""),A1=vd(0),cy=rY({negative:!1,base10Value:"0"}),sh=[],ly=[],Kb=[],_2=0,eS=!1,tS=0,Z3=10,gx=[],g6=[],N1=[],hx=[],yx=[],h6=[],rS=[],y6=[],vx=[],bx=[],nS=[],f2=[],p2=[],I1=[],s0=[],d2=[],Ud=[],wa=qk(),iS=qk(),v6=N6(),uy,a0,Lm=new Map,Wf=new Map,R_=new Map,Yu=new Map,K_=new Map,F1=new Map,b6=zs();b6.set(Oe.escapedName,Oe);var Sx=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",J.jsx===1?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];return Eut(),Jt;function sS(n){return n?Ce.get(n):void 0}function m2(n,a){return n&&Ce.set(n,a),a}function O1(n){if(n){const a=Or(n);if(a)if(jT(n)){if(a.localJsxFragmentNamespace)return a.localJsxFragmentNamespace;const l=a.pragmas.get("jsxfrag");if(l){const m=es(l)?l[0]:l;if(a.localJsxFragmentFactory=WT(m.arguments.factory,ie),He(a.localJsxFragmentFactory,L1,V_),a.localJsxFragmentFactory)return a.localJsxFragmentNamespace=$_(a.localJsxFragmentFactory).escapedText}const _=Hge(n);if(_)return a.localJsxFragmentFactory=_,a.localJsxFragmentNamespace=$_(_).escapedText}else{const l=aS(a);if(l)return a.localJsxNamespace=l}}return uy||(uy="React",J.jsxFactory?(a0=WT(J.jsxFactory,ie),He(a0,L1),a0&&(uy=$_(a0).escapedText)):J.reactNamespace&&(uy=zo(J.reactNamespace))),a0||(a0=I.createQualifiedName(I.createIdentifier(bi(uy)),"createElement")),uy}function aS(n){if(n.localJsxNamespace)return n.localJsxNamespace;const a=n.pragmas.get("jsx");if(a){const l=es(a)?a[0]:a;if(n.localJsxFactory=WT(l.arguments.factory,ie),He(n.localJsxFactory,L1,V_),n.localJsxFactory)return n.localJsxNamespace=$_(n.localJsxFactory).escapedText}}function L1(n){return km(n,-1,-1),sr(n,L1,cd)}function Cl(n,a){return O7e(n,a),lt}function o0(n,a,...l){const _=n?mn(n,a,...l):dc(a,...l),m=wa.lookup(_);return m||(wa.add(_),_)}function c0(n,a,l,..._){const m=je(a,l,..._);return m.skippedOn=n,m}function Tg(n,a,...l){return n?mn(n,a,...l):dc(a,...l)}function je(n,a,...l){const _=Tg(n,a,...l);return wa.add(_),_}function Ol(n,a){n?wa.add(a):iS.add({...a,category:2})}function Uf(n,a,l,..._){if(a.pos<0||a.end<0){if(!n)return;const m=Or(a);Ol(n,"message"in l?xl(m,0,0,l,..._):BJ(m,l));return}Ol(n,"message"in l?mn(a,l,..._):Hg(Or(a),a,l))}function Bu(n,a,l,..._){const m=je(n,l,..._);if(a){const h=mn(n,d.Did_you_forget_to_use_await);ua(m,h)}return m}function S6(n,a){const l=Array.isArray(n)?Zt(n,eJ):eJ(n);return l&&ua(a,mn(l,d.The_declaration_was_marked_as_deprecated_here)),iS.add(a),a}function l0(n){const a=f_(n);return a&&Ir(n.declarations)>1?a.flags&64?ut(n.declarations,M1):qi(n.declarations,M1):!!n.valueDeclaration&&M1(n.valueDeclaration)||Ir(n.declarations)&&qi(n.declarations,M1)}function M1(n){return!!(G2(n)&536870912)}function xg(n,a,l){const _=mn(n,d._0_is_deprecated,l);return S6(a,_)}function K3(n,a,l,_){const m=l?mn(n,d.The_signature_0_of_1_is_deprecated,_,l):mn(n,d._0_is_deprecated,_);return S6(a,m)}function Aa(n,a,l){y++;const _=new u(n|33554432,a);return _.links=new Rie,_.links.checkFlags=l||0,_}function pd(n,a){const l=Aa(1,n);return l.links.type=a,l}function oS(n,a){const l=Aa(4,n);return l.links.type=a,l}function cS(n){let a=0;return n&2&&(a|=111551),n&1&&(a|=111550),n&4&&(a|=0),n&8&&(a|=900095),n&16&&(a|=110991),n&32&&(a|=899503),n&64&&(a|=788872),n&256&&(a|=899327),n&128&&(a|=899967),n&512&&(a|=110735),n&8192&&(a|=103359),n&32768&&(a|=46015),n&65536&&(a|=78783),n&262144&&(a|=526824),n&524288&&(a|=788968),n&2097152&&(a|=2097152),a}function g2(n,a){a.mergeId||(a.mergeId=Lie,Lie++),gx[a.mergeId]=n}function h2(n){const a=Aa(n.flags,n.escapedName);return a.declarations=n.declarations?n.declarations.slice():[],a.parent=n.parent,n.valueDeclaration&&(a.valueDeclaration=n.valueDeclaration),n.constEnumOnlyModule&&(a.constEnumOnlyModule=!0),n.members&&(a.members=new Map(n.members)),n.exports&&(a.exports=new Map(n.exports)),g2(a,n),a}function bp(n,a,l=!1){if(!(n.flags&cS(a.flags))||(a.flags|n.flags)&67108864){if(a===n)return n;if(!(n.flags&33554432)){const m=Cc(n);if(m===dt)return a;n=h2(m)}a.flags&512&&n.flags&512&&n.constEnumOnlyModule&&!a.constEnumOnlyModule&&(n.constEnumOnlyModule=!1),n.flags|=a.flags,a.valueDeclaration&&r8(n,a.valueDeclaration),Dn(n.declarations,a.declarations),a.members&&(n.members||(n.members=zs()),Vd(n.members,a.members,l)),a.exports&&(n.exports||(n.exports=zs()),Vd(n.exports,a.exports,l)),l||g2(n,a)}else if(n.flags&1024)n!==Xe&&je(a.declarations&&as(a.declarations[0]),d.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity,ii(n));else{const m=!!(n.flags&384||a.flags&384),h=!!(n.flags&2||a.flags&2),x=m?d.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:h?d.Cannot_redeclare_block_scoped_variable_0:d.Duplicate_identifier_0,N=a.declarations&&Or(a.declarations[0]),F=n.declarations&&Or(n.declarations[0]),V=FP(N,J.checkJs),ne=FP(F,J.checkJs),le=ii(a);if(N&&F&&Xa&&!m&&N!==F){const xe=qy(N.path,F.path)===-1?N:F,Ne=xe===N?F:N,nt=u4(Xa,`${xe.path}|${Ne.path}`,()=>({firstFile:xe,secondFile:Ne,conflictingSymbols:new Map})),kt=u4(nt.conflictingSymbols,le,()=>({isBlockScoped:h,firstFileLocations:[],secondFileLocations:[]}));V||_(kt.firstFileLocations,a),ne||_(kt.secondFileLocations,n)}else V||dd(a,x,le,n),ne||dd(n,x,le,a)}return n;function _(m,h){if(h.declarations)for(const x of h.declarations)tp(m,x)}}function dd(n,a,l,_){Zt(n.declarations,m=>{kg(m,a,l,_.declarations)})}function kg(n,a,l,_){const m=(e1(n,!1)?XJ(n):as(n))||n,h=o0(m,a,l);for(const x of _||ze){const N=(e1(x,!1)?XJ(x):as(x))||x;if(N===m)continue;h.relatedInformation=h.relatedInformation||[];const F=mn(N,d._0_was_also_declared_here,l),V=mn(N,d.and_here);Ir(h.relatedInformation)>=5||ut(h.relatedInformation,ne=>mE(ne,V)===0||mE(ne,F)===0)||ua(h,Ir(h.relatedInformation)?V:F)}}function lS(n,a){if(!n?.size)return a;if(!a?.size)return n;const l=zs();return Vd(l,n),Vd(l,a),l}function Vd(n,a,l=!1){a.forEach((_,m)=>{const h=n.get(m);n.set(m,h?bp(h,_,l):Na(_))})}function uS(n){var a,l,_;const m=n.parent;if(((a=m.symbol.declarations)==null?void 0:a[0])!==m){E.assert(m.symbol.declarations.length>1);return}if(Dd(m))Vd(me,m.symbol.exports);else{const h=n.parent.parent.flags&33554432?void 0:d.Invalid_module_name_in_augmentation_module_0_cannot_be_found;let x=Pg(n,n,h,!0);if(!x)return;if(x=ef(x),x.flags&1920)if(ut(Bf,N=>x===N.symbol)){const N=bp(m.symbol,x,!0);$l||($l=new Map),$l.set(n.text,N)}else{if((l=x.exports)!=null&&l.get("__export")&&((_=m.symbol.exports)!=null&&_.size)){const N=Ipe(x,"resolvedExports");for(const[F,V]of fs(m.symbol.exports.entries()))N.has(F)&&!x.exports.has(F)&&bp(N.get(F),V)}bp(x,m.symbol)}else je(n,d.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity,n.text)}}function T6(n,a,l){a.forEach((m,h)=>{const x=n.get(h);x?Zt(x.declarations,_(bi(h),l)):n.set(h,m)});function _(m,h){return x=>wa.add(mn(x,h,m))}}function yi(n){if(n.flags&33554432)return n.links;const a=Xs(n);return g6[a]??(g6[a]=new Rie)}function Wn(n){const a=Oa(n);return N1[a]||(N1[a]=new E9e)}function qd(n){return n.kind===312&&!H_(n)}function S_(n,a,l){if(l){const _=Na(n.get(a));if(_&&(E.assert((Ko(_)&1)===0,"Should never get an instantiated symbol here."),_.flags&l||_.flags&2097152&&cu(_)&l))return _}}function x6(n,a){const l=n.parent,_=n.parent.parent,m=S_(l.locals,a,111551),h=S_(Cy(_.symbol),a,111551);return m&&h?[m,h]:E.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}function u0(n,a){const l=Or(n),_=Or(a),m=bm(n);if(l!==_){if(B&&(l.externalModuleIndicator||_.externalModuleIndicator)||!to(J)||yb(a)||n.flags&33554432||x(a,n))return!0;const F=e.getSourceFiles();return F.indexOf(l)<=F.indexOf(_)}if(a.flags&16777216||yb(a)||ume(a))return!0;if(n.pos<=a.pos&&!(Es(n)&&VP(a.parent)&&!n.initializer&&!n.exclamationToken)){if(n.kind===208){const F=r1(a,208);return F?Ar(F,Pa)!==Ar(n,Pa)||n.posxa(F)&&F.parent.parent===n);if(Es(n))return!N(n,a,!1);if(E_(n,n.parent))return!(_e&&wl(n)===wl(a)&&x(a,n))}return!0}if(a.parent.kind===281||a.parent.kind===277&&a.parent.isExportEquals||a.kind===277&&a.isExportEquals)return!0;if(x(a,n))return _e&&wl(n)&&(Es(n)||E_(n,n.parent))?!N(n,a,!0):!0;return!1;function h(F,V){switch(F.parent.parent.kind){case 243:case 248:case 250:if(v2(V,F,m))return!0;break}const ne=F.parent.parent;return Sk(ne)&&v2(V,ne.expression,m)}function x(F,V){return!!Ar(F,ne=>{if(ne===m)return"quit";if(ks(ne))return!0;if(Go(ne))return V.posF.end?!1:Ar(V,xe=>{if(xe===F)return"quit";switch(xe.kind){case 219:return!0;case 172:return ne&&(Es(F)&&xe.parent===F.parent||E_(F,F.parent)&&xe.parent===F.parent.parent)?"quit":!0;case 241:switch(xe.parent.kind){case 177:case 174:case 178:return!0;default:return!1}default:return!1}})===void 0}}function k6(n,a,l){const _=Da(J),m=a;if(us(l)&&m.body&&n.valueDeclaration&&n.valueDeclaration.pos>=m.body.pos&&n.valueDeclaration.end<=m.body.end&&_>=2){const N=Wn(m);return N.declarationRequiresScopeChange===void 0&&(N.declarationRequiresScopeChange=Zt(m.parameters,h)||!1),!N.declarationRequiresScopeChange}return!1;function h(N){return x(N.name)||!!N.initializer&&x(N.initializer)}function x(N){switch(N.kind){case 219:case 218:case 262:case 176:return!1;case 174:case 177:case 178:case 303:return x(N.name);case 172:return Uc(N)?!_e:x(N.name);default:return sJ(N)||gu(N)?_<7:Pa(N)&&N.dotDotDotToken&&jp(N.parent)?_<4:Si(N)?!1:ds(N,x)||!1}}}function y2(n){return sb(n)&&Vg(n.type)||qE(n)&&Vg(n.typeExpression)}function _c(n,a,l,_,m,h,x=!1,N=!0){return Ju(n,a,l,_,m,h,x,N,S_)}function Ju(n,a,l,_,m,h,x,N,F){var V,ne,le;const xe=n;let Ne,nt,kt,Xt,_r,Yr=!1;const gr=n;let Ut,Nr=!1;e:for(;n;){if(a==="const"&&y2(n))return;if(PP(n)&&nt&&n.name===nt&&(nt=n,n=n.parent),hm(n)&&n.locals&&!qd(n)&&(Ne=F(n.locals,a,l))){let Er=!0;if(ks(n)&&nt&&nt!==n.body?(l&Ne.flags&788968&&nt.kind!==327&&(Er=Ne.flags&262144?nt===n.type||nt.kind===169||nt.kind===348||nt.kind===349||nt.kind===168:!1),l&Ne.flags&3&&(k6(Ne,n,nt)?Er=!1:Ne.flags&1&&(Er=nt.kind===169||nt===n.type&&!!Ar(Ne.valueDeclaration,us)))):n.kind===194&&(Er=nt===n.trueType),Er)break e;Ne=void 0}switch(Yr=Yr||Mm(n,nt),n.kind){case 312:if(!H_(n))break;Nr=!0;case 267:const Er=((V=cn(n))==null?void 0:V.exports)||W;if(n.kind===312||vc(n)&&n.flags&33554432&&!Dd(n)){if(Ne=Er.get("default")){const ms=Xk(Ne);if(ms&&Ne.flags&l&&ms.escapedName===a)break e;Ne=void 0}const sn=Er.get(a);if(sn&&sn.flags===2097152&&(Wo(sn,281)||Wo(sn,280)))break}if(a!=="default"&&(Ne=F(Er,a,l&2623475)))if(Ai(n)&&n.commonJsModuleIndicator&&!((ne=Ne.declarations)!=null&&ne.some(op)))Ne=void 0;else break e;break;case 266:if(Ne=F(((le=cn(n))==null?void 0:le.exports)||W,a,l&8)){_&&nd(J)&&!(n.flags&33554432)&&Or(n)!==Or(Ne.valueDeclaration)&&je(gr,d.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead,bi(a),Je,`${bi(tf(n).escapedName)}.${bi(a)}`);break e}break;case 172:if(!Ls(n)){const sn=$p(n.parent);sn&&sn.locals&&F(sn.locals,a,l&111551)&&(E.assertNode(n,Es),Xt=n)}break;case 263:case 231:case 264:if(Ne=F(cn(n).members||W,a,l&788968)){if(!R1(Ne,n)){Ne=void 0;break}if(nt&&Ls(nt)){_&&je(gr,d.Static_members_cannot_reference_class_type_parameters);return}break e}if(Nl(n)&&l&32){const sn=n.name;if(sn&&a===sn.escapedText){Ne=n.symbol;break e}}break;case 233:if(nt===n.expression&&n.parent.token===96){const sn=n.parent.parent;if(Qn(sn)&&(Ne=F(cn(sn).members,a,l&788968))){_&&je(gr,d.Base_class_expressions_cannot_reference_class_type_parameters);return}}break;case 167:if(Ut=n.parent.parent,(Qn(Ut)||Ut.kind===264)&&(Ne=F(cn(Ut).members,a,l&788968))){_&&je(gr,d.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);return}break;case 219:if(Da(J)>=2)break;case 174:case 176:case 177:case 178:case 262:if(l&3&&a==="arguments"){Ne=it;break e}break;case 218:if(l&3&&a==="arguments"){Ne=it;break e}if(l&16){const sn=n.name;if(sn&&a===sn.escapedText){Ne=n.symbol;break e}}break;case 170:n.parent&&n.parent.kind===169&&(n=n.parent),n.parent&&(Pl(n.parent)||n.parent.kind===263)&&(n=n.parent);break;case 353:case 345:case 347:const hr=$4(n);hr&&(n=hr.parent);break;case 169:nt&&(nt===n.initializer||nt===n.name&&As(nt))&&(_r||(_r=n));break;case 208:nt&&(nt===n.initializer||nt===n.name&&As(nt))&&Iv(n)&&!_r&&(_r=n);break;case 195:if(l&262144){const sn=n.typeParameter.name;if(sn&&a===sn.escapedText){Ne=n.typeParameter.symbol;break e}}break;case 281:nt&&nt===n.propertyName&&n.parent.parent.moduleSpecifier&&(n=n.parent.parent.parent);break}Cg(n)&&(kt=n),nt=n,n=od(n)?i5(n)||n.parent:(ad(n)||$F(n))&&t1(n)||n.parent}if(h&&Ne&&(!kt||Ne!==kt.symbol)&&(Ne.isReferenced|=l),!Ne){if(nt&&(E.assertNode(nt,Ai),nt.commonJsModuleIndicator&&a==="exports"&&l&nt.symbol.flags))return nt.symbol;x||(Ne=F(me,a,l))}if(!Ne&&xe&&Hr(xe)&&xe.parent&&g_(xe.parent,!1))return mt;function Sr(){return Xt&&!_e?(je(gr,gr&&Xt.type&&pP(Xt.type,gr.pos)?d.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:d.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,eo(Xt.name),Gp(m)),!0):!1}if(Ne){if(_&&Sr())return}else{_&&r(()=>{if(!gr||gr.parent.kind!==331&&!Eg(gr,a,m)&&!Sr()&&!C6(gr)&&!E6(gr,a,l)&&!_0(gr,a)&&!xx(gr,a,l)&&!D6(gr,a,l)&&!Hd(gr,a,l)){let Er,hr;if(m&&(hr=mst(m),hr&&je(gr,_,Gp(m),hr)),!hr&&N&&tS{if(gr&&(l&2||(l&32||l&384)&&(l&111551)===111551)){const Er=kp(Ne);(Er.flags&2||Er.flags&32||Er.flags&384)&&io(Er,gr)}if(Ne&&Nr&&(l&111551)===111551&&!(xe.flags&16777216)){const Er=Na(Ne);Ir(Er.declarations)&&qi(Er.declarations,hr=>aw(hr)||Ai(hr)&&!!hr.symbol.globalExports)&&Uf(!J.allowUmdGlobalAccess,gr,d._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,bi(a))}if(Ne&&_r&&!Yr&&(l&111551)===111551){const Er=Na(JQ(Ne)),hr=Tm(_r);Er===cn(_r)?je(gr,d.Parameter_0_cannot_reference_itself,eo(_r.name)):Er.valueDeclaration&&Er.valueDeclaration.pos>_r.pos&&hr.parent.locals&&F(hr.parent.locals,Er.escapedName,l)===Er&&je(gr,d.Parameter_0_cannot_reference_identifier_1_declared_after_it,eo(_r.name),eo(gr))}if(Ne&&gr&&l&111551&&Ne.flags&2097152&&!(Ne.flags&111551)&&!o1(gr)){const Er=qf(Ne,111551);if(Er){const hr=Er.kind===281||Er.kind===278||Er.kind===280?d._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:d._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type,sn=bi(a);ah(je(gr,hr,sn),Er,sn)}}}),Ne}function ah(n,a,l){return a?ua(n,mn(a,a.kind===281||a.kind===278||a.kind===280?d._0_was_exported_here:d._0_was_imported_here,l)):n}function Mm(n,a){return n.kind!==219&&n.kind!==218?lC(n)||(po(n)||n.kind===172&&!Ls(n))&&(!a||a!==n.name):a&&a===n.name?!1:n.asteriskToken||In(n,1024)?!0:!_b(n)}function Cg(n){switch(n.kind){case 262:case 263:case 264:case 266:case 265:case 267:return!0;default:return!1}}function Gp(n){return ns(n)?bi(n):eo(n)}function R1(n,a){if(n.declarations){for(const l of n.declarations)if(l.kind===168&&(od(l.parent)?lT(l.parent):l.parent)===a)return!(od(l.parent)&&kn(l.parent.parent.tags,op))}return!1}function Eg(n,a,l){if(!Ie(n)||n.escapedText!==a||L7e(n)||yb(n))return!1;const _=i_(n,!1,!1);let m=_;for(;m;){if(Qn(m.parent)){const h=cn(m.parent);if(!h)break;const x=Br(h);if(Gs(x,a))return je(n,d.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,Gp(l),ii(h)),!0;if(m===_&&!Ls(m)){const N=bo(h).thisType;if(Gs(N,a))return je(n,d.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,Gp(l)),!0}}m=m.parent}return!1}function C6(n){const a=Rm(n);return a&&lo(a,64,!0)?(je(n,d.Cannot_extend_an_interface_0_Did_you_mean_implements,Wc(a)),!0):!1}function Rm(n){switch(n.kind){case 80:case 211:return n.parent?Rm(n.parent):void 0;case 233:if(oc(n.expression))return n.expression;default:return}}function E6(n,a,l){const _=1920|(Hr(n)?111551:0);if(l===_){const m=Cc(_c(n,a,788968&~_,void 0,void 0,!1)),h=n.parent;if(m){if(h_(h)){E.assert(h.left===n,"Should only be resolving left side of qualified name as a namespace");const x=h.right.escapedText;if(Gs(bo(m),x))return je(h,d.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,bi(a),bi(x)),!0}return je(n,d._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,bi(a)),!0}}return!1}function Hd(n,a,l){if(l&788584){const _=Cc(_c(n,a,111127,void 0,void 0,!1));if(_&&!(_.flags&1920))return je(n,d._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,bi(a)),!0}return!1}function jm(n){return n==="any"||n==="string"||n==="number"||n==="boolean"||n==="never"||n==="unknown"}function _0(n,a){return jm(a)&&n.parent.kind===281?(je(n,d.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,a),!0):!1}function D6(n,a,l){if(l&111551){if(jm(a)){const h=n.parent.parent;if(h&&h.parent&&Q_(h)){const x=h.token,N=h.parent.kind;N===264&&x===96?je(n,d.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types,bi(a)):N===263&&x===96?je(n,d.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values,bi(a)):N===263&&x===119&&je(n,d.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types,bi(a))}else je(n,d._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,bi(a));return!0}const _=Cc(_c(n,a,788544,void 0,void 0,!1)),m=_&&cu(_);if(_&&m!==void 0&&!(m&111551)){const h=bi(a);return eD(a)?je(n,d._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later,h):Tx(n,_)?je(n,d._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,h,h==="K"?"P":"K"):je(n,d._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,h),!0}}return!1}function Tx(n,a){const l=Ar(n.parent,_=>xa(_)||ff(_)?!1:X_(_)||"quit");if(l&&l.members.length===1){const _=bo(a);return!!(_.flags&1048576)&&qR(_,384,!0)}return!1}function eD(n){switch(n){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return!0}return!1}function xx(n,a,l){if(l&111127){if(Cc(_c(n,a,1024,void 0,void 0,!1)))return je(n,d.Cannot_use_namespace_0_as_a_value,bi(a)),!0}else if(l&788544&&Cc(_c(n,a,1536,void 0,void 0,!1)))return je(n,d.Cannot_use_namespace_0_as_a_type,bi(a)),!0;return!1}function io(n,a){var l;if(E.assert(!!(n.flags&2||n.flags&32||n.flags&384)),n.flags&67108881&&n.flags&32)return;const _=(l=n.declarations)==null?void 0:l.find(m=>PJ(m)||Qn(m)||m.kind===266);if(_===void 0)return E.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(_.flags&33554432)&&!u0(_,a)){let m;const h=eo(as(_));n.flags&2?m=je(a,d.Block_scoped_variable_0_used_before_its_declaration,h):n.flags&32?m=je(a,d.Class_0_used_before_its_declaration,h):n.flags&256&&(m=je(a,d.Enum_0_used_before_its_declaration,h)),m&&ua(m,mn(_,d._0_is_declared_here,h))}}function v2(n,a,l){return!!a&&!!Ar(n,_=>_===a||(_===l||ks(_)&&(!_b(_)||pl(_)&3)?"quit":!1))}function kx(n){switch(n.kind){case 271:return n;case 273:return n.parent;case 274:return n.parent.parent;case 276:return n.parent.parent.parent;default:return}}function Sp(n){return n.declarations&&US(n.declarations,j1)}function j1(n){return n.kind===271||n.kind===270||n.kind===273&&!!n.name||n.kind===274||n.kind===280||n.kind===276||n.kind===281||n.kind===277&&zk(n)||Gr(n)&&ac(n)===2&&zk(n)||co(n)&&Gr(n.parent)&&n.parent.left===n&&n.parent.operatorToken.kind===64&&Cx(n.parent.right)||n.kind===304||n.kind===303&&Cx(n.initializer)||n.kind===260&&Pv(n)||n.kind===208&&Pv(n.parent.parent)}function Cx(n){return u8(n)||ro(n)&&nm(n)}function tD(n,a){const l=ch(n);if(l){const m=dE(l.expression).arguments[0];return Ie(l.name)?Cc(Gs(DPe(m),l.name.escapedText)):void 0}if(Ei(n)||n.moduleReference.kind===283){const m=Zu(n,HJ(n)||q4(n)),h=ef(m);return T_(n,m,h,!1),h}const _=dS(n.moduleReference,a);return _S(n,_),_}function _S(n,a){if(T_(n,void 0,a,!1)&&!n.isTypeOnly){const l=qf(cn(n)),_=l.kind===281||l.kind===278,m=_?d.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:d.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type,h=_?d._0_was_exported_here:d._0_was_imported_here,x=l.kind===278?"*":bi(l.name.escapedText);ua(je(n.moduleReference,m),mn(l,h,x))}}function Kr(n,a,l,_){const m=n.exports.get("export="),h=m?Gs(Br(m),a,!0):n.exports.get(a),x=Cc(h,_);return T_(l,h,x,!1),x}function Ql(n){return cc(n)&&!n.isExportEquals||In(n,2048)||vu(n)||Dm(n)}function Yi(n){return Ja(n)?ld(Or(n),n):void 0}function __(n,a){return n===99&&a===1}function Gd(n){return Yi(n)===99&&fc(n.text,".json")}function Tp(n,a,l,_){const m=n&&Yi(_);if(n&&m!==void 0){const h=__(m,n.impliedNodeFormat);if(m===99||h)return h}if(!$)return!1;if(!n||n.isDeclarationFile){const h=Kr(a,"default",void 0,!0);return!(h&&ut(h.declarations,Ql)||Kr(a,zo("__esModule"),void 0,l))}return Iu(n)?typeof n.externalModuleIndicator!="object"&&!Kr(a,zo("__esModule"),void 0,l):C2(a)}function Ur(n,a){const l=Zu(n,n.parent.moduleSpecifier);if(l)return b2(l,n,a)}function b2(n,a,l){var _;let m;B4(n)?m=n:m=Kr(n,"default",a,l);const h=(_=n.declarations)==null?void 0:_.find(Ai),x=B1(a);if(!x)return m;const N=Gd(x),F=Tp(h,n,l,x);if(!m&&!F&&!N)if(C2(n)&&!$){const V=B>=5?"allowSyntheticDefaultImports":"esModuleInterop",le=n.exports.get("export=").valueDeclaration,xe=je(a.name,d.Module_0_can_only_be_default_imported_using_the_1_flag,ii(n),V);le&&ua(xe,mn(le,d.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,V))}else Em(a)?yl(n,a):z1(n,n,a,rT(a)&&a.propertyName||a.name);else if(F||N){const V=ef(n,l)||Cc(n,l);return T_(a,n,V,!1),V}return T_(a,m,void 0,!1),m}function B1(n){switch(n.kind){case 273:return n.parent.moduleSpecifier;case 271:return Pm(n.moduleReference)?n.moduleReference.expression:void 0;case 274:return n.parent.parent.moduleSpecifier;case 276:return n.parent.parent.parent.moduleSpecifier;case 281:return n.parent.parent.moduleSpecifier;default:return E.assertNever(n)}}function yl(n,a){var l,_,m;if((l=n.exports)!=null&&l.has(a.symbol.escapedName))je(a.name,d.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,ii(n),ii(a.symbol));else{const h=je(a.name,d.Module_0_has_no_default_export,ii(n)),x=(_=n.exports)==null?void 0:_.get("__export");if(x){const N=(m=x.declarations)==null?void 0:m.find(F=>{var V,ne;return!!(qc(F)&&F.moduleSpecifier&&((ne=(V=Zu(F,F.moduleSpecifier))==null?void 0:V.exports)!=null&&ne.has("default")))});N&&ua(h,mn(N,d.export_Asterisk_does_not_re_export_a_default))}}}function $d(n,a){const l=n.parent.parent.moduleSpecifier,_=Zu(n,l),m=dy(_,l,a,!1);return T_(n,_,m,!1),m}function Xd(n,a){const l=n.parent.moduleSpecifier,_=l&&Zu(n,l),m=l&&dy(_,l,a,!1);return T_(n,_,m,!1),m}function _y(n,a){if(n===dt&&a===dt)return dt;if(n.flags&790504)return n;const l=Aa(n.flags|a.flags,n.escapedName);return E.assert(n.declarations||a.declarations),l.declarations=VS(Xi(n.declarations,a.declarations),w0),l.parent=n.parent||a.parent,n.valueDeclaration&&(l.valueDeclaration=n.valueDeclaration),a.members&&(l.members=new Map(a.members)),n.exports&&(l.exports=new Map(n.exports)),l}function Ex(n,a,l,_){var m;if(n.flags&1536){const h=j_(n).get(a.escapedText),x=Cc(h,_),N=(m=yi(n).typeOnlyExportStarMap)==null?void 0:m.get(a.escapedText);return T_(l,h,x,!1,N,a.escapedText),x}}function oh(n,a){if(n.flags&3){const l=n.valueDeclaration.type;if(l)return Cc(Gs(si(l),a))}}function J1(n,a,l=!1){var _;const m=HJ(n)||n.moduleSpecifier,h=Zu(n,m),x=!bn(a)&&a.propertyName||a.name;if(!Ie(x))return;const N=x.escapedText==="default"&&$,F=dy(h,m,!1,N);if(F&&x.escapedText){if(B4(h))return h;let V;h&&h.exports&&h.exports.get("export=")?V=Gs(Br(F),x.escapedText,!0):V=oh(F,x.escapedText),V=Cc(V,l);let ne=Ex(F,x,a,l);if(ne===void 0&&x.escapedText==="default"){const xe=(_=h.declarations)==null?void 0:_.find(Ai);(Gd(m)||Tp(xe,h,l,m))&&(ne=ef(h,l)||Cc(h,l))}const le=ne&&V&&ne!==V?_y(V,ne):ne||V;return le||z1(h,F,n,x),le}}function z1(n,a,l,_){var m;const h=xp(n,l),x=eo(_),N=QY(_,a);if(N!==void 0){const F=ii(N),V=je(_,d._0_has_no_exported_member_named_1_Did_you_mean_2,h,x,F);N.valueDeclaration&&ua(V,mn(N.valueDeclaration,d._0_is_declared_here,F))}else(m=n.exports)!=null&&m.has("default")?je(_,d.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,h,x):Dg(l,_,x,n,h)}function Dg(n,a,l,_,m){var h,x;const N=(x=(h=Jn(_.valueDeclaration,hm))==null?void 0:h.locals)==null?void 0:x.get(a.escapedText),F=_.exports;if(N){const V=F?.get("export=");if(V)Df(V,N)?Bm(n,a,l,m):je(a,d.Module_0_has_no_exported_member_1,m,l);else{const ne=F?kn(Qpe(F),xe=>!!Df(xe,N)):void 0,le=ne?je(a,d.Module_0_declares_1_locally_but_it_is_exported_as_2,m,l,ii(ne)):je(a,d.Module_0_declares_1_locally_but_it_is_not_exported,m,l);N.declarations&&ua(le,...Yt(N.declarations,(xe,Ne)=>mn(xe,Ne===0?d._0_is_declared_here:d.and_here,l)))}}else je(a,d.Module_0_has_no_exported_member_1,m,l)}function Bm(n,a,l,_){if(B>=5){const m=xm(J)?d._0_can_only_be_imported_by_using_a_default_import:d._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;je(a,m,l)}else if(Hr(n)){const m=xm(J)?d._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:d._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;je(a,m,l)}else{const m=xm(J)?d._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:d._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;je(a,m,l,l,_)}}function fS(n,a){if(v_(n)&&an(n.propertyName||n.name)==="default"){const x=B1(n),N=x&&Zu(n,x);if(N)return b2(N,n,a)}const l=Pa(n)?Tm(n):n.parent.parent.parent,_=ch(l),m=J1(l,_||n,a),h=n.propertyName||n.name;return _&&m&&Ie(h)?Cc(Gs(Br(m),h.escapedText),a):(T_(n,void 0,m,!1),m)}function ch(n){if(Ei(n)&&n.initializer&&bn(n.initializer))return n.initializer}function fy(n,a){if(Ed(n.parent)){const l=ef(n.parent.symbol,a);return T_(n,void 0,l,!1),l}}function S2(n,a,l){if(an(n.propertyName||n.name)==="default"){const m=B1(n),h=m&&Zu(n,m);if(h)return b2(h,n,!!l)}const _=n.parent.parent.moduleSpecifier?J1(n.parent.parent,n,l):lo(n.propertyName||n.name,a,!1,l);return T_(n,void 0,_,!1),_}function Dx(n,a){const l=cc(n)?n.expression:n.right,_=pS(l,a);return T_(n,void 0,_,!1),_}function pS(n,a){if(Nl(n))return Bc(n).symbol;if(!V_(n)&&!oc(n))return;const l=lo(n,901119,!0,a);return l||(Bc(n),Wn(n).resolvedSymbol)}function T2(n,a){if(Gr(n.parent)&&n.parent.left===n&&n.parent.operatorToken.kind===64)return pS(n.parent.right,a)}function Vf(n,a=!1){switch(n.kind){case 271:case 260:return tD(n,a);case 273:return Ur(n,a);case 274:return $d(n,a);case 280:return Xd(n,a);case 276:case 208:return fS(n,a);case 281:return S2(n,901119,a);case 277:case 226:return Dx(n,a);case 270:return fy(n,a);case 304:return lo(n.name,901119,!0,a);case 303:return pS(n.initializer,a);case 212:case 211:return T2(n,a);default:return E.fail()}}function W1(n,a=901119){return n?(n.flags&(2097152|a))===2097152||!!(n.flags&2097152&&n.flags&67108864):!1}function Cc(n,a){return!a&&W1(n)?ul(n):n}function ul(n){E.assert((n.flags&2097152)!==0,"Should only get Alias here.");const a=yi(n);if(a.aliasTarget)a.aliasTarget===fe&&(a.aliasTarget=dt);else{a.aliasTarget=fe;const l=Sp(n);if(!l)return E.fail();const _=Vf(l);a.aliasTarget===fe?a.aliasTarget=_||dt:je(l,d.Circular_definition_of_import_alias_0,ii(n))}return a.aliasTarget}function Px(n){if(yi(n).aliasTarget!==fe)return ul(n)}function cu(n,a,l){const _=a&&qf(n),m=_&&qc(_),h=_&&(m?Zu(_.moduleSpecifier,_.moduleSpecifier,!0):ul(_.symbol)),x=m&&h?wg(h):void 0;let N=l?0:n.flags,F;for(;n.flags&2097152;){const V=kp(ul(n));if(!m&&V===h||x?.get(V.escapedName)===V)break;if(V===dt)return 67108863;if(V===n||F?.has(V))break;V.flags&2097152&&(F?F.add(V):F=new Set([n,V])),N|=V.flags,n=V}return N}function T_(n,a,l,_,m,h){if(!n||bn(n))return!1;const x=cn(n);if(bv(n)){const F=yi(x);return F.typeOnlyDeclaration=n,!0}if(m){const F=yi(x);return F.typeOnlyDeclaration=m,x.escapedName!==h&&(F.typeOnlyExportStarName=h),!0}const N=yi(x);return x2(N,a,_)||x2(N,l,_)}function x2(n,a,l){var _;if(a&&(n.typeOnlyDeclaration===void 0||l&&n.typeOnlyDeclaration===!1)){const m=((_=a.exports)==null?void 0:_.get("export="))??a,h=m.declarations&&kn(m.declarations,bv);n.typeOnlyDeclaration=h??yi(m).typeOnlyDeclaration??!1}return!!n.typeOnlyDeclaration}function qf(n,a){if(!(n.flags&2097152))return;const l=yi(n);if(a===void 0)return l.typeOnlyDeclaration||void 0;if(l.typeOnlyDeclaration){const _=l.typeOnlyDeclaration.kind===278?Cc(wg(l.typeOnlyDeclaration.symbol.parent).get(l.typeOnlyExportStarName||n.escapedName)):ul(l.typeOnlyDeclaration.symbol);return cu(_)&a?l.typeOnlyDeclaration:void 0}}function U1(n){if(!ot)return;const a=cn(n),l=ul(a);l&&(l===dt||cu(a,!0)&111551&&!m7(l))&&f0(a)}function f0(n){E.assert(ot);const a=yi(n);if(!a.referenced){a.referenced=!0;const l=Sp(n);if(!l)return E.fail();Ok(l)&&cu(Cc(n))&111551&&Bc(l.moduleReference)}}function Ll(n){const a=yi(n);a.constEnumReferenced||(a.constEnumReferenced=!0)}function dS(n,a){return n.kind===80&&cE(n)&&(n=n.parent),n.kind===80||n.parent.kind===166?lo(n,1920,!1,a):(E.assert(n.parent.kind===271),lo(n,901119,!1,a))}function xp(n,a){return n.parent?xp(n.parent,a)+"."+ii(n):ii(n,a,void 0,36)}function py(n){for(;h_(n.parent);)n=n.parent;return n}function P6(n){let a=$_(n),l=_c(a,a.escapedText,111551,void 0,a,!0);if(l){for(;h_(a.parent);){const _=Br(l);if(l=Gs(_,a.parent.right.escapedText),!l)return;a=a.parent}return l}}function lo(n,a,l,_,m){if(sc(n))return;const h=1920|(Hr(n)?a&111551:0);let x;if(n.kind===80){const N=a===h||Po(n)?d.Cannot_find_namespace_0:Swe($_(n)),F=Hr(n)&&!Po(n)?w6(n,a):void 0;if(x=Na(_c(m||n,n.escapedText,a,l||F?void 0:N,n,!0,!1)),!x)return Na(F)}else if(n.kind===166||n.kind===211){const N=n.kind===166?n.left:n.expression,F=n.kind===166?n.right:n.name;let V=lo(N,h,l,!1,m);if(!V||sc(F))return;if(V===dt)return V;if(V.valueDeclaration&&Hr(V.valueDeclaration)&&Vl(J)!==100&&Ei(V.valueDeclaration)&&V.valueDeclaration.initializer&&tNe(V.valueDeclaration.initializer)){const ne=V.valueDeclaration.initializer.arguments[0],le=Zu(ne,ne);if(le){const xe=ef(le);xe&&(V=xe)}}if(x=Na(S_(j_(V),F.escapedText,a)),!x&&V.flags&2097152&&(x=Na(S_(j_(ul(V)),F.escapedText,a))),!x){if(!l){const ne=xp(V),le=eo(F),xe=QY(F,V);if(xe){je(F,d._0_has_no_exported_member_named_1_Did_you_mean_2,ne,le,ii(xe));return}const Ne=h_(n)&&py(n);if(ye&&a&788968&&Ne&&!pC(Ne.parent)&&P6(Ne)){je(Ne,d._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,D_(Ne));return}if(a&1920&&h_(n.parent)){const kt=Na(S_(j_(V),F.escapedText,788968));if(kt){je(n.parent.right,d.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,ii(kt),bi(n.parent.right.escapedText));return}}je(F,d.Namespace_0_has_no_exported_member_1,ne,le)}return}}else E.assertNever(n,"Unknown entity name kind.");return E.assert((Ko(x)&1)===0,"Should never get an instantiated symbol here."),!Po(n)&&V_(n)&&(x.flags&2097152||n.parent.kind===277)&&T_(iz(n),x,void 0,!0),x.flags&a||_?x:ul(x)}function w6(n,a){if(XQ(n.parent)){const l=mS(n.parent);if(l)return _c(l,n.escapedText,a,void 0,n,!0)}}function mS(n){if(Ar(n,m=>Tk(m)||m.flags&16777216?op(m):"quit"))return;const l=lT(n);if(l&&kl(l)&&t8(l.expression)){const m=cn(l.expression.left);if(m)return V1(m)}if(l&&ro(l)&&t8(l.parent)&&kl(l.parent.parent)){const m=cn(l.parent.left);if(m)return V1(m)}if(l&&(Mp(l)||Hc(l))&&Gr(l.parent.parent)&&ac(l.parent.parent)===6){const m=cn(l.parent.parent.left);if(m)return V1(m)}const _=mb(n);if(_&&ks(_)){const m=cn(_);return m&&m.valueDeclaration}}function V1(n){const a=n.parent.valueDeclaration;return a?(H4(a)?aT(a):ab(a)?QP(a):void 0)||a:void 0}function wx(n){const a=n.valueDeclaration;if(!a||!Hr(a)||n.flags&524288||e1(a,!1))return;const l=Ei(a)?QP(a):aT(a);if(l){const _=tf(l);if(_)return tge(_,n)}}function Zu(n,a,l){const m=Vl(J)===1?d.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:d.Cannot_find_module_0_or_its_corresponding_type_declarations;return Pg(n,a,l?void 0:m)}function Pg(n,a,l,_=!1){return Ja(a)?lh(n,a.text,l,a,_):void 0}function lh(n,a,l,_,m=!1){var h,x,N,F,V,ne,le,xe,Ne,nt;if(Qi(a,"@types/")){const hr=d.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1,sn=g4(a,"@types/");je(_,hr,sn,a)}const kt=zQ(a,!0);if(kt)return kt;const Xt=Or(n),_r=Ja(n)?n:((h=Ar(n,G_))==null?void 0:h.arguments[0])||((x=Ar(n,gl))==null?void 0:x.moduleSpecifier)||((N=Ar(n,Ky))==null?void 0:N.moduleReference.expression)||((F=Ar(n,qc))==null?void 0:F.moduleSpecifier)||((V=vc(n)?n:n.parent&&vc(n.parent)&&n.parent.name===n?n.parent:void 0)==null?void 0:V.name)||((ne=U0(n)?n:void 0)==null?void 0:ne.argument.literal),Yr=_r&&Ja(_r)?ld(Xt,_r):Xt.impliedNodeFormat,gr=Vl(J),Ut=(le=e.getResolvedModule(Xt,a,Yr))==null?void 0:le.resolvedModule,Nr=Ut&&QV(J,Ut,Xt),Sr=Ut&&(!Nr||Nr===d.Module_0_was_resolved_to_1_but_jsx_is_not_set)&&e.getSourceFile(Ut.resolvedFileName);if(Sr){if(Nr&&je(_,Nr,a,Ut.resolvedFileName),Ut.resolvedUsingTsExtension&&Il(a)){const hr=((xe=Ar(n,gl))==null?void 0:xe.importClause)||Ar(n,ed(Hl,qc));(hr&&!hr.isTypeOnly||Ar(n,G_))&&je(_,d.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,Er(E.checkDefined(b5(a))))}else if(Ut.resolvedUsingTsExtension&&!FC(J,Xt.fileName)){const hr=((Ne=Ar(n,gl))==null?void 0:Ne.importClause)||Ar(n,ed(Hl,qc));if(!(hr?.isTypeOnly||Ar(n,Zg))){const sn=E.checkDefined(b5(a));je(_,d.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled,sn)}}if(Sr.symbol){if(Ut.isExternalLibraryImport&&!yE(Ut.extension)&&k2(!1,_,Xt,Yr,Ut,a),gr===3||gr===99){const hr=Xt.impliedNodeFormat===1&&!Ar(n,G_)||!!Ar(n,Hl),sn=Ar(n,ms=>Zg(ms)||qc(ms)||gl(ms));if(hr&&Sr.impliedNodeFormat===99&&!xre(sn))if(Ar(n,Hl))je(_,d.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead,a);else{let ms;const xs=ug(Xt.fileName);if(xs===".ts"||xs===".js"||xs===".tsx"||xs===".jsx"){const vs=Xt.packageJsonScope,Vi=xs===".ts"?".mts":xs===".js"?".mjs":void 0;vs&&!vs.contents.packageJsonContent.type?Vi?ms=ps(void 0,d.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1,Vi,Hn(vs.packageDirectory,"package.json")):ms=ps(void 0,d.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0,Hn(vs.packageDirectory,"package.json")):Vi?ms=ps(void 0,d.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module,Vi):ms=ps(void 0,d.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module)}wa.add(Hg(Or(_),_,ps(ms,d.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead,a)))}}return Na(Sr.symbol)}l&&je(_,d.File_0_is_not_a_module,Sr.fileName);return}if(Bf){const hr=Ej(Bf,sn=>sn.pattern,a);if(hr){const sn=$l&&$l.get(a);return Na(sn||hr.symbol)}}if(Ut&&!yE(Ut.extension)&&Nr===void 0||Nr===d.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type){if(m){const hr=d.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;je(_,hr,a,Ut.resolvedFileName)}else k2(se&&!!l,_,Xt,Yr,Ut,a);return}if(l){if(Ut){const hr=e.getProjectReferenceRedirect(Ut.resolvedFileName);if(hr){je(_,d.Output_file_0_has_not_been_built_from_source_file_1,hr,Ut.resolvedFileName);return}}if(Nr)je(_,Nr,a,Ut.resolvedFileName);else{const hr=U_(a)&&!ZS(a),sn=gr===3||gr===99;if(!Rv(J)&&Ho(a,".json")&&gr!==1&&w5(J))je(_,d.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,a);else if(Yr===99&&sn&&hr){const ms=is(a,qn(Xt.path)),xs=(nt=Sx.find(([vs,Vi])=>e.fileExists(ms+vs)))==null?void 0:nt[1];xs?je(_,d.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,a+xs):je(_,d.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path)}else je(_,l,a)}}return;function Er(hr){const sn=F8(a,hr);if(P5(B)||Yr===99){const ms=Il(a)&&FC(J);return sn+(hr===".mts"||hr===".d.mts"?ms?".mts":".mjs":hr===".cts"||hr===".d.mts"?ms?".cts":".cjs":ms?".ts":".js")}return sn}}function k2(n,a,l,_,{packageId:m,resolvedFileName:h},x){let N;!Tl(x)&&m&&(N=xJ(l,e,x,_,m.name)),Uf(n,a,ps(N,d.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,x,h))}function ef(n,a){if(n?.exports){const l=Cc(n.exports.get("export="),a),_=Ax(Na(l),Na(n));return Na(_)||n}}function Ax(n,a){if(!n||n===dt||n===a||a.exports.size===1||n.flags&2097152)return n;const l=yi(n);if(l.cjsExportMerged)return l.cjsExportMerged;const _=n.flags&33554432?n:h2(n);return _.flags=_.flags|512,_.exports===void 0&&(_.exports=zs()),a.exports.forEach((m,h)=>{h!=="export="&&_.exports.set(h,_.exports.has(h)?bp(_.exports.get(h),m):m)}),_===n&&(yi(_).resolvedExports=void 0,yi(_).resolvedMembers=void 0),yi(_).cjsExportMerged=_,l.cjsExportMerged=_}function dy(n,a,l,_){var m;const h=ef(n,l);if(!l&&h){if(!_&&!(h.flags&1539)&&!Wo(h,312)){const N=B>=5?"allowSyntheticDefaultImports":"esModuleInterop";return je(a,d.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,N),h}const x=a.parent;if(gl(x)&&jk(x)||G_(x)){const N=G_(x)?x.arguments[0]:x.moduleSpecifier,F=Br(h),V=KAe(F,h,n,N);if(V)return Ef(h,V,x);const ne=(m=n?.declarations)==null?void 0:m.find(Ai),le=ne&&__(Yi(N),ne.impliedNodeFormat);if(xm(J)||le){let xe=eR(F,0);if((!xe||!xe.length)&&(xe=eR(F,1)),xe&&xe.length||Gs(F,"default",!0)||le){const Ne=F.flags&3670016?eNe(F,h,n,N):rge(h,h.parent);return Ef(h,Ne,x)}}}}return h}function Ef(n,a,l){const _=Aa(n.flags,n.escapedName);_.declarations=n.declarations?n.declarations.slice():[],_.parent=n.parent,_.links.target=n,_.links.originatingImport=l,n.valueDeclaration&&(_.valueDeclaration=n.valueDeclaration),n.constEnumOnlyModule&&(_.constEnumOnlyModule=!0),n.members&&(_.members=new Map(n.members)),n.exports&&(_.exports=new Map(n.exports));const m=gd(a);return _.links.type=Qo(_,m.members,ze,ze,m.indexInfos),_}function C2(n){return n.exports.get("export=")!==void 0}function p0(n){return Qpe(wg(n))}function rD(n){const a=p0(n),l=ef(n);if(l!==n){const _=Br(l);q1(_)&&Dn(a,Wa(_))}return a}function Nx(n,a){wg(n).forEach((m,h)=>{G1(h)||a(m,h)});const _=ef(n);if(_!==n){const m=Br(_);q1(m)&&BKe(m,(h,x)=>{a(h,x)})}}function Ix(n,a){const l=wg(a);if(l)return l.get(n)}function Fx(n,a){const l=Ix(n,a);if(l)return l;const _=ef(a);if(_===a)return;const m=Br(_);return q1(m)?Gs(m,n):void 0}function q1(n){return!(n.flags&402784252||Pn(n)&1||ep(n)||pa(n))}function j_(n){return n.flags&6256?Ipe(n,"resolvedExports"):n.flags&1536?wg(n):n.exports||W}function wg(n){const a=yi(n);if(!a.resolvedExports){const{exports:l,typeOnlyExportStarMap:_}=Lx(n);a.resolvedExports=l,a.typeOnlyExportStarMap=_}return a.resolvedExports}function Ox(n,a,l,_){a&&a.forEach((m,h)=>{if(h==="default")return;const x=n.get(h);if(!x)n.set(h,m),l&&_&&l.set(h,{specifierText:Wc(_.moduleSpecifier)});else if(l&&_&&x&&Cc(x)!==Cc(m)){const N=l.get(h);N.exportsWithDuplicate?N.exportsWithDuplicate.push(_):N.exportsWithDuplicate=[_]}})}function Lx(n){const a=[];let l;const _=new Set;n=ef(n);const m=h(n)||W;return l&&_.forEach(x=>l.delete(x)),{exports:m,typeOnlyExportStarMap:l};function h(x,N,F){if(!F&&x?.exports&&x.exports.forEach((le,xe)=>_.add(xe)),!(x&&x.exports&&tp(a,x)))return;const V=new Map(x.exports),ne=x.exports.get("__export");if(ne){const le=zs(),xe=new Map;if(ne.declarations)for(const Ne of ne.declarations){const nt=Zu(Ne,Ne.moduleSpecifier),kt=h(nt,Ne,F||Ne.isTypeOnly);Ox(le,kt,xe,Ne)}xe.forEach(({exportsWithDuplicate:Ne},nt)=>{if(!(nt==="export="||!(Ne&&Ne.length)||V.has(nt)))for(const kt of Ne)wa.add(mn(kt,d.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity,xe.get(nt).specifierText,bi(nt)))}),Ox(V,le)}return N?.isTypeOnly&&(l??(l=new Map),V.forEach((le,xe)=>l.set(xe,N))),V}}function Na(n){let a;return n&&n.mergeId&&(a=gx[n.mergeId])?a:n}function cn(n){return Na(n.symbol&&JQ(n.symbol))}function tf(n){return Ed(n)?cn(n):void 0}function f_(n){return Na(n.parent&&JQ(n.parent))}function E2(n,a){const l=Or(a),_=Oa(l),m=yi(n);let h;if(m.extendedContainersByFile&&(h=m.extendedContainersByFile.get(_)))return h;if(l&&l.imports){for(const N of l.imports){if(Po(N))continue;const F=Zu(a,N,!0);!F||!my(F,n)||(h=lr(h,F))}if(Ir(h))return(m.extendedContainersByFile||(m.extendedContainersByFile=new Map)).set(_,h),h}if(m.extendedContainers)return m.extendedContainers;const x=e.getSourceFiles();for(const N of x){if(!Nc(N))continue;const F=cn(N);my(F,n)&&(h=lr(h,F))}return m.extendedContainers=h||ze}function A6(n,a,l){const _=f_(n);if(_&&!(n.flags&262144)){const x=Ii(_.declarations,h),N=a&&E2(n,a),F=H1(_,l);if(a&&_.flags&Ag(l)&&$1(_,a,1920,!1))return lr(Xi(Xi([_],x),N),F);const V=!(_.flags&Ag(l))&&_.flags&788968&&bo(_).flags&524288&&l===111551?hy(a,le=>zl(le,xe=>{if(xe.flags&Ag(l)&&Br(xe)===bo(_))return xe})):void 0;let ne=V?[V,...x,_]:[...x,_];return ne=lr(ne,F),ne=Dn(ne,N),ne}const m=Ii(n.declarations,x=>{if(!ru(x)&&x.parent){if(ws(x.parent))return cn(x.parent);if(Ld(x.parent)&&x.parent.parent&&ef(cn(x.parent.parent))===n)return cn(x.parent.parent)}if(Nl(x)&&Gr(x.parent)&&x.parent.operatorToken.kind===64&&co(x.parent.left)&&oc(x.parent.left.expression))return ag(x.parent.left)||fb(x.parent.left.expression)?cn(Or(x)):(Bc(x.parent.left.expression),Wn(x.parent.left.expression).resolvedSymbol)});if(!Ir(m))return;return Ii(m,x=>my(x,n)?x:void 0);function h(x){return _&&D2(x,_)}}function H1(n,a){const l=!!Ir(n.declarations)&&ba(n.declarations);if(a&111551&&l&&l.parent&&Ei(l.parent)&&(ma(l)&&l===l.parent.initializer||X_(l)&&l===l.parent.type))return cn(l.parent)}function D2(n,a){const l=ri(n),_=l&&l.exports&&l.exports.get("export=");return _&&Df(_,a)?l:void 0}function my(n,a){if(n===f_(a))return a;const l=n.exports&&n.exports.get("export=");if(l&&Df(l,a))return n;const _=j_(n),m=_.get(a.escapedName);return m&&Df(m,a)?m:zl(_,h=>{if(Df(h,a))return h})}function Df(n,a){if(Na(Cc(Na(n)))===Na(Cc(Na(a))))return n}function kp(n){return Na(n&&(n.flags&1048576)!==0&&n.exportSymbol||n)}function gy(n,a){return!!(n.flags&111551||n.flags&2097152&&cu(n,!a)&111551)}function $p(n){const a=n.members;for(const l of a)if(l.kind===176&&ip(l.body))return l}function Cp(n){var a;const l=new f(Jt,n);return p++,l.id=p,(a=Jr)==null||a.recordType(l),l}function d0(n,a){const l=Cp(n);return l.symbol=a,l}function P2(n){return new f(Jt,n)}function Lc(n,a,l=0,_){nD(a,_);const m=Cp(n);return m.intrinsicName=a,m.debugIntrinsicName=_,m.objectFlags=l|524288|2097152|33554432|16777216,m}function nD(n,a){const l=`${n},${a??""}`;gt.has(l)&&E.fail(`Duplicate intrinsic type name ${n}${a?` (${a})`:""}; you may need to pass a name to createIntrinsicType.`),gt.add(l)}function Hf(n,a){const l=d0(524288,a);return l.objectFlags=n,l.members=void 0,l.properties=void 0,l.callSignatures=void 0,l.constructSignatures=void 0,l.indexInfos=void 0,l}function N6(){return Mn(fs(nV.keys(),p_))}function lu(n){return d0(262144,n)}function G1(n){return n.charCodeAt(0)===95&&n.charCodeAt(1)===95&&n.charCodeAt(2)!==95&&n.charCodeAt(2)!==64&&n.charCodeAt(2)!==35}function w2(n){let a;return n.forEach((l,_)=>{gS(l,_)&&(a||(a=[])).push(l)}),a||ze}function gS(n,a){return!G1(a)&&gy(n)}function I6(n){const a=w2(n),l=VQ(n);return l?Xi(a,[l]):a}function Gf(n,a,l,_,m){const h=n;return h.members=a,h.properties=ze,h.callSignatures=l,h.constructSignatures=_,h.indexInfos=m,a!==W&&(h.properties=w2(a)),h}function Qo(n,a,l,_,m){return Gf(Hf(16,n),a,l,_,m)}function Qd(n){if(n.constructSignatures.length===0)return n;if(n.objectTypeWithoutAbstractConstructSignatures)return n.objectTypeWithoutAbstractConstructSignatures;const a=wn(n.constructSignatures,_=>!(_.flags&4));if(n.constructSignatures===a)return n;const l=Qo(n.symbol,n.members,n.callSignatures,ut(a)?a:ze,n.indexInfos);return n.objectTypeWithoutAbstractConstructSignatures=l,l.objectTypeWithoutAbstractConstructSignatures=l,l}function hy(n,a){let l;for(let _=n;_;_=_.parent){if(hm(_)&&_.locals&&!qd(_)&&(l=a(_.locals,void 0,!0,_)))return l;switch(_.kind){case 312:if(!H_(_))break;case 267:const m=cn(_);if(l=a(m?.exports||W,void 0,!0,_))return l;break;case 263:case 231:case 264:let h;if((cn(_).members||W).forEach((x,N)=>{x.flags&788968&&(h||(h=zs())).set(N,x)}),h&&(l=a(h,void 0,!1,_)))return l;break}}return a(me,void 0,!0)}function Ag(n){return n===111551?111551:1920}function $1(n,a,l,_,m=new Map){if(!(n&&!yy(n)))return;const h=yi(n),x=h.accessibleChainCache||(h.accessibleChainCache=new Map),N=hy(a,(_r,Yr,gr,Ut)=>Ut),F=`${_?0:1}|${N&&Oa(N)}|${l}`;if(x.has(F))return x.get(F);const V=Xs(n);let ne=m.get(V);ne||m.set(V,ne=[]);const le=hy(a,xe);return x.set(F,le),le;function xe(_r,Yr,gr){if(!tp(ne,_r))return;const Ut=kt(_r,Yr,gr);return ne.pop(),Ut}function Ne(_r,Yr){return!F6(_r,a,Yr)||!!$1(_r.parent,a,Ag(Yr),_,m)}function nt(_r,Yr,gr){return(n===(Yr||_r)||Na(n)===Na(Yr||_r))&&!ut(_r.declarations,ws)&&(gr||Ne(Na(_r),l))}function kt(_r,Yr,gr){return nt(_r.get(n.escapedName),void 0,Yr)?[n]:zl(_r,Nr=>{if(Nr.flags&2097152&&Nr.escapedName!=="export="&&Nr.escapedName!=="default"&&!(k5(Nr)&&a&&Nc(Or(a)))&&(!_||ut(Nr.declarations,Ky))&&(!gr||!ut(Nr.declarations,ete))&&(Yr||!Wo(Nr,281))){const Sr=ul(Nr),Er=Xt(Nr,Sr,Yr);if(Er)return Er}if(Nr.escapedName===n.escapedName&&Nr.exportSymbol&&nt(Na(Nr.exportSymbol),void 0,Yr))return[n]})||(_r===me?Xt(Xe,Xe,Yr):void 0)}function Xt(_r,Yr,gr){if(nt(_r,Yr,gr))return[_r];const Ut=j_(Yr),Nr=Ut&&xe(Ut,!0);if(Nr&&Ne(_r,Ag(l)))return[_r].concat(Nr)}}function F6(n,a,l){let _=!1;return hy(a,m=>{let h=Na(m.get(n.escapedName));if(!h)return!1;if(h===n)return!0;const x=h.flags&2097152&&!Wo(h,281);return h=x?ul(h):h,(x?cu(h):h.flags)&l?(_=!0,!0):!1}),_}function yy(n){if(n.declarations&&n.declarations.length){for(const a of n.declarations)switch(a.kind){case 172:case 174:case 177:case 178:continue;default:return!1}return!0}return!1}function k(n,a){return hi(n,a,788968,!1,!0).accessibility===0}function te(n,a){return hi(n,a,111551,!1,!0).accessibility===0}function at(n,a,l){return hi(n,a,l,!1,!1).accessibility===0}function Gt(n,a,l,_,m,h){if(!Ir(n))return;let x,N=!1;for(const F of n){const V=$1(F,a,_,!1);if(V){x=F;const xe=x_(V[0],m);if(xe)return xe}if(h&&ut(F.declarations,ws)){if(m){N=!0;continue}return{accessibility:0}}const ne=A6(F,a,_),le=Gt(ne,a,l,l===F?Ag(_):_,m,h);if(le)return le}if(N)return{accessibility:0};if(x)return{accessibility:1,errorSymbolName:ii(l,a,_),errorModuleName:x!==l?ii(x,a,1920):void 0}}function pn(n,a,l,_){return hi(n,a,l,_,!0)}function hi(n,a,l,_,m){if(n&&a){const h=Gt([n],a,n,l,_,m);if(h)return h;const x=Zt(n.declarations,ri);if(x){const N=ri(a);if(x!==N)return{accessibility:2,errorSymbolName:ii(n,a,l),errorModuleName:ii(x),errorNode:Hr(a)?a:void 0}}return{accessibility:1,errorSymbolName:ii(n,a,l)}}return{accessibility:0}}function ri(n){const a=Ar(n,Mi);return a&&cn(a)}function Mi(n){return ru(n)||n.kind===312&&H_(n)}function ws(n){return II(n)||n.kind===312&&H_(n)}function x_(n,a){let l;if(!qi(wn(n.declarations,h=>h.kind!==80),_))return;return{accessibility:0,aliasesToMakeVisible:l};function _(h){var x,N;if(!uh(h)){const F=kx(h);if(F&&!In(F,32)&&uh(F.parent))return m(h,F);if(Ei(h)&&ec(h.parent.parent)&&!In(h.parent.parent,32)&&uh(h.parent.parent.parent))return m(h,h.parent.parent);if(FI(h)&&!In(h,32)&&uh(h.parent))return m(h,h);if(Pa(h)){if(n.flags&2097152&&Hr(h)&&((x=h.parent)!=null&&x.parent)&&Ei(h.parent.parent)&&((N=h.parent.parent.parent)!=null&&N.parent)&&ec(h.parent.parent.parent.parent)&&!In(h.parent.parent.parent.parent,32)&&h.parent.parent.parent.parent.parent&&uh(h.parent.parent.parent.parent.parent))return m(h,h.parent.parent.parent.parent);if(n.flags&2){const V=Ar(h,ec);return In(V,32)?!0:uh(V.parent)?m(h,V):!1}}return!1}return!0}function m(h,x){return a&&(Wn(h).isVisible=!0,l=Bg(l,x)),!0}}function B_(n,a){let l;n.parent.kind===186||n.parent.kind===233&&!ig(n.parent)||n.parent.kind===167?l=1160127:n.kind===166||n.kind===211||n.parent.kind===271?l=1920:l=788968;const _=$_(n),m=_c(a,_.escapedText,l,void 0,void 0,!1);return m&&m.flags&262144&&l&788968?{accessibility:0}:!m&&Lv(_)&&pn(cn(i_(_,!1,!1)),_,l,!1).accessibility===0?{accessibility:0}:m&&x_(m,!0)||{accessibility:1,errorSymbolName:Wc(_),errorNode:_}}function ii(n,a,l,_=4,m){let h=70221824;_&2&&(h|=128),_&1&&(h|=512),_&8&&(h|=16384),_&32&&(h|=134217728),_&16&&(h|=1073741824);const x=_&4?pt.symbolToNode:pt.symbolToEntityName;return m?N(m).getText():R4(N);function N(F){const V=x(n,l,a,h),ne=a?.kind===312?AV():t2(),le=a&&Or(a);return ne.writeNode(4,V,le,F),F}}function Yd(n,a,l=0,_,m){return m?h(m).getText():R4(h);function h(x){let N;l&262144?N=_===1?185:184:N=_===1?180:179;const F=pt.signatureToSignatureDeclaration(n,N,a,X1(l)|70221824|512),V=Gw(),ne=a&&Or(a);return V.writeNode(4,F,ne,gz(x)),x}}function mr(n,a,l=1064960,_=h8("")){const m=J.noErrorTruncation||l&1,h=pt.typeToTypeNode(n,a,X1(l)|70221824|(m?1:0));if(h===void 0)return E.fail("should always get typenode");const x=n!==Ct?t2():wV(),N=a&&Or(a);x.writeNode(4,h,N,_);const F=_.getText(),V=m?Q5*2:B8*2;return V&&F&&F.length>=V?F.substr(0,V-3)+"...":F}function vy(n,a){let l=hS(n.symbol)?mr(n,n.symbol.valueDeclaration):mr(n),_=hS(a.symbol)?mr(a,a.symbol.valueDeclaration):mr(a);return l===_&&(l=m0(n),_=m0(a)),[l,_]}function m0(n){return mr(n,void 0,64)}function hS(n){return n&&!!n.valueDeclaration&&ct(n.valueDeclaration)&&!Zf(n.valueDeclaration)}function X1(n=0){return n&848330091}function Mx(n){return!!n.symbol&&!!(n.symbol.flags&32)&&(n===Qf(n.symbol)||!!(n.flags&524288)&&!!(Pn(n)&16777216))}function yS(){return{typeToTypeNode:($e,de,qr,dn)=>a(de,qr,dn,Zn=>_($e,Zn)),indexInfoToIndexSignatureDeclaration:($e,de,qr,dn)=>a(de,qr,dn,Zn=>ne($e,Zn,void 0)),signatureToSignatureDeclaration:($e,de,qr,dn,Zn)=>a(qr,dn,Zn,Xn=>le($e,de,Xn)),symbolToEntityName:($e,de,qr,dn,Zn)=>a(qr,dn,Zn,Xn=>Vi($e,Xn,de,!1)),symbolToExpression:($e,de,qr,dn,Zn)=>a(qr,dn,Zn,Xn=>Cu($e,Xn,de)),symbolToTypeParameterDeclarations:($e,de,qr,dn)=>a(de,qr,dn,Zn=>Nr($e,Zn)),symbolToParameterDeclaration:($e,de,qr,dn)=>a(de,qr,dn,Zn=>Xt($e,Zn)),typeParameterToDeclaration:($e,de,qr,dn)=>a(de,qr,dn,Zn=>nt($e,Zn)),symbolTableToDeclarationStatements:($e,de,qr,dn,Zn)=>a(de,qr,dn,Xn=>af($e,Xn,Zn)),symbolToNode:($e,de,qr,dn,Zn)=>a(qr,dn,Zn,Xn=>n($e,Xn,de))};function n($e,de,qr){if(de.flags&1073741824){if($e.valueDeclaration){const Zn=as($e.valueDeclaration);if(Zn&&xa(Zn))return Zn}const dn=yi($e).nameType;if(dn&&dn.flags&9216)return de.enclosingDeclaration=dn.symbol.valueDeclaration,I.createComputedPropertyName(Cu(dn.symbol,de,qr))}return Cu($e,de,qr)}function a($e,de,qr,dn){E.assert($e===void 0||($e.flags&16)===0);const Zn=qr?.trackSymbol?qr.moduleResolverHost:de&134217728?P9e(e):void 0,Xn={enclosingDeclaration:$e,flags:de||0,tracker:void 0,encounteredError:!1,reportedDiagnostic:!1,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0,trackedSymbols:void 0};Xn.tracker=new iV(Xn,qr,Zn);const ui=dn(Xn);return Xn.truncating&&Xn.flags&1&&Xn.tracker.reportTruncationError(),Xn.encounteredError?void 0:ui}function l($e){return $e.truncating?$e.truncating:$e.truncating=$e.approximateLength>($e.flags&1?Q5:B8)}function _($e,de){const qr=de.flags,dn=m($e,de);return de.flags=qr,dn}function m($e,de){var qr,dn;i&&i.throwIfCancellationRequested&&i.throwIfCancellationRequested();const Zn=de.flags&8388608;if(de.flags&=-8388609,!$e){if(!(de.flags&262144)){de.encounteredError=!0;return}return de.approximateLength+=3,I.createKeywordTypeNode(133)}if(de.flags&536870912||($e=hd($e)),$e.flags&1)return $e.aliasSymbol?I.createTypeReferenceNode(sn($e.aliasSymbol),F($e.aliasTypeArguments,de)):$e===Ct?NE(I.createKeywordTypeNode(133),3,"unresolved"):(de.approximateLength+=3,I.createKeywordTypeNode($e===er?141:133));if($e.flags&2)return I.createKeywordTypeNode(159);if($e.flags&4)return de.approximateLength+=6,I.createKeywordTypeNode(154);if($e.flags&8)return de.approximateLength+=6,I.createKeywordTypeNode(150);if($e.flags&64)return de.approximateLength+=6,I.createKeywordTypeNode(163);if($e.flags&16&&!$e.aliasSymbol)return de.approximateLength+=7,I.createKeywordTypeNode(136);if($e.flags&1056){if($e.symbol.flags&8){const pr=f_($e.symbol),Vn=ms(pr,de,788968);if(bo(pr)===$e)return Vn;const mi=pc($e.symbol);return lf(mi,0)?ai(Vn,I.createTypeReferenceNode(mi,void 0)):Zg(Vn)?(Vn.isTypeOf=!0,I.createIndexedAccessTypeNode(Vn,I.createLiteralTypeNode(I.createStringLiteral(mi)))):mp(Vn)?I.createIndexedAccessTypeNode(I.createTypeQueryNode(Vn.typeName),I.createLiteralTypeNode(I.createStringLiteral(mi))):E.fail("Unhandled type node kind returned from `symbolToTypeNode`.")}return ms($e.symbol,de,788968)}if($e.flags&128)return de.approximateLength+=$e.value.length+2,I.createLiteralTypeNode(Vr(I.createStringLiteral($e.value,!!(de.flags&268435456)),16777216));if($e.flags&256){const pr=$e.value;return de.approximateLength+=(""+pr).length,I.createLiteralTypeNode(pr<0?I.createPrefixUnaryExpression(41,I.createNumericLiteral(-pr)):I.createNumericLiteral(pr))}if($e.flags&2048)return de.approximateLength+=Bv($e.value).length+1,I.createLiteralTypeNode(I.createBigIntLiteral($e.value));if($e.flags&512)return de.approximateLength+=$e.intrinsicName.length,I.createLiteralTypeNode($e.intrinsicName==="true"?I.createTrue():I.createFalse());if($e.flags&8192){if(!(de.flags&1048576)){if(te($e.symbol,de.enclosingDeclaration))return de.approximateLength+=6,ms($e.symbol,de,111551);de.tracker.reportInaccessibleUniqueSymbolError&&de.tracker.reportInaccessibleUniqueSymbolError()}return de.approximateLength+=13,I.createTypeOperatorNode(158,I.createKeywordTypeNode(155))}if($e.flags&16384)return de.approximateLength+=4,I.createKeywordTypeNode(116);if($e.flags&32768)return de.approximateLength+=9,I.createKeywordTypeNode(157);if($e.flags&65536)return de.approximateLength+=4,I.createLiteralTypeNode(I.createNull());if($e.flags&131072)return de.approximateLength+=5,I.createKeywordTypeNode(146);if($e.flags&4096)return de.approximateLength+=6,I.createKeywordTypeNode(155);if($e.flags&67108864)return de.approximateLength+=6,I.createKeywordTypeNode(151);if(CE($e))return de.flags&4194304&&(!de.encounteredError&&!(de.flags&32768)&&(de.encounteredError=!0),(dn=(qr=de.tracker).reportInaccessibleThisError)==null||dn.call(qr)),de.approximateLength+=4,I.createThisTypeNode();if(!Zn&&$e.aliasSymbol&&(de.flags&16384||k($e.aliasSymbol,de.enclosingDeclaration))){const pr=F($e.aliasTypeArguments,de);return G1($e.aliasSymbol.escapedName)&&!($e.aliasSymbol.flags&32)?I.createTypeReferenceNode(I.createIdentifier(""),pr):Ir(pr)===1&&$e.aliasSymbol===Ps.symbol?I.createArrayTypeNode(pr[0]):ms($e.aliasSymbol,de,788968,pr)}const Xn=Pn($e);if(Xn&4)return E.assert(!!($e.flags&524288)),$e.node?jt($e,vr):vr($e);if($e.flags&262144||Xn&3){if($e.flags&262144&&_s(de.inferTypeParameters,$e)){de.approximateLength+=pc($e.symbol).length+6;let Vn;const mi=ku($e);if(mi){const Bi=IPe($e,!0);Bi&&hh(mi,Bi)||(de.approximateLength+=9,Vn=mi&&_(mi,de))}return I.createInferTypeNode(Ne($e,de,Vn))}if(de.flags&4&&$e.flags&262144&&!k($e.symbol,de.enclosingDeclaration)){const Vn=vs($e,de);return de.approximateLength+=an(Vn).length,I.createTypeReferenceNode(I.createIdentifier(an(Vn)),void 0)}if($e.symbol)return ms($e.symbol,de,788968);const pr=($e===A||$e===Pe)&&O&&O.symbol?($e===Pe?"sub-":"super-")+pc(O.symbol):"?";return I.createTypeReferenceNode(I.createIdentifier(pr),void 0)}if($e.flags&1048576&&$e.origin&&($e=$e.origin),$e.flags&3145728){const pr=$e.flags&1048576?g0($e.types):$e.types;if(Ir(pr)===1)return _(pr[0],de);const Vn=F(pr,de,!0);if(Vn&&Vn.length>0)return $e.flags&1048576?I.createUnionTypeNode(Vn):I.createIntersectionTypeNode(Vn);!de.encounteredError&&!(de.flags&262144)&&(de.encounteredError=!0);return}if(Xn&48)return E.assert(!!($e.flags&524288)),Vt($e);if($e.flags&4194304){const pr=$e.type;de.approximateLength+=6;const Vn=_(pr,de);return I.createTypeOperatorNode(143,Vn)}if($e.flags&134217728){const pr=$e.texts,Vn=$e.types,mi=I.createTemplateHead(pr[0]),Bi=I.createNodeArray(Yt(Vn,($s,_l)=>I.createTemplateLiteralTypeSpan(_($s,de),(_lui(pr));if($e.flags&33554432)return _($e.baseType,de);return E.fail("Should be unreachable.");function ui(pr){const Vn=_(pr.checkType,de);if(de.approximateLength+=15,de.flags&4&&pr.root.isDistributive&&!(pr.checkType.flags&262144)){const Bo=lu(Aa(262144,"T")),Fo=vs(Bo,de),_u=I.createTypeReferenceNode(Fo);de.approximateLength+=37;const Jo=$x(pr.root.checkType,Bo,pr.mapper),Ge=de.inferTypeParameters;de.inferTypeParameters=pr.root.inferTypeParameters;const _t=_(Ri(pr.root.extendsType,Jo),de);de.inferTypeParameters=Ge;const zt=Sn(Ri(si(pr.root.node.trueType),Jo)),Pr=Sn(Ri(si(pr.root.node.falseType),Jo));return I.createConditionalTypeNode(Vn,I.createInferTypeNode(I.createTypeParameterDeclaration(void 0,I.cloneNode(_u.typeName))),I.createConditionalTypeNode(I.createTypeReferenceNode(I.cloneNode(Fo)),_(pr.checkType,de),I.createConditionalTypeNode(_u,_t,zt,Pr),I.createKeywordTypeNode(146)),I.createKeywordTypeNode(146))}const mi=de.inferTypeParameters;de.inferTypeParameters=pr.root.inferTypeParameters;const Bi=_(pr.extendsType,de);de.inferTypeParameters=mi;const $s=Sn(iv(pr)),_l=Sn(sv(pr));return I.createConditionalTypeNode(Vn,Bi,$s,_l)}function Sn(pr){var Vn,mi,Bi;return pr.flags&1048576?(Vn=de.visitedTypes)!=null&&Vn.has(Wu(pr))?(de.flags&131072||(de.encounteredError=!0,(Bi=(mi=de.tracker)==null?void 0:mi.reportCyclicStructureError)==null||Bi.call(mi)),h(de)):jt(pr,$s=>_($s,de)):_(pr,de)}function un(pr){return!!cY(pr)}function Ke(pr){return!!pr.target&&un(pr.target)&&!un(pr)}function xt(pr){var Vn;E.assert(!!(pr.flags&524288));const mi=pr.declaration.readonlyToken?I.createToken(pr.declaration.readonlyToken.kind):void 0,Bi=pr.declaration.questionToken?I.createToken(pr.declaration.questionToken.kind):void 0;let $s,_l;const Bo=!NN(pr)&&!(Jx(pr).flags&2)&&de.flags&4&&!(Ep(pr).flags&262144&&((Vn=ku(Ep(pr)))==null?void 0:Vn.flags)&4194304);if(NN(pr)){if(Ke(pr)&&de.flags&4){const zt=lu(Aa(262144,"T")),Pr=vs(zt,de);_l=I.createTypeReferenceNode(Pr)}$s=I.createTypeOperatorNode(143,_l||_(Jx(pr),de))}else if(Bo){const zt=lu(Aa(262144,"T")),Pr=vs(zt,de);_l=I.createTypeReferenceNode(Pr),$s=_l}else $s=_(Ep(pr),de);const Fo=Ne(md(pr),de,$s),_u=pr.declaration.nameType?_(y0(pr),de):void 0,Jo=_(My(dh(pr),!!(qm(pr)&4)),de),Ge=I.createMappedTypeNode(mi,Fo,_u,Bi,Jo,void 0);de.approximateLength+=10;const _t=Vr(Ge,1);if(Ke(pr)&&de.flags&4){const zt=Ri(ku(si(pr.declaration.typeParameter.constraint.type))||or,pr.mapper);return I.createConditionalTypeNode(_(Jx(pr),de),I.createInferTypeNode(I.createTypeParameterDeclaration(void 0,I.cloneNode(_l.typeName),zt.flags&2?void 0:_(zt,de))),_t,I.createKeywordTypeNode(146))}else if(Bo)return I.createConditionalTypeNode(_(Ep(pr),de),I.createInferTypeNode(I.createTypeParameterDeclaration(void 0,I.cloneNode(_l.typeName),I.createTypeOperatorNode(143,_(Jx(pr),de)))),_t,I.createKeywordTypeNode(146));return _t}function Vt(pr){var Vn,mi;const Bi=pr.id,$s=pr.symbol;if($s){const Bo=Mx(pr)?788968:111551;if(nm($s.valueDeclaration))return ms($s,de,Bo);if($s.flags&32&&!SS($s)&&!($s.valueDeclaration&&Qn($s.valueDeclaration)&&de.flags&2048&&(!Vc($s.valueDeclaration)||pn($s,de.enclosingDeclaration,Bo,!1).accessibility!==0))||$s.flags&896||_l())return ms($s,de,Bo);if((Vn=de.visitedTypes)!=null&&Vn.has(Bi)){const Fo=O6(pr);return Fo?ms(Fo,de,788968):h(de)}else return jt(pr,$t)}else{if(!!(Pn(pr)&8388608)){const Fo=pr;if(lC(Fo.node)){const _u=So(de,Fo.node);if(_u)return _u}return(mi=de.visitedTypes)!=null&&mi.has(Bi)?h(de):jt(pr,$t)}return $t(pr)}function _l(){var Bo;const Fo=!!($s.flags&8192)&&ut($s.declarations,Jo=>Ls(Jo)),_u=!!($s.flags&16)&&($s.parent||Zt($s.declarations,Jo=>Jo.parent.kind===312||Jo.parent.kind===268));if(Fo||_u)return(!!(de.flags&4096)||((Bo=de.visitedTypes)==null?void 0:Bo.has(Bi)))&&(!(de.flags&8)||te($s,de.enclosingDeclaration))}}function jt(pr,Vn){var mi,Bi,$s;const _l=pr.id,Bo=Pn(pr)&16&&pr.symbol&&pr.symbol.flags&32,Fo=Pn(pr)&4&&pr.node?"N"+Oa(pr.node):pr.flags&16777216?"N"+Oa(pr.root.node):pr.symbol?(Bo?"+":"")+Xs(pr.symbol):void 0;de.visitedTypes||(de.visitedTypes=new Set),Fo&&!de.symbolDepth&&(de.symbolDepth=new Map);const _u=de.enclosingDeclaration&&Wn(de.enclosingDeclaration),Jo=`${Wu(pr)}|${de.flags}`;_u&&(_u.serializedTypes||(_u.serializedTypes=new Map));const Ge=(mi=_u?.serializedTypes)==null?void 0:mi.get(Jo);if(Ge)return(Bi=Ge.trackedSymbols)==null||Bi.forEach(([oi,cs,Js])=>de.tracker.trackSymbol(oi,cs,Js)),Ge.truncating&&(de.truncating=!0),de.approximateLength+=Ge.addedLength,nn(Ge.node);let _t;if(Fo){if(_t=de.symbolDepth.get(Fo)||0,_t>10)return h(de);de.symbolDepth.set(Fo,_t+1)}de.visitedTypes.add(_l);const zt=de.trackedSymbols;de.trackedSymbols=void 0;const Pr=de.approximateLength,ln=Vn(pr),ir=de.approximateLength-Pr;return!de.reportedDiagnostic&&!de.encounteredError&&(($s=_u?.serializedTypes)==null||$s.set(Jo,{node:ln,truncating:de.truncating,addedLength:ir,trackedSymbols:de.trackedSymbols})),de.visitedTypes.delete(_l),Fo&&de.symbolDepth.set(Fo,_t),de.trackedSymbols=zt,ln;function nn(oi){return!Po(oi)&&ss(oi)===oi?oi:tt(I.cloneNode(sr(oi,nn,cd,Kn)),oi)}function Kn(oi,cs,Js,Vs,ti){return oi&&oi.length===0?tt(I.createNodeArray(void 0,oi.hasTrailingComma),oi):kr(oi,cs,Js,Vs,ti)}}function $t(pr){if(Af(pr)||pr.containsError)return xt(pr);const Vn=gd(pr);if(!Vn.properties.length&&!Vn.indexInfos.length){if(!Vn.callSignatures.length&&!Vn.constructSignatures.length)return de.approximateLength+=2,Vr(I.createTypeLiteralNode(void 0),1);if(Vn.callSignatures.length===1&&!Vn.constructSignatures.length){const Bo=Vn.callSignatures[0];return le(Bo,184,de)}if(Vn.constructSignatures.length===1&&!Vn.callSignatures.length){const Bo=Vn.constructSignatures[0];return le(Bo,185,de)}}const mi=wn(Vn.constructSignatures,Bo=>!!(Bo.flags&4));if(ut(mi)){const Bo=Yt(mi,DS);return Vn.callSignatures.length+(Vn.constructSignatures.length-mi.length)+Vn.indexInfos.length+(de.flags&2048?Ch(Vn.properties,_u=>!(_u.flags&4194304)):Ir(Vn.properties))&&Bo.push(Qd(Vn)),_(fa(Bo),de)}const Bi=de.flags;de.flags|=4194304;const $s=Hi(Vn);de.flags=Bi;const _l=I.createTypeLiteralNode($s);return de.approximateLength+=2,Vr(_l,de.flags&1024?0:1),_l}function vr(pr){let Vn=uo(pr);if(pr.target===Ps||pr.target===Fs){if(de.flags&2){const $s=_(Vn[0],de);return I.createTypeReferenceNode(pr.target===Ps?"Array":"ReadonlyArray",[$s])}const mi=_(Vn[0],de),Bi=I.createArrayTypeNode(mi);return pr.target===Ps?Bi:I.createTypeOperatorNode(148,Bi)}else if(pr.target.objectFlags&8){if(Vn=Yc(Vn,(mi,Bi)=>My(mi,!!(pr.target.elementFlags[Bi]&2))),Vn.length>0){const mi=b0(pr),Bi=F(Vn.slice(0,mi),de);if(Bi){const{labeledElementDeclarations:$s}=pr.target;for(let Bo=0;Bo0){const _u=(pr.target.typeParameters||ze).length;_l=F(Vn.slice(Bi,_u),de)}const Bo=de.flags;de.flags|=16;const Fo=ms(pr.symbol,de,788968,_l);return de.flags=Bo,$s?ai($s,Fo):Fo}}}function ai(pr,Vn){if(Zg(pr)){let mi=pr.typeArguments,Bi=pr.qualifier;Bi&&(Ie(Bi)?mi!==kb(Bi)&&(Bi=Vh(I.cloneNode(Bi),mi)):mi!==kb(Bi.right)&&(Bi=I.updateQualifiedName(Bi,Bi.left,Vh(I.cloneNode(Bi.right),mi)))),mi=Vn.typeArguments;const $s=Un(Vn);for(const _l of $s)Bi=Bi?I.createQualifiedName(Bi,_l):_l;return I.updateImportTypeNode(pr,pr.argument,pr.attributes,Bi,mi,pr.isTypeOf)}else{let mi=pr.typeArguments,Bi=pr.typeName;Ie(Bi)?mi!==kb(Bi)&&(Bi=Vh(I.cloneNode(Bi),mi)):mi!==kb(Bi.right)&&(Bi=I.updateQualifiedName(Bi,Bi.left,Vh(I.cloneNode(Bi.right),mi))),mi=Vn.typeArguments;const $s=Un(Vn);for(const _l of $s)Bi=I.createQualifiedName(Bi,_l);return I.updateTypeReferenceNode(pr,Bi,mi)}}function Un(pr){let Vn=pr.typeName;const mi=[];for(;!Ie(Vn);)mi.unshift(Vn.right),Vn=Vn.left;return mi.unshift(Vn),mi}function Hi(pr){if(l(de))return[I.createPropertySignature(void 0,"...",void 0,void 0)];const Vn=[];for(const $s of pr.callSignatures)Vn.push(le($s,179,de));for(const $s of pr.constructSignatures)$s.flags&4||Vn.push(le($s,180,de));for(const $s of pr.indexInfos)Vn.push(ne($s,de,pr.objectFlags&1024?h(de):void 0));const mi=pr.properties;if(!mi)return Vn;let Bi=0;for(const $s of mi){if(Bi++,de.flags&2048){if($s.flags&4194304)continue;Mf($s)&6&&de.tracker.reportPrivateInBaseOfClassExpression&&de.tracker.reportPrivateInBaseOfClassExpression(bi($s.escapedName))}if(l(de)&&Bi+2!(vr.flags&32768)),0);for(const vr of $t){const ai=le(vr,173,de,{name:Sn,questionToken:un});qr.push(jt(ai))}if($t.length||!un)return}let Ke;x($e,de)?Ke=h(de):(Zn&&(de.reverseMappedStack||(de.reverseMappedStack=[]),de.reverseMappedStack.push($e)),Ke=Xn?il(de,Xn,$e,ui):I.createKeywordTypeNode(133),Zn&&de.reverseMappedStack.pop());const xt=Td($e)?[I.createToken(148)]:void 0;xt&&(de.approximateLength+=9);const Vt=I.createPropertySignature(xt,Sn,un,Ke);qr.push(jt(Vt));function jt($t){var vr;const ai=(vr=$e.declarations)==null?void 0:vr.find(Un=>Un.kind===355);if(ai){const Un=vP(ai.comment);Un&&l1($t,[{kind:3,text:`* + * `+Un.replace(/\n/g,` + * `)+` + `,pos:-1,end:-1,hasTrailingNewLine:!0}])}else $e.valueDeclaration&&Ac($t,$e.valueDeclaration);return $t}}function F($e,de,qr){if(ut($e)){if(l(de))if(qr){if($e.length>2)return[_($e[0],de),I.createTypeReferenceNode(`... ${$e.length-2} more ...`,void 0),_($e[$e.length-1],de)]}else return[I.createTypeReferenceNode("...",void 0)];const Zn=!(de.flags&64)?of():void 0,Xn=[];let ui=0;for(const Sn of $e){if(ui++,l(de)&&ui+2<$e.length-1){Xn.push(I.createTypeReferenceNode(`... ${$e.length-ui} more ...`,void 0));const Ke=_($e[$e.length-1],de);Ke&&Xn.push(Ke);break}de.approximateLength+=2;const un=_(Sn,de);un&&(Xn.push(un),Zn&&dre(un)&&Zn.add(un.typeName.escapedText,[Sn,Xn.length-1]))}if(Zn){const Sn=de.flags;de.flags|=64,Zn.forEach(un=>{if(!mre(un,([Ke],[xt])=>V(Ke,xt)))for(const[Ke,xt]of un)Xn[xt]=_(Ke,de)}),de.flags=Sn}return Xn}}function V($e,de){return $e===de||!!$e.symbol&&$e.symbol===de.symbol||!!$e.aliasSymbol&&$e.aliasSymbol===de.aliasSymbol}function ne($e,de,qr){const dn=Mee($e)||"x",Zn=_($e.keyType,de),Xn=I.createParameterDeclaration(void 0,void 0,dn,void 0,Zn,void 0);return qr||(qr=_($e.type||G,de)),!$e.type&&!(de.flags&2097152)&&(de.encounteredError=!0),de.approximateLength+=dn.length+4,I.createIndexSignature($e.isReadonly?[I.createToken(148)]:void 0,[Xn],qr)}function le($e,de,qr,dn){var Zn;const Xn=qr.flags&256;Xn&&(qr.flags&=-257),qr.approximateLength+=3;let ui,Sn;qr.flags&32&&$e.target&&$e.mapper&&$e.target.typeParameters?Sn=$e.target.typeParameters.map(Hi=>_(Ri(Hi,$e.mapper),qr)):ui=$e.typeParameters&&$e.typeParameters.map(Hi=>nt(Hi,qr));const un=cPe($e,!0)[0];let Ke;if(qr.enclosingDeclaration&&$e.declaration&&$e.declaration!==qr.enclosingDeclaration&&!Hr($e.declaration)&&ut(un)){const Hi=Wn(qr.enclosingDeclaration).fakeScopeForSignatureDeclaration?qr.enclosingDeclaration:void 0;E.assertOptionalNode(Hi,Ss);const pr=Hi?.locals??zs();let Vn;for(const mi of un)pr.has(mi.escapedName)||(Vn=lr(Vn,mi.escapedName),pr.set(mi.escapedName,mi));if(Vn){let mi=function(){Zt(Vn,Bi=>pr.delete(Bi))};var xt=mi;if(Hi)Ke=mi;else{const Bi=wm.createBlock(ze);Wn(Bi).fakeScopeForSignatureDeclaration=!0,Bi.locals=pr;const $s=qr.enclosingDeclaration;ga(Bi,$s),qr.enclosingDeclaration=Bi,Ke=()=>{qr.enclosingDeclaration=$s,mi()}}}}const Vt=(ut(un,Hi=>Hi!==un[un.length-1]&&!!(Ko(Hi)&32768))?$e.parameters:un).map(Hi=>Xt(Hi,qr,de===176,dn?.privateSymbolVisitor,dn?.bundledImports)),jt=qr.flags&33554432?void 0:xe($e,qr);jt&&Vt.unshift(jt);let $t;const vr=Yf($e);if(vr){const Hi=vr.kind===2||vr.kind===3?I.createToken(131):void 0,pr=vr.kind===1||vr.kind===3?Vr(I.createIdentifier(vr.parameterName),16777216):I.createThisTypeNode(),Vn=vr.type&&_(vr.type,qr);$t=I.createTypePredicateNode(Hi,pr,Vn)}else{const Hi=Ma($e);Hi&&!(Xn&&Ae(Hi))?$t=vl(qr,Hi,$e,dn?.privateSymbolVisitor,dn?.bundledImports):Xn||($t=I.createKeywordTypeNode(133))}let ai=dn?.modifiers;if(de===185&&$e.flags&4){const Hi=Nd(ai);ai=I.createModifiersFromModifierFlags(Hi|64)}const Un=de===179?I.createCallSignature(ui,Vt,$t):de===180?I.createConstructSignature(ui,Vt,$t):de===173?I.createMethodSignature(ai,dn?.name??I.createIdentifier(""),dn?.questionToken,ui,Vt,$t):de===174?I.createMethodDeclaration(ai,void 0,dn?.name??I.createIdentifier(""),void 0,ui,Vt,$t,void 0):de===176?I.createConstructorDeclaration(ai,Vt,void 0):de===177?I.createGetAccessorDeclaration(ai,dn?.name??I.createIdentifier(""),Vt,$t,void 0):de===178?I.createSetAccessorDeclaration(ai,dn?.name??I.createIdentifier(""),Vt,void 0):de===181?I.createIndexSignature(ai,Vt,$t):de===324?I.createJSDocFunctionType(Vt,$t):de===184?I.createFunctionTypeNode(ui,Vt,$t??I.createTypeReferenceNode(I.createIdentifier(""))):de===185?I.createConstructorTypeNode(ai,ui,Vt,$t??I.createTypeReferenceNode(I.createIdentifier(""))):de===262?I.createFunctionDeclaration(ai,void 0,dn?.name?Ms(dn.name,Ie):I.createIdentifier(""),ui,Vt,$t,void 0):de===218?I.createFunctionExpression(ai,void 0,dn?.name?Ms(dn.name,Ie):I.createIdentifier(""),ui,Vt,$t,I.createBlock([])):de===219?I.createArrowFunction(ai,ui,Vt,$t,void 0,I.createBlock([])):E.assertNever(de);if(Sn&&(Un.typeArguments=I.createNodeArray(Sn)),((Zn=$e.declaration)==null?void 0:Zn.kind)===330&&$e.declaration.parent.kind===346){const Hi=Wc($e.declaration.parent.parent,!0).slice(2,-2).split(/\r\n|\n|\r/).map(pr=>pr.replace(/^\s+/," ")).join(` +`);NE(Un,3,Hi,!0)}return Ke?.(),Un}function xe($e,de){if($e.thisParameter)return Xt($e.thisParameter,de);if($e.declaration&&Hr($e.declaration)){const qr=lI($e.declaration);if(qr&&qr.typeExpression)return I.createParameterDeclaration(void 0,void 0,"this",void 0,_(si(qr.typeExpression),de))}}function Ne($e,de,qr){const dn=de.flags;de.flags&=-513;const Zn=I.createModifiersFromModifierFlags(Jde($e)),Xn=vs($e,de),ui=ES($e),Sn=ui&&_(ui,de);return de.flags=dn,I.createTypeParameterDeclaration(Zn,Xn,qr,Sn)}function nt($e,de,qr=ku($e)){const dn=qr&&_(qr,de);return Ne($e,de,dn)}function kt($e){const de=Wo($e,169);if(de)return de;if(!ym($e))return Wo($e,348)}function Xt($e,de,qr,dn,Zn){const Xn=kt($e);let ui=Br($e);Xn&&H7e(Xn)&&(ui=Ly(ui));const Sn=il(de,ui,$e,de.enclosingDeclaration,dn,Zn),un=!(de.flags&8192)&&qr&&Xn&&Wp(Xn)?Yt(hv(Xn),I.cloneNode):void 0,xt=Xn&&rg(Xn)||Ko($e)&32768?I.createToken(26):void 0,Vt=_r($e,Xn,de),$t=Xn&&ON(Xn)||Ko($e)&16384?I.createToken(58):void 0,vr=I.createParameterDeclaration(un,xt,Vt,$t,Sn,void 0);return de.approximateLength+=pc($e).length+3,vr}function _r($e,de,qr){return de&&de.name?de.name.kind===80?Vr(I.cloneNode(de.name),16777216):de.name.kind===166?Vr(I.cloneNode(de.name.right),16777216):dn(de.name):pc($e);function dn(Zn){return Xn(Zn);function Xn(ui){qr.tracker.canTrackSymbol&&xa(ui)&&Npe(ui)&&Yr(ui.expression,qr.enclosingDeclaration,qr);let Sn=sr(ui,Xn,cd,void 0,Xn);return Pa(Sn)&&(Sn=I.updateBindingElement(Sn,Sn.dotDotDotToken,Sn.propertyName,Sn.name,void 0)),Po(Sn)||(Sn=I.cloneNode(Sn)),Vr(Sn,16777217)}}}function Yr($e,de,qr){if(!qr.tracker.canTrackSymbol)return;const dn=$_($e),Zn=_c(dn,dn.escapedText,1160127,void 0,void 0,!0);Zn&&qr.tracker.trackSymbol(Zn,de,111551)}function gr($e,de,qr,dn){return de.tracker.trackSymbol($e,de.enclosingDeclaration,qr),Ut($e,de,qr,dn)}function Ut($e,de,qr,dn){let Zn;return!($e.flags&262144)&&(de.enclosingDeclaration||de.flags&64)&&!(de.flags&134217728)?(Zn=E.checkDefined(ui($e,qr,!0)),E.assert(Zn&&Zn.length>0)):Zn=[$e],Zn;function ui(Sn,un,Ke){let xt=$1(Sn,de.enclosingDeclaration,un,!!(de.flags&128)),Vt;if(!xt||F6(xt[0],de.enclosingDeclaration,xt.length===1?un:Ag(un))){const $t=A6(xt?xt[0]:Sn,de.enclosingDeclaration,un);if(Ir($t)){Vt=$t.map(Un=>ut(Un.declarations,ws)?hr(Un,de):void 0);const vr=$t.map((Un,Hi)=>Hi);vr.sort(jt);const ai=vr.map(Un=>$t[Un]);for(const Un of ai){const Hi=ui(Un,Ag(un),!1);if(Hi){if(Un.exports&&Un.exports.get("export=")&&Df(Un.exports.get("export="),Sn)){xt=Hi;break}xt=Hi.concat(xt||[my(Un,Sn)||Sn]);break}}}}if(xt)return xt;if(Ke||!(Sn.flags&6144))return!Ke&&!dn&&Zt(Sn.declarations,ws)?void 0:[Sn];function jt($t,vr){const ai=Vt[$t],Un=Vt[vr];if(ai&&Un){const Hi=U_(Un);return U_(ai)===Hi?DO(ai)-DO(Un):Hi?-1:1}return 0}}}function Nr($e,de){let qr;return i4($e).flags&524384&&(qr=I.createNodeArray(Yt(cr($e),Zn=>nt(Zn,de)))),qr}function Sr($e,de,qr){var dn;E.assert($e&&0<=de&&de<$e.length);const Zn=$e[de],Xn=Xs(Zn);if((dn=qr.typeParameterSymbolList)!=null&&dn.has(Xn))return;(qr.typeParameterSymbolList||(qr.typeParameterSymbolList=new Set)).add(Xn);let ui;if(qr.flags&512&&de<$e.length-1){const Sn=Zn,un=$e[de+1];if(Ko(un)&1){const Ke=Fn(Sn.flags&2097152?ul(Sn):Sn);ui=F(Yt(Ke,xt=>Iy(xt,un.links.mapper)),qr)}else ui=Nr(Zn,qr)}return ui}function Er($e){return OT($e.objectType)?Er($e.objectType):$e}function hr($e,de,qr){let dn=Wo($e,312);if(!dn){const Ke=ic($e.declarations,xt=>D2(xt,$e));Ke&&(dn=Wo(Ke,312))}if(dn&&dn.moduleName!==void 0)return dn.moduleName;if(!dn){if(de.tracker.trackReferencedAmbientModule){const Ke=wn($e.declarations,ru);if(Ir(Ke))for(const xt of Ke)de.tracker.trackReferencedAmbientModule(xt,$e)}if(rV.test($e.escapedName))return $e.escapedName.substring(1,$e.escapedName.length-1)}if(!de.enclosingDeclaration||!de.tracker.moduleResolverHost)return rV.test($e.escapedName)?$e.escapedName.substring(1,$e.escapedName.length-1):Or(IJ($e)).fileName;const Zn=Or(Zo(de.enclosingDeclaration)),Xn=qr||Zn?.impliedNodeFormat,ui=n3(Zn.path,Xn),Sn=yi($e);let un=Sn.specifierCache&&Sn.specifierCache.get(ui);if(!un){const Ke=!!to(J),{moduleResolverHost:xt}=de.tracker,Vt=Ke?{...J,baseUrl:xt.getCommonSourceDirectory()}:J;un=ba(c2e($e,Jt,Vt,Zn,xt,{importModuleSpecifierPreference:Ke?"non-relative":"project-relative",importModuleSpecifierEnding:Ke?"minimal":Xn===99?"js":void 0},{overrideImportMode:qr})),Sn.specifierCache??(Sn.specifierCache=new Map),Sn.specifierCache.set(ui,un)}return un}function sn($e){const de=I.createIdentifier(bi($e.escapedName));return $e.parent?I.createQualifiedName(sn($e.parent),de):de}function ms($e,de,qr,dn){const Zn=gr($e,de,qr,!(de.flags&16384)),Xn=qr===111551;if(ut(Zn[0].declarations,ws)){const un=Zn.length>1?Sn(Zn,Zn.length-1,1):void 0,Ke=dn||Sr(Zn,0,de),xt=Or(Zo(de.enclosingDeclaration)),Vt=PI(Zn[0]);let jt,$t;if((Vl(J)===3||Vl(J)===99)&&Vt?.impliedNodeFormat===99&&Vt.impliedNodeFormat!==xt?.impliedNodeFormat&&(jt=hr(Zn[0],de,99),$t=I.createImportAttributes(I.createNodeArray([I.createImportAttribute(I.createStringLiteral("resolution-mode"),I.createStringLiteral("import"))]))),jt||(jt=hr(Zn[0],de)),!(de.flags&67108864)&&Vl(J)!==1&&jt.includes("/node_modules/")){const ai=jt;if(Vl(J)===3||Vl(J)===99){const Un=xt?.impliedNodeFormat===99?1:99;jt=hr(Zn[0],de,Un),jt.includes("/node_modules/")?jt=ai:$t=I.createImportAttributes(I.createNodeArray([I.createImportAttribute(I.createStringLiteral("resolution-mode"),I.createStringLiteral(Un===99?"import":"require"))]))}$t||(de.encounteredError=!0,de.tracker.reportLikelyUnsafeImportRequiredError&&de.tracker.reportLikelyUnsafeImportRequiredError(ai))}const vr=I.createLiteralTypeNode(I.createStringLiteral(jt));if(de.tracker.trackExternalModuleSymbolOfImportTypeNode&&de.tracker.trackExternalModuleSymbolOfImportTypeNode(Zn[0]),de.approximateLength+=jt.length+10,!un||V_(un)){if(un){const ai=Ie(un)?un:un.right;Vh(ai,void 0)}return I.createImportTypeNode(vr,$t,un,Ke,Xn)}else{const ai=Er(un),Un=ai.objectType.typeName;return I.createIndexedAccessTypeNode(I.createImportTypeNode(vr,$t,Un,Ke,Xn),ai.indexType)}}const ui=Sn(Zn,Zn.length-1,0);if(OT(ui))return ui;if(Xn)return I.createTypeQueryNode(ui);{const un=Ie(ui)?ui:ui.right,Ke=kb(un);return Vh(un,void 0),I.createTypeReferenceNode(ui,Ke)}function Sn(un,Ke,xt){const Vt=Ke===un.length-1?dn:Sr(un,Ke,de),jt=un[Ke],$t=un[Ke-1];let vr;if(Ke===0)de.flags|=16777216,vr=zm(jt,de),de.approximateLength+=(vr?vr.length:0)+1,de.flags^=16777216;else if($t&&j_($t)){const Un=j_($t);zl(Un,(Hi,pr)=>{if(Df(Hi,jt)&&!wN(pr)&&pr!=="export=")return vr=bi(pr),!0})}if(vr===void 0){const Un=ic(jt.declarations,as);if(Un&&xa(Un)&&V_(Un.expression)){const Hi=Sn(un,Ke-1,xt);return V_(Hi)?I.createIndexedAccessTypeNode(I.createParenthesizedType(I.createTypeQueryNode(Hi)),I.createTypeQueryNode(Un.expression)):Hi}vr=zm(jt,de)}if(de.approximateLength+=vr.length+1,!(de.flags&16)&&$t&&Cy($t)&&Cy($t).get(jt.escapedName)&&Df(Cy($t).get(jt.escapedName),jt)){const Un=Sn(un,Ke-1,xt);return OT(Un)?I.createIndexedAccessTypeNode(Un,I.createLiteralTypeNode(I.createStringLiteral(vr))):I.createIndexedAccessTypeNode(I.createTypeReferenceNode(Un,Vt),I.createLiteralTypeNode(I.createStringLiteral(vr)))}const ai=Vr(I.createIdentifier(vr),16777216);if(Vt&&Vh(ai,I.createNodeArray(Vt)),ai.symbol=jt,Ke>xt){const Un=Sn(un,Ke-1,xt);return V_(Un)?I.createQualifiedName(Un,ai):E.fail("Impossible construct - an export of an indexed access cannot be reachable")}return ai}}function xs($e,de,qr){const dn=_c(de.enclosingDeclaration,$e,788968,void 0,$e,!1);return dn?!(dn.flags&262144&&dn===qr.symbol):!1}function vs($e,de){var qr,dn;if(de.flags&4&&de.typeParameterNames){const Xn=de.typeParameterNames.get(Wu($e));if(Xn)return Xn}let Zn=Vi($e.symbol,de,788968,!0);if(!(Zn.kind&80))return I.createIdentifier("(Missing type parameter)");if(de.flags&4){const Xn=Zn.escapedText;let ui=((qr=de.typeParameterNamesByTextNextNameCount)==null?void 0:qr.get(Xn))||0,Sn=Xn;for(;(dn=de.typeParameterNamesByText)!=null&&dn.has(Sn)||xs(Sn,de,$e);)ui++,Sn=`${Xn}_${ui}`;if(Sn!==Xn){const un=kb(Zn);Zn=I.createIdentifier(Sn),Vh(Zn,un)}(de.typeParameterNamesByTextNextNameCount||(de.typeParameterNamesByTextNextNameCount=new Map)).set(Xn,ui),(de.typeParameterNames||(de.typeParameterNames=new Map)).set(Wu($e),Zn),(de.typeParameterNamesByText||(de.typeParameterNamesByText=new Set)).add(Xn)}return Zn}function Vi($e,de,qr,dn){const Zn=gr($e,de,qr);return dn&&Zn.length!==1&&!de.encounteredError&&!(de.flags&65536)&&(de.encounteredError=!0),Xn(Zn,Zn.length-1);function Xn(ui,Sn){const un=Sr(ui,Sn,de),Ke=ui[Sn];Sn===0&&(de.flags|=16777216);const xt=zm(Ke,de);Sn===0&&(de.flags^=16777216);const Vt=Vr(I.createIdentifier(xt),16777216);return un&&Vh(Vt,I.createNodeArray(un)),Vt.symbol=Ke,Sn>0?I.createQualifiedName(Xn(ui,Sn-1),Vt):Vt}}function Cu($e,de,qr){const dn=gr($e,de,qr);return Zn(dn,dn.length-1);function Zn(Xn,ui){const Sn=Sr(Xn,ui,de),un=Xn[ui];ui===0&&(de.flags|=16777216);let Ke=zm(un,de);ui===0&&(de.flags^=16777216);let xt=Ke.charCodeAt(0);if($P(xt)&&ut(un.declarations,ws))return I.createStringLiteral(hr(un,de));if(ui===0||Zz(Ke,ie)){const Vt=Vr(I.createIdentifier(Ke),16777216);return Sn&&Vh(Vt,I.createNodeArray(Sn)),Vt.symbol=un,ui>0?I.createPropertyAccessExpression(Zn(Xn,ui-1),Vt):Vt}else{xt===91&&(Ke=Ke.substring(1,Ke.length-1),xt=Ke.charCodeAt(0));let Vt;if($P(xt)&&!(un.flags&8)?Vt=I.createStringLiteral(lp(Ke).replace(/\\./g,jt=>jt.substring(1)),xt===39):""+ +Ke===Ke&&(Vt=I.createNumericLiteral(+Ke)),!Vt){const jt=Vr(I.createIdentifier(Ke),16777216);Sn&&Vh(jt,I.createNodeArray(Sn)),jt.symbol=un,Vt=jt}return I.createElementAccessExpression(Zn(Xn,ui-1),Vt)}}}function If($e){const de=as($e);return de?xa(de)?!!(Ui(de.expression).flags&402653316):mo(de)?!!(Ui(de.argumentExpression).flags&402653316):ra(de):!1}function fr($e){const de=as($e);return!!(de&&ra(de)&&(de.singleQuote||!Po(de)&&Qi(Wc(de,!1),"'")))}function jr($e,de){const qr=!!Ir($e.declarations)&&qi($e.declarations,If),dn=!!Ir($e.declarations)&&qi($e.declarations,fr),Zn=!!($e.flags&8192),Xn=vi($e,de,dn,qr,Zn);if(Xn)return Xn;const ui=bi($e.escapedName);return q5(ui,Da(J),dn,qr,Zn)}function vi($e,de,qr,dn,Zn){const Xn=yi($e).nameType;if(Xn){if(Xn.flags&384){const ui=""+Xn.value;return!lf(ui,Da(J))&&(dn||!_g(ui))?I.createStringLiteral(ui,!!qr):_g(ui)&&Qi(ui,"-")?I.createComputedPropertyName(I.createNumericLiteral(+ui)):q5(ui,Da(J),qr,dn,Zn)}if(Xn.flags&8192)return I.createComputedPropertyName(Cu(Xn.symbol,de,111551))}}function Cs($e){const de={...$e};return de.typeParameterNames&&(de.typeParameterNames=new Map(de.typeParameterNames)),de.typeParameterNamesByText&&(de.typeParameterNamesByText=new Set(de.typeParameterNamesByText)),de.typeParameterSymbolList&&(de.typeParameterSymbolList=new Set(de.typeParameterSymbolList)),de.tracker=new iV(de,de.tracker.inner,de.tracker.moduleResolverHost),de}function Wr($e,de){return $e.declarations&&kn($e.declarations,qr=>!!Wl(qr)&&(!de||!!Ar(qr,dn=>dn===de)))}function Ta($e,de){return!(Pn(de)&4)||!mp($e)||Ir($e.typeArguments)>=Hm(de.target.typeParameters)}function so($e){return Wn($e).fakeScopeForSignatureDeclaration?$e.parent:$e}function il($e,de,qr,dn,Zn,Xn){if(!et(de)&&dn){const un=Wr(qr,so(dn));if(un&&!po(un)&&!pf(un)){const Ke=Wl(un);if(Ra(Ke,un,de)&&Ta(Ke,de)){const xt=So($e,Ke,Zn,Xn);if(xt)return xt}}}const ui=$e.flags;de.flags&8192&&de.symbol===qr&&(!$e.enclosingDeclaration||ut(qr.declarations,un=>Or(un)===Or($e.enclosingDeclaration)))&&($e.flags|=1048576);const Sn=_(de,$e);return $e.flags=ui,Sn}function Ra($e,de,qr){const dn=si($e);return dn===qr?!0:us(de)&&de.questionToken?Ap(qr,524288)===dn:!1}function vl($e,de,qr,dn,Zn){if(!et(de)&&$e.enclosingDeclaration){const Xn=qr.declaration&&up(qr.declaration),ui=so($e.enclosingDeclaration);if(Ar(Xn,Sn=>Sn===ui)&&Xn){const Sn=si(Xn);if((Sn.flags&262144&&Sn.isThisType?Ri(Sn,qr.mapper):Sn)===de&&Ta(Xn,de)){const Ke=So($e,Xn,dn,Zn);if(Ke)return Ke}}}return _(de,$e)}function Ec($e,de,qr){let dn=!1;const Zn=$_($e);if(Hr($e)&&(fb(Zn)||ag(Zn.parent)||h_(Zn.parent)&&QJ(Zn.parent.left)&&fb(Zn.parent.right)))return dn=!0,{introducesError:dn,node:$e};const Xn=lo(Zn,67108863,!0,!0);if(Xn&&(pn(Xn,de.enclosingDeclaration,67108863,!1).accessibility!==0?dn=!0:(de.tracker.trackSymbol(Xn,de.enclosingDeclaration,67108863),qr?.(Xn)),Ie($e))){const ui=bo(Xn),Sn=Xn.flags&262144&&!k(ui.symbol,de.enclosingDeclaration)?vs(ui,de):I.cloneNode($e);return Sn.symbol=Xn,{introducesError:dn,node:Vr(rn(Sn,$e),16777216)}}return{introducesError:dn,node:$e}}function So($e,de,qr,dn){i&&i.throwIfCancellationRequested&&i.throwIfCancellationRequested();let Zn=!1;const Xn=Or(de),ui=He(de,Sn,Si);if(Zn)return;return ui===de?tt(I.cloneNode(de),de):ui;function Sn(un){if(mne(un)||un.kind===326)return I.createKeywordTypeNode(133);if(gne(un))return I.createKeywordTypeNode(159);if(gC(un))return I.createUnionTypeNode([He(un.type,Sn,Si),I.createLiteralTypeNode(I.createNull())]);if(WW(un))return I.createUnionTypeNode([He(un.type,Sn,Si),I.createKeywordTypeNode(157)]);if(qF(un))return He(un.type,Sn);if(HF(un))return I.createArrayTypeNode(He(un.type,Sn,Si));if(JT(un))return I.createTypeLiteralNode(Yt(un.jsDocPropertyTags,jt=>{const $t=Ie(jt.name)?jt.name:jt.name.right,vr=q(si(un),$t.escapedText),ai=vr&&jt.typeExpression&&si(jt.typeExpression.type)!==vr?_(vr,$e):void 0;return I.createPropertySignature(void 0,$t,jt.isBracketed||jt.typeExpression&&WW(jt.typeExpression.type)?I.createToken(58):void 0,ai||jt.typeExpression&&He(jt.typeExpression.type,Sn,Si)||I.createKeywordTypeNode(133))}));if(mp(un)&&Ie(un.typeName)&&un.typeName.escapedText==="")return rn(I.createKeywordTypeNode(133),un);if((qh(un)||mp(un))&&YI(un))return I.createTypeLiteralNode([I.createIndexSignature(void 0,[I.createParameterDeclaration(void 0,void 0,"x",void 0,He(un.typeArguments[0],Sn,Si))],He(un.typeArguments[1],Sn,Si))]);if(hC(un))if(Bk(un)){let jt;return I.createConstructorTypeNode(void 0,kr(un.typeParameters,Sn,Uo),Ii(un.parameters,($t,vr)=>$t.name&&Ie($t.name)&&$t.name.escapedText==="new"?(jt=$t.type,void 0):I.createParameterDeclaration(void 0,Ke($t),xt($t,vr),$t.questionToken,He($t.type,Sn,Si),void 0)),He(jt||un.type,Sn,Si)||I.createKeywordTypeNode(133))}else return I.createFunctionTypeNode(kr(un.typeParameters,Sn,Uo),Yt(un.parameters,(jt,$t)=>I.createParameterDeclaration(void 0,Ke(jt),xt(jt,$t),jt.questionToken,He(jt.type,Sn,Si),void 0)),He(un.type,Sn,Si)||I.createKeywordTypeNode(133));if(mp(un)&&GP(un)&&(!Ta(un,si(un))||JPe(un)||dt===G6(un,788968,!0)))return rn(_(si(un),$e),un);if(U0(un)){const jt=Wn(un).resolvedSymbol;return GP(un)&&jt&&(!un.isTypeOf&&!(jt.flags&788968)||!(Ir(un.typeArguments)>=Hm(cr(jt))))?rn(_(si(un),$e),un):I.updateImportTypeNode(un,I.updateLiteralTypeNode(un.argument,Vt(un,un.argument.literal)),un.attributes,un.qualifier,kr(un.typeArguments,Sn,Si),un.isTypeOf)}if(V_(un)||oc(un)){const{introducesError:jt,node:$t}=Ec(un,$e,qr);if(Zn=Zn||jt,$t!==un)return $t}return Xn&&uC(un)&&qa(Xn,un.pos).line===qa(Xn,un.end).line&&Vr(un,1),sr(un,Sn,cd);function Ke(jt){return jt.dotDotDotToken||(jt.type&&HF(jt.type)?I.createToken(26):void 0)}function xt(jt,$t){return jt.name&&Ie(jt.name)&&jt.name.escapedText==="this"?"this":Ke(jt)?"args":`arg${$t}`}function Vt(jt,$t){if(dn){if($e.tracker&&$e.tracker.moduleResolverHost){const vr=Gge(jt);if(vr){const Un={getCanonicalFileName:tu(!!e.useCaseSensitiveFileNames),getCurrentDirectory:()=>$e.tracker.moduleResolverHost.getCurrentDirectory(),getCommonSourceDirectory:()=>$e.tracker.moduleResolverHost.getCommonSourceDirectory()},Hi=_5(Un,vr);return I.createStringLiteral(Hi)}}}else if($e.tracker&&$e.tracker.trackExternalModuleSymbolOfImportTypeNode){const vr=Pg($t,$t,void 0);vr&&$e.tracker.trackExternalModuleSymbolOfImportTypeNode(vr)}return $t}}}function af($e,de,qr){var dn;const Zn=Dl(I.createPropertyDeclaration,174,!0),Xn=Dl((yt,hn,Gn,Bn)=>I.createPropertySignature(yt,hn,Gn,Bn),173,!1),ui=de.enclosingDeclaration;let Sn=[];const un=new Set,Ke=[],xt=de;de={...xt,usedSymbolNames:new Set(xt.usedSymbolNames),remappedSymbolNames:new Map,remappedSymbolReferences:new Map((dn=xt.remappedSymbolReferences)==null?void 0:dn.entries()),tracker:void 0};const Vt={...xt.tracker.inner,trackSymbol:(yt,hn,Gn)=>{var Bn,$n;if((Bn=de.remappedSymbolNames)!=null&&Bn.has(Xs(yt)))return!1;if(pn(yt,hn,Gn,!1).accessibility===0){const js=Ut(yt,de,Gn);if(!(yt.flags&4)){const gs=js[0],ea=Or(xt.enclosingDeclaration);ut(gs.declarations,Ba=>Or(Ba)===ea)&&Fo(gs)}}else if(($n=xt.tracker.inner)!=null&&$n.trackSymbol)return xt.tracker.inner.trackSymbol(yt,hn,Gn);return!1}};de.tracker=new iV(de,Vt,xt.tracker.moduleResolverHost),zl($e,(yt,hn)=>{const Gn=bi(hn);z_(yt,Gn)});let jt=!qr;const $t=$e.get("export=");return $t&&$e.size>1&&$t.flags&2097152&&($e=zs(),$e.set("export=",$t)),$s($e),Vn(Sn);function vr(yt){return!!yt&&yt.kind===80}function ai(yt){return ec(yt)?wn(Yt(yt.declarationList.declarations,as),vr):wn([as(yt)],vr)}function Un(yt){const hn=kn(yt,cc),Gn=Dc(yt,vc);let Bn=Gn!==-1?yt[Gn]:void 0;if(Bn&&hn&&hn.isExportEquals&&Ie(hn.expression)&&Ie(Bn.name)&&an(Bn.name)===an(hn.expression)&&Bn.body&&Ld(Bn.body)){const $n=wn(yt,gs=>!!(Fu(gs)&32)),ja=Bn.name;let js=Bn.body;if(Ir($n)&&(Bn=I.updateModuleDeclaration(Bn,Bn.modifiers,Bn.name,js=I.updateModuleBlock(js,I.createNodeArray([...Bn.body.statements,I.createExportDeclaration(void 0,!1,I.createNamedExports(Yt(ta($n,gs=>ai(gs)),gs=>I.createExportSpecifier(!1,void 0,gs))),void 0)]))),yt=[...yt.slice(0,Gn),Bn,...yt.slice(Gn+1)]),!kn(yt,gs=>gs!==Bn&&gP(gs,ja))){Sn=[];const gs=!ut(js.statements,ea=>In(ea,32)||cc(ea)||qc(ea));Zt(js.statements,ea=>{Jo(ea,gs?32:0)}),yt=[...wn(yt,ea=>ea!==Bn&&ea!==hn),...Sn]}}return yt}function Hi(yt){const hn=wn(yt,Bn=>qc(Bn)&&!Bn.moduleSpecifier&&!!Bn.exportClause&&gp(Bn.exportClause));Ir(hn)>1&&(yt=[...wn(yt,$n=>!qc($n)||!!$n.moduleSpecifier||!$n.exportClause),I.createExportDeclaration(void 0,!1,I.createNamedExports(ta(hn,$n=>Ms($n.exportClause,gp).elements)),void 0)]);const Gn=wn(yt,Bn=>qc(Bn)&&!!Bn.moduleSpecifier&&!!Bn.exportClause&&gp(Bn.exportClause));if(Ir(Gn)>1){const Bn=p4(Gn,$n=>ra($n.moduleSpecifier)?">"+$n.moduleSpecifier.text:">");if(Bn.length!==Gn.length)for(const $n of Bn)$n.length>1&&(yt=[...wn(yt,ja=>!$n.includes(ja)),I.createExportDeclaration(void 0,!1,I.createNamedExports(ta($n,ja=>Ms(ja.exportClause,gp).elements)),$n[0].moduleSpecifier)])}return yt}function pr(yt){const hn=Dc(yt,Gn=>qc(Gn)&&!Gn.moduleSpecifier&&!Gn.attributes&&!!Gn.exportClause&&gp(Gn.exportClause));if(hn>=0){const Gn=yt[hn],Bn=Ii(Gn.exportClause.elements,$n=>{if(!$n.propertyName){const ja=WD(yt),js=wn(ja,gs=>gP(yt[gs],$n.name));if(Ir(js)&&qi(js,gs=>L8(yt[gs]))){for(const gs of js)yt[gs]=mi(yt[gs]);return}}return $n});Ir(Bn)?yt[hn]=I.updateExportDeclaration(Gn,Gn.modifiers,Gn.isTypeOnly,I.updateNamedExports(Gn.exportClause,Bn),Gn.moduleSpecifier,Gn.attributes):Uy(yt,hn)}return yt}function Vn(yt){return yt=Un(yt),yt=Hi(yt),yt=pr(yt),ui&&(Ai(ui)&&H_(ui)||vc(ui))&&(!ut(yt,DP)||!lee(yt)&&ut(yt,yI))&&yt.push(lw(I)),yt}function mi(yt){const hn=(Fu(yt)|32)&-129;return I.replaceModifiers(yt,hn)}function Bi(yt){const hn=Fu(yt)&-33;return I.replaceModifiers(yt,hn)}function $s(yt,hn,Gn){hn||Ke.push(new Map),yt.forEach(Bn=>{_l(Bn,!1,!!Gn)}),hn||(Ke[Ke.length-1].forEach(Bn=>{_l(Bn,!0,!!Gn)}),Ke.pop())}function _l(yt,hn,Gn){const Bn=Na(yt);if(un.has(Xs(Bn)))return;if(un.add(Xs(Bn)),!hn||Ir(yt.declarations)&&ut(yt.declarations,ja=>!!Ar(ja,js=>js===ui))){const ja=de;de=Cs(de),Bo(yt,hn,Gn),de.reportedDiagnostic&&(xt.reportedDiagnostic=de.reportedDiagnostic),de.trackedSymbols&&(ja.trackedSymbols?E.assert(de.trackedSymbols===ja.trackedSymbols):ja.trackedSymbols=de.trackedSymbols),de=ja}}function Bo(yt,hn,Gn,Bn=yt.escapedName){var $n,ja,js,gs,ea,Ba;const oo=bi(Bn),r_=Bn==="default";if(hn&&!(de.flags&131072)&&_T(oo)&&!r_){de.encounteredError=!0;return}let fu=r_&&!!(yt.flags&-113||yt.flags&16&&Ir(Wa(Br(yt))))&&!(yt.flags&2097152),pu=!fu&&!hn&&_T(oo)&&!r_;(fu||pu)&&(hn=!0);const Oo=(hn?0:32)|(r_&&!fu?2048:0),Kl=yt.flags&1536&&yt.flags&7&&Bn!=="export=",jg=Kl&&Fa(Br(yt),yt);if((yt.flags&8208||jg)&&nn(Br(yt),yt,z_(yt,oo),Oo),yt.flags&524288&&Ge(yt,oo,Oo),yt.flags&98311&&Bn!=="export="&&!(yt.flags&4194304)&&!(yt.flags&32)&&!(yt.flags&8192)&&!jg)if(Gn)ao(yt)&&(pu=!1,fu=!1);else{const eu=Br(yt),W_=z_(yt,oo);if(eu.symbol&&eu.symbol!==yt&&eu.symbol.flags&16&&ut(eu.symbol.declarations,Jv)&&(($n=eu.symbol.members)!=null&&$n.size||(ja=eu.symbol.exports)!=null&&ja.size))de.remappedSymbolReferences||(de.remappedSymbolReferences=new Map),de.remappedSymbolReferences.set(Xs(eu.symbol),yt),Bo(eu.symbol,hn,Gn,Bn),de.remappedSymbolReferences.delete(Xs(eu.symbol));else if(!(yt.flags&16)&&Fa(eu,yt))nn(eu,yt,W_,Oo);else{const tk=yt.flags&2?DD(yt)?2:1:(js=yt.parent)!=null&&js.valueDeclaration&&Ai((gs=yt.parent)==null?void 0:gs.valueDeclaration)?2:void 0,om=fu||!(yt.flags&4)?W_:fv(W_,yt);let By=yt.declarations&&kn(yt.declarations,y7=>Ei(y7));By&&ml(By.parent)&&By.parent.declarations.length===1&&(By=By.parent.parent);const Jy=(ea=yt.declarations)==null?void 0:ea.find(bn);if(Jy&&Gr(Jy.parent)&&Ie(Jy.parent.right)&&((Ba=eu.symbol)!=null&&Ba.valueDeclaration)&&Ai(eu.symbol.valueDeclaration)){const y7=W_===Jy.parent.right.escapedText?void 0:Jy.parent.right;Jo(I.createExportDeclaration(void 0,!1,I.createNamedExports([I.createExportSpecifier(!1,y7,W_)])),0),de.tracker.trackSymbol(eu.symbol,de.enclosingDeclaration,111551)}else{const y7=tt(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(om,void 0,il(de,eu,yt,ui,Fo,qr))],tk)),By);Jo(y7,om!==W_?Oo&-33:Oo),om!==W_&&!hn&&(Jo(I.createExportDeclaration(void 0,!1,I.createNamedExports([I.createExportSpecifier(!1,om,W_)])),0),pu=!1,fu=!1)}}}if(yt.flags&384&&ir(yt,oo,Oo),yt.flags&32&&(yt.flags&4&&yt.valueDeclaration&&Gr(yt.valueDeclaration.parent)&&Nl(yt.valueDeclaration.parent.right)?bs(yt,z_(yt,oo),Oo):Vs(yt,z_(yt,oo),Oo)),(yt.flags&1536&&(!Kl||Pr(yt))||jg)&&ln(yt,oo,Oo),yt.flags&64&&!(yt.flags&32)&&_t(yt,oo,Oo),yt.flags&2097152&&bs(yt,z_(yt,oo),Oo),yt.flags&4&&yt.escapedName==="export="&&ao(yt),yt.flags&8388608&&yt.declarations)for(const eu of yt.declarations){const W_=Zu(eu,eu.moduleSpecifier);W_&&Jo(I.createExportDeclaration(void 0,eu.isTypeOnly,void 0,I.createStringLiteral(hr(W_,de))),0)}fu?Jo(I.createExportAssignment(void 0,!1,I.createIdentifier(z_(yt,oo))),0):pu&&Jo(I.createExportDeclaration(void 0,!1,I.createNamedExports([I.createExportSpecifier(!1,z_(yt,oo),oo)])),0)}function Fo(yt){if(ut(yt.declarations,Iv))return;E.assertIsDefined(Ke[Ke.length-1]),fv(bi(yt.escapedName),yt);const hn=!!(yt.flags&2097152)&&!ut(yt.declarations,Gn=>!!Ar(Gn,qc)||Dm(Gn)||Hl(Gn)&&!Pm(Gn.moduleReference));Ke[hn?0:Ke.length-1].set(Xs(yt),yt)}function _u(yt){return Ai(yt)&&(H_(yt)||ap(yt))||ru(yt)&&!Dd(yt)}function Jo(yt,hn){if(Wp(yt)){let Gn=0;const Bn=de.enclosingDeclaration&&(op(de.enclosingDeclaration)?Or(de.enclosingDeclaration):de.enclosingDeclaration);hn&32&&Bn&&(_u(Bn)||vc(Bn))&&L8(yt)&&(Gn|=32),jt&&!(Gn&32)&&(!Bn||!(Bn.flags&33554432))&&(p1(yt)||ec(yt)||Zc(yt)||Vc(yt)||vc(yt))&&(Gn|=128),hn&2048&&(Vc(yt)||Mu(yt)||Zc(yt))&&(Gn|=2048),Gn&&(yt=I.replaceModifiers(yt,Gn|Fu(yt)))}Sn.push(yt)}function Ge(yt,hn,Gn){var Bn;const $n=QDe(yt),ja=yi(yt).typeParameters,js=Yt(ja,fu=>nt(fu,de)),gs=(Bn=yt.declarations)==null?void 0:Bn.find(op),ea=vP(gs?gs.comment||gs.parent.comment:void 0),Ba=de.flags;de.flags|=8388608;const oo=de.enclosingDeclaration;de.enclosingDeclaration=gs;const r_=gs&&gs.typeExpression&&Fb(gs.typeExpression)&&So(de,gs.typeExpression.type,Fo,qr)||_($n,de);Jo(l1(I.createTypeAliasDeclaration(void 0,z_(yt,hn),js,r_),ea?[{kind:3,text:`* + * `+ea.replace(/\n/g,` + * `)+` + `,pos:-1,end:-1,hasTrailingNewLine:!0}]:[]),Gn),de.flags=Ba,de.enclosingDeclaration=oo}function _t(yt,hn,Gn){const Bn=Qf(yt),$n=cr(yt),ja=Yt($n,pu=>nt(pu,de)),js=Qc(Bn),gs=Ir(js)?fa(js):void 0,ea=ta(Wa(Bn),pu=>sm(pu,gs)),Ba=am(0,Bn,gs,179),oo=am(1,Bn,gs,180),r_=$2(Bn,gs),fu=Ir(js)?[I.createHeritageClause(96,Ii(js,pu=>ek(pu,111551)))]:void 0;Jo(I.createInterfaceDeclaration(void 0,z_(yt,hn),ja,fu,[...r_,...oo,...Ba,...ea]),Gn)}function zt(yt){const hn=j_(yt);return hn?wn(fs(hn.values()),Gn=>cs(Gn)&&lf(Gn.escapedName,99)):[]}function Pr(yt){return qi(zt(yt),hn=>!(cu(Cc(hn))&111551))}function ln(yt,hn,Gn){const Bn=zt(yt),$n=VD(Bn,gs=>gs.parent&&gs.parent===yt?"real":"merged"),ja=$n.get("real")||ze,js=$n.get("merged")||ze;if(Ir(ja)){const gs=z_(yt,hn);oi(ja,gs,Gn,!!(yt.flags&67108880))}if(Ir(js)){const gs=Or(de.enclosingDeclaration),ea=z_(yt,hn),Ba=I.createModuleBlock([I.createExportDeclaration(void 0,!1,I.createNamedExports(Ii(wn(js,oo=>oo.escapedName!=="export="),oo=>{var r_,fu;const pu=bi(oo.escapedName),Oo=z_(oo,pu),Kl=oo.declarations&&Sp(oo);if(gs&&(Kl?gs!==Or(Kl):!ut(oo.declarations,W_=>Or(W_)===gs))){(fu=(r_=de.tracker)==null?void 0:r_.reportNonlocalAugmentation)==null||fu.call(r_,gs,yt,oo);return}const jg=Kl&&Vf(Kl,!0);Fo(jg||oo);const eu=jg?z_(jg,bi(jg.escapedName)):Oo;return I.createExportSpecifier(!1,pu===eu?void 0:eu,pu)})))]);Jo(I.createModuleDeclaration(void 0,I.createIdentifier(ea),Ba,32),0)}}function ir(yt,hn,Gn){Jo(I.createEnumDeclaration(I.createModifiersFromModifierFlags(pge(yt)?4096:0),z_(yt,hn),Yt(wn(Wa(Br(yt)),Bn=>!!(Bn.flags&8)),Bn=>{const $n=Bn.declarations&&Bn.declarations[0]&&$v(Bn.declarations[0])?Vge(Bn.declarations[0]):void 0;return I.createEnumMember(bi(Bn.escapedName),$n===void 0?void 0:typeof $n=="string"?I.createStringLiteral($n):I.createNumericLiteral($n))})),Gn)}function nn(yt,hn,Gn,Bn){const $n=Ts(yt,0);for(const ja of $n){const js=le(ja,262,de,{name:I.createIdentifier(Gn),privateSymbolVisitor:Fo,bundledImports:qr});Jo(tt(js,Kn(ja)),Bn)}if(!(hn.flags&1536&&hn.exports&&hn.exports.size)){const ja=wn(Wa(yt),cs);oi(ja,Gn,Bn,!0)}}function Kn(yt){if(yt.declaration&&yt.declaration.parent){if(Gr(yt.declaration.parent)&&ac(yt.declaration.parent)===5)return yt.declaration.parent;if(Ei(yt.declaration.parent)&&yt.declaration.parent.parent)return yt.declaration.parent.parent}return yt.declaration}function oi(yt,hn,Gn,Bn){if(Ir(yt)){const ja=VD(yt,Oo=>!Ir(Oo.declarations)||ut(Oo.declarations,Kl=>Or(Kl)===Or(de.enclosingDeclaration))?"local":"remote").get("local")||ze;let js=wm.createModuleDeclaration(void 0,I.createIdentifier(hn),I.createModuleBlock([]),32);ga(js,ui),js.locals=zs(yt),js.symbol=yt[0].parent;const gs=Sn;Sn=[];const ea=jt;jt=!1;const Ba={...de,enclosingDeclaration:js},oo=de;de=Ba,$s(zs(ja),Bn,!0),de=oo,jt=ea;const r_=Sn;Sn=gs;const fu=Yt(r_,Oo=>cc(Oo)&&!Oo.isExportEquals&&Ie(Oo.expression)?I.createExportDeclaration(void 0,!1,I.createNamedExports([I.createExportSpecifier(!1,Oo.expression,I.createIdentifier("default"))])):Oo),pu=qi(fu,Oo=>In(Oo,32))?Yt(fu,Bi):fu;js=I.updateModuleDeclaration(js,js.modifiers,js.name,I.createModuleBlock(pu)),Jo(js,Gn)}}function cs(yt){return!!(yt.flags&2887656)||!(yt.flags&4194304||yt.escapedName==="prototype"||yt.valueDeclaration&&Ls(yt.valueDeclaration)&&Qn(yt.valueDeclaration.parent))}function Js(yt){const hn=Ii(yt,Gn=>{const Bn=de.enclosingDeclaration;de.enclosingDeclaration=Gn;let $n=Gn.expression;if(oc($n)){if(Ie($n)&&an($n)==="")return ja(void 0);let js;if({introducesError:js,node:$n}=Ec($n,de,Fo),js)return ja(void 0)}return ja(I.createExpressionWithTypeArguments($n,Yt(Gn.typeArguments,js=>So(de,js,Fo,qr)||_(si(js),de))));function ja(js){return de.enclosingDeclaration=Bn,js}});if(hn.length===yt.length)return hn}function Vs(yt,hn,Gn){var Bn,$n;const ja=(Bn=yt.declarations)==null?void 0:Bn.find(Qn),js=de.enclosingDeclaration;de.enclosingDeclaration=ja||js;const gs=cr(yt),ea=Yt(gs,cm=>nt(cm,de)),Ba=rf(Qf(yt)),oo=Qc(Ba),r_=ja&&Wk(ja),fu=r_&&Js(r_)||Ii(ph(Ba),kh),pu=Br(yt),Oo=!!(($n=pu.symbol)!=null&&$n.valueDeclaration)&&Qn(pu.symbol.valueDeclaration),Kl=Oo?Xc(pu):G,jg=[...Ir(oo)?[I.createHeritageClause(96,Yt(oo,cm=>a4(cm,Kl,hn)))]:[],...Ir(fu)?[I.createHeritageClause(119,fu)]:[]],eu=alt(Ba,oo,Wa(Ba)),W_=wn(eu,cm=>{const BD=cm.valueDeclaration;return!!BD&&!(Au(BD)&&Ti(BD.name))}),om=ut(eu,cm=>{const BD=cm.valueDeclaration;return!!BD&&Au(BD)&&Ti(BD.name)})?[I.createPropertyDeclaration(void 0,I.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:ze,By=ta(W_,cm=>Zn(cm,!1,oo[0])),Jy=ta(wn(Wa(pu),cm=>!(cm.flags&4194304)&&cm.escapedName!=="prototype"&&!cs(cm)),cm=>Zn(cm,!0,Kl)),T_t=!Oo&&!!yt.valueDeclaration&&Hr(yt.valueDeclaration)&&!ut(Ts(pu,1))?[I.createConstructorDeclaration(I.createModifiersFromModifierFlags(2),[],void 0)]:am(1,pu,Kl,176),x_t=$2(Ba,oo[0]);de.enclosingDeclaration=js,Jo(tt(I.createClassDeclaration(void 0,hn,ea,jg,[...x_t,...Jy,...T_t,...By,...om]),yt.declarations&&wn(yt.declarations,cm=>Vc(cm)||Nl(cm))[0]),Gn)}function ti(yt){return ic(yt,hn=>{if(v_(hn)||vu(hn))return an(hn.propertyName||hn.name);if(Gr(hn)||cc(hn)){const Gn=cc(hn)?hn.expression:hn.right;if(bn(Gn))return an(Gn.name)}if(j1(hn)){const Gn=as(hn);if(Gn&&Ie(Gn))return an(Gn)}})}function bs(yt,hn,Gn){var Bn,$n,ja,js,gs;const ea=Sp(yt);if(!ea)return E.fail();const Ba=Na(Vf(ea,!0));if(!Ba)return;let oo=B4(Ba)&&ti(yt.declarations)||bi(Ba.escapedName);oo==="export="&&$&&(oo="default");const r_=z_(Ba,oo);switch(Fo(Ba),ea.kind){case 208:if((($n=(Bn=ea.parent)==null?void 0:Bn.parent)==null?void 0:$n.kind)===260){const Oo=hr(Ba.parent||Ba,de),{propertyName:Kl}=ea;Jo(I.createImportDeclaration(void 0,I.createImportClause(!1,void 0,I.createNamedImports([I.createImportSpecifier(!1,Kl&&Ie(Kl)?I.createIdentifier(an(Kl)):void 0,I.createIdentifier(hn))])),I.createStringLiteral(Oo),void 0),0);break}E.failBadSyntaxKind(((ja=ea.parent)==null?void 0:ja.parent)||ea,"Unhandled binding element grandparent kind in declaration serialization");break;case 304:((gs=(js=ea.parent)==null?void 0:js.parent)==null?void 0:gs.kind)===226&&Ks(bi(yt.escapedName),r_);break;case 260:if(bn(ea.initializer)){const Oo=ea.initializer,Kl=I.createUniqueName(hn),jg=hr(Ba.parent||Ba,de);Jo(I.createImportEqualsDeclaration(void 0,!1,Kl,I.createExternalModuleReference(I.createStringLiteral(jg))),0),Jo(I.createImportEqualsDeclaration(void 0,!1,I.createIdentifier(hn),I.createQualifiedName(Kl,Oo.name)),Gn);break}case 271:if(Ba.escapedName==="export="&&ut(Ba.declarations,Oo=>Ai(Oo)&&ap(Oo))){ao(yt);break}const fu=!(Ba.flags&512)&&!Ei(ea);Jo(I.createImportEqualsDeclaration(void 0,!1,I.createIdentifier(hn),fu?Vi(Ba,de,67108863,!1):I.createExternalModuleReference(I.createStringLiteral(hr(Ba,de)))),fu?Gn:0);break;case 270:Jo(I.createNamespaceExportDeclaration(an(ea.name)),0);break;case 273:{const Oo=hr(Ba.parent||Ba,de),Kl=qr?I.createStringLiteral(Oo):ea.parent.moduleSpecifier;Jo(I.createImportDeclaration(void 0,I.createImportClause(!1,I.createIdentifier(hn),void 0),Kl,ea.parent.attributes),0);break}case 274:{const Oo=hr(Ba.parent||Ba,de),Kl=qr?I.createStringLiteral(Oo):ea.parent.parent.moduleSpecifier;Jo(I.createImportDeclaration(void 0,I.createImportClause(!1,void 0,I.createNamespaceImport(I.createIdentifier(hn))),Kl,ea.parent.attributes),0);break}case 280:Jo(I.createExportDeclaration(void 0,!1,I.createNamespaceExport(I.createIdentifier(hn)),I.createStringLiteral(hr(Ba,de))),0);break;case 276:{const Oo=hr(Ba.parent||Ba,de),Kl=qr?I.createStringLiteral(Oo):ea.parent.parent.parent.moduleSpecifier;Jo(I.createImportDeclaration(void 0,I.createImportClause(!1,void 0,I.createNamedImports([I.createImportSpecifier(!1,hn!==oo?I.createIdentifier(oo):void 0,I.createIdentifier(hn))])),Kl,ea.parent.parent.parent.attributes),0);break}case 281:const pu=ea.parent.parent.moduleSpecifier;Ks(bi(yt.escapedName),pu?oo:r_,pu&&Ja(pu)?I.createStringLiteral(pu.text):void 0);break;case 277:ao(yt);break;case 226:case 211:case 212:yt.escapedName==="default"||yt.escapedName==="export="?ao(yt):Ks(hn,r_);break;default:return E.failBadSyntaxKind(ea,"Unhandled alias declaration kind in symbol serializer!")}}function Ks(yt,hn,Gn){Jo(I.createExportDeclaration(void 0,!1,I.createNamedExports([I.createExportSpecifier(!1,yt!==hn?hn:void 0,yt)]),Gn),0)}function ao(yt){var hn;if(yt.flags&4194304)return!1;const Gn=bi(yt.escapedName),Bn=Gn==="export=",ja=Bn||Gn==="default",js=yt.declarations&&Sp(yt),gs=js&&Vf(js,!0);if(gs&&Ir(gs.declarations)&&ut(gs.declarations,ea=>Or(ea)===Or(ui))){const ea=js&&(cc(js)||Gr(js)?sz(js):_te(js)),Ba=ea&&oc(ea)?blt(ea):void 0,oo=Ba&&lo(Ba,67108863,!0,!0,ui);(oo||gs)&&Fo(oo||gs);const r_=de.tracker.disableTrackSymbol;if(de.tracker.disableTrackSymbol=!0,ja)Sn.push(I.createExportAssignment(void 0,Bn,Cu(gs,de,67108863)));else if(Ba===ea&&Ba)Ks(Gn,an(Ba));else if(ea&&Nl(ea))Ks(Gn,z_(gs,pc(gs)));else{const fu=fv(Gn,yt);Jo(I.createImportEqualsDeclaration(void 0,!1,I.createIdentifier(fu),Vi(gs,de,67108863,!1)),0),Ks(Gn,fu)}return de.tracker.disableTrackSymbol=r_,!0}else{const ea=fv(Gn,yt),Ba=nf(Br(Na(yt)));if(Fa(Ba,yt))nn(Ba,yt,ea,ja?0:32);else{const oo=((hn=de.enclosingDeclaration)==null?void 0:hn.kind)===267&&(!(yt.flags&98304)||yt.flags&65536)?1:2,r_=I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(ea,void 0,il(de,Ba,yt,ui,Fo,qr))],oo));Jo(r_,gs&&gs.flags&4&&gs.escapedName==="export="?128:Gn===ea?32:0)}return ja?(Sn.push(I.createExportAssignment(void 0,Bn,I.createIdentifier(ea))),!0):Gn!==ea?(Ks(Gn,ea),!0):!1}}function Fa(yt,hn){const Gn=Or(de.enclosingDeclaration);return Pn(yt)&48&&!Ir(zu(yt))&&!Mx(yt)&&!!(Ir(wn(Wa(yt),cs))||Ir(Ts(yt,0)))&&!Ir(Ts(yt,1))&&!Wr(hn,ui)&&!(yt.symbol&&ut(yt.symbol.declarations,Bn=>Or(Bn)!==Gn))&&!ut(Wa(yt),Bn=>wN(Bn.escapedName))&&!ut(Wa(yt),Bn=>ut(Bn.declarations,$n=>Or($n)!==Gn))&&qi(Wa(yt),Bn=>lf(pc(Bn),ie)?Bn.flags&98304?ky(Bn)===TS(Bn):!0:!1)}function Dl(yt,hn,Gn){return function($n,ja,js){var gs,ea,Ba,oo,r_;const fu=Mf($n),pu=!!(fu&2);if(ja&&$n.flags&2887656)return[];if($n.flags&4194304||$n.escapedName==="constructor"||js&&Gs(js,$n.escapedName)&&Td(Gs(js,$n.escapedName))===Td($n)&&($n.flags&16777216)===(Gs(js,$n.escapedName).flags&16777216)&&hh(Br($n),q(js,$n.escapedName)))return[];const Oo=fu&-1025|(ja?256:0),Kl=jr($n,de),jg=(gs=$n.declarations)==null?void 0:gs.find(ed(Es,R0,Ei,ff,Gr,bn));if($n.flags&98304&&Gn){const eu=[];if($n.flags&65536){const W_=$n.declarations&&Zt($n.declarations,om=>{if(om.kind===178)return om;if(Rs(om)&&pb(om))return Zt(om.arguments[2].properties,By=>{const Jy=as(By);if(Jy&&Ie(Jy)&&an(Jy)==="set")return By})});E.assert(!!W_);const tk=po(W_)?Dp(W_).parameters[0]:void 0;eu.push(tt(I.createSetAccessorDeclaration(I.createModifiersFromModifierFlags(Oo),Kl,[I.createParameterDeclaration(void 0,void 0,tk?_r(tk,kt(tk),de):"value",void 0,pu?void 0:il(de,Br($n),$n,ui,Fo,qr))],void 0),((ea=$n.declarations)==null?void 0:ea.find(Lh))||jg))}if($n.flags&32768){const W_=fu&2;eu.push(tt(I.createGetAccessorDeclaration(I.createModifiersFromModifierFlags(Oo),Kl,[],W_?void 0:il(de,Br($n),$n,ui,Fo,qr),void 0),((Ba=$n.declarations)==null?void 0:Ba.find(B0))||jg))}return eu}else if($n.flags&98311)return tt(yt(I.createModifiersFromModifierFlags((Td($n)?8:0)|Oo),Kl,$n.flags&16777216?I.createToken(58):void 0,pu?void 0:il(de,TS($n),$n,ui,Fo,qr),void 0),((oo=$n.declarations)==null?void 0:oo.find(ed(Es,Ei)))||jg);if($n.flags&8208){const eu=Br($n),W_=Ts(eu,0);if(Oo&2)return tt(yt(I.createModifiersFromModifierFlags((Td($n)?8:0)|Oo),Kl,$n.flags&16777216?I.createToken(58):void 0,void 0,void 0),((r_=$n.declarations)==null?void 0:r_.find(po))||W_[0]&&W_[0].declaration||$n.declarations&&$n.declarations[0]);const tk=[];for(const om of W_){const By=le(om,hn,de,{name:Kl,questionToken:$n.flags&16777216?I.createToken(58):void 0,modifiers:Oo?I.createModifiersFromModifierFlags(Oo):void 0}),Jy=om.declaration&&t8(om.declaration.parent)?om.declaration.parent:om.declaration;tk.push(tt(By,Jy))}return tk}return E.fail(`Unhandled class member kind! ${$n.__debugFlags||$n.flags}`)}}function sm(yt,hn){return Xn(yt,!1,hn)}function am(yt,hn,Gn,Bn){const $n=Ts(hn,yt);if(yt===1){if(!Gn&&qi($n,gs=>Ir(gs.parameters)===0))return[];if(Gn){const gs=Ts(Gn,1);if(!Ir(gs)&&qi($n,ea=>Ir(ea.parameters)===0))return[];if(gs.length===$n.length){let ea=!1;for(let Ba=0;Ba_($n,de)),Bn=Cu(yt.target.symbol,de,788968)):yt.symbol&&at(yt.symbol,ui,hn)&&(Bn=Cu(yt.symbol,de,788968)),Bn)return I.createExpressionWithTypeArguments(Bn,Gn)}function kh(yt){const hn=ek(yt,788968);if(hn)return hn;if(yt.symbol)return I.createExpressionWithTypeArguments(Cu(yt.symbol,de,788968),void 0)}function fv(yt,hn){var Gn,Bn;const $n=hn?Xs(hn):void 0;if($n&&de.remappedSymbolNames.has($n))return de.remappedSymbolNames.get($n);hn&&(yt=sj(hn,yt));let ja=0;const js=yt;for(;(Gn=de.usedSymbolNames)!=null&&Gn.has(yt);)ja++,yt=`${js}_${ja}`;return(Bn=de.usedSymbolNames)==null||Bn.add(yt),$n&&de.remappedSymbolNames.set($n,yt),yt}function sj(yt,hn){if(hn==="default"||hn==="__class"||hn==="__function"){const Gn=de.flags;de.flags|=16777216;const Bn=zm(yt,de);de.flags=Gn,hn=Bn.length>0&&$P(Bn.charCodeAt(0))?lp(Bn):Bn}return hn==="default"?hn="_default":hn==="export="&&(hn="_exports"),hn=lf(hn,ie)&&!_T(hn)?hn:"_"+hn.replace(/[^a-zA-Z0-9]/g,"_"),hn}function z_(yt,hn){const Gn=Xs(yt);return de.remappedSymbolNames.has(Gn)?de.remappedSymbolNames.get(Gn):(hn=sj(yt,hn),de.remappedSymbolNames.set(Gn,hn),hn)}}}function Jm(n,a,l=16384,_){return _?m(_).getText():R4(m);function m(h){const x=I.createTypePredicateNode(n.kind===2||n.kind===3?I.createToken(131):void 0,n.kind===1||n.kind===3?I.createIdentifier(n.parameterName):I.createThisTypeNode(),n.type&&pt.typeToTypeNode(n.type,a,X1(l)|70221824|512)),N=t2(),F=a&&Or(a);return N.writeNode(4,x,F,h),h}}function g0(n){const a=[];let l=0;for(let _=0;_as(x)?x:void 0);const h=m&&as(m);if(m&&h){if(Rs(m)&&pb(m))return pc(n);if(xa(h)&&!(Ko(n)&4096)){const x=yi(n).nameType;if(x&&x.flags&384){const N=iD(n,a);if(N!==void 0)return N}}return eo(h)}if(m||(m=n.declarations[0]),m.parent&&m.parent.kind===260)return eo(m.parent.name);switch(m.kind){case 231:case 218:case 219:return a&&!a.encounteredError&&!(a.flags&131072)&&(a.encounteredError=!0),m.kind===231?"(Anonymous class)":"(Anonymous function)"}}const _=iD(n,a);return _!==void 0?_:pc(n)}function uh(n){if(n){const l=Wn(n);return l.isVisible===void 0&&(l.isVisible=!!a()),l.isVisible}return!1;function a(){switch(n.kind){case 345:case 353:case 347:return!!(n.parent&&n.parent.parent&&n.parent.parent.parent&&Ai(n.parent.parent.parent));case 208:return uh(n.parent.parent);case 260:if(As(n.name)&&!n.name.elements.length)return!1;case 267:case 263:case 264:case 265:case 262:case 266:case 271:if(xv(n))return!0;const l=vS(n);return!(wZ(n)&32)&&!(n.kind!==271&&l.kind!==312&&l.flags&33554432)?qd(l):uh(l);case 172:case 171:case 177:case 178:case 174:case 173:if(w_(n,6))return!1;case 176:case 180:case 179:case 181:case 169:case 268:case 184:case 185:case 187:case 183:case 188:case 189:case 192:case 193:case 196:case 202:return uh(n.parent);case 273:case 274:case 276:return!1;case 168:case 312:case 270:return!0;case 277:return!1;default:return!1}}}function L6(n,a){let l;n.parent&&n.parent.kind===277?l=_c(n,n.escapedText,2998271,void 0,n,!1):n.parent.kind===281&&(l=S2(n.parent,2998271));let _,m;return l&&(m=new Set,m.add(Xs(l)),h(l.declarations)),_;function h(x){Zt(x,N=>{const F=kx(N)||N;if(a?Wn(N).isVisible=!0:(_=_||[],tp(_,F)),Ok(N)){const V=N.moduleReference,ne=$_(V),le=_c(N,ne.escapedText,901119,void 0,void 0,!1);le&&m&&zy(m,Xs(le))&&h(le.declarations)}})}}function Wm(n,a){const l=Q1(n,a);if(l>=0){const{length:_}=sh;for(let m=l;m<_;m++)ly[m]=!1;return!1}return sh.push(n),ly.push(!0),Kb.push(a),!0}function Q1(n,a){for(let l=sh.length-1;l>=_2;l--){if(qM(sh[l],Kb[l]))return-1;if(sh[l]===n&&Kb[l]===a)return l}return-1}function qM(n,a){switch(a){case 0:return!!yi(n).type;case 5:return!!Wn(n).resolvedEnumType;case 2:return!!yi(n).declaredType;case 1:return!!n.resolvedBaseConstructorType;case 3:return!!n.resolvedReturnType;case 4:return!!n.immediateBaseConstraint;case 6:return!!n.resolvedTypeArguments;case 7:return!!n.baseTypesResolved;case 8:return!!yi(n).writeType;case 9:return Wn(n).parameterInitializerContainsUndefined!==void 0}return E.assertNever(a)}function Zd(){return sh.pop(),Kb.pop(),ly.pop()}function vS(n){return Ar(Tm(n),a=>{switch(a.kind){case 260:case 261:case 276:case 275:case 274:case 273:return!1;default:return!0}}).parent}function DN(n){const a=bo(f_(n));return a.typeParameters?v0(a,Yt(a.typeParameters,l=>G)):a}function q(n,a){const l=Gs(n,a);return l?Br(l):void 0}function ge(n,a){var l;let _;return q(n,a)||(_=(l=Wx(n,a))==null?void 0:l.type)&&El(_,!0,!0)}function Ae(n){return n&&(n.flags&1)!==0}function et(n){return n===st||!!(n.flags&1&&n.aliasSymbol)}function wt(n,a){if(a!==0)return _h(n,!1,a);const l=cn(n);return l&&yi(l).type||_h(n,!1,a)}function rr(n,a,l){if(n=jc(n,F=>!(F.flags&98304)),n.flags&131072)return Us;if(n.flags&1048576)return Io(n,F=>rr(F,a,l));let _=Mn(Yt(a,S0));const m=[],h=[];for(const F of Wa(n)){const V=gD(F,8576);!ca(V,_)&&!(Mf(F)&6)&&tY(F)?m.push(F):h.push(V)}if(O2(n)||nv(_)){if(h.length&&(_=Mn([_,...h])),_.flags&131072)return n;const F=Iet();return F?H6(F,[n,_]):st}const x=zs();for(const F of m)x.set(F.escapedName,Cde(F,!1));const N=Qo(l,x,ze,ze,zu(n));return N.objectFlags|=4194304,N}function vn(n){return!!(n.flags&465829888)&&Yo(Ku(n)||or,32768)}function di(n){const a=em(n,vn)?Io(n,l=>l.flags&465829888?mh(l):l):n;return Ap(a,524288)}function ci(n,a){const l=Yn(n);return l?Ry(l,a):a}function Yn(n){const a=Li(n);if(a&&s8(a)&&a.flowNode){const l=Za(n);if(l){const _=tt(wm.createStringLiteral(l),n),m=m_(a)?a:wm.createParenthesizedExpression(a),h=tt(wm.createElementAccessExpression(m,_),n);return ga(_,h),ga(h,n),m!==a&&ga(m,h),h.flowNode=a.flowNode,h}}}function Li(n){const a=n.parent.parent;switch(a.kind){case 208:case 303:return Yn(a);case 209:return Yn(n.parent);case 260:return a.initializer;case 226:return a.right}}function Za(n){const a=n.parent;return n.kind===208&&a.kind===206?La(n.propertyName||n.name):n.kind===303||n.kind===304?La(n.name):""+a.elements.indexOf(n)}function La(n){const a=S0(n);return a.flags&384?""+a.value:void 0}function Ia(n){const a=n.dotDotDotToken?32:0,l=wt(n.parent.parent,a);return l&&$f(n,l,!1)}function $f(n,a,l){if(Ae(a))return a;const _=n.parent;H&&n.flags&33554432&&Iv(n)?a=Sh(a):H&&_.parent.initializer&&!wp(Iwe(_.parent.initializer),65536)&&(a=Ap(a,524288));let m;if(_.kind===206)if(n.dotDotDotToken){if(a=hd(a),a.flags&2||!PR(a))return je(n,d.Rest_types_may_only_be_created_from_object_types),st;const h=[];for(const x of _.elements)x.dotDotDotToken||h.push(x.propertyName||x.name);m=rr(a,h,n.symbol)}else{const h=n.propertyName||n.name,x=S0(h),N=J_(a,x,32,h);m=ci(n,N)}else{const h=E0(65|(n.dotDotDotToken?0:128),a,j,_),x=_.elements.indexOf(n);if(n.dotDotDotToken){const N=Io(a,F=>F.flags&58982400?mh(F):F);m=Nf(N,pa)?Io(N,F=>mD(F,x)):uu(h)}else if(x0(a)){const N=vd(x),F=32|(l||PD(n)?16:0),V=Ay(a,N,F,n.name)||st;m=ci(n,V)}else m=h}return n.initializer?Wl(dk(n))?H&&!wp(a7(n,0),16777216)?di(m):m:gge(n,Mn([di(m),a7(n,0)],2)):m}function Xp(n){const a=Yy(n);if(a)return si(a)}function by(n){const a=Ha(n,!0);return a.kind===106||a.kind===80&&Qp(a)===Oe}function Ig(n){const a=Ha(n,!0);return a.kind===209&&a.elements.length===0}function El(n,a=!1,l=!0){return H&&l?Ly(n,a):n}function _h(n,a,l){if(Ei(n)&&n.parent.parent.kind===249){const x=$m(Jme(Ui(n.parent.parent.expression,l)));return x.flags&4456448?m8e(x):Fe}if(Ei(n)&&n.parent.parent.kind===250){const x=n.parent.parent;return KR(x)||G}if(As(n.parent))return Ia(n);const _=Es(n)&&!Ad(n)||ff(n)||vne(n),m=a&&EE(n),h=Le(n);if(wJ(n))return h?Ae(h)||h===or?h:st:ve?or:G;if(h)return El(h,_,m);if((se||Hr(n))&&Ei(n)&&!As(n.name)&&!(wZ(n)&32)&&!(n.flags&33554432)){if(!(G2(n)&6)&&(!n.initializer||by(n.initializer)))return ht;if(n.initializer&&Ig(n.initializer))return Oc}if(us(n)){const x=n.parent;if(x.kind===178&&W6(x)){const V=Wo(cn(n.parent),177);if(V){const ne=Dp(V),le=Qge(x);return le&&n===le?(E.assert(!le.type),Br(ne.thisParameter)):Ma(ne)}}const N=ret(x,n);if(N)return N;const F=n.symbol.escapedName==="this"?Zwe(x):Kwe(n);if(F)return El(F,!1,m)}if(ab(n)&&n.initializer){if(Hr(n)&&!us(n)){const N=cD(n,cn(n),QP(n));if(N)return N}const x=gge(n,a7(n,l));return El(x,_,m)}if(Es(n)&&(se||Hr(n)))if(Uc(n)){const x=wn(n.parent.members,Go),N=x.length?HM(n.symbol,x):Fu(n)&128?hY(n.symbol):void 0;return N&&El(N,!0,m)}else{const x=$p(n.parent),N=x?oD(n.symbol,x):Fu(n)&128?hY(n.symbol):void 0;return N&&El(N,!0,m)}if(Rd(n))return Zr;if(As(n.name))return jx(n.name,!1,!0)}function sD(n){if(n.valueDeclaration&&Gr(n.valueDeclaration)){const a=yi(n);return a.isConstructorDeclaredProperty===void 0&&(a.isConstructorDeclaredProperty=!1,a.isConstructorDeclaredProperty=!!R6(n)&&qi(n.declarations,l=>Gr(l)&&zY(l)&&(l.left.kind!==212||_f(l.left.argumentExpression))&&!Xf(void 0,l,n,l))),a.isConstructorDeclaredProperty}return!1}function M6(n){const a=n.valueDeclaration;return a&&Es(a)&&!Wl(a)&&!a.initializer&&(se||Hr(a))}function R6(n){if(n.declarations)for(const a of n.declarations){const l=i_(a,!1,!1);if(l&&(l.kind===176||nm(l)))return l}}function aD(n){const a=Or(n.declarations[0]),l=bi(n.escapedName),_=n.declarations.every(h=>Hr(h)&&co(h)&&ag(h.expression)),m=_?I.createPropertyAccessExpression(I.createPropertyAccessExpression(I.createIdentifier("module"),I.createIdentifier("exports")),l):I.createPropertyAccessExpression(I.createIdentifier("exports"),l);return _&&ga(m.expression.expression,m.expression),ga(m.expression,m),ga(m,a),m.flowNode=a.endFlowNode,Ry(m,ht,j)}function HM(n,a){const l=Qi(n.escapedName,"__#")?I.createPrivateIdentifier(n.escapedName.split("@")[1]):bi(n.escapedName);for(const _ of a){const m=I.createPropertyAccessExpression(I.createThis(),l);ga(m.expression,m),ga(m,_),m.flowNode=_.returnFlowNode;const h=Pf(m,n);if(se&&(h===ht||h===Oc)&&je(n.valueDeclaration,d.Member_0_implicitly_has_an_1_type,ii(n),mr(h)),!Nf(h,IR))return d7(h)}}function oD(n,a){const l=Qi(n.escapedName,"__#")?I.createPrivateIdentifier(n.escapedName.split("@")[1]):bi(n.escapedName),_=I.createPropertyAccessExpression(I.createThis(),l);ga(_.expression,_),ga(_,a),_.flowNode=a.returnFlowNode;const m=Pf(_,n);return se&&(m===ht||m===Oc)&&je(n.valueDeclaration,d.Member_0_implicitly_has_an_1_type,ii(n),mr(m)),Nf(m,IR)?void 0:d7(m)}function Pf(n,a){const l=a?.valueDeclaration&&(!M6(a)||Fu(a.valueDeclaration)&128)&&hY(a)||j;return Ry(n,ht,l)}function fh(n,a){const l=aT(n.valueDeclaration);if(l){const N=Hr(l)?Qy(l):void 0;return N&&N.typeExpression?si(N.typeExpression):n.valueDeclaration&&cD(n.valueDeclaration,n,l)||B2(Bc(l))}let _,m=!1,h=!1;if(sD(n)&&(_=oD(n,R6(n))),!_){let N;if(n.declarations){let F;for(const V of n.declarations){const ne=Gr(V)||Rs(V)?V:co(V)?Gr(V.parent)?V.parent:V:void 0;if(!ne)continue;const le=co(ne)?e8(ne):ac(ne);(le===4||Gr(ne)&&zY(ne,le))&&(Mc(ne)?m=!0:h=!0),Rs(ne)||(F=Xf(F,ne,n,V)),F||(N||(N=[])).push(Gr(ne)||Rs(ne)?j6(n,a,ne,le):Cn)}_=F}if(!_){if(!Ir(N))return st;let F=m&&n.declarations?Sy(N,n.declarations):void 0;if(h){const ne=hY(n);ne&&((F||(F=[])).push(ne),m=!0)}const V=ut(F,ne=>!!(ne.flags&-98305))?F:N;_=Mn(V)}}const x=nf(El(_,!1,h&&!m));return n.valueDeclaration&&Hr(n.valueDeclaration)&&jc(x,N=>!!(N.flags&-98305))===Cn?(cv(n.valueDeclaration,G),G):x}function cD(n,a,l){var _,m;if(!Hr(n)||!l||!ma(l)||l.properties.length)return;const h=zs();for(;Gr(n)||bn(n);){const F=tf(n);(_=F?.exports)!=null&&_.size&&Vd(h,F.exports),n=Gr(n)?n.parent:n.parent.parent}const x=tf(n);(m=x?.exports)!=null&&m.size&&Vd(h,x.exports);const N=Qo(a,h,ze,ze,ze);return N.objectFlags|=4096,N}function Xf(n,a,l,_){var m;const h=Wl(a.parent);if(h){const x=nf(si(h));if(n)!et(n)&&!et(x)&&!hh(n,x)&&t7e(void 0,n,_,x);else return x}if((m=l.parent)!=null&&m.valueDeclaration){const x=Wl(l.parent.valueDeclaration);if(x){const N=Gs(si(x),l.escapedName);if(N)return ky(N)}}return n}function j6(n,a,l,_){if(Rs(l)){if(a)return Br(a);const x=Bc(l.arguments[2]),N=q(x,"value");if(N)return N;const F=q(x,"get");if(F){const ne=jS(F);if(ne)return Ma(ne)}const V=q(x,"set");if(V){const ne=jS(V);if(ne)return oge(ne)}return G}if(ka(l.left,l.right))return G;const m=_===1&&(bn(l.left)||mo(l.left))&&(ag(l.left.expression)||Ie(l.left.expression)&&fb(l.left.expression)),h=a?Br(a):m?t_(Bc(l.right)):B2(Bc(l.right));if(h.flags&524288&&_===2&&n.escapedName==="export="){const x=gd(h),N=zs();EI(x.members,N);const F=N.size;a&&!a.exports&&(a.exports=zs()),(a||n).exports.forEach((ne,le)=>{var xe;const Ne=N.get(le);if(Ne&&Ne!==ne&&!(ne.flags&2097152))if(ne.flags&111551&&Ne.flags&111551){if(ne.valueDeclaration&&Ne.valueDeclaration&&Or(ne.valueDeclaration)!==Or(Ne.valueDeclaration)){const kt=bi(ne.escapedName),Xt=((xe=Jn(Ne.valueDeclaration,Au))==null?void 0:xe.name)||Ne.valueDeclaration;ua(je(ne.valueDeclaration,d.Duplicate_identifier_0,kt),mn(Xt,d._0_was_also_declared_here,kt)),ua(je(Xt,d.Duplicate_identifier_0,kt),mn(ne.valueDeclaration,d._0_was_also_declared_here,kt))}const nt=Aa(ne.flags|Ne.flags,le);nt.links.type=Mn([Br(ne),Br(Ne)]),nt.valueDeclaration=Ne.valueDeclaration,nt.declarations=Xi(Ne.declarations,ne.declarations),N.set(le,nt)}else N.set(le,bp(ne,Ne));else N.set(le,ne)});const V=Qo(F!==N.size?void 0:x.symbol,N,x.callSignatures,x.constructSignatures,x.indexInfos);if(F===N.size&&(h.aliasSymbol&&(V.aliasSymbol=h.aliasSymbol,V.aliasTypeArguments=h.aliasTypeArguments),Pn(h)&4)){V.aliasSymbol=h.symbol;const ne=uo(h);V.aliasTypeArguments=Ir(ne)?ne:void 0}return V.objectFlags|=Pn(h)&4096,V.symbol&&V.symbol.flags&32&&h===Qf(V.symbol)&&(V.objectFlags|=16777216),V}return vY(h)?(cv(l,nc),nc):h}function ka(n,a){return bn(n)&&n.expression.kind===110&&QE(a,l=>Yl(n,l))}function Mc(n){const a=i_(n,!1,!1);return a.kind===176||a.kind===262||a.kind===218&&!t8(a.parent)}function Sy(n,a){return E.assert(n.length===a.length),n.filter((l,_)=>{const m=a[_],h=Gr(m)?m:Gr(m.parent)?m.parent:void 0;return h&&Mc(h)})}function bS(n,a,l){if(n.initializer){const _=As(n.name)?jx(n.name,!0,!1):or;return El(gge(n,a7(n,0,_)))}return As(n.name)?jx(n.name,a,l):(l&&!re(n)&&cv(n,G),a?Qt:G)}function GM(n,a,l){const _=zs();let m,h=131200;Zt(n.elements,N=>{const F=N.propertyName||N.name;if(N.dotDotDotToken){m=Gm(Fe,G,!1);return}const V=S0(F);if(!pp(V)){h|=512;return}const ne=dp(V),le=4|(N.initializer?16777216:0),xe=Aa(le,ne);xe.links.type=bS(N,a,l),xe.links.bindingElement=N,_.set(xe.escapedName,xe)});const x=Qo(void 0,_,ze,ze,m?[m]:ze);return x.objectFlags|=h,a&&(x.pattern=n,x.objectFlags|=131072),x}function Um(n,a,l){const _=n.elements,m=Mo(_),h=m&&m.kind===208&&m.dotDotDotToken?m:void 0;if(_.length===0||_.length===1&&h)return ie>=2?KPe(G):nc;const x=Yt(_,ne=>dl(ne)?G:bS(ne,a,l)),N=b7(_,ne=>!(ne===h||dl(ne)||PD(ne)),_.length-1)+1,F=Yt(_,(ne,le)=>ne===h?4:le>=N?2:1);let V=yd(x,F);return a&&(V=OPe(V),V.pattern=n,V.objectFlags|=131072),V}function jx(n,a=!1,l=!1){return n.kind===206?GM(n,a,l):Um(n,a,l)}function v(n,a){return R(_h(n,!0,0),n,a)}function P(n){const a=tf(n),l=vet(!1);return l&&a&&a===l}function R(n,a,l){return n?(n.flags&4096&&P(a.parent)&&(n=Ede(a)),l&&PY(a,n),n.flags&8192&&(Pa(a)||!a.type)&&n.symbol!==cn(a)&&(n=Ln),nf(n)):(n=us(a)&&a.dotDotDotToken?nc:G,l&&(re(a)||cv(a,n)),n)}function re(n){const a=Tm(n),l=a.kind===169?a.parent:a;return $R(l)}function Le(n){const a=Wl(n);if(a)return si(a)}function Ot(n){let a=n.valueDeclaration;return a?(Pa(a)&&(a=dk(a)),us(a)?uY(a.parent):!1):!1}function en(n){const a=yi(n);if(!a.type){const l=Zi(n);return!a.type&&!Ot(n)&&(a.type=l),l}return a.type}function Zi(n){if(n.flags&4194304)return DN(n);if(n===mt)return G;if(n.flags&134217728&&n.valueDeclaration){const _=cn(Or(n.valueDeclaration)),m=Aa(_.flags,"exports");m.declarations=_.declarations?_.declarations.slice():[],m.parent=n,m.links.target=_,_.valueDeclaration&&(m.valueDeclaration=_.valueDeclaration),_.members&&(m.members=new Map(_.members)),_.exports&&(m.exports=new Map(_.exports));const h=zs();return h.set("exports",m),Qo(n,h,ze,ze,ze)}E.assertIsDefined(n.valueDeclaration);const a=n.valueDeclaration;if(Ai(a)&&ap(a))return a.statements.length?nf(B2(Ui(a.statements[0].expression))):Us;if(R0(a))return Y1(n);if(!Wm(n,0))return n.flags&512&&!(n.flags&67108864)?lD(n):B6(n);let l;if(a.kind===277)l=R(Le(a)||Bc(a.expression),a);else if(Gr(a)||Hr(a)&&(Rs(a)||(bn(a)||t5(a))&&Gr(a.parent)))l=fh(n);else if(bn(a)||mo(a)||Ie(a)||Ja(a)||A_(a)||Vc(a)||Zc(a)||mc(a)&&!Mp(a)||fg(a)||Ai(a)){if(n.flags&9136)return lD(n);l=Gr(a.parent)?fh(n):Le(a)||G}else if(Hc(a))l=Le(a)||DNe(a);else if(Rd(a))l=Le(a)||_Ae(a);else if(Y_(a))l=Le(a)||ND(a.name,0);else if(Mp(a))l=Le(a)||PNe(a,0);else if(us(a)||Es(a)||ff(a)||Ei(a)||Pa(a)||bP(a))l=v(a,!0);else if(p1(a))l=lD(n);else if($v(a))l=MQ(n);else return E.fail("Unhandled declaration kind! "+E.formatSyntaxKind(a.kind)+" for "+E.formatSymbol(n));return Zd()?l:n.flags&512&&!(n.flags&67108864)?lD(n):B6(n)}function za(n){if(n)switch(n.kind){case 177:return up(n);case 178:return Ste(n);case 172:return E.assert(Ad(n)),Wl(n)}}function wf(n){const a=za(n);return a&&si(a)}function Ty(n){const a=Qge(n);return a&&a.symbol}function xy(n){return tv(Dp(n))}function Y1(n){const a=yi(n);if(!a.type){if(!Wm(n,0))return st;const l=Wo(n,177),_=Wo(n,178),m=Jn(Wo(n,172),n_);let h=l&&Hr(l)&&Xp(l)||wf(l)||wf(_)||wf(m)||l&&l.body&&iZ(l)||m&&m.initializer&&v(m,!0);h||(_&&!$R(_)?Uf(se,_,d.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,ii(n)):l&&!$R(l)?Uf(se,l,d.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,ii(n)):m&&!$R(m)&&Uf(se,m,d.Member_0_implicitly_has_an_1_type,ii(n),"any"),h=G),Zd()||(za(l)?je(l,d._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ii(n)):za(_)||za(m)?je(_,d._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ii(n)):l&&se&&je(l,d._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,ii(n)),h=G),a.type=h}return a.type}function LQ(n){const a=yi(n);if(!a.writeType){if(!Wm(n,8))return st;const l=Wo(n,178)??Jn(Wo(n,172),n_);let _=wf(l);Zd()||(za(l)&&je(l,d._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ii(n)),_=G),a.writeType=_||Y1(n)}return a.writeType}function SS(n){const a=Xc(Qf(n));return a.flags&8650752?a:a.flags&2097152?kn(a.types,l=>!!(l.flags&8650752)):void 0}function lD(n){let a=yi(n);const l=a;if(!a.type){const _=n.valueDeclaration&&rZ(n.valueDeclaration,!1);if(_){const m=tge(n,_);m&&(n=m,a=m.links)}l.type=a.type=Dpe(n)}return a.type}function Dpe(n){const a=n.valueDeclaration;if(n.flags&1536&&B4(n))return G;if(a&&(a.kind===226||co(a)&&a.parent.kind===226))return fh(n);if(n.flags&512&&a&&Ai(a)&&a.commonJsModuleIndicator){const _=ef(n);if(_!==n){if(!Wm(n,0))return st;const m=Na(n.exports.get("export=")),h=fh(m,m===_?void 0:_);return Zd()?h:B6(n)}}const l=Hf(16,n);if(n.flags&32){const _=SS(n);return _?fa([l,_]):l}else return H&&n.flags&16777216?Ly(l,!0):l}function MQ(n){const a=yi(n);return a.type||(a.type=KDe(n))}function $M(n){const a=yi(n);if(!a.type){if(!Wm(n,0))return st;const l=ul(n),_=n.declarations&&Vf(Sp(n),!0),m=ic(_?.declarations,h=>cc(h)?Le(h):void 0);if(a.type=_?.declarations&&bZ(_.declarations)&&n.declarations.length?aD(_):bZ(n.declarations)?ht:m||(cu(l)&111551?Br(l):st),!Zd())return B6(_??n),a.type=st}return a.type}function Ppe(n){const a=yi(n);return a.type||(a.type=Ri(Br(a.target),a.mapper))}function RQ(n){const a=yi(n);return a.writeType||(a.writeType=Ri(TS(a.target),a.mapper))}function B6(n){const a=n.valueDeclaration;if(a){if(Wl(a))return je(n.valueDeclaration,d._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,ii(n)),st;se&&(a.kind!==169||a.initializer)&&je(n.valueDeclaration,d._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,ii(n))}else if(n.flags&2097152){const l=Sp(n);l&&je(l,d.Circular_definition_of_import_alias_0,ii(n))}return G}function jQ(n){const a=yi(n);return a.type||(E.assertIsDefined(a.deferralParent),E.assertIsDefined(a.deferralConstituents),a.type=a.deferralParent.flags&1048576?Mn(a.deferralConstituents):fa(a.deferralConstituents)),a.type}function wpe(n){const a=yi(n);return!a.writeType&&a.deferralWriteConstituents&&(E.assertIsDefined(a.deferralParent),E.assertIsDefined(a.deferralConstituents),a.writeType=a.deferralParent.flags&1048576?Mn(a.deferralWriteConstituents):fa(a.deferralWriteConstituents)),a.writeType}function TS(n){const a=Ko(n);return n.flags&4?a&2?a&65536?wpe(n)||jQ(n):n.links.writeType||n.links.type:My(Br(n),!!(n.flags&16777216)):n.flags&98304?a&1?RQ(n):LQ(n):Br(n)}function Br(n){const a=Ko(n);return a&65536?jQ(n):a&1?Ppe(n):a&262144?RKe(n):a&8192?Krt(n):n.flags&7?en(n):n.flags&9136?lD(n):n.flags&8?MQ(n):n.flags&98304?Y1(n):n.flags&2097152?$M(n):st}function ky(n){return My(Br(n),!!(n.flags&16777216))}function Z1(n,a){return n!==void 0&&a!==void 0&&(Pn(n)&4)!==0&&n.target===a}function J6(n){return Pn(n)&4?n.target:n}function Bx(n,a){return l(n);function l(_){if(Pn(_)&7){const m=J6(_);return m===a||ut(Qc(m),l)}else if(_.flags&2097152)return ut(_.types,l);return!1}}function A2(n,a){for(const l of a)n=Bg(n,kS(cn(l)));return n}function uD(n,a){for(;;){if(n=n.parent,n&&Gr(n)){const l=ac(n);if(l===6||l===3){const _=cn(n.left);_&&_.parent&&!Ar(_.parent.valueDeclaration,m=>n===m)&&(n=_.parent.valueDeclaration)}}if(!n)return;switch(n.kind){case 263:case 231:case 264:case 179:case 180:case 173:case 184:case 185:case 324:case 262:case 174:case 218:case 219:case 265:case 352:case 353:case 347:case 345:case 200:case 194:{const _=uD(n,a);if(n.kind===200)return lr(_,kS(cn(n.typeParameter)));if(n.kind===194)return Xi(_,C8e(n));const m=A2(_,L0(n)),h=a&&(n.kind===263||n.kind===231||n.kind===264||nm(n))&&Qf(cn(n)).thisType;return h?lr(m,h):m}case 348:const l=o8(n);l&&(n=l.valueDeclaration);break;case 327:{const _=uD(n,a);return n.tags?A2(_,ta(n.tags,m=>od(m)?m.typeParameters:void 0)):_}}}}function N2(n){var a;const l=n.flags&32||n.flags&16?n.valueDeclaration:(a=n.declarations)==null?void 0:a.find(_=>{if(_.kind===264)return!0;if(_.kind!==260)return!1;const m=_.initializer;return!!m&&(m.kind===218||m.kind===219)});return E.assert(!!l,"Class was missing valueDeclaration -OR- non-class had no interface declarations"),uD(l)}function cr(n){if(!n.declarations)return;let a;for(const l of n.declarations)(l.kind===264||l.kind===263||l.kind===231||nm(l)||i8(l))&&(a=A2(a,L0(l)));return a}function Fn(n){return Xi(N2(n),cr(n))}function xn(n){const a=Ts(n,1);if(a.length===1){const l=a[0];if(!l.typeParameters&&l.parameters.length===1&&bu(l)){const _=JR(l.parameters[0]);return Ae(_)||Wde(_)===G}}return!1}function fi(n){if(Ts(n,1).length>0)return!0;if(n.flags&8650752){const a=Ku(n);return!!a&&xn(a)}return!1}function pi(n){const a=Qg(n.symbol);return a&&Pd(a)}function Ea(n,a,l){const _=Ir(a),m=Hr(l);return wn(Ts(n,1),h=>(m||_>=Hm(h.typeParameters))&&_<=Ir(h.typeParameters))}function Ka(n,a,l){const _=Ea(n,a,l),m=Yt(a,si);return Yc(_,h=>ut(h.typeParameters)?LN(h,m,Hr(l)):h)}function Xc(n){if(!n.resolvedBaseConstructorType){const a=Qg(n.symbol),l=a&&Pd(a),_=pi(n);if(!_)return n.resolvedBaseConstructorType=j;if(!Wm(n,1))return st;const m=Ui(_.expression);if(l&&_!==l&&(E.assert(!l.typeArguments),Ui(l.expression)),m.flags&2621440&&gd(m),!Zd())return je(n.symbol.valueDeclaration,d._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,ii(n.symbol)),n.resolvedBaseConstructorType=st;if(!(m.flags&1)&&m!==Ve&&!fi(m)){const h=je(_.expression,d.Type_0_is_not_a_constructor_function_type,mr(m));if(m.flags&262144){const x=pD(m);let N=or;if(x){const F=Ts(x,1);F[0]&&(N=Ma(F[0]))}m.symbol.declarations&&ua(h,mn(m.symbol.declarations[0],d.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,ii(m.symbol),mr(N)))}return n.resolvedBaseConstructorType=st}n.resolvedBaseConstructorType=m}return n.resolvedBaseConstructorType}function ph(n){let a=ze;if(n.symbol.declarations)for(const l of n.symbol.declarations){const _=Wk(l);if(_)for(const m of _){const h=si(m);et(h)||(a===ze?a=[h]:a.push(h))}}return a}function Vm(n,a){je(n,d.Type_0_recursively_references_itself_as_a_base_type,mr(a,void 0,2))}function Qc(n){if(!n.baseTypesResolved){if(Wm(n,7)&&(n.objectFlags&8?n.resolvedBaseTypes=[h0(n)]:n.symbol.flags&96?(n.symbol.flags&32&&PN(n),n.symbol.flags&64&&pKe(n)):E.fail("type must be class or interface"),!Zd()&&n.symbol.declarations))for(const a of n.symbol.declarations)(a.kind===263||a.kind===264)&&Vm(a,n);n.baseTypesResolved=!0}return n.resolvedBaseTypes}function h0(n){const a=Yc(n.typeParameters,(l,_)=>n.elementFlags[_]&8?J_(l,vt):l);return uu(Mn(a||ze),n.readonly)}function PN(n){n.resolvedBaseTypes=X5;const a=e_(Xc(n));if(!(a.flags&2621441))return n.resolvedBaseTypes=ze;const l=pi(n);let _;const m=a.symbol?bo(a.symbol):void 0;if(a.symbol&&a.symbol.flags&32&&z6(m))_=LPe(l,a.symbol);else if(a.flags&1)_=a;else{const x=Ka(a,l.typeArguments,l);if(!x.length)return je(l.expression,d.No_base_constructor_has_the_specified_number_of_type_arguments),n.resolvedBaseTypes=ze;_=Ma(x[0])}if(et(_))return n.resolvedBaseTypes=ze;const h=hd(_);if(!xS(h)){const x=qpe(void 0,_),N=ps(x,d.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,mr(h));return wa.add(Hg(Or(l.expression),l.expression,N)),n.resolvedBaseTypes=ze}return n===h||Bx(h,n)?(je(n.symbol.valueDeclaration,d.Type_0_recursively_references_itself_as_a_base_type,mr(n,void 0,2)),n.resolvedBaseTypes=ze):(n.resolvedBaseTypes===X5&&(n.members=void 0),n.resolvedBaseTypes=[h])}function z6(n){const a=n.outerTypeParameters;if(a){const l=a.length-1,_=uo(n);return a[l].symbol!==_[l].symbol}return!0}function xS(n){if(n.flags&262144){const a=Ku(n);if(a)return xS(a)}return!!(n.flags&67633153&&!Af(n)||n.flags&2097152&&qi(n.types,xS))}function pKe(n){if(n.resolvedBaseTypes=n.resolvedBaseTypes||ze,n.symbol.declarations){for(const a of n.symbol.declarations)if(a.kind===264&&Y4(a))for(const l of Y4(a)){const _=hd(si(l));et(_)||(xS(_)?n!==_&&!Bx(_,n)?n.resolvedBaseTypes===ze?n.resolvedBaseTypes=[_]:n.resolvedBaseTypes.push(_):Vm(a,n):je(l,d.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members))}}}function dKe(n){if(!n.declarations)return!0;for(const a of n.declarations)if(a.kind===264){if(a.flags&256)return!1;const l=Y4(a);if(l){for(const _ of l)if(oc(_.expression)){const m=lo(_.expression,788968,!0);if(!m||!(m.flags&64)||Qf(m).thisType)return!1}}}return!0}function Qf(n){let a=yi(n);const l=a;if(!a.declaredType){const _=n.flags&32?1:2,m=tge(n,n.valueDeclaration&&Kst(n.valueDeclaration));m&&(n=m,a=m.links);const h=l.declaredType=a.declaredType=Hf(_,n),x=N2(n),N=cr(n);(x||N||_===1||!dKe(n))&&(h.objectFlags|=4,h.typeParameters=Xi(x,N),h.outerTypeParameters=x,h.localTypeParameters=N,h.instantiations=new Map,h.instantiations.set(Pp(h.typeParameters),h),h.target=h,h.resolvedTypeArguments=h.typeParameters,h.thisType=lu(n),h.thisType.isThisType=!0,h.thisType.constraint=h)}return a.declaredType}function QDe(n){var a;const l=yi(n);if(!l.declaredType){if(!Wm(n,2))return st;const _=E.checkDefined((a=n.declarations)==null?void 0:a.find(i8),"Type alias symbol with no valid declaration found"),m=op(_)?_.typeExpression:_.type;let h=m?si(m):st;if(Zd()){const x=cr(n);x&&(l.typeParameters=x,l.instantiations=new Map,l.instantiations.set(Pp(x),h))}else h=st,_.kind===347?je(_.typeExpression.type,d.Type_alias_0_circularly_references_itself,ii(n)):je(Au(_)&&_.name||_,d.Type_alias_0_circularly_references_itself,ii(n));l.declaredType=h}return l.declaredType}function BQ(n){return n.flags&1056&&n.symbol.flags&8?bo(f_(n.symbol)):n}function YDe(n){const a=yi(n);if(!a.declaredType){const l=[];if(n.declarations){for(const m of n.declarations)if(m.kind===266){for(const h of m.members)if(W6(h)){const x=cn(h),N=g7(h),F=Gx(N!==void 0?Ott(N,Xs(n),x):ZDe(x));yi(x).declaredType=F,l.push(t_(F))}}}const _=l.length?Mn(l,1,n,void 0):ZDe(n);_.flags&1048576&&(_.flags|=1024,_.symbol=n),a.declaredType=_}return a.declaredType}function ZDe(n){const a=d0(32,n),l=d0(32,n);return a.regularType=a,a.freshType=l,l.regularType=a,l.freshType=l,a}function KDe(n){const a=yi(n);if(!a.declaredType){const l=YDe(f_(n));a.declaredType||(a.declaredType=l)}return a.declaredType}function kS(n){const a=yi(n);return a.declaredType||(a.declaredType=lu(n))}function mKe(n){const a=yi(n);return a.declaredType||(a.declaredType=bo(ul(n)))}function bo(n){return ePe(n)||st}function ePe(n){if(n.flags&96)return Qf(n);if(n.flags&524288)return QDe(n);if(n.flags&262144)return kS(n);if(n.flags&384)return YDe(n);if(n.flags&8)return KDe(n);if(n.flags&2097152)return mKe(n)}function XM(n){switch(n.kind){case 133:case 159:case 154:case 150:case 163:case 136:case 155:case 151:case 116:case 157:case 146:case 201:return!0;case 188:return XM(n.elementType);case 183:return!n.typeArguments||n.typeArguments.every(XM)}return!1}function gKe(n){const a=gk(n);return!a||XM(a)}function tPe(n){const a=Wl(n);return a?XM(a):!J0(n)}function hKe(n){const a=up(n),l=L0(n);return(n.kind===176||!!a&&XM(a))&&n.parameters.every(tPe)&&l.every(gKe)}function yKe(n){if(n.declarations&&n.declarations.length===1){const a=n.declarations[0];if(a)switch(a.kind){case 172:case 171:return tPe(a);case 174:case 173:case 176:case 177:case 178:return hKe(a)}}return!1}function rPe(n,a,l){const _=zs();for(const m of n)_.set(m.escapedName,l&&yKe(m)?m:Pde(m,a));return _}function nPe(n,a){for(const l of a){if(iPe(l))continue;const _=n.get(l.escapedName);(!_||_.valueDeclaration&&Gr(_.valueDeclaration)&&!sD(_)&&!Qee(_.valueDeclaration))&&(n.set(l.escapedName,l),n.set(l.escapedName,l))}}function iPe(n){return!!n.valueDeclaration&&Nu(n.valueDeclaration)&&Ls(n.valueDeclaration)}function Ape(n){if(!n.declaredProperties){const a=n.symbol,l=Cy(a);n.declaredProperties=w2(l),n.declaredCallSignatures=ze,n.declaredConstructSignatures=ze,n.declaredIndexInfos=ze,n.declaredCallSignatures=I2(l.get("__call")),n.declaredConstructSignatures=I2(l.get("__new")),n.declaredIndexInfos=NPe(a)}return n}function Npe(n){if(!xa(n)&&!mo(n))return!1;const a=xa(n)?n.expression:n.argumentExpression;return oc(a)&&pp(xa(n)?Lg(n):Bc(a))}function wN(n){return n.charCodeAt(0)===95&&n.charCodeAt(1)===95&&n.charCodeAt(2)===64}function QM(n){const a=as(n);return!!a&&Npe(a)}function W6(n){return!V0(n)||QM(n)}function vKe(n){return l5(n)&&!Npe(n)}function bKe(n,a,l){E.assert(!!(Ko(n)&4096),"Expected a late-bound symbol."),n.flags|=l,yi(a.symbol).lateSymbol=n,n.declarations?a.symbol.isReplaceableByMethod||n.declarations.push(a):n.declarations=[a],l&111551&&(!n.valueDeclaration||n.valueDeclaration.kind!==a.kind)&&(n.valueDeclaration=a)}function sPe(n,a,l,_){E.assert(!!_.symbol,"The member is expected to have a symbol.");const m=Wn(_);if(!m.resolvedSymbol){m.resolvedSymbol=_.symbol;const h=Gr(_)?_.left:_.name,x=mo(h)?Bc(h.argumentExpression):Lg(h);if(pp(x)){const N=dp(x),F=_.symbol.flags;let V=l.get(N);V||l.set(N,V=Aa(0,N,4096));const ne=a&&a.get(N);if(!(n.flags&32)&&(V.flags&cS(F)||ne)){const le=ne?Xi(ne.declarations,V.declarations):V.declarations,xe=!(x.flags&8192)&&bi(N)||eo(h);Zt(le,Ne=>je(as(Ne)||Ne,d.Property_0_was_also_declared_here,xe)),je(h||_,d.Duplicate_property_0,xe),V=Aa(0,N,4096)}return V.links.nameType=x,bKe(V,_,F),V.parent?E.assert(V.parent===n,"Existing symbol parent should match new one"):V.parent=n,m.resolvedSymbol=V}}return m.resolvedSymbol}function Ipe(n,a){var l,_,m;const h=yi(n);if(!h[a]){const x=a==="resolvedExports",N=x?n.flags&1536?Lx(n).exports:n.exports:n.members;h[a]=N||W;const F=zs();for(const le of n.declarations||ze){const xe=Wee(le);if(xe)for(const Ne of xe)x===Uc(Ne)&&QM(Ne)&&sPe(n,N,F,Ne)}const V=(((l=n.valueDeclaration)==null?void 0:l.kind)===219||((_=n.valueDeclaration)==null?void 0:_.kind)===218)&&((m=tf(n.valueDeclaration.parent))==null?void 0:m.assignmentDeclarationMembers)||n.assignmentDeclarationMembers;if(V){const le=fs(V.values());for(const xe of le){const Ne=ac(xe),nt=Ne===3||Gr(xe)&&zY(xe,Ne)||Ne===9||Ne===6;x===!nt&&QM(xe)&&sPe(n,N,F,xe)}}let ne=lS(N,F);if(n.flags&33554432&&h.cjsExportMerged&&n.declarations)for(const le of n.declarations){const xe=yi(le.symbol)[a];if(!ne){ne=xe;continue}xe&&xe.forEach((Ne,nt)=>{const kt=ne.get(nt);if(!kt)ne.set(nt,Ne);else{if(kt===Ne)return;ne.set(nt,bp(kt,Ne))}})}h[a]=ne||W}return h[a]}function Cy(n){return n.flags&6256?Ipe(n,"resolvedMembers"):n.members||W}function JQ(n){if(n.flags&106500&&n.escapedName==="__computed"){const a=yi(n);if(!a.lateSymbol&&ut(n.declarations,QM)){const l=Na(n.parent);ut(n.declarations,Uc)?j_(l):Cy(l)}return a.lateSymbol||(a.lateSymbol=n)}return n}function rf(n,a,l){if(Pn(n)&4){const _=n.target,m=uo(n);return Ir(_.typeParameters)===Ir(m)?v0(_,Xi(m,[a||_.thisType])):n}else if(n.flags&2097152){const _=Yc(n.types,m=>rf(m,a,l));return _!==n.types?fa(_):n}return l?e_(n):n}function aPe(n,a,l,_){let m,h,x,N,F;gj(l,_,0,l.length)?(h=a.symbol?Cy(a.symbol):zs(a.declaredProperties),x=a.declaredCallSignatures,N=a.declaredConstructSignatures,F=a.declaredIndexInfos):(m=k_(l,_),h=rPe(a.declaredProperties,m,l.length===1),x=sY(a.declaredCallSignatures,m),N=sY(a.declaredConstructSignatures,m),F=N8e(a.declaredIndexInfos,m));const V=Qc(a);if(V.length){if(a.symbol&&h===Cy(a.symbol)){const le=zs();for(const xe of h.values())xe.flags&262144||le.set(xe.escapedName,xe);h=le}Gf(n,h,x,N,F);const ne=Mo(_);for(const le of V){const xe=ne?rf(Ri(le,m),ne):le;nPe(h,Wa(xe)),x=Xi(x,Ts(xe,0)),N=Xi(N,Ts(xe,1));const Ne=xe!==G?zu(xe):[Gm(Fe,G,!1)];F=Xi(F,wn(Ne,nt=>!Hpe(F,nt.keyType)))}}Gf(n,h,x,N,F)}function SKe(n){aPe(n,Ape(n),ze,ze)}function TKe(n){const a=Ape(n.target),l=Xi(a.typeParameters,[a.thisType]),_=uo(n),m=_.length===l.length?_:Xi(_,[n]);aPe(n,a,l,m)}function Fg(n,a,l,_,m,h,x,N){const F=new g(Jt,N);return F.declaration=n,F.typeParameters=a,F.parameters=_,F.thisParameter=l,F.resolvedReturnType=m,F.resolvedTypePredicate=h,F.minArgumentCount=x,F.resolvedMinArgumentCount=void 0,F.target=void 0,F.mapper=void 0,F.compositeSignatures=void 0,F.compositeKind=void 0,F}function AN(n){const a=Fg(n.declaration,n.typeParameters,n.thisParameter,n.parameters,void 0,void 0,n.minArgumentCount,n.flags&167);return a.target=n.target,a.mapper=n.mapper,a.compositeSignatures=n.compositeSignatures,a.compositeKind=n.compositeKind,a}function oPe(n,a){const l=AN(n);return l.compositeSignatures=a,l.compositeKind=1048576,l.target=void 0,l.mapper=void 0,l}function xKe(n,a){if((n.flags&24)===a)return n;n.optionalCallSignatureCache||(n.optionalCallSignatureCache={});const l=a===8?"inner":"outer";return n.optionalCallSignatureCache[l]||(n.optionalCallSignatureCache[l]=kKe(n,a))}function kKe(n,a){E.assert(a===8||a===16,"An optional call signature can either be for an inner call chain or an outer call chain, but not both.");const l=AN(n);return l.flags|=a,l}function cPe(n,a){if(bu(n)){const m=n.parameters.length-1,h=n.parameters[m].escapedName,x=Br(n.parameters[m]);if(pa(x))return[l(x,m,h)];if(!a&&x.flags&1048576&&qi(x.types,pa))return Yt(x.types,N=>l(N,m,h))}return[n.parameters];function l(m,h,x){const N=uo(m),F=_(m,x),V=Yt(N,(ne,le)=>{const xe=F&&F[le]?F[le]:wD(n,h+le,m),Ne=m.target.elementFlags[le],nt=Ne&12?32768:Ne&2?16384:0,kt=Aa(1,xe,nt);return kt.links.type=Ne&4?uu(ne):ne,kt});return Xi(n.parameters.slice(0,h),V)}function _(m,h){const x=new Map;return Yt(m.target.labeledElementDeclarations,(N,F)=>{const V=age(N,F,h),ne=x.get(V);return ne===void 0?(x.set(V,1),V):(x.set(V,ne+1),`${V}_${ne}`)})}}function CKe(n){const a=Xc(n),l=Ts(a,1),_=Qg(n.symbol),m=!!_&&In(_,64);if(l.length===0)return[Fg(void 0,n.localTypeParameters,void 0,ze,n,void 0,0,m?4:0)];const h=pi(n),x=Hr(h),N=rR(h),F=Ir(N),V=[];for(const ne of l){const le=Hm(ne.typeParameters),xe=Ir(ne.typeParameters);if(x||F>=le&&F<=xe){const Ne=xe?UQ(ne,Dy(N,ne.typeParameters,le,x)):AN(ne);Ne.typeParameters=n.localTypeParameters,Ne.resolvedReturnType=n,Ne.flags=m?Ne.flags|4:Ne.flags&-5,V.push(Ne)}}return V}function Fpe(n,a,l,_,m){for(const h of n)if(mR(h,a,l,_,m,l?Ktt:WN))return h}function EKe(n,a,l){if(a.typeParameters){if(l>0)return;for(let m=1;m1&&(l=l===void 0?_:-1);for(const m of n[_])if(!a||!Fpe(a,m,!1,!1,!0)){const h=EKe(n,m,_);if(h){let x=m;if(h.length>1){let N=m.thisParameter;const F=Zt(h,V=>V.thisParameter);if(F){const V=fa(Ii(h,ne=>ne.thisParameter&&Br(ne.thisParameter)));N=AS(F,V)}x=oPe(m,h),x.thisParameter=N}(a||(a=[])).push(x)}}}if(!Ir(a)&&l!==-1){const _=n[l!==void 0?l:0];let m=_.slice();for(const h of n)if(h!==_){const x=h[0];if(E.assert(!!x,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"),m=x.typeParameters&&ut(m,N=>!!N.typeParameters&&!lPe(x.typeParameters,N.typeParameters))?void 0:Yt(m,N=>wKe(N,x)),!m)break}a=m}return a||ze}function lPe(n,a){if(Ir(n)!==Ir(a))return!1;if(!n||!a)return!0;const l=k_(a,n);for(let _=0;_=m?n:a,x=h===n?a:n,N=h===n?_:m,F=Xm(n)||Xm(a),V=F&&!Xm(h),ne=new Array(N+(V?1:0));for(let le=0;le=im(h)&&le>=im(x),_r=le>=_?void 0:wD(n,le),Yr=le>=m?void 0:wD(a,le),gr=_r===Yr?_r:_r?Yr?void 0:_r:Yr,Ut=Aa(1|(Xt&&!kt?16777216:0),gr||`arg${le}`,kt?32768:Xt?16384:0);Ut.links.type=kt?uu(nt):nt,ne[le]=Ut}if(V){const le=Aa(1,"args",32768);le.links.type=uu(Sd(x,N)),x===a&&(le.links.type=Ri(le.links.type,l)),ne[N]=le}return ne}function wKe(n,a){const l=n.typeParameters||a.typeParameters;let _;n.typeParameters&&a.typeParameters&&(_=k_(a.typeParameters,n.typeParameters));const m=n.declaration,h=PKe(n,a,_),x=DKe(n.thisParameter,a.thisParameter,_),N=Math.max(n.minArgumentCount,a.minArgumentCount),F=Fg(m,l,x,h,void 0,void 0,N,(n.flags|a.flags)&167);return F.compositeKind=1048576,F.compositeSignatures=Xi(n.compositeKind!==2097152&&n.compositeSignatures||[n],[a]),_&&(F.mapper=n.compositeKind!==2097152&&n.mapper&&n.compositeSignatures?av(n.mapper,_):_),F}function uPe(n){const a=zu(n[0]);if(a){const l=[];for(const _ of a){const m=_.keyType;qi(n,h=>!!Og(h,m))&&l.push(Gm(m,Mn(Yt(n,h=>ev(h,m))),ut(n,h=>Og(h,m).isReadonly)))}return l}return ze}function AKe(n){const a=Ope(Yt(n.types,m=>m===St?[dr]:Ts(m,0))),l=Ope(Yt(n.types,m=>Ts(m,1))),_=uPe(n.types);Gf(n,W,a,l,_)}function YM(n,a){return n?a?fa([n,a]):n:a}function _Pe(n){const a=Ch(n,_=>Ts(_,1).length>0),l=Yt(n,xn);if(a>0&&a===Ch(l,_=>_)){const _=l.indexOf(!0);l[_]=!1}return l}function NKe(n,a,l,_){const m=[];for(let h=0;hN);for(let N=0;N0&&(V=Yt(V,ne=>{const le=AN(ne);return le.resolvedReturnType=NKe(Ma(ne),m,h,N),le})),l=fPe(l,V)}a=fPe(a,Ts(F,0)),_=Eu(zu(F),(V,ne)=>pPe(V,ne,!1),_)}Gf(n,W,a||ze,l||ze,_||ze)}function fPe(n,a){for(const l of a)(!n||qi(n,_=>!mR(_,l,!1,!1,!1,WN)))&&(n=lr(n,l));return n}function pPe(n,a,l){if(n)for(let _=0;_{var F;!(N.flags&418)&&!(N.flags&512&&((F=N.declarations)!=null&&F.length)&&qi(N.declarations,ru))&&x.set(N.escapedName,N)}),l=x}let m;if(Gf(n,l,ze,ze,ze),a.flags&32){const x=Qf(a),N=Xc(x);N.flags&11272192?(l=zs(I6(l)),nPe(l,Wa(N))):N===G&&(m=Gm(Fe,G,!1))}const h=VQ(l);if(h?_=Kpe(h):(m&&(_=lr(_,m)),a.flags&384&&(bo(a).flags&32||ut(n.properties,x=>!!(Br(x).flags&296)))&&(_=lr(_,yn))),Gf(n,l,ze,ze,_||ze),a.flags&8208&&(n.callSignatures=I2(a)),a.flags&32){const x=Qf(a);let N=a.members?I2(a.members.get("__constructor")):ze;a.flags&16&&(N=Dn(N.slice(),Ii(n.callSignatures,F=>nm(F.declaration)?Fg(F.declaration,F.typeParameters,F.thisParameter,F.parameters,x,void 0,F.minArgumentCount,F.flags&167):void 0))),N.length||(N=CKe(x)),n.constructSignatures=N}}function OKe(n,a,l){return Ri(n,k_([a.indexType,a.objectType],[vd(0),yd([l])]))}function LKe(n){const a=Og(n.source,Fe),l=qm(n.mappedType),_=!(l&1),m=l&4?0:16777216,h=a?[Gm(Fe,AY(a.type,n.mappedType,n.constraintType),_&&a.isReadonly)]:ze,x=zs();for(const N of Wa(n.source)){const F=8192|(_&&Td(N)?8:0),V=Aa(4|N.flags&m,N.escapedName,F);if(V.declarations=N.declarations,V.links.nameType=yi(N).nameType,V.links.propertyType=Br(N),n.constraintType.type.flags&8388608&&n.constraintType.type.objectType.flags&262144&&n.constraintType.type.indexType.flags&262144){const ne=n.constraintType.type.objectType,le=OKe(n.mappedType,n.constraintType.type,ne);V.links.mappedType=le,V.links.constraintType=$m(ne)}else V.links.mappedType=n.mappedType,V.links.constraintType=n.constraintType;x.set(N.escapedName,V)}Gf(n,x,ze,ze,h)}function ZM(n){if(n.flags&4194304){const a=e_(n.type);return k0(a)?n8e(a):$m(a)}if(n.flags&16777216){if(n.root.isDistributive){const a=n.checkType,l=ZM(a);if(l!==a)return Nde(n,$x(n.root.checkType,l,n.mapper))}return n}if(n.flags&1048576)return Io(n,ZM,!0);if(n.flags&2097152){const a=n.types;return a.length===2&&a[0].flags&76&&a[1]===Fc?n:fa(Yc(n.types,ZM))}return n}function Lpe(n){return Ko(n)&4096}function Mpe(n,a,l,_){for(const m of Wa(n))_(gD(m,a));if(n.flags&1)_(Fe);else for(const m of zu(n))(!l||m.keyType.flags&134217732)&&_(m.keyType)}function MKe(n){const a=zs();let l;Gf(n,W,ze,ze,ze);const _=md(n),m=Ep(n),h=n.target||n,x=y0(h),N=!x||gPe(h),F=dh(h),V=e_(Jx(n)),ne=qm(n),le=Te?128:8576;NN(n)?Mpe(V,le,Te,xe):OS(ZM(m),xe),Gf(n,a,ze,ze,l||ze);function xe(nt){const kt=x?Ri(x,zN(n.mapper,_,nt)):nt;OS(kt,Xt=>Ne(nt,Xt))}function Ne(nt,kt){if(pp(kt)){const Xt=dp(kt),_r=a.get(Xt);if(_r)_r.links.nameType=Mn([_r.links.nameType,kt]),_r.links.keyType=Mn([_r.links.keyType,nt]);else{const Yr=pp(nt)?Gs(V,dp(nt)):void 0,gr=!!(ne&4||!(ne&8)&&Yr&&Yr.flags&16777216),Ut=!!(ne&1||!(ne&2)&&Yr&&Td(Yr)),Nr=H&&!gr&&Yr&&Yr.flags&16777216,Sr=Yr?Lpe(Yr):0,Er=Aa(4|(gr?16777216:0),Xt,Sr|262144|(Ut?8:0)|(Nr?524288:0));Er.links.mappedType=n,Er.links.nameType=kt,Er.links.keyType=nt,Yr&&(Er.links.syntheticOrigin=Yr,Er.declarations=N?Yr.declarations:void 0),a.set(Xt,Er)}}else if(qQ(kt)||kt.flags&33){const Xt=kt.flags&5?Fe:kt.flags&40?vt:kt,_r=Ri(F,zN(n.mapper,_,nt)),Yr=FN(V,kt),gr=!!(ne&1||!(ne&2)&&Yr?.isReadonly),Ut=Gm(Xt,_r,gr);l=pPe(l,Ut,!0)}}}function RKe(n){if(!n.links.type){const a=n.links.mappedType;if(!Wm(n,0))return a.containsError=!0,st;const l=dh(a.target||a),_=zN(a.mapper,md(a),n.links.keyType),m=Ri(l,_);let h=H&&n.flags&16777216&&!Yo(m,49152)?Ly(m,!0):n.links.checkFlags&524288?CY(m):m;Zd()||(je(D,d.Type_of_property_0_circularly_references_itself_in_mapped_type_1,ii(n),mr(a)),h=st),n.links.type=h}return n.links.type}function md(n){return n.typeParameter||(n.typeParameter=kS(cn(n.declaration.typeParameter)))}function Ep(n){return n.constraintType||(n.constraintType=ku(md(n))||st)}function y0(n){return n.declaration.nameType?n.nameType||(n.nameType=Ri(si(n.declaration.nameType),n.mapper)):void 0}function dh(n){return n.templateType||(n.templateType=n.declaration.type?Ri(El(si(n.declaration.type),!0,!!(qm(n)&4)),n.mapper):st)}function dPe(n){return gk(n.declaration.typeParameter)}function NN(n){const a=dPe(n);return a.kind===198&&a.operator===143}function Jx(n){if(!n.modifiersType)if(NN(n))n.modifiersType=Ri(si(dPe(n).type),n.mapper);else{const a=Sde(n.declaration),l=Ep(a),_=l&&l.flags&262144?ku(l):l;n.modifiersType=_&&_.flags&4194304?Ri(_.type,n.mapper):or}return n.modifiersType}function qm(n){const a=n.declaration;return(a.readonlyToken?a.readonlyToken.kind===41?2:1:0)|(a.questionToken?a.questionToken.kind===41?8:4:0)}function mPe(n){const a=qm(n);return a&8?-1:a&4?1:0}function Rpe(n){const a=mPe(n),l=Jx(n);return a||(Af(l)?mPe(l):0)}function jKe(n){return!!(Pn(n)&32&&qm(n)&4)}function Af(n){if(Pn(n)&32){const a=Ep(n);if(nv(a))return!0;const l=y0(n);if(l&&nv(Ri(l,R2(md(n),a))))return!0}return!1}function gPe(n){const a=y0(n);return!!a&&ca(a,md(n))}function gd(n){return n.members||(n.flags&524288?n.objectFlags&4?TKe(n):n.objectFlags&3?SKe(n):n.objectFlags&1024?LKe(n):n.objectFlags&16?FKe(n):n.objectFlags&32?MKe(n):E.fail("Unhandled object type "+E.formatObjectFlags(n.objectFlags)):n.flags&1048576?AKe(n):n.flags&2097152?IKe(n):E.fail("Unhandled type "+E.formatTypeFlags(n.flags))),n}function Ey(n){return n.flags&524288?gd(n).properties:ze}function K1(n,a){if(n.flags&524288){const _=gd(n).members.get(a);if(_&&gy(_))return _}}function KM(n){if(!n.resolvedProperties){const a=zs();for(const l of n.types){for(const _ of Wa(l))if(!a.has(_.escapedName)){const m=Upe(n,_.escapedName);m&&a.set(_.escapedName,m)}if(n.flags&1048576&&zu(l).length===0)break}n.resolvedProperties=w2(a)}return n.resolvedProperties}function Wa(n){return n=_D(n),n.flags&3145728?KM(n):Ey(n)}function BKe(n,a){n=_D(n),n.flags&3670016&&gd(n).members.forEach((l,_)=>{gS(l,_)&&a(l,_)})}function JKe(n,a){return a.properties.some(_=>{const m=_.name&&(sd(_.name)?p_(j8(_.name)):S0(_.name)),h=m&&pp(m)?dp(m):void 0,x=h===void 0?void 0:q(n,h);return!!x&&qN(x)&&!ca(Zx(_),x)})}function zKe(n){const a=Mn(n);if(!(a.flags&1048576))return Uge(a);const l=zs();for(const _ of n)for(const{escapedName:m}of Uge(_))if(!l.has(m)){const h=SPe(a,m);h&&l.set(m,h)}return fs(l.values())}function CS(n){return n.flags&262144?ku(n):n.flags&8388608?WKe(n):n.flags&16777216?vPe(n):Ku(n)}function ku(n){return IN(n)?pD(n):void 0}function zx(n,a=0){var l;return a<5&&!!(n&&(n.flags&262144&&ut((l=n.symbol)==null?void 0:l.declarations,_=>In(_,4096))||n.flags&3145728&&ut(n.types,_=>zx(_,a))||n.flags&8388608&&zx(n.objectType,a+1)||n.flags&16777216&&zx(vPe(n),a+1)||n.flags&33554432&&zx(n.baseType,a)||k0(n)&&Dc(rv(n),(_,m)=>!!(n.target.elementFlags[m]&8)&&zx(_,a))>=0))}function WKe(n){return IN(n)?UKe(n):void 0}function jpe(n){const a=gh(n,!1);return a!==n?a:CS(n)}function UKe(n){if(Wpe(n)||Af(n.objectType))return KQ(n.objectType,n.indexType);const a=jpe(n.indexType);if(a&&a!==n.indexType){const _=Ay(n.objectType,a,n.accessFlags);if(_)return _}const l=jpe(n.objectType);if(l&&l!==n.objectType)return Ay(l,n.indexType,n.accessFlags)}function Bpe(n){if(!n.resolvedDefaultConstraint){const a=Ptt(n),l=sv(n);n.resolvedDefaultConstraint=Ae(a)?l:Ae(l)?a:Mn([a,l])}return n.resolvedDefaultConstraint}function hPe(n){if(n.resolvedConstraintOfDistributive!==void 0)return n.resolvedConstraintOfDistributive||void 0;if(n.root.isDistributive&&n.restrictiveInstantiation!==n){const a=gh(n.checkType,!1),l=a===n.checkType?CS(a):a;if(l&&l!==n.checkType){const _=Nde(n,$x(n.root.checkType,l,n.mapper));if(!(_.flags&131072))return n.resolvedConstraintOfDistributive=_,_}}n.resolvedConstraintOfDistributive=!1}function yPe(n){return hPe(n)||Bpe(n)}function vPe(n){return IN(n)?yPe(n):void 0}function VKe(n,a){let l,_=!1;for(const m of n)if(m.flags&465829888){let h=CS(m);for(;h&&h.flags&21233664;)h=CS(h);h&&(l=lr(l,h),a&&(l=lr(l,m)))}else(m.flags&469892092||vh(m))&&(_=!0);if(l&&(a||_)){if(_)for(const m of n)(m.flags&469892092||vh(m))&&(l=lr(l,m));return fR(fa(l),!1)}}function Ku(n){if(n.flags&464781312||k0(n)){const a=Jpe(n);return a!==No&&a!==$c?a:void 0}return n.flags&4194304?Tc:void 0}function mh(n){return Ku(n)||n}function IN(n){return Jpe(n)!==$c}function Jpe(n){if(n.resolvedBaseConstraint)return n.resolvedBaseConstraint;const a=[];return n.resolvedBaseConstraint=l(n);function l(h){if(!h.immediateBaseConstraint){if(!Wm(h,4))return $c;let x;const N=yY(h);if((a.length<10||a.length<50&&!_s(a,N))&&(a.push(N),x=m(gh(h,!1)),a.pop()),!Zd()){if(h.flags&262144){const F=ede(h);if(F){const V=je(F,d.Type_parameter_0_has_a_circular_constraint,mr(h));D&&!Av(F,D)&&!Av(D,F)&&ua(V,mn(D,d.Circularity_originates_in_type_at_this_location))}}x=$c}h.immediateBaseConstraint=x||No}return h.immediateBaseConstraint}function _(h){const x=l(h);return x!==No&&x!==$c?x:void 0}function m(h){if(h.flags&262144){const x=pD(h);return h.isThisType||!x?x:_(x)}if(h.flags&3145728){const x=h.types,N=[];let F=!1;for(const V of x){const ne=_(V);ne?(ne!==V&&(F=!0),N.push(ne)):F=!0}return F?h.flags&1048576&&N.length===x.length?Mn(N):h.flags&2097152&&N.length?fa(N):void 0:h}if(h.flags&4194304)return Tc;if(h.flags&134217728){const x=h.types,N=Ii(x,_);return N.length===x.length?PS(h.texts,N):Fe}if(h.flags&268435456){const x=_(h.type);return x&&x!==h.type?Vx(h.symbol,x):Fe}if(h.flags&8388608){if(Wpe(h))return _(KQ(h.objectType,h.indexType));const x=_(h.objectType),N=_(h.indexType),F=x&&N&&Ay(x,N,h.accessFlags);return F&&_(F)}if(h.flags&16777216){const x=yPe(h);return x&&_(x)}if(h.flags&33554432)return _(nde(h));if(k0(h)){const x=Yt(rv(h),(N,F)=>{const V=N.flags&262144&&h.target.elementFlags[F]&8&&_(N)||N;return V!==N&&Nf(V,ne=>j2(ne)&&!k0(ne))?V:N});return yd(x,h.target.elementFlags,h.target.readonly,h.target.labeledElementDeclarations)}return h}}function qKe(n,a){return n.resolvedApparentType||(n.resolvedApparentType=rf(n,a,!0))}function zpe(n){if(n.default)n.default===ju&&(n.default=$c);else if(n.target){const a=zpe(n.target);n.default=a?Ri(a,n.mapper):No}else{n.default=ju;const a=n.symbol&&Zt(n.symbol.declarations,_=>Uo(_)&&_.default),l=a?si(a):No;n.default===ju&&(n.default=l)}return n.default}function ES(n){const a=zpe(n);return a!==No&&a!==$c?a:void 0}function HKe(n){return zpe(n)!==$c}function bPe(n){return!!(n.symbol&&Zt(n.symbol.declarations,a=>Uo(a)&&a.default))}function GKe(n){return n.resolvedApparentType||(n.resolvedApparentType=$Ke(n))}function $Ke(n){const a=cY(n);if(a&&!n.declaration.nameType){const l=ku(a);if(l&&Nf(l,j2))return Ri(n,$x(a,l,n.mapper))}return n}function Wpe(n){let a;return!!(n.flags&8388608&&Pn(a=n.objectType)&32&&!Af(a)&&nv(n.indexType)&&!(qm(a)&8)&&!a.declaration.nameType)}function e_(n){const a=n.flags&465829888?Ku(n)||or:n,l=Pn(a);return l&32?GKe(a):l&4&&a!==n?rf(a,n):a.flags&2097152?qKe(a,n):a.flags&402653316?uc:a.flags&296?hc:a.flags&2112?Fet():a.flags&528?jo:a.flags&12288?$Pe():a.flags&67108864?Us:a.flags&4194304?Tc:a.flags&2&&!H?Us:a}function _D(n){return hd(e_(hd(n)))}function SPe(n,a,l){var _,m,h;let x,N,F;const V=n.flags&1048576;let ne,le=4,xe=V?0:8,Ne=!1;for(const Er of n.types){const hr=e_(Er);if(!(et(hr)||hr.flags&131072)){const sn=Gs(hr,a,l),ms=sn?Mf(sn):0;if(sn){if(sn.flags&106500&&(ne??(ne=V?0:16777216),V?ne|=sn.flags&16777216:ne&=sn.flags),!x)x=sn;else if(sn!==x)if((i4(sn)||sn)===(i4(x)||x)&&zde(x,sn,(vs,Vi)=>vs===Vi?-1:0)===-1)Ne=!!x.parent&&!!Ir(cr(x.parent));else{N||(N=new Map,N.set(Xs(x),x));const vs=Xs(sn);N.has(vs)||N.set(vs,sn)}V&&Td(sn)?xe|=8:!V&&!Td(sn)&&(xe&=-9),xe|=(ms&6?0:256)|(ms&4?512:0)|(ms&2?1024:0)|(ms&256?2048:0),jme(sn)||(le=2)}else if(V){const xs=!wN(a)&&Wx(hr,a);xs?(xe|=32|(xs.isReadonly?8:0),F=lr(F,pa(hr)?SY(hr)||j:xs.type)):uv(hr)&&!(Pn(hr)&2097152)?(xe|=32,F=lr(F,j)):xe|=16}}}if(!x||V&&(N||xe&48)&&xe&1536&&!(N&&XKe(N.values())))return;if(!N&&!(xe&16)&&!F)if(Ne){const Er=(_=Jn(x,ym))==null?void 0:_.links,hr=AS(x,Er?.type);return hr.parent=(h=(m=x.valueDeclaration)==null?void 0:m.symbol)==null?void 0:h.parent,hr.links.containingType=n,hr.links.mapper=Er?.mapper,hr}else return x;const nt=N?fs(N.values()):[x];let kt,Xt,_r;const Yr=[];let gr,Ut,Nr=!1;for(const Er of nt){Ut?Er.valueDeclaration&&Er.valueDeclaration!==Ut&&(Nr=!0):Ut=Er.valueDeclaration,kt=Dn(kt,Er.declarations);const hr=Br(Er);Xt||(Xt=hr,_r=yi(Er).nameType);const sn=TS(Er);(gr||sn!==hr)&&(gr=lr(gr||Yr.slice(),sn)),hr!==Xt&&(xe|=64),(qN(hr)||qx(hr))&&(xe|=128),hr.flags&131072&&hr!==Ro&&(xe|=131072),Yr.push(hr)}Dn(Yr,F);const Sr=Aa(4|(ne??0),a,le|xe);return Sr.links.containingType=n,!Nr&&Ut&&(Sr.valueDeclaration=Ut,Ut.symbol.parent&&(Sr.parent=Ut.symbol.parent)),Sr.declarations=kt,Sr.links.nameType=_r,Yr.length>2?(Sr.links.checkFlags|=65536,Sr.links.deferralParent=n,Sr.links.deferralConstituents=Yr,Sr.links.deferralWriteConstituents=gr):(Sr.links.type=V?Mn(Yr):fa(Yr),gr&&(Sr.links.writeType=V?Mn(gr):fa(gr))),Sr}function TPe(n,a,l){var _,m;let h=(_=n.propertyCacheWithoutObjectFunctionPropertyAugment)!=null&&_.get(a)||!l?(m=n.propertyCache)==null?void 0:m.get(a):void 0;return h||(h=SPe(n,a,l),h&&(l?n.propertyCacheWithoutObjectFunctionPropertyAugment||(n.propertyCacheWithoutObjectFunctionPropertyAugment=zs()):n.propertyCache||(n.propertyCache=zs())).set(a,h)),h}function XKe(n){let a;for(const l of n){if(!l.declarations)return;if(!a){a=new Set(l.declarations);continue}if(a.forEach(_=>{_s(l.declarations,_)||a.delete(_)}),a.size===0)return}return a}function Upe(n,a,l){const _=TPe(n,a,l);return _&&!(Ko(_)&16)?_:void 0}function hd(n){return n.flags&1048576&&n.objectFlags&16777216?n.resolvedReducedType||(n.resolvedReducedType=QKe(n)):n.flags&2097152?(n.objectFlags&16777216||(n.objectFlags|=16777216|(ut(KM(n),YKe)?33554432:0)),n.objectFlags&33554432?Cn:n):n}function QKe(n){const a=Yc(n.types,hd);if(a===n.types)return n;const l=Mn(a);return l.flags&1048576&&(l.resolvedReducedType=l),l}function YKe(n){return xPe(n)||kPe(n)}function xPe(n){return!(n.flags&16777216)&&(Ko(n)&131264)===192&&!!(Br(n).flags&131072)}function kPe(n){return!n.valueDeclaration&&!!(Ko(n)&1024)}function Vpe(n){return!!(n.flags&1048576&&n.objectFlags&16777216&&ut(n.types,Vpe)||n.flags&2097152&&ZKe(n))}function ZKe(n){const a=n.uniqueLiteralFilledInstantiation||(n.uniqueLiteralFilledInstantiation=Ri(n,hs));return hd(a)!==a}function qpe(n,a){if(a.flags&2097152&&Pn(a)&33554432){const l=kn(KM(a),xPe);if(l)return ps(n,d.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,mr(a,void 0,536870912),ii(l));const _=kn(KM(a),kPe);if(_)return ps(n,d.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,mr(a,void 0,536870912),ii(_))}return n}function Gs(n,a,l,_){if(n=_D(n),n.flags&524288){const m=gd(n),h=m.members.get(a);if(h&&gy(h,_))return h;if(l)return;const x=m===qt?St:m.callSignatures.length?Fr:m.constructSignatures.length?Wi:void 0;if(x){const N=K1(x,a);if(N)return N}return K1(ye,a)}if(n.flags&3145728)return Upe(n,a,l)}function eR(n,a){if(n.flags&3670016){const l=gd(n);return a===0?l.callSignatures:l.constructSignatures}return ze}function Ts(n,a){const l=eR(_D(n),a);if(a===0&&!Ir(l)&&n.flags&1048576){if(n.arrayFallbackSignatures)return n.arrayFallbackSignatures;let _;if(Nf(n,m=>{var h;return!!((h=m.symbol)!=null&&h.parent)&&KKe(m.symbol.parent)&&(_?_===m.symbol.escapedName:(_=m.symbol.escapedName,!0))})){const m=Io(n,x=>Iy((CPe(x.symbol.parent)?Fs:Ps).typeParameters[0],x.mapper)),h=uu(m,em(n,x=>CPe(x.symbol.parent)));return n.arrayFallbackSignatures=Ts(q(h,_),a)}n.arrayFallbackSignatures=l}return l}function KKe(n){return!n||!Ps.symbol||!Fs.symbol?!1:!!Df(n,Ps.symbol)||!!Df(n,Fs.symbol)}function CPe(n){return!n||!Fs.symbol?!1:!!Df(n,Fs.symbol)}function Hpe(n,a){return kn(n,l=>l.keyType===a)}function Gpe(n,a){let l,_,m;for(const h of n)h.keyType===Fe?l=h:U6(a,h.keyType)&&(_?(m||(m=[_])).push(h):_=h);return m?Gm(or,fa(Yt(m,h=>h.type)),Eu(m,(h,x)=>h&&x.isReadonly,!0)):_||(l&&U6(a,Fe)?l:void 0)}function U6(n,a){return ca(n,a)||a===Fe&&ca(n,vt)||a===vt&&(n===rc||!!(n.flags&128)&&_g(n.value))}function $pe(n){return n.flags&3670016?gd(n).indexInfos:ze}function zu(n){return $pe(_D(n))}function Og(n,a){return Hpe(zu(n),a)}function ev(n,a){var l;return(l=Og(n,a))==null?void 0:l.type}function Xpe(n,a){return zu(n).filter(l=>U6(a,l.keyType))}function FN(n,a){return Gpe(zu(n),a)}function Wx(n,a){return FN(n,wN(a)?Ln:p_(bi(a)))}function EPe(n){var a;let l;for(const _ of L0(n))l=Bg(l,kS(_.symbol));return l?.length?l:Zc(n)?(a=fD(n))==null?void 0:a.typeParameters:void 0}function Qpe(n){const a=[];return n.forEach((l,_)=>{G1(_)||a.push(l)}),a}function zQ(n,a){if(Tl(n))return;const l=S_(me,'"'+n+'"',512);return l&&a?Na(l):l}function ON(n){if(cT(n)||M8(n)||R8(n))return!0;if(n.initializer){const l=Dp(n.parent),_=n.parent.parameters.indexOf(n);return E.assert(_>=0),_>=im(l,3)}const a=_b(n.parent);return a?!n.type&&!n.dotDotDotToken&&n.parent.parameters.indexOf(n)>=eZ(a).length:!1}function eet(n){return Es(n)&&!Ad(n)&&n.questionToken}function tR(n,a,l,_){return{kind:n,parameterName:a,parameterIndex:l,type:_}}function Hm(n){let a=0;if(n)for(let l=0;l=l&&h<=m){const x=n?n.slice():[];for(let F=h;FN.arguments.length&&!Xt||R8(nt)||(m=l.length)}if((n.kind===177||n.kind===178)&&W6(n)&&(!x||!h)){const Ne=n.kind===177?178:177,nt=Wo(cn(n),Ne);nt&&(h=Ty(nt))}if(Hr(n)){const Ne=lI(n);Ne&&Ne.typeExpression&&(h=AS(Aa(1,"this"),si(Ne.typeExpression)))}const ne=m1(n)?mb(n):n,le=ne&&gc(ne)?Qf(Na(ne.parent.symbol)):void 0,xe=le?le.localTypeParameters:EPe(n);(bJ(n)||Hr(n)&&tet(n,l))&&(_|=1),(ME(n)&&In(n,64)||gc(n)&&In(n.parent,64))&&(_|=4),a.resolvedSignature=Fg(n,xe,h,l,void 0,void 0,m,_)}return a.resolvedSignature}function tet(n,a){if(m1(n)||!Ype(n))return!1;const l=Mo(n.parameters),_=l?mk(l):Zy(n).filter(ad),m=ic(_,x=>x.typeExpression&&HF(x.typeExpression.type)?x.typeExpression.type:void 0),h=Aa(3,"args",32768);return m?h.links.type=uu(si(m.type)):(h.links.checkFlags|=65536,h.links.deferralParent=Cn,h.links.deferralConstituents=[nc],h.links.deferralWriteConstituents=[nc]),m&&a.pop(),a.push(h),!0}function fD(n){if(!(Hr(n)&&po(n)))return;const a=Qy(n);return a?.typeExpression&&jS(si(a.typeExpression))}function ret(n,a){const l=fD(n);if(!l)return;const _=n.parameters.indexOf(a);return a.dotDotDotToken?r7(l,_):Sd(l,_)}function net(n){const a=fD(n);return a&&Ma(a)}function Ype(n){const a=Wn(n);return a.containsArgumentsReference===void 0&&(a.flags&512?a.containsArgumentsReference=!0:a.containsArgumentsReference=l(n.body)),a.containsArgumentsReference;function l(_){if(!_)return!1;switch(_.kind){case 80:return _.escapedText===it.escapedName&&h7(_)===it;case 172:case 174:case 177:case 178:return _.name.kind===167&&l(_.name);case 211:case 212:return l(_.expression);case 303:return l(_.initializer);default:return!uz(_)&&!ig(_)&&!!ds(_,l)}}}function I2(n){if(!n||!n.declarations)return ze;const a=[];for(let l=0;l0&&_.body){const m=n.declarations[l-1];if(_.parent===m.parent&&_.kind===m.kind&&_.pos===m.end)continue}if(Hr(_)&&_.jsDoc){let m=!1;for(const h of _.jsDoc)if(h.tags){for(const x of h.tags)if(vC(x)){const N=x.typeExpression;N.type===void 0&&!gc(_)&&cv(N,G),a.push(Dp(N)),m=!0}}if(m)continue}a.push(!Jv(_)&&!Mp(_)&&fD(_)||Dp(_))}}return a}function DPe(n){const a=Zu(n,n);if(a){const l=ef(a);if(l)return Br(l)}return G}function tv(n){if(n.thisParameter)return Br(n.thisParameter)}function Yf(n){if(!n.resolvedTypePredicate){if(n.target){const a=Yf(n.target);n.resolvedTypePredicate=a?Utt(a,n.mapper):qe}else if(n.compositeSignatures)n.resolvedTypePredicate=rtt(n.compositeSignatures,n.compositeKind)||qe;else{const a=n.declaration&&up(n.declaration);let l;if(!a){const _=fD(n.declaration);_&&n!==_&&(l=Yf(_))}n.resolvedTypePredicate=a&&RF(a)?iet(a,n):l||qe}E.assert(!!n.resolvedTypePredicate)}return n.resolvedTypePredicate===qe?void 0:n.resolvedTypePredicate}function iet(n,a){const l=n.parameterName,_=n.type&&si(n.type);return l.kind===197?tR(n.assertsModifier?2:0,void 0,void 0,_):tR(n.assertsModifier?3:1,l.escapedText,Dc(a.parameters,m=>m.escapedName===l.escapedText),_)}function PPe(n,a,l){return a!==2097152?Mn(n,l):fa(n)}function Ma(n){if(!n.resolvedReturnType){if(!Wm(n,3))return st;let a=n.target?Ri(Ma(n.target),n.mapper):n.compositeSignatures?Ri(PPe(Yt(n.compositeSignatures,Ma),n.compositeKind,2),n.mapper):V6(n.declaration)||(sc(n.declaration.body)?G:iZ(n.declaration));if(n.flags&8?a=lwe(a):n.flags&16&&(a=Ly(a)),!Zd()){if(n.declaration){const l=up(n.declaration);if(l)je(l,d.Return_type_annotation_circularly_references_itself);else if(se){const _=n.declaration,m=as(_);m?je(m,d._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,eo(m)):je(_,d.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions)}}a=G}n.resolvedReturnType=a}return n.resolvedReturnType}function V6(n){if(n.kind===176)return Qf(Na(n.parent.symbol));const a=up(n);if(m1(n)){const l=$4(n);if(l&&gc(l.parent)&&!a)return Qf(Na(l.parent.parent.symbol))}if(Bk(n))return si(n.parameters[0].type);if(a)return si(a);if(n.kind===177&&W6(n)){const l=Hr(n)&&Xp(n);if(l)return l;const _=Wo(cn(n),178),m=wf(_);if(m)return m}return net(n)}function WQ(n){return n.compositeSignatures&&ut(n.compositeSignatures,WQ)||!n.resolvedReturnType&&Q1(n,3)>=0}function set(n){return wPe(n)||G}function wPe(n){if(bu(n)){const a=Br(n.parameters[n.parameters.length-1]),l=pa(a)?SY(a):a;return l&&ev(l,vt)}}function LN(n,a,l,_){const m=Zpe(n,Dy(a,n.typeParameters,Hm(n.typeParameters),l));if(_){const h=jAe(Ma(m));if(h){const x=AN(h);x.typeParameters=_;const N=AN(m);return N.resolvedReturnType=DS(x),N}}return m}function Zpe(n,a){const l=n.instantiations||(n.instantiations=new Map),_=Pp(a);let m=l.get(_);return m||l.set(_,m=UQ(n,a)),m}function UQ(n,a){return X6(n,aet(n,a),!0)}function aet(n,a){return k_(n.typeParameters,a)}function MN(n){return n.typeParameters?n.erasedSignatureCache||(n.erasedSignatureCache=oet(n)):n}function oet(n){return X6(n,I8e(n.typeParameters),!0)}function cet(n){return n.typeParameters?n.canonicalSignatureCache||(n.canonicalSignatureCache=uet(n)):n}function uet(n){return LN(n,Yt(n.typeParameters,a=>a.target&&!ku(a.target)?a.target:a),Hr(n.declaration))}function _et(n){const a=n.typeParameters;if(a){if(n.baseSignatureCache)return n.baseSignatureCache;const l=I8e(a),_=k_(a,Yt(a,h=>ku(h)||or));let m=Yt(a,h=>Ri(h,_)||or);for(let h=0;h{qQ(m)&&!Hpe(a,m)&&a.push(Gm(m,l.type?si(l.type):G,w_(l,8),l))})}return a}return ze}function qQ(n){return!!(n.flags&4108)||qx(n)||!!(n.flags&2097152)&&!hD(n)&&ut(n.types,qQ)}function ede(n){return Ii(wn(n.symbol&&n.symbol.declarations,Uo),gk)[0]}function IPe(n,a){var l;let _;if((l=n.symbol)!=null&&l.declarations){for(const m of n.symbol.declarations)if(m.parent.kind===195){const[h=m.parent,x]=lte(m.parent.parent);if(x.kind===183&&!a){const N=x,F=Tge(N);if(F){const V=N.typeArguments.indexOf(h);if(V()=>xot(N,F,nt))),xe=Ri(ne,le);xe!==n&&(_=lr(_,xe))}}}}else if(x.kind===169&&x.dotDotDotToken||x.kind===191||x.kind===202&&x.dotDotDotToken)_=lr(_,uu(or));else if(x.kind===204)_=lr(_,Fe);else if(x.kind===168&&x.parent.kind===200)_=lr(_,Tc);else if(x.kind===200&&x.type&&Ha(x.type)===m.parent&&x.parent.kind===194&&x.parent.extendsType===x&&x.parent.checkType.kind===200&&x.parent.checkType.type){const N=x.parent.checkType,F=si(N.type);_=lr(_,Ri(F,R2(kS(cn(N.typeParameter)),N.typeParameter.constraint?si(N.typeParameter.constraint):Tc)))}}}return _&&fa(_)}function pD(n){if(!n.constraint)if(n.target){const a=ku(n.target);n.constraint=a?Ri(a,n.mapper):No}else{const a=ede(n);if(!a)n.constraint=IPe(n)||No;else{let l=si(a);l.flags&1&&!et(l)&&(l=a.parent.parent.kind===200?Tc:or),n.constraint=l}}return n.constraint===No?void 0:n.constraint}function FPe(n){const a=Wo(n.symbol,168),l=od(a.parent)?i5(a.parent):a.parent;return l&&tf(l)}function Pp(n){let a="";if(n){const l=n.length;let _=0;for(;_1&&(a+=":"+h),_+=h}}return a}function Ux(n,a){return n?`@${Xs(n)}`+(a?`:${Pp(a)}`:""):""}function HQ(n,a){let l=0;for(const _ of n)(a===void 0||!(_.flags&a))&&(l|=Pn(_));return l&458752}function q6(n,a){return ut(a)&&n===rs?or:v0(n,a)}function v0(n,a){const l=Pp(a);let _=n.instantiations.get(l);return _||(_=Hf(4,n.symbol),n.instantiations.set(l,_),_.objectFlags|=a?HQ(a):0,_.target=n,_.resolvedTypeArguments=a),_}function OPe(n){const a=d0(n.flags,n.symbol);return a.objectFlags=n.objectFlags,a.target=n.target,a.resolvedTypeArguments=n.resolvedTypeArguments,a}function tde(n,a,l,_,m){if(!_){_=Hx(a);const x=$6(_);m=l?T0(x,l):x}const h=Hf(4,n.symbol);return h.target=n,h.node=a,h.mapper=l,h.aliasSymbol=_,h.aliasTypeArguments=m,h}function uo(n){var a,l;if(!n.resolvedTypeArguments){if(!Wm(n,6))return((a=n.target.localTypeParameters)==null?void 0:a.map(()=>st))||ze;const _=n.node,m=_?_.kind===183?Xi(n.target.outerTypeParameters,cZ(_,n.target.localTypeParameters)):_.kind===188?[si(_.elementType)]:Yt(_.elements,si):ze;Zd()?n.resolvedTypeArguments=n.mapper?T0(m,n.mapper):m:(n.resolvedTypeArguments=((l=n.target.localTypeParameters)==null?void 0:l.map(()=>st))||ze,je(n.node||D,n.target.symbol?d.Type_arguments_for_0_circularly_reference_themselves:d.Tuple_type_arguments_circularly_reference_themselves,n.target.symbol&&ii(n.target.symbol)))}return n.resolvedTypeArguments}function b0(n){return Ir(n.target.typeParameters)}function LPe(n,a){const l=bo(Na(a)),_=l.localTypeParameters;if(_){const m=Ir(n.typeArguments),h=Hm(_),x=Hr(n);if(!(!se&&x)&&(m_.length)){const V=x&&qh(n)&&!yC(n.parent),ne=h===_.length?V?d.Expected_0_type_arguments_provide_these_with_an_extends_tag:d.Generic_type_0_requires_1_type_argument_s:V?d.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:d.Generic_type_0_requires_between_1_and_2_type_arguments,le=mr(l,void 0,2);if(je(n,ne,le,h,_.length),!x)return st}if(n.kind===183&&t8e(n,Ir(n.typeArguments)!==_.length))return tde(l,n,void 0);const F=Xi(l.outerTypeParameters,Dy(rR(n),_,h,x));return v0(l,F)}return F2(n,a)?l:st}function H6(n,a,l,_){const m=bo(n);if(m===er&&IO.has(n.escapedName)&&a&&a.length===1)return Vx(n,a[0]);const h=yi(n),x=h.typeParameters,N=Pp(a)+Ux(l,_);let F=h.instantiations.get(N);return F||h.instantiations.set(N,F=L8e(m,k_(x,Dy(a,x,Hm(x),Hr(n.valueDeclaration))),l,_)),F}function fet(n,a){if(Ko(a)&1048576){const m=rR(n),h=Ux(a,m);let x=Be.get(h);return x||(x=Lc(1,"error",void 0,`alias ${h}`),x.aliasSymbol=a,x.aliasTypeArguments=m,Be.set(h,x)),x}const l=bo(a),_=yi(a).typeParameters;if(_){const m=Ir(n.typeArguments),h=Hm(_);if(m_.length)return je(n,h===_.length?d.Generic_type_0_requires_1_type_argument_s:d.Generic_type_0_requires_between_1_and_2_type_arguments,ii(a),h,_.length),st;const x=Hx(n);let N=x&&(MPe(a)||!MPe(x))?x:void 0,F;if(N)F=$6(N);else if(kI(n)){const V=G6(n,2097152,!0);if(V&&V!==dt){const ne=ul(V);ne&&ne.flags&524288&&(N=ne,F=rR(n)||(_?[]:void 0))}}return H6(a,rR(n),N,F)}return F2(n,a)?l:st}function MPe(n){var a;const l=(a=n.declarations)==null?void 0:a.find(i8);return!!(l&&uf(l))}function pet(n){switch(n.kind){case 183:return n.typeName;case 233:const a=n.expression;if(oc(a))return a}}function RPe(n){return n.parent?`${RPe(n.parent)}.${n.escapedName}`:n.escapedName}function GQ(n){const l=(n.kind===166?n.right:n.kind===211?n.name:n).escapedText;if(l){const _=n.kind===166?GQ(n.left):n.kind===211?GQ(n.expression):void 0,m=_?`${RPe(_)}.${l}`:l;let h=we.get(m);return h||(we.set(m,h=Aa(524288,l,1048576)),h.parent=_,h.links.declaredType=Ct),h}return dt}function G6(n,a,l){const _=pet(n);if(!_)return dt;const m=lo(_,a,l);return m&&m!==dt?m:l?dt:GQ(_)}function $Q(n,a){if(a===dt)return st;if(a=wx(a)||a,a.flags&96)return LPe(n,a);if(a.flags&524288)return fet(n,a);const l=ePe(a);if(l)return F2(n,a)?t_(l):st;if(a.flags&111551&&XQ(n)){const _=det(n,a);return _||(G6(n,788968),Br(a))}return st}function det(n,a){const l=Wn(n);if(!l.resolvedJSDocType){const _=Br(a);let m=_;if(a.valueDeclaration){const h=n.kind===205&&n.qualifier;_.symbol&&_.symbol!==a&&h&&(m=$Q(n,_.symbol))}l.resolvedJSDocType=m}return l.resolvedJSDocType}function rde(n,a){if(a.flags&3||a===n||n.flags&1)return n;const l=`${Wu(n)}>${Wu(a)}`,_=$i.get(l);if(_)return _;const m=Cp(33554432);return m.baseType=n,m.constraint=a,$i.set(l,m),m}function nde(n){return fa([n.constraint,n.baseType])}function jPe(n){return n.kind===189&&n.elements.length===1}function BPe(n,a,l){return jPe(a)&&jPe(l)?BPe(n,a.elements[0],l.elements[0]):Ny(si(a))===Ny(n)?si(l):void 0}function met(n,a){let l,_=!0;for(;a&&!Ci(a)&&a.kind!==327;){const m=a.parent;if(m.kind===169&&(_=!_),(_||n.flags&8650752)&&m.kind===194&&a===m.trueType){const h=BPe(n,m.checkType,m.extendsType);h&&(l=lr(l,h))}else if(n.flags&262144&&m.kind===200&&a===m.type){const h=si(m);if(md(h)===Ny(n)){const x=cY(h);if(x){const N=ku(x);N&&Nf(N,j2)&&(l=lr(l,Mn([vt,rc])))}}}a=m}return l?rde(n,fa(l)):n}function XQ(n){return!!(n.flags&16777216)&&(n.kind===183||n.kind===205)}function F2(n,a){return n.typeArguments?(je(n,d.Type_0_is_not_generic,a?ii(a):n.typeName?eo(n.typeName):PO),!1):!0}function JPe(n){if(Ie(n.typeName)){const a=n.typeArguments;switch(n.typeName.escapedText){case"String":return F2(n),Fe;case"Number":return F2(n),vt;case"Boolean":return F2(n),On;case"Void":return F2(n),Ni;case"Undefined":return F2(n),j;case"Null":return F2(n),De;case"Function":case"function":return F2(n),St;case"array":return(!a||!a.length)&&!se?nc:void 0;case"promise":return(!a||!a.length)&&!se?WR(G):void 0;case"Object":if(a&&a.length===2){if(YI(n)){const l=si(a[0]),_=si(a[1]),m=l===Fe||l===vt?[Gm(l,_,!1)]:ze;return Qo(void 0,W,ze,ze,m)}return G}return F2(n),se?void 0:G}}}function get(n){const a=si(n.type);return H?TY(a,65536):a}function ide(n){const a=Wn(n);if(!a.resolvedType){if(Vg(n)&&sb(n.parent))return a.resolvedSymbol=dt,a.resolvedType=Bc(n.parent.expression);let l,_;const m=788968;XQ(n)&&(_=JPe(n),_||(l=G6(n,m,!0),l===dt?l=G6(n,m|111551):G6(n,m),_=$Q(n,l))),_||(l=G6(n,m),_=$Q(n,l)),a.resolvedSymbol=l,a.resolvedType=_}return a.resolvedType}function rR(n){return Yt(n.typeArguments,si)}function zPe(n){const a=Wn(n);if(!a.resolvedType){const l=iNe(n);a.resolvedType=t_(nf(l))}return a.resolvedType}function WPe(n,a){function l(m){const h=m.declarations;if(h)for(const x of h)switch(x.kind){case 263:case 264:case 266:return x}}if(!n)return a?rs:Us;const _=bo(n);return _.flags&524288?Ir(_.typeParameters)!==a?(je(l(n),d.Global_type_0_must_have_1_type_parameter_s,pc(n),a),a?rs:Us):_:(je(l(n),d.Global_type_0_must_be_a_class_or_interface_type,pc(n)),a?rs:Us)}function sde(n,a){return dD(n,111551,a?d.Cannot_find_global_value_0:void 0)}function UPe(n,a){return dD(n,788968,a?d.Cannot_find_global_type_0:void 0)}function QQ(n,a,l){const _=dD(n,788968,l?d.Cannot_find_global_type_0:void 0);if(_&&(bo(_),Ir(yi(_).typeParameters)!==a)){const m=_.declarations&&kn(_.declarations,Jp);je(m,d.Global_type_0_must_have_1_type_parameter_s,pc(_),a);return}return _}function dD(n,a,l){return _c(void 0,n,a,l,n,!1,!1,!1)}function Rc(n,a,l){const _=UPe(n,l);return _||l?WPe(_,a):void 0}function het(){return Fm||(Fm=Rc("TypedPropertyDescriptor",1,!0)||rs)}function yet(){return Mr||(Mr=Rc("TemplateStringsArray",0,!0)||Us)}function VPe(){return Rn||(Rn=Rc("ImportMeta",0,!0)||Us)}function qPe(){if(!jn){const n=Aa(0,"ImportMetaExpression"),a=VPe(),l=Aa(4,"meta",8);l.parent=n,l.links.type=a;const _=zs([l]);n.members=_,jn=Qo(n,_,ze,ze,ze)}return jn}function HPe(n){return Oi||(Oi=Rc("ImportCallOptions",0,n))||Us}function GPe(n){return Xu||(Xu=sde("Symbol",n))}function vet(n){return Jf||(Jf=UPe("SymbolConstructor",n))}function $Pe(){return vg||(vg=Rc("Symbol",0,!1))||Us}function nR(n){return n0||(n0=Rc("Promise",1,n))||rs}function XPe(n){return ou||(ou=Rc("PromiseLike",1,n))||rs}function ade(n){return bg||(bg=sde("Promise",n))}function bet(n){return L_||(L_=Rc("PromiseConstructorLike",0,n))||Us}function YQ(n){return L||(L=Rc("AsyncIterable",1,n))||rs}function Tet(n){return pe||(pe=Rc("AsyncIterator",3,n))||rs}function xet(n){return Ze||(Ze=Rc("AsyncIterableIterator",1,n))||rs}function ket(n){return At||(At=Rc("AsyncGenerator",3,n))||rs}function ode(n){return zf||(zf=Rc("Iterable",1,n))||rs}function Cet(n){return Qu||(Qu=Rc("Iterator",3,n))||rs}function Eet(n){return Q||(Q=Rc("IterableIterator",1,n))||rs}function Det(n){return Ye||(Ye=Rc("Generator",3,n))||rs}function Pet(n){return Et||(Et=Rc("IteratorYieldResult",1,n))||rs}function wet(n){return Pt||(Pt=Rc("IteratorReturnResult",1,n))||rs}function QPe(n){return sa||(sa=Rc("Disposable",0,n))||Us}function Aet(n){return aa||(aa=Rc("AsyncDisposable",0,n))||Us}function YPe(n,a=0){const l=dD(n,788968,void 0);return l&&WPe(l,a)}function Net(){return Xo||(Xo=QQ("Extract",2,!0)||dt),Xo===dt?void 0:Xo}function Iet(){return Xl||(Xl=QQ("Omit",2,!0)||dt),Xl===dt?void 0:Xl}function cde(n){return ll||(ll=QQ("Awaited",1,n)||(n?dt:void 0)),ll===dt?void 0:ll}function Fet(){return kf||(kf=Rc("BigInt",0,!1))||Us}function Oet(n){return Cf??(Cf=Rc("ClassDecoratorContext",1,n))??rs}function Let(n){return Sg??(Sg=Rc("ClassMethodDecoratorContext",2,n))??rs}function Met(n){return Om??(Om=Rc("ClassGetterDecoratorContext",2,n))??rs}function Ret(n){return ki??(ki=Rc("ClassSetterDecoratorContext",2,n))??rs}function jet(n){return ay??(ay=Rc("ClassAccessorDecoratorContext",2,n))??rs}function Bet(n){return oy??(oy=Rc("ClassAccessorDecoratorTarget",2,n))??rs}function Jet(n){return fd??(fd=Rc("ClassAccessorDecoratorResult",2,n))??rs}function zet(n){return u2??(u2=Rc("ClassFieldDecoratorContext",2,n))??rs}function Wet(){return _a||(_a=sde("NaN",!1))}function Uet(){return vp||(vp=QQ("Record",2,!0)||dt),vp===dt?void 0:vp}function RN(n,a){return n!==rs?v0(n,a):Us}function ZPe(n){return RN(het(),[n])}function KPe(n){return RN(ode(!0),[n])}function uu(n,a){return RN(a?Fs:Ps,[n])}function lde(n){switch(n.kind){case 190:return 2;case 191:return e8e(n);case 202:return n.questionToken?2:n.dotDotDotToken?e8e(n):1;default:return 1}}function e8e(n){return oR(n.type)?4:8}function Vet(n){const a=Get(n.parent);if(oR(n))return a?Fs:Ps;const _=Yt(n.elements,lde);return ude(_,a,Yt(n.elements,qet))}function qet(n){return RE(n)||us(n)?n:void 0}function t8e(n,a){return!!Hx(n)||r8e(n)&&(n.kind===188?Py(n.elementType):n.kind===189?ut(n.elements,Py):a||ut(n.typeArguments,Py))}function r8e(n){const a=n.parent;switch(a.kind){case 196:case 202:case 183:case 192:case 193:case 199:case 194:case 198:case 188:case 189:return r8e(a);case 265:return!0}return!1}function Py(n){switch(n.kind){case 183:return XQ(n)||!!(G6(n,788968).flags&524288);case 186:return!0;case 198:return n.operator!==158&&Py(n.type);case 196:case 190:case 202:case 323:case 321:case 322:case 316:return Py(n.type);case 191:return n.type.kind!==188||Py(n.type.elementType);case 192:case 193:return ut(n.types,Py);case 199:return Py(n.objectType)||Py(n.indexType);case 194:return Py(n.checkType)||Py(n.extendsType)||Py(n.trueType)||Py(n.falseType)}return!1}function Het(n){const a=Wn(n);if(!a.resolvedType){const l=Vet(n);if(l===rs)a.resolvedType=Us;else if(!(n.kind===189&&ut(n.elements,_=>!!(lde(_)&8)))&&t8e(n))a.resolvedType=n.kind===189&&n.elements.length===0?l:tde(l,n,void 0);else{const _=n.kind===188?[si(n.elementType)]:Yt(n.elements,si);a.resolvedType=_de(l,_)}}return a.resolvedType}function Get(n){return FT(n)&&n.operator===148}function yd(n,a,l=!1,_=[]){const m=ude(a||Yt(n,h=>1),l,_);return m===rs?Us:n.length?_de(m,n):m}function ude(n,a,l){if(n.length===1&&n[0]&4)return a?Fs:Ps;const _=Yt(n,h=>h&1?"#":h&2?"?":h&4?".":"*").join()+(a?"R":"")+(ut(l,h=>!!h)?","+Yt(l,h=>h?Oa(h):"_").join(","):"");let m=zi.get(_);return m||zi.set(_,m=$et(n,a,l)),m}function $et(n,a,l){const _=n.length,m=Ch(n,le=>!!(le&9));let h;const x=[];let N=0;if(_){h=new Array(_);for(let le=0;le<_;le++){const xe=h[le]=lu(),Ne=n[le];if(N|=Ne,!(N&12)){const nt=Aa(4|(Ne&2?16777216:0),""+le,a?8:0);nt.links.tupleLabelDeclaration=l?.[le],nt.links.type=xe,x.push(nt)}}}const F=x.length,V=Aa(4,"length",a?8:0);if(N&12)V.links.type=vt;else{const le=[];for(let xe=m;xe<=_;xe++)le.push(vd(xe));V.links.type=Mn(le)}x.push(V);const ne=Hf(12);return ne.typeParameters=h,ne.outerTypeParameters=void 0,ne.localTypeParameters=h,ne.instantiations=new Map,ne.instantiations.set(Pp(ne.typeParameters),ne),ne.target=ne,ne.resolvedTypeArguments=ne.typeParameters,ne.thisType=lu(),ne.thisType.isThisType=!0,ne.thisType.constraint=ne,ne.declaredProperties=x,ne.declaredCallSignatures=ze,ne.declaredConstructSignatures=ze,ne.declaredIndexInfos=ze,ne.elementFlags=n,ne.minLength=m,ne.fixedLength=F,ne.hasRestElement=!!(N&12),ne.combinedFlags=N,ne.readonly=a,ne.labeledElementDeclarations=l,ne}function _de(n,a){return n.objectFlags&8?fde(n,a):v0(n,a)}function fde(n,a){var l,_,m;if(!(n.combinedFlags&14))return v0(n,a);if(n.combinedFlags&8){const Ne=Dc(a,(nt,kt)=>!!(n.elementFlags[kt]&8&&nt.flags&1179648));if(Ne>=0)return iR(Yt(a,(nt,kt)=>n.elementFlags[kt]&8?nt:or))?Io(a[Ne],nt=>fde(n,vj(a,Ne,nt))):st}const h=[],x=[],N=[];let F=-1,V=-1,ne=-1;for(let Ne=0;Ne=1e4)return je(D,ig(D)?d.Type_produces_a_tuple_type_that_is_too_large_to_represent:d.Expression_produces_a_tuple_type_that_is_too_large_to_represent),st;Zt(Xt,(_r,Yr)=>{var gr;return xe(_r,nt.target.elementFlags[Yr],(gr=nt.target.labeledElementDeclarations)==null?void 0:gr[Yr])})}else xe(x0(nt)&&ev(nt,vt)||st,4,(_=n.labeledElementDeclarations)==null?void 0:_[Ne]);else xe(nt,kt,(m=n.labeledElementDeclarations)==null?void 0:m[Ne])}for(let Ne=0;Ne=0&&Vx[V+nt]&8?J_(Ne,vt):Ne)),h.splice(V+1,ne-V),x.splice(V+1,ne-V),N.splice(V+1,ne-V));const le=ude(x,n.readonly,N);return le===rs?Us:x.length?v0(le,h):le;function xe(Ne,nt,kt){nt&1&&(F=x.length),nt&4&&V<0&&(V=x.length),nt&6&&(ne=x.length),h.push(nt&2?El(Ne,!0):Ne),x.push(nt),N.push(kt)}}function mD(n,a,l=0){const _=n.target,m=b0(n)-l;return a>_.fixedLength?Ort(n)||yd(ze):yd(uo(n).slice(a,m),_.elementFlags.slice(a,m),!1,_.labeledElementDeclarations&&_.labeledElementDeclarations.slice(a,m))}function n8e(n){return Mn(lr(zZ(n.target.fixedLength,a=>p_(""+a)),$m(n.target.readonly?Fs:Ps)))}function Xet(n,a){const l=Dc(n.elementFlags,_=>!(_&a));return l>=0?l:n.elementFlags.length}function jN(n,a){return n.elementFlags.length-b7(n.elementFlags,l=>!(l&a))-1}function pde(n){return n.fixedLength+jN(n,3)}function rv(n){const a=uo(n),l=b0(n);return a.length===l?a:a.slice(0,l)}function Qet(n){return El(si(n.type),!0)}function Wu(n){return n.id}function wy(n,a){return Dh(n,a,Wu,xo)>=0}function dde(n,a){const l=Dh(n,a,Wu,xo);return l<0?(n.splice(~l,0,a),!0):!1}function Yet(n,a,l){const _=l.flags;if(!(_&131072))if(a|=_&473694207,_&465829888&&(a|=33554432),l===Dt&&(a|=8388608),!H&&_&98304)Pn(l)&65536||(a|=4194304);else{const m=n.length,h=m&&l.id>n[m-1].id?~m:Dh(n,l,Wu,xo);h<0&&n.splice(~h,0,l)}return a}function i8e(n,a,l){let _;for(const m of l)m!==_&&(a=m.flags&1048576?i8e(n,a|(ttt(m)?1048576:0),m.types):Yet(n,a,m),_=m);return a}function Zet(n,a){var l;if(n.length<2)return n;const _=Pp(n),m=Qs.get(_);if(m)return m;const h=a&&ut(n,V=>!!(V.flags&524288)&&!Af(V)&&Lde(gd(V))),x=n.length;let N=x,F=0;for(;N>0;){N--;const V=n[N];if(h||V.flags&469499904){if(V.flags&262144&&mh(V).flags&1048576){Kd(V,Mn(Yt(n,xe=>xe===V?Cn:xe)),Wf)&&Uy(n,N);continue}const ne=V.flags&61603840?kn(Wa(V),xe=>bd(Br(xe))):void 0,le=ne&&t_(Br(ne));for(const xe of n)if(V!==xe){if(F===1e5&&F/(x-N)*x>1e6){(l=Jr)==null||l.instant(Jr.Phase.CheckTypes,"removeSubtypes_DepthLimit",{typeIds:n.map(nt=>nt.id)}),je(D,d.Expression_produces_a_union_type_that_is_too_complex_to_represent);return}if(F++,ne&&xe.flags&61603840){const Ne=q(xe,ne.escapedName);if(Ne&&bd(Ne)&&t_(Ne)!==le)continue}if(Kd(V,xe,Wf)&&(!(Pn(J6(V))&1)||!(Pn(J6(xe))&1)||ov(V,xe))){Uy(n,N);break}}}}return Qs.set(_,n),n}function Ket(n,a,l){let _=n.length;for(;_>0;){_--;const m=n[_],h=m.flags;(h&402653312&&a&4||h&256&&a&8||h&2048&&a&64||h&8192&&a&4096||l&&h&32768&&a&16384||M2(m)&&wy(n,m.regularType))&&Uy(n,_)}}function ett(n){const a=wn(n,l=>!!(l.flags&134217728)&&qx(l));if(a.length){let l=n.length;for(;l>0;){l--;const _=n[l];_.flags&128&&ut(a,m=>NY(_,m))&&Uy(n,l)}}}function ttt(n){return!!(n.flags&1048576&&(n.aliasSymbol||n.origin))}function s8e(n,a){for(const l of a)if(l.flags&1048576){const _=l.origin;l.aliasSymbol||_&&!(_.flags&1048576)?tp(n,l):_&&_.flags&1048576&&s8e(n,_.types)}}function mde(n,a){const l=P2(n);return l.types=a,l}function Mn(n,a=1,l,_,m){if(n.length===0)return Cn;if(n.length===1)return n[0];if(n.length===2&&!m&&(n[0].flags&1048576||n[1].flags&1048576)){const h=a===0?"N":a===2?"S":"L",x=n[0].id=2&&h[0]===j&&h[1]===ee&&Uy(h,1),(x&402664352||x&16384&&x&32768)&&Ket(h,x,!!(a&2)),x&128&&x&134217728&&ett(h),a===2&&(h=Zet(h,!!(x&524288)),!h))return st;if(h.length===0)return x&65536?x&4194304?De:Ve:x&32768?x&4194304?j:ce:Cn}if(!m&&x&1048576){const F=[];s8e(F,n);const V=[];for(const le of h)ut(F,xe=>wy(xe.types,le))||V.push(le);if(!l&&F.length===1&&V.length===0)return F[0];if(Eu(F,(le,xe)=>le+xe.types.length,0)+V.length===h.length){for(const le of F)dde(V,le);m=mde(1048576,V)}}const N=(x&36323331?0:32768)|(x&2097152?16777216:0);return hde(h,N,l,_,m)}function rtt(n,a){let l;const _=[];for(const h of n){const x=Yf(h);if(x){if(x.kind!==0&&x.kind!==1||l&&!gde(l,x))return;l=x,_.push(x.type)}else{const N=a!==2097152?Ma(h):void 0;if(N!==Wt&&N!==Lr)return}}if(!l)return;const m=PPe(_,a);return tR(l.kind,l.parameterName,l.parameterIndex,m)}function gde(n,a){return n.kind===a.kind&&n.parameterIndex===a.parameterIndex}function hde(n,a,l,_,m){if(n.length===0)return Cn;if(n.length===1)return n[0];const x=(m?m.flags&1048576?`|${Pp(m.types)}`:m.flags&2097152?`&${Pp(m.types)}`:`#${m.type.id}|${Pp(n)}`:Pp(n))+Ux(l,_);let N=Qe.get(x);return N||(N=Cp(1048576),N.objectFlags=a|HQ(n,98304),N.types=n,N.origin=m,N.aliasSymbol=l,N.aliasTypeArguments=_,n.length===2&&n[0].flags&512&&n[1].flags&512&&(N.flags|=16,N.intrinsicName="boolean"),Qe.set(x,N)),N}function ntt(n){const a=Wn(n);if(!a.resolvedType){const l=Hx(n);a.resolvedType=Mn(Yt(n.types,si),1,l,$6(l))}return a.resolvedType}function itt(n,a,l){const _=l.flags;return _&2097152?o8e(n,a,l.types):(vh(l)?a&16777216||(a|=16777216,n.set(l.id.toString(),l)):(_&3?l===Dt&&(a|=8388608):(H||!(_&98304))&&(l===ee&&(a|=262144,l=j),n.has(l.id.toString())||(l.flags&109472&&a&109472&&(a|=67108864),n.set(l.id.toString(),l))),a|=_&473694207),a)}function o8e(n,a,l){for(const _ of l)a=itt(n,a,t_(_));return a}function stt(n,a){let l=n.length;for(;l>0;){l--;const _=n[l];(_.flags&4&&a&402653312||_.flags&8&&a&256||_.flags&64&&a&2048||_.flags&4096&&a&8192||_.flags&16384&&a&32768||vh(_)&&a&470302716)&&Uy(n,l)}}function att(n,a){for(const l of n)if(!wy(l.types,a)){const _=a.flags&128?Fe:a.flags&288?vt:a.flags&2048?Lt:a.flags&8192?Ln:void 0;if(!_||!wy(l.types,_))return!1}return!0}function ott(n){let a=n.length;const l=wn(n,_=>!!(_.flags&128));for(;a>0;){a--;const _=n[a];if(_.flags&134217728){for(const m of l)if(Fy(m,_)){Uy(n,a);break}else if(qx(_))return!0}}return!1}function c8e(n,a){for(let l=0;l!(_.flags&a))}function ctt(n){let a;const l=Dc(n,x=>!!(Pn(x)&32768));if(l<0)return!1;let _=l+1;for(;_!!(V.flags&1048576&&V.types[0].flags&32768))){const V=ut(x,GN)?ee:j;c8e(x,32768),F=Mn([fa(x),V],1,a,l)}else if(qi(x,V=>!!(V.flags&1048576&&(V.types[0].flags&65536||V.types[1].flags&65536))))c8e(x,65536),F=Mn([fa(x),De],1,a,l);else{if(!iR(x))return st;const V=utt(x),ne=ut(V,le=>!!(le.flags&2097152))&&yde(V)>yde(x)?mde(2097152,x):void 0;F=Mn(V,1,a,l,ne)}else F=ltt(x,a,l);Dr.set(N,F)}return F}function l8e(n){return Eu(n,(a,l)=>l.flags&1048576?a*l.types.length:l.flags&131072?0:a,1)}function iR(n){var a;const l=l8e(n);return l>=1e5?((a=Jr)==null||a.instant(Jr.Phase.CheckTypes,"checkCrossProductUnion_DepthLimit",{typeIds:n.map(_=>_.id),size:l}),je(D,d.Expression_produces_a_union_type_that_is_too_complex_to_represent),!1):!0}function utt(n){const a=l8e(n),l=[];for(let _=0;_=0;N--)if(n[N].flags&1048576){const F=n[N].types,V=F.length;m[N]=F[h%V],h=Math.floor(h/V)}const x=fa(m);x.flags&131072||l.push(x)}return l}function u8e(n){return!(n.flags&3145728)||n.aliasSymbol?1:n.flags&1048576&&n.origin?u8e(n.origin):yde(n.types)}function yde(n){return Eu(n,(a,l)=>a+u8e(l),0)}function _tt(n){const a=Wn(n);if(!a.resolvedType){const l=Hx(n),_=Yt(n.types,si),m=_.length===2?_.indexOf(Fc):-1,h=m>=0?_[1-m]:or,x=!!(h.flags&76||h.flags&134217728&&qx(h));a.resolvedType=fa(_,l,$6(l),x)}return a.resolvedType}function _8e(n,a){const l=Cp(4194304);return l.type=n,l.indexFlags=a,l}function ftt(n){const a=P2(4194304);return a.type=n,a}function f8e(n,a){return a&1?n.resolvedStringIndexType||(n.resolvedStringIndexType=_8e(n,1)):n.resolvedIndexType||(n.resolvedIndexType=_8e(n,0))}function ptt(n,a){const l=md(n),_=Ep(n),m=y0(n.target||n);if(!m&&!(a&2))return _;const h=[];if(NN(n)){if(nv(_))return f8e(n,a);{const F=e_(Jx(n));Mpe(F,8576,!!(a&1),N)}}else OS(ZM(_),N);nv(_)&&OS(_,N);const x=a&2?jc(Mn(h),F=>!(F.flags&5)):Mn(h);if(x.flags&1048576&&_.flags&1048576&&Pp(x.types)===Pp(_.types))return _;return x;function N(F){const V=m?Ri(m,zN(n.mapper,l,F)):F;h.push(V===Fe?Is:V)}}function dtt(n){const a=md(n);return l(y0(n)||a);function l(_){return _.flags&470810623?!0:_.flags&16777216?_.root.isDistributive&&_.checkType===a:_.flags&137363456?qi(_.types,l):_.flags&8388608?l(_.objectType)&&l(_.indexType):_.flags&33554432?l(_.baseType)&&l(_.constraint):_.flags&268435456?l(_.type):!1}}function S0(n){if(Ti(n))return Cn;if(A_(n))return t_(Ui(n));if(xa(n))return t_(Lg(n));const a=gb(n);return a!==void 0?p_(bi(a)):ct(n)?t_(Ui(n)):Cn}function gD(n,a,l){if(l||!(Mf(n)&6)){let _=yi(JQ(n)).nameType;if(!_){const m=as(n.valueDeclaration);_=n.escapedName==="default"?p_("default"):m&&S0(m)||(p8(n)?void 0:p_(pc(n)))}if(_&&_.flags&a)return _}return Cn}function p8e(n,a){return!!(n.flags&a||n.flags&2097152&&ut(n.types,l=>p8e(l,a)))}function mtt(n,a,l){const _=l&&(Pn(n)&7||n.aliasSymbol)?ftt(n):void 0,m=Yt(Wa(n),x=>gD(x,a)),h=Yt(zu(n),x=>x!==yn&&p8e(x.keyType,a)?x.keyType===Fe&&a&8?Is:x.keyType:Cn);return Mn(Xi(m,h),1,void 0,void 0,_)}function d8e(n,a=0){return!!(n.flags&58982400||k0(n)||Af(n)&&!dtt(n)||n.flags&1048576&&!(a&4)&&Vpe(n)||n.flags&2097152&&Yo(n,465829888)&&ut(n.types,vh))}function $m(n,a=Me){return n=hd(n),d8e(n,a)?f8e(n,a):n.flags&1048576?fa(Yt(n.types,l=>$m(l,a))):n.flags&2097152?Mn(Yt(n.types,l=>$m(l,a))):Pn(n)&32?ptt(n,a):n===Dt?Dt:n.flags&2?Cn:n.flags&131073?Tc:mtt(n,(a&2?128:402653316)|(a&1?0:12584),a===Me)}function m8e(n){if(Te)return n;const a=Net();return a?H6(a,[n,Fe]):Fe}function gtt(n){const a=m8e($m(n));return a.flags&131072?Fe:a}function htt(n){const a=Wn(n);if(!a.resolvedType)switch(n.operator){case 143:a.resolvedType=$m(si(n.type));break;case 158:a.resolvedType=n.type.kind===155?Ede(c8(n.parent)):st;break;case 148:a.resolvedType=si(n.type);break;default:E.assertNever(n.operator)}return a.resolvedType}function ytt(n){const a=Wn(n);return a.resolvedType||(a.resolvedType=PS([n.head.text,...Yt(n.templateSpans,l=>l.literal.text)],Yt(n.templateSpans,l=>si(l.type)))),a.resolvedType}function PS(n,a){const l=Dc(a,V=>!!(V.flags&1179648));if(l>=0)return iR(a)?Io(a[l],V=>PS(n,vj(a,l,V))):st;if(_s(a,Dt))return Dt;const _=[],m=[];let h=n[0];if(!F(n,a))return Fe;if(_.length===0)return p_(h);if(m.push(h),qi(m,V=>V==="")){if(qi(_,V=>!!(V.flags&4)))return Fe;if(_.length===1&&qx(_[0]))return _[0]}const x=`${Pp(_)}|${Yt(m,V=>V.length).join(",")}|${m.join("")}`;let N=ji.get(x);return N||ji.set(x,N=btt(m,_)),N;function F(V,ne){for(let le=0;leVx(n,l)):a.flags&128?p_(g8e(n,a.value)):a.flags&134217728?PS(...Stt(n,a.texts,a.types)):a.flags&268435456&&n===a.symbol?a:a.flags&268435461||nv(a)?h8e(n,a):sR(a)?h8e(n,PS(["",""],[a])):a}function g8e(n,a){switch(IO.get(n.escapedName)){case 0:return a.toUpperCase();case 1:return a.toLowerCase();case 2:return a.charAt(0).toUpperCase()+a.slice(1);case 3:return a.charAt(0).toLowerCase()+a.slice(1)}return a}function Stt(n,a,l){switch(IO.get(n.escapedName)){case 0:return[a.map(_=>_.toUpperCase()),l.map(_=>Vx(n,_))];case 1:return[a.map(_=>_.toLowerCase()),l.map(_=>Vx(n,_))];case 2:return[a[0]===""?a:[a[0].charAt(0).toUpperCase()+a[0].slice(1),...a.slice(1)],a[0]===""?[Vx(n,l[0]),...l.slice(1)]:l];case 3:return[a[0]===""?a:[a[0].charAt(0).toLowerCase()+a[0].slice(1),...a.slice(1)],a[0]===""?[Vx(n,l[0]),...l.slice(1)]:l]}return[a,l]}function h8e(n,a){const l=`${Xs(n)},${Wu(a)}`;let _=Di.get(l);return _||Di.set(l,_=Ttt(n,a)),_}function Ttt(n,a){const l=d0(268435456,n);return l.type=a,l}function xtt(n,a,l,_,m){const h=Cp(8388608);return h.objectType=n,h.indexType=a,h.accessFlags=l,h.aliasSymbol=_,h.aliasTypeArguments=m,h}function BN(n){if(se)return!1;if(Pn(n)&4096)return!0;if(n.flags&1048576)return qi(n.types,BN);if(n.flags&2097152)return ut(n.types,BN);if(n.flags&465829888){const a=Jpe(n);return a!==n&&BN(a)}return!1}function ZQ(n,a){return pp(n)?dp(n):a&&wc(a)?gb(a):void 0}function vde(n,a){if(a.flags&8208){const l=Ar(n.parent,_=>!co(_))||n.parent;return Sv(l)?gm(l)&&Ie(n)&&Ewe(l,n):qi(a.declarations,_=>!ks(_)||M1(_))}return!0}function y8e(n,a,l,_,m,h){const x=m&&m.kind===212?m:void 0,N=m&&Ti(m)?void 0:ZQ(l,m);if(N!==void 0){if(h&256)return z2(a,N)||G;const V=Gs(a,N);if(V){if(h&64&&m&&V.declarations&&l0(V)&&vde(m,V)){const le=x?.argumentExpression??(OT(m)?m.indexType:m);xg(le,V.declarations,N)}if(x){if(OR(V,x,FAe(x.expression,a.symbol)),bNe(x,V,uT(x))){je(x.argumentExpression,d.Cannot_assign_to_0_because_it_is_a_read_only_property,ii(V));return}if(h&8&&(Wn(m).resolvedSymbol=V),EAe(x,V))return ht}const ne=h&4?TS(V):Br(V);return x&&uT(x)!==1?Ry(x,ne):m&&OT(m)&&GN(ne)?Mn([ne,j]):ne}if(Nf(a,pa)&&_g(N)){const ne=+N;if(m&&Nf(a,le=>!le.target.hasRestElement)&&!(h&16)){const le=bde(m);if(pa(a)){if(ne<0)return je(le,d.A_tuple_type_cannot_be_indexed_with_a_negative_value),j;je(le,d.Tuple_type_0_of_length_1_has_no_element_at_index_2,mr(a),b0(a),bi(N))}else je(le,d.Property_0_does_not_exist_on_type_1,bi(N),mr(a))}if(ne>=0)return F(Og(a,vt)),awe(a,ne,h&1?ee:void 0)}}if(!(l.flags&98304)&&Ml(l,402665900)){if(a.flags&131073)return a;const V=FN(a,l)||Og(a,Fe);if(V){if(h&2&&V.keyType!==vt){x&&(h&4?je(x,d.Type_0_is_generic_and_can_only_be_indexed_for_reading,mr(n)):je(x,d.Type_0_cannot_be_used_to_index_type_1,mr(l),mr(n)));return}if(m&&V.keyType===Fe&&!Ml(l,12)){const ne=bde(m);return je(ne,d.Type_0_cannot_be_used_as_an_index_type,mr(l)),h&1?Mn([V.type,ee]):V.type}return F(V),h&1&&!(a.symbol&&a.symbol.flags&384&&l.symbol&&l.flags&1024&&f_(l.symbol)===a.symbol)?Mn([V.type,ee]):V.type}if(l.flags&131072)return Cn;if(BN(a))return G;if(x&&!aZ(a)){if(uv(a)){if(se&&l.flags&384)return wa.add(mn(x,d.Property_0_does_not_exist_on_type_1,l.value,mr(a))),j;if(l.flags&12){const ne=Yt(a.properties,le=>Br(le));return Mn(lr(ne,j))}}if(a.symbol===Xe&&N!==void 0&&Xe.exports.has(N)&&Xe.exports.get(N).flags&418)je(x,d.Property_0_does_not_exist_on_type_1,bi(N),mr(a));else if(se&&!J.suppressImplicitAnyIndexErrors&&!(h&128))if(N!==void 0&&AAe(N,a)){const ne=mr(a);je(x,d.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,N,ne,ne+"["+Wc(x.argumentExpression)+"]")}else if(ev(a,vt))je(x.argumentExpression,d.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);else{let ne;if(N!==void 0&&(ne=qme(N,a)))ne!==void 0&&je(x.argumentExpression,d.Property_0_does_not_exist_on_type_1_Did_you_mean_2,N,mr(a),ne);else{const le=vst(a,x,l);if(le!==void 0)je(x,d.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,mr(a),le);else{let xe;if(l.flags&1024)xe=ps(void 0,d.Property_0_does_not_exist_on_type_1,"["+mr(l)+"]",mr(a));else if(l.flags&8192){const Ne=xp(l.symbol,x);xe=ps(void 0,d.Property_0_does_not_exist_on_type_1,"["+Ne+"]",mr(a))}else l.flags&128||l.flags&256?xe=ps(void 0,d.Property_0_does_not_exist_on_type_1,l.value,mr(a)):l.flags&12&&(xe=ps(void 0,d.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,mr(l),mr(a)));xe=ps(xe,d.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,mr(_),mr(a)),wa.add(Hg(Or(x),x,xe))}}}return}}if(BN(a))return G;if(m){const V=bde(m);l.flags&384?je(V,d.Property_0_does_not_exist_on_type_1,""+l.value,mr(a)):l.flags&12?je(V,d.Type_0_has_no_matching_index_signature_for_type_1,mr(a),mr(l)):je(V,d.Type_0_cannot_be_used_as_an_index_type,mr(l))}if(Ae(l))return l;return;function F(V){V&&V.isReadonly&&x&&(og(x)||nz(x))&&je(x,d.Index_signature_in_type_0_only_permits_reading,mr(a))}}function bde(n){return n.kind===212?n.argumentExpression:n.kind===199?n.indexType:n.kind===167?n.expression:n}function sR(n){if(n.flags&2097152){let a=!1;for(const l of n.types)if(l.flags&101248||sR(l))a=!0;else if(!(l.flags&524288))return!1;return a}return!!(n.flags&77)||qx(n)}function qx(n){return!!(n.flags&134217728)&&qi(n.types,sR)||!!(n.flags&268435456)&&sR(n.type)}function hD(n){return!!JN(n)}function O2(n){return!!(JN(n)&4194304)}function nv(n){return!!(JN(n)&8388608)}function JN(n){return n.flags&3145728?(n.objectFlags&2097152||(n.objectFlags|=2097152|Eu(n.types,(a,l)=>a|JN(l),0)),n.objectFlags&12582912):n.flags&33554432?(n.objectFlags&2097152||(n.objectFlags|=2097152|JN(n.baseType)|JN(n.constraint)),n.objectFlags&12582912):(n.flags&58982400||Af(n)||k0(n)?4194304:0)|(n.flags&465829888&&!qx(n)?8388608:0)}function gh(n,a){return n.flags&8388608?Ctt(n,a):n.flags&16777216?Ett(n,a):n}function v8e(n,a,l){if(n.flags&1048576||n.flags&2097152&&!d8e(n)){const _=Yt(n.types,m=>gh(J_(m,a),l));return n.flags&2097152||l?fa(_):Mn(_)}}function ktt(n,a,l){if(a.flags&1048576){const _=Yt(a.types,m=>gh(J_(n,m),l));return l?fa(_):Mn(_)}}function Ctt(n,a){const l=a?"simplifiedForWriting":"simplifiedForReading";if(n[l])return n[l]===$c?n:n[l];n[l]=$c;const _=gh(n.objectType,a),m=gh(n.indexType,a),h=ktt(_,m,a);if(h)return n[l]=h;if(!(m.flags&465829888)){const x=v8e(_,m,a);if(x)return n[l]=x}if(k0(_)&&m.flags&296){const x=TD(_,m.flags&8?0:_.target.fixedLength,0,a);if(x)return n[l]=x}return Af(_)&&(!y0(_)||gPe(_))?n[l]=Io(KQ(_,n.indexType),x=>gh(x,a)):n[l]=n}function Ett(n,a){const l=n.checkType,_=n.extendsType,m=iv(n),h=sv(n);if(h.flags&131072&&Ny(m)===Ny(l)){if(l.flags&1||ca(wS(l),wS(_)))return gh(m,a);if(b8e(l,_))return Cn}else if(m.flags&131072&&Ny(h)===Ny(l)){if(!(l.flags&1)&&ca(wS(l),wS(_)))return Cn;if(l.flags&1||b8e(l,_))return gh(h,a)}return n}function b8e(n,a){return!!(Mn([YM(n,a),Cn]).flags&131072)}function KQ(n,a){const l=k_([md(n)],[a]),_=av(n.mapper,l);return Ri(dh(n.target||n),_)}function J_(n,a,l=0,_,m,h){return Ay(n,a,l,_,m,h)||(_?st:or)}function S8e(n,a){return Nf(n,l=>{if(l.flags&384){const _=dp(l);if(_g(_)){const m=+_;return m>=0&&m0&&!ut(n.elements,a=>LW(a)||MW(a)||RE(a)&&!!(a.questionToken||a.dotDotDotToken))}function k8e(n,a){return hD(n)||a&&pa(n)&&ut(rv(n),hD)}function Tde(n,a,l,_){let m,h,x=0;for(;;){if(x===1e3)return je(D,d.Type_instantiation_is_excessively_deep_and_possibly_infinite),st;const F=Ri(Ny(n.checkType),a),V=Ri(n.extendsType,a);if(F===st||V===st)return st;if(F===Dt||V===Dt)return Dt;const ne=x8e(n.node.checkType)&&x8e(n.node.extendsType)&&Ir(n.node.checkType.elements)===Ir(n.node.extendsType.elements),le=k8e(F,ne);let xe;if(n.inferTypeParameters){const nt=Yc(n.inferTypeParameters,Dtt),kt=nt!==n.inferTypeParameters?k_(n.inferTypeParameters,nt):void 0,Xt=XN(nt,void 0,0);if(kt){const Yr=av(a,kt);for(let gr=0;grIy(kt,le)),Ne=k_(ne.outerTypeParameters,xe),nt=ne.isDistributive?Iy(ne.checkType,Ne):void 0;if(!nt||nt===ne.checkType||!(nt.flags&1179648))return n=ne,a=Ne,l=void 0,_=void 0,ne.aliasSymbol&&x++,!0}}return!1}}function iv(n){return n.resolvedTrueType||(n.resolvedTrueType=Ri(si(n.root.node.trueType),n.mapper))}function sv(n){return n.resolvedFalseType||(n.resolvedFalseType=Ri(si(n.root.node.falseType),n.mapper))}function Ptt(n){return n.resolvedInferredTrueType||(n.resolvedInferredTrueType=n.combinedMapper?Ri(si(n.root.node.trueType),n.combinedMapper):iv(n))}function C8e(n){let a;return n.locals&&n.locals.forEach(l=>{l.flags&262144&&(a=lr(a,bo(l)))}),a}function wtt(n){return n.isDistributive&&(lR(n.checkType,n.node.trueType)||lR(n.checkType,n.node.falseType))}function Att(n){const a=Wn(n);if(!a.resolvedType){const l=si(n.checkType),_=Hx(n),m=$6(_),h=uD(n,!0),x=m?h:wn(h,F=>lR(F,n)),N={node:n,checkType:l,extendsType:si(n.extendsType),isDistributive:!!(l.flags&262144),inferTypeParameters:C8e(n),outerTypeParameters:x,instantiations:void 0,aliasSymbol:_,aliasTypeArguments:m};a.resolvedType=Tde(N,void 0),x&&(N.instantiations=new Map,N.instantiations.set(Pp(x),a.resolvedType))}return a.resolvedType}function Ntt(n){const a=Wn(n);return a.resolvedType||(a.resolvedType=kS(cn(n.typeParameter))),a.resolvedType}function E8e(n){return Ie(n)?[n]:lr(E8e(n.left),n.right)}function Itt(n){var a;const l=Wn(n);if(!l.resolvedType){if(!U0(n))return je(n.argument,d.String_literal_expected),l.resolvedSymbol=dt,l.resolvedType=st;const _=n.isTypeOf?111551:n.flags&16777216?900095:788968,m=Zu(n,n.argument.literal);if(!m)return l.resolvedSymbol=dt,l.resolvedType=st;const h=!!((a=m.exports)!=null&&a.get("export=")),x=ef(m,!1);if(sc(n.qualifier))if(x.flags&_)l.resolvedType=D8e(n,l,x,_);else{const N=_===111551?d.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:d.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0;je(n,N,n.argument.literal.text),l.resolvedSymbol=dt,l.resolvedType=st}else{const N=E8e(n.qualifier);let F=x,V;for(;V=N.shift();){const ne=N.length?1920:_,le=Na(Cc(F)),xe=n.isTypeOf||Hr(n)&&h?Gs(Br(le),V.escapedText,!1,!0):void 0,nt=(n.isTypeOf?void 0:S_(j_(le),V.escapedText,ne))??xe;if(!nt)return je(V,d.Namespace_0_has_no_exported_member_1,xp(F),eo(V)),l.resolvedType=st;Wn(V).resolvedSymbol=nt,Wn(V.parent).resolvedSymbol=nt,F=nt}l.resolvedType=D8e(n,l,F,_)}}return l.resolvedType}function D8e(n,a,l,_){const m=Cc(l);return a.resolvedSymbol=m,_===111551?sNe(Br(l),n):$Q(n,m)}function P8e(n){const a=Wn(n);if(!a.resolvedType){const l=Hx(n);if(Cy(n.symbol).size===0&&!l)a.resolvedType=Fc;else{let _=Hf(16,n.symbol);_.aliasSymbol=l,_.aliasTypeArguments=$6(l),JT(n)&&n.isArrayType&&(_=uu(_)),a.resolvedType=_}}return a.resolvedType}function Hx(n){let a=n.parent;for(;IT(a)||Fb(a)||FT(a)&&a.operator===148;)a=a.parent;return i8(a)?cn(a):void 0}function $6(n){return n?cr(n):void 0}function eY(n){return!!(n.flags&524288)&&!Af(n)}function xde(n){return yh(n)||!!(n.flags&474058748)}function kde(n,a){if(!(n.flags&1048576))return n;if(qi(n.types,xde))return kn(n.types,yh)||Us;const l=kn(n.types,h=>!xde(h));if(!l||kn(n.types,h=>h!==l&&!xde(h)))return n;return m(l);function m(h){const x=zs();for(const F of Wa(h))if(!(Mf(F)&6)){if(tY(F)){const V=F.flags&65536&&!(F.flags&32768),le=Aa(16777220,F.escapedName,Lpe(F)|(a?8:0));le.links.type=V?j:El(Br(F),!0),le.declarations=F.declarations,le.links.nameType=yi(F).nameType,le.links.syntheticOrigin=F,x.set(F.escapedName,le)}}const N=Qo(h.symbol,x,ze,ze,zu(h));return N.objectFlags|=131200,N}}function L2(n,a,l,_,m){if(n.flags&1||a.flags&1)return G;if(n.flags&2||a.flags&2)return or;if(n.flags&131072)return a;if(a.flags&131072)return n;if(n=kde(n,m),n.flags&1048576)return iR([n,a])?Io(n,V=>L2(V,a,l,_,m)):st;if(a=kde(a,m),a.flags&1048576)return iR([n,a])?Io(a,V=>L2(n,V,l,_,m)):st;if(a.flags&473960444)return n;if(O2(n)||O2(a)){if(yh(n))return a;if(n.flags&2097152){const V=n.types,ne=V[V.length-1];if(eY(ne)&&eY(a))return fa(Xi(V.slice(0,V.length-1),[L2(ne,a,l,_,m)]))}return fa([n,a])}const h=zs(),x=new Set,N=n===Us?zu(a):uPe([n,a]);for(const V of Wa(a))Mf(V)&6?x.add(V.escapedName):tY(V)&&h.set(V.escapedName,Cde(V,m));for(const V of Wa(n))if(!(x.has(V.escapedName)||!tY(V)))if(h.has(V.escapedName)){const ne=h.get(V.escapedName),le=Br(ne);if(ne.flags&16777216){const xe=Xi(V.declarations,ne.declarations),Ne=4|V.flags&16777216,nt=Aa(Ne,V.escapedName),kt=Br(V),Xt=CY(kt),_r=CY(le);nt.links.type=Xt===_r?kt:Mn([kt,_r],2),nt.links.leftSpread=V,nt.links.rightSpread=ne,nt.declarations=xe,nt.links.nameType=yi(V).nameType,h.set(V.escapedName,nt)}}else h.set(V.escapedName,Cde(V,m));const F=Qo(l,h,ze,ze,Yc(N,V=>Ftt(V,m)));return F.objectFlags|=2228352|_,F}function tY(n){var a;return!ut(n.declarations,Nu)&&(!(n.flags&106496)||!((a=n.declarations)!=null&&a.some(l=>Qn(l.parent))))}function Cde(n,a){const l=n.flags&65536&&!(n.flags&32768);if(!l&&a===Td(n))return n;const _=4|n.flags&16777216,m=Aa(_,n.escapedName,Lpe(n)|(a?8:0));return m.links.type=l?j:Br(n),m.declarations=n.declarations,m.links.nameType=yi(n).nameType,m.links.syntheticOrigin=n,m}function Ftt(n,a){return n.isReadonly!==a?Gm(n.keyType,n.type,a,n.declaration):n}function aR(n,a,l,_){const m=d0(n,l);return m.value=a,m.regularType=_||m,m}function Gx(n){if(n.flags&2976){if(!n.freshType){const a=aR(n.flags,n.value,n.symbol,n);a.freshType=a,n.freshType=a}return n.freshType}return n}function t_(n){return n.flags&2976?n.regularType:n.flags&1048576?n.regularType||(n.regularType=Io(n,t_)):n}function M2(n){return!!(n.flags&2976)&&n.freshType===n}function p_(n){let a;return Ft.get(n)||(Ft.set(n,a=aR(128,n)),a)}function vd(n){let a;return yr.get(n)||(yr.set(n,a=aR(256,n)),a)}function rY(n){let a;const l=Bv(n);return Tr.get(l)||(Tr.set(l,a=aR(2048,n)),a)}function Ott(n,a,l){let _;const m=`${a}${typeof n=="string"?"@":"#"}${n}`,h=1024|(typeof n=="string"?128:256);return Xr.get(m)||(Xr.set(m,_=aR(h,n,l)),_)}function Ltt(n){if(n.literal.kind===106)return De;const a=Wn(n);return a.resolvedType||(a.resolvedType=t_(Ui(n.literal))),a.resolvedType}function Mtt(n){const a=d0(8192,n);return a.escapedName=`__@${a.symbol.escapedName}@${Xs(a.symbol)}`,a}function Ede(n){if(qee(n)){const a=BI(n)?tf(n.left):tf(n);if(a){const l=yi(a);return l.uniqueESSymbolType||(l.uniqueESSymbolType=Mtt(a))}}return Ln}function Rtt(n){const a=i_(n,!1,!1),l=a&&a.parent;if(l&&(Qn(l)||l.kind===264)&&!Ls(a)&&(!gc(a)||Av(n,a.body)))return Qf(cn(l)).thisType;if(l&&ma(l)&&Gr(l.parent)&&ac(l.parent)===6)return Qf(tf(l.parent.left).parent).thisType;const _=n.flags&16777216?t1(n):void 0;return _&&ro(_)&&Gr(_.parent)&&ac(_.parent)===3?Qf(tf(_.parent.left).parent).thisType:nm(a)&&Av(n,a.body)?Qf(cn(a)).thisType:(je(n,d.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface),st)}function nY(n){const a=Wn(n);return a.resolvedType||(a.resolvedType=Rtt(n)),a.resolvedType}function w8e(n){return si(oR(n.type)||n.type)}function oR(n){switch(n.kind){case 196:return oR(n.type);case 189:if(n.elements.length===1&&(n=n.elements[0],n.kind===191||n.kind===202&&n.dotDotDotToken))return oR(n.type);break;case 188:return n.elementType}}function jtt(n){const a=Wn(n);return a.resolvedType||(a.resolvedType=n.dotDotDotToken?w8e(n):El(si(n.type),!0,!!n.questionToken))}function si(n){return met(A8e(n),n)}function A8e(n){switch(n.kind){case 133:case 319:case 320:return G;case 159:return or;case 154:return Fe;case 150:return vt;case 163:return Lt;case 136:return On;case 155:return Ln;case 116:return Ni;case 157:return j;case 106:return De;case 146:return Cn;case 151:return n.flags&524288&&!se?G:ia;case 141:return er;case 197:case 110:return nY(n);case 201:return Ltt(n);case 183:return ide(n);case 182:return n.assertsModifier?Ni:On;case 233:return ide(n);case 186:return zPe(n);case 188:case 189:return Het(n);case 190:return Qet(n);case 192:return ntt(n);case 193:return _tt(n);case 321:return get(n);case 323:return El(si(n.type));case 202:return jtt(n);case 196:case 322:case 316:return si(n.type);case 191:return w8e(n);case 325:return Llt(n);case 184:case 185:case 187:case 329:case 324:case 330:return P8e(n);case 198:return htt(n);case 199:return T8e(n);case 200:return Sde(n);case 194:return Att(n);case 195:return Ntt(n);case 203:return ytt(n);case 205:return Itt(n);case 80:case 166:case 211:const a=Yp(n);return a?bo(a):st;default:return st}}function iY(n,a,l){if(n&&n.length)for(let _=0;__.typeParameter),Yt(l,()=>or))}function av(n,a){return n?aY(4,n,a):a}function ztt(n,a){return n?aY(5,n,a):a}function $x(n,a,l){return l?aY(5,R2(n,a),l):R2(n,a)}function zN(n,a,l){return n?aY(5,n,R2(a,l)):R2(a,l)}function Wtt(n){return!n.constraint&&!ede(n)||n.constraint===No?n:n.restrictiveInstantiation||(n.restrictiveInstantiation=lu(n.symbol),n.restrictiveInstantiation.constraint=No,n.restrictiveInstantiation)}function oY(n){const a=lu(n.symbol);return a.target=n,a}function Utt(n,a){return tR(n.kind,n.parameterName,n.parameterIndex,Ri(n.type,a))}function X6(n,a,l){let _;if(n.typeParameters&&!l){_=Yt(n.typeParameters,oY),a=av(k_(n.typeParameters,_),a);for(const h of _)h.mapper=a}const m=Fg(n.declaration,_,n.thisParameter&&Pde(n.thisParameter,a),iY(n.parameters,a,Pde),void 0,void 0,n.minArgumentCount,n.flags&167);return m.target=n,m.mapper=a,m}function Pde(n,a){const l=yi(n);if(l.type&&!lv(l.type)&&(!(n.flags&65536)||l.writeType&&!lv(l.writeType)))return n;Ko(n)&1&&(n=l.target,a=av(l.mapper,a));const _=Aa(n.flags,n.escapedName,1|Ko(n)&53256);return _.declarations=n.declarations,_.parent=n.parent,_.links.target=n,_.links.mapper=a,n.valueDeclaration&&(_.valueDeclaration=n.valueDeclaration),l.nameType&&(_.links.nameType=l.nameType),_}function Vtt(n,a,l,_){const m=n.objectFlags&4||n.objectFlags&8388608?n.node:n.symbol.declarations[0],h=Wn(m),x=n.objectFlags&4?h.resolvedType:n.objectFlags&64?n.target:n;let N=h.outerTypeParameters;if(!N){let F=uD(m,!0);if(nm(m)){const ne=EPe(m);F=Dn(F,ne)}N=F||ze;const V=n.objectFlags&8388612?[m]:n.symbol.declarations;N=(x.objectFlags&8388612||x.symbol.flags&8192||x.symbol.flags&2048)&&!x.aliasTypeArguments?wn(N,ne=>ut(V,le=>lR(ne,le))):N,h.outerTypeParameters=N}if(N.length){const F=av(n.mapper,a),V=Yt(N,nt=>Iy(nt,F)),ne=l||n.aliasSymbol,le=l?_:T0(n.aliasTypeArguments,a),xe=Pp(V)+Ux(ne,le);x.instantiations||(x.instantiations=new Map,x.instantiations.set(Pp(N)+Ux(x.aliasSymbol,x.aliasTypeArguments),x));let Ne=x.instantiations.get(xe);if(!Ne){const nt=k_(N,V);Ne=x.objectFlags&4?tde(n.target,n.node,nt,ne,le):x.objectFlags&32?F8e(x,nt,ne,le):Ade(x,nt,ne,le),x.instantiations.set(xe,Ne);const kt=Pn(Ne);if(Ne.flags&3899393&&!(kt&524288)){const Xt=ut(V,lv);Pn(Ne)&524288||(kt&52?Ne.objectFlags|=524288|(Xt?1048576:0):Ne.objectFlags|=Xt?0:524288)}}return Ne}return n}function qtt(n){return!(n.parent.kind===183&&n.parent.typeArguments&&n===n.parent.typeName||n.parent.kind===205&&n.parent.typeArguments&&n===n.parent.qualifier)}function lR(n,a){if(n.symbol&&n.symbol.declarations&&n.symbol.declarations.length===1){const _=n.symbol.declarations[0].parent;for(let m=a;m!==_;m=m.parent)if(!m||m.kind===241||m.kind===194&&ds(m.extendsType,l))return!0;return l(a)}return!0;function l(_){switch(_.kind){case 197:return!!n.isThisType;case 80:return!n.isThisType&&ig(_)&&qtt(_)&&A8e(_)===n;case 186:const m=_.exprName,h=$_(m);if(!Lv(h)){const x=Qp(h),N=n.symbol.declarations[0],F=N.kind===168?N.parent:n.isThisType?N:void 0;if(x.declarations&&F)return ut(x.declarations,V=>Av(V,F))||ut(_.typeArguments,l)}return!0;case 174:case 173:return!_.type&&!!_.body||ut(_.typeParameters,l)||ut(_.parameters,l)||!!_.type&&l(_.type)}return!!ds(_,l)}}function cY(n){const a=Ep(n);if(a.flags&4194304){const l=Ny(a.type);if(l.flags&262144)return l}}function F8e(n,a,l,_){const m=cY(n);if(m){const h=Ri(m,a);if(m!==h)return Mwe(hd(h),x=>{if(x.flags&61603843&&x!==Dt&&!et(x)){if(!n.declaration.nameType){let N;if(ep(x)||x.flags&1&&Q1(m,4)<0&&(N=ku(m))&&Nf(N,j2))return Gtt(x,n,$x(m,x,a));if(k0(x))return Htt(x,n,m,a);if(pa(x))return $tt(x,n,$x(m,x,a))}return Ade(n,$x(m,x,a))}return x},l,_)}return Ri(Ep(n),a)===Dt?Dt:Ade(n,a,l,_)}function wde(n,a){return a&1?!0:a&2?!1:n}function Htt(n,a,l,_){const m=n.target.elementFlags,h=Yt(rv(n),(N,F)=>{const V=m[F]&8?N:m[F]&4?uu(N):yd([N],[m[F]]);return V===l?a:F8e(a,$x(l,V,_))}),x=wde(n.target.readonly,qm(a));return yd(h,Yt(h,N=>8),x)}function Gtt(n,a,l){const _=O8e(a,vt,!0,l);return et(_)?st:uu(_,wde(bD(n),qm(a)))}function $tt(n,a,l){const _=n.target.elementFlags,m=Yt(rv(n),(F,V)=>O8e(a,p_(""+V),!!(_[V]&2),l)),h=qm(a),x=h&4?Yt(_,F=>F&1?2:F):h&8?Yt(_,F=>F&2?1:F):_,N=wde(n.target.readonly,h);return _s(m,st)?st:yd(m,x,N,n.target.labeledElementDeclarations)}function O8e(n,a,l,_){const m=zN(_,md(n),a),h=Ri(dh(n.target||n),m),x=qm(n);return H&&x&4&&!Yo(h,49152)?Ly(h,!0):H&&x&8&&l?Ap(h,524288):h}function Ade(n,a,l,_){const m=Hf(n.objectFlags&-1572865|64,n.symbol);if(n.objectFlags&32){m.declaration=n.declaration;const h=md(n),x=oY(h);m.typeParameter=x,a=av(R2(h,x),a),x.mapper=a}return n.objectFlags&8388608&&(m.node=n.node),m.target=n,m.mapper=a,m.aliasSymbol=l||n.aliasSymbol,m.aliasTypeArguments=l?_:T0(n.aliasTypeArguments,a),m.objectFlags|=m.aliasTypeArguments?HQ(m.aliasTypeArguments):0,m}function Nde(n,a,l,_){const m=n.root;if(m.outerTypeParameters){const h=Yt(m.outerTypeParameters,F=>Iy(F,a)),x=Pp(h)+Ux(l,_);let N=m.instantiations.get(x);if(!N){const F=k_(m.outerTypeParameters,h),V=m.checkType,ne=m.isDistributive?Iy(V,F):void 0;N=ne&&V!==ne&&ne.flags&1179648?Mwe(hd(ne),le=>Tde(m,$x(V,le,F)),l,_):Tde(m,F,l,_),m.instantiations.set(x,N)}return N}return n}function Ri(n,a){return n&&a?L8e(n,a,void 0,void 0):n}function L8e(n,a,l,_){var m;if(!lv(n))return n;if(C===100||T>=5e6)return(m=Jr)==null||m.instant(Jr.Phase.CheckTypes,"instantiateType_DepthLimit",{typeId:n.id,instantiationDepth:C,instantiationCount:T}),je(D,d.Type_instantiation_is_excessively_deep_and_possibly_infinite),st;S++,T++,C++;const h=Xtt(n,a,l,_);return C--,h}function Xtt(n,a,l,_){const m=n.flags;if(m&262144)return Iy(n,a);if(m&524288){const h=n.objectFlags;if(h&52){if(h&4&&!n.node){const x=n.resolvedTypeArguments,N=T0(x,a);return N!==x?_de(n.target,N):n}return h&1024?Qtt(n,a):Vtt(n,a,l,_)}return n}if(m&3145728){const h=n.flags&1048576?n.origin:void 0,x=h&&h.flags&3145728?h.types:n.types,N=T0(x,a);if(N===x&&l===n.aliasSymbol)return n;const F=l||n.aliasSymbol,V=l?_:T0(n.aliasTypeArguments,a);return m&2097152||h&&h.flags&2097152?fa(N,F,V):Mn(N,1,F,V)}if(m&4194304)return $m(Ri(n.type,a));if(m&134217728)return PS(n.texts,T0(n.types,a));if(m&268435456)return Vx(n.symbol,Ri(n.type,a));if(m&8388608){const h=l||n.aliasSymbol,x=l?_:T0(n.aliasTypeArguments,a);return J_(Ri(n.objectType,a),Ri(n.indexType,a),n.accessFlags,void 0,h,x)}if(m&16777216)return Nde(n,av(n.mapper,a),l,_);if(m&33554432){const h=Ri(n.baseType,a),x=Ri(n.constraint,a);return h.flags&8650752&&hD(x)?rde(h,x):x.flags&3||ca(wS(h),wS(x))?h:h.flags&8650752?rde(h,x):fa([x,h])}return n}function Qtt(n,a){const l=Ri(n.mappedType,a);if(!(Pn(l)&32))return n;const _=Ri(n.constraintType,a);if(!(_.flags&4194304))return n;const m=dwe(Ri(n.source,a),l,_);return m||n}function lY(n){return n.flags&402915327?n:n.permissiveInstantiation||(n.permissiveInstantiation=Ri(n,cl))}function wS(n){return n.flags&402915327?n:(n.restrictiveInstantiation||(n.restrictiveInstantiation=Ri(n,Vo),n.restrictiveInstantiation.restrictiveInstantiation=n.restrictiveInstantiation),n.restrictiveInstantiation)}function Ytt(n,a){return Gm(n.keyType,Ri(n.type,a),n.isReadonly,n.declaration)}function Zf(n){switch(E.assert(n.kind!==174||Mp(n)),n.kind){case 218:case 219:case 174:case 262:return M8e(n);case 210:return ut(n.properties,Zf);case 209:return ut(n.elements,Zf);case 227:return Zf(n.whenTrue)||Zf(n.whenFalse);case 226:return(n.operatorToken.kind===57||n.operatorToken.kind===61)&&(Zf(n.left)||Zf(n.right));case 303:return Zf(n.initializer);case 217:return Zf(n.expression);case 292:return ut(n.properties,Zf)||Md(n.parent)&&ut(n.parent.parent.children,Zf);case 291:{const{initializer:a}=n;return!!a&&Zf(a)}case 294:{const{expression:a}=n;return!!a&&Zf(a)}}return!1}function M8e(n){return V5(n)||Ztt(n)}function Ztt(n){return n.typeParameters||up(n)||!n.body?!1:n.body.kind!==241?Zf(n.body):!!Ev(n.body,a=>!!a.expression&&Zf(a.expression))}function uY(n){return(Jv(n)||Mp(n))&&M8e(n)}function R8e(n){if(n.flags&524288){const a=gd(n);if(a.constructSignatures.length||a.callSignatures.length){const l=Hf(16,n.symbol);return l.members=a.members,l.properties=a.properties,l.callSignatures=ze,l.constructSignatures=ze,l.indexInfos=ze,l}}else if(n.flags&2097152)return fa(Yt(n.types,R8e));return n}function hh(n,a){return Kd(n,a,K_)}function WN(n,a){return Kd(n,a,K_)?-1:0}function Ide(n,a){return Kd(n,a,R_)?-1:0}function Ktt(n,a){return Kd(n,a,Lm)?-1:0}function Fy(n,a){return Kd(n,a,Lm)}function j8e(n,a){return Kd(n,a,Wf)}function ca(n,a){return Kd(n,a,R_)}function ov(n,a){return n.flags&1048576?qi(n.types,l=>ov(l,a)):a.flags&1048576?ut(a.types,l=>ov(n,l)):n.flags&2097152?ut(n.types,l=>ov(l,a)):n.flags&58982400?ov(Ku(n)||or,a):vh(a)?!!(n.flags&67633152):a===ye?!!(n.flags&67633152)&&!vh(n):a===St?!!(n.flags&524288)&&pme(n):Bx(n,J6(a))||ep(a)&&!bD(a)&&ov(n,Fs)}function _Y(n,a){return Kd(n,a,Yu)}function uR(n,a){return _Y(n,a)||_Y(a,n)}function Uu(n,a,l,_,m,h){return Kf(n,a,R_,l,_,m,h)}function Oy(n,a,l,_,m,h){return Fde(n,a,R_,l,_,m,h,void 0)}function Fde(n,a,l,_,m,h,x,N){return Kd(n,a,l)?!0:!_||!UN(m,n,a,l,h,x,N)?Kf(n,a,l,_,h,x,N):!1}function B8e(n){return!!(n.flags&16777216||n.flags&2097152&&ut(n.types,B8e))}function UN(n,a,l,_,m,h,x){if(!n||B8e(l))return!1;if(!Kf(a,l,_,void 0)&&ert(n,a,l,_,m,h,x))return!0;switch(n.kind){case 234:if(!y2(n))break;case 294:case 217:return UN(n.expression,a,l,_,m,h,x);case 226:switch(n.operatorToken.kind){case 64:case 28:return UN(n.right,a,l,_,m,h,x)}break;case 210:return crt(n,a,l,_,h,x);case 209:return art(n,a,l,_,h,x);case 292:return srt(n,a,l,_,h,x);case 219:return trt(n,a,l,_,h,x)}return!1}function ert(n,a,l,_,m,h,x){const N=Ts(a,0),F=Ts(a,1);for(const V of[F,N])if(ut(V,ne=>{const le=Ma(ne);return!(le.flags&131073)&&Kf(le,l,_,void 0)})){const ne=x||{};Uu(a,l,n,m,h,ne);const le=ne.errors[ne.errors.length-1];return ua(le,mn(n,V===F?d.Did_you_mean_to_use_new_with_this_expression:d.Did_you_mean_to_call_this_expression)),!0}return!1}function trt(n,a,l,_,m,h){if(Ss(n.body)||ut(n.parameters,xI))return!1;const x=jS(a);if(!x)return!1;const N=Ts(l,0);if(!Ir(N))return!1;const F=n.body,V=Ma(x),ne=Mn(Yt(N,Ma));if(!Kf(V,ne,_,void 0)){const le=F&&UN(F,V,ne,_,void 0,m,h);if(le)return le;const xe=h||{};if(Kf(V,ne,_,F,void 0,m,xe),xe.errors)return l.symbol&&Ir(l.symbol.declarations)&&ua(xe.errors[xe.errors.length-1],mn(l.symbol.declarations[0],d.The_expected_type_comes_from_the_return_type_of_this_signature)),!(pl(n)&2)&&!q(V,"then")&&Kf(WR(V),ne,_,void 0)&&ua(xe.errors[xe.errors.length-1],mn(n,d.Did_you_mean_to_mark_this_function_as_async)),!0}return!1}function J8e(n,a,l){const _=Ay(a,l);if(_)return _;if(a.flags&1048576){const m=$8e(n,a);if(m)return Ay(m,l)}}function z8e(n,a){DR(n,a,!1);const l=ND(n,1);return KN(),l}function _R(n,a,l,_,m,h){let x=!1;for(const N of n){const{errorNode:F,innerExpression:V,nameType:ne,errorMessage:le}=N;let xe=J8e(a,l,ne);if(!xe||xe.flags&8388608)continue;let Ne=Ay(a,ne);if(!Ne)continue;const nt=ZQ(ne,void 0);if(!Kf(Ne,xe,_,void 0)){const kt=V&&UN(V,Ne,xe,_,void 0,m,h);if(x=!0,!kt){const Xt=h||{},_r=V?z8e(V,Ne):Ne;if(he&&pY(_r,xe)){const Yr=mn(F,d.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,mr(_r),mr(xe));wa.add(Yr),Xt.errors=[Yr]}else{const Yr=!!(nt&&(Gs(l,nt)||dt).flags&16777216),gr=!!(nt&&(Gs(a,nt)||dt).flags&16777216);xe=My(xe,Yr),Ne=My(Ne,Yr&&gr),Kf(_r,xe,_,F,le,m,Xt)&&_r!==Ne&&Kf(Ne,xe,_,F,le,m,Xt)}if(Xt.errors){const Yr=Xt.errors[Xt.errors.length-1],gr=pp(ne)?dp(ne):void 0,Ut=gr!==void 0?Gs(l,gr):void 0;let Nr=!1;if(!Ut){const Sr=FN(l,ne);Sr&&Sr.declaration&&!Or(Sr.declaration).hasNoDefaultLib&&(Nr=!0,ua(Yr,mn(Sr.declaration,d.The_expected_type_comes_from_this_index_signature)))}if(!Nr&&(Ut&&Ir(Ut.declarations)||l.symbol&&Ir(l.symbol.declarations))){const Sr=Ut&&Ir(Ut.declarations)?Ut.declarations[0]:l.symbol.declarations[0];Or(Sr).hasNoDefaultLib||ua(Yr,mn(Sr,d.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,gr&&!(ne.flags&8192)?bi(gr):mr(ne),mr(l)))}}}}}return x}function rrt(n,a,l,_,m,h){const x=jc(l,bY),N=jc(l,ne=>!bY(ne)),F=N!==Cn?Nge(13,0,N,void 0):void 0;let V=!1;for(let ne=n.next();!ne.done;ne=n.next()){const{errorNode:le,innerExpression:xe,nameType:Ne,errorMessage:nt}=ne.value;let kt=F;const Xt=x!==Cn?J8e(a,x,Ne):void 0;if(Xt&&!(Xt.flags&8388608)&&(kt=F?Mn([F,Xt]):Xt),!kt)continue;let _r=Ay(a,Ne);if(!_r)continue;const Yr=ZQ(Ne,void 0);if(!Kf(_r,kt,_,void 0)){const gr=xe&&UN(xe,_r,kt,_,void 0,m,h);if(V=!0,!gr){const Ut=h||{},Nr=xe?z8e(xe,_r):_r;if(he&&pY(Nr,kt)){const Sr=mn(le,d.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,mr(Nr),mr(kt));wa.add(Sr),Ut.errors=[Sr]}else{const Sr=!!(Yr&&(Gs(x,Yr)||dt).flags&16777216),Er=!!(Yr&&(Gs(a,Yr)||dt).flags&16777216);kt=My(kt,Sr),_r=My(_r,Sr&&Er),Kf(Nr,kt,_,le,nt,m,Ut)&&Nr!==_r&&Kf(_r,kt,_,le,nt,m,Ut)}}}}return V}function*nrt(n){if(Ir(n.properties))for(const a of n.properties)BT(a)||Fme(j8(a.name))||(yield{errorNode:a.name,innerExpression:a.initializer,nameType:p_(j8(a.name))})}function*irt(n,a){if(!Ir(n.children))return;let l=0;for(let _=0;_1;let Xt,_r;if(ode(!1)!==rs){const gr=KPe(G);Xt=jc(Ne,Ut=>ca(Ut,gr)),_r=jc(Ne,Ut=>!ca(Ut,gr))}else Xt=jc(Ne,bY),_r=jc(Ne,gr=>!bY(gr));if(kt){if(Xt!==Cn){const gr=yd(qY(V,0)),Ut=irt(V,F);x=rrt(Ut,gr,Xt,_,m,h)||x}else if(!Kd(J_(a,xe),Ne,_)){x=!0;const gr=je(V.openingElement.tagName,d.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided,le,mr(Ne));h&&h.skipLogging&&(h.errors||(h.errors=[])).push(gr)}}else if(_r!==Cn){const gr=nt[0],Ut=W8e(gr,xe,F);Ut&&(x=_R(function*(){yield Ut}(),a,l,_,m,h)||x)}else if(!Kd(J_(a,xe),Ne,_)){x=!0;const gr=je(V.openingElement.tagName,d.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided,le,mr(Ne));h&&h.skipLogging&&(h.errors||(h.errors=[])).push(gr)}}return x;function F(){if(!N){const V=Wc(n.parent.tagName),ne=wR(MS(n)),le=ne===void 0?"children":bi(ne),xe=J_(l,p_(le)),Ne=d._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;N={...Ne,key:"!!ALREADY FORMATTED!!",message:Lz(Ne,V,le,mr(xe))}}return N}}function*U8e(n,a){const l=Ir(n.elements);if(l)for(let _=0;_F:im(n)>F))return _&&!(l&8)&&m(d.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1,im(n),F),0;n.typeParameters&&n.typeParameters!==a.typeParameters&&(a=cet(a),n=BAe(n,a,void 0,x));const ne=sf(n),le=i7(n),xe=i7(a);(le||xe)&&Ri(le||xe,N);const Ne=a.declaration?a.declaration.kind:0,nt=!(l&3)&&K&&Ne!==174&&Ne!==173&&Ne!==176;let kt=-1;const Xt=tv(n);if(Xt&&Xt!==Ni){const gr=tv(a);if(gr){const Ut=!nt&&x(Xt,gr,!1)||x(gr,Xt,_);if(!Ut)return _&&m(d.The_this_types_of_each_signature_are_incompatible),0;kt&=Ut}}const _r=le||xe?Math.min(ne,F):Math.max(ne,F),Yr=le||xe?_r-1:-1;for(let gr=0;gr<_r;gr++){const Ut=gr===Yr?r7(n,gr):BS(n,gr),Nr=gr===Yr?r7(a,gr):BS(a,gr);if(Ut&&Nr){const Sr=l&3?void 0:jS(Sh(Ut)),Er=l&3?void 0:jS(Sh(Nr));let sn=Sr&&Er&&!Yf(Sr)&&!Yf(Er)&&kD(Ut,50331648)===kD(Nr,50331648)?Ode(Er,Sr,l&8|(nt?2:1),_,m,h,x,N):!(l&3)&&!nt&&x(Ut,Nr,!1)||x(Nr,Ut,_);if(sn&&l&8&&gr>=im(n)&&gr=3&&a[0].flags&32768&&a[1].flags&65536&&ut(a,vh)?67108864:0)}return!!(n.objectFlags&67108864)}return!1}function yD(n){return!!((n.flags&1048576?n.types[0]:n).flags&32768)}function q8e(n){return n.flags&524288&&!Af(n)&&Wa(n).length===0&&zu(n).length===1&&!!Og(n,Fe)||n.flags&3145728&&qi(n.types,q8e)||!1}function Mde(n,a,l){const _=n.flags&8?f_(n):n,m=a.flags&8?f_(a):a;if(_===m)return!0;if(_.escapedName!==m.escapedName||!(_.flags&256)||!(m.flags&256))return!1;const h=Xs(_)+","+Xs(m),x=F1.get(h);if(x!==void 0&&!(!(x&4)&&x&2&&l))return!!(x&1);const N=Br(m);for(const F of Wa(Br(_)))if(F.flags&8){const V=Gs(N,F.escapedName);if(!V||!(V.flags&8))return l?(l(d.Property_0_is_missing_in_type_1,pc(F),mr(bo(m),void 0,64)),F1.set(h,6)):F1.set(h,2),!1}return F1.set(h,1),!0}function VN(n,a,l,_){const m=n.flags,h=a.flags;return h&1||m&131072||n===Dt||h&2&&!(l===Wf&&m&1)?!0:h&131072?!1:!!(m&402653316&&h&4||m&128&&m&1024&&h&128&&!(h&1024)&&n.value===a.value||m&296&&h&8||m&256&&m&1024&&h&256&&!(h&1024)&&n.value===a.value||m&2112&&h&64||m&528&&h&16||m&12288&&h&4096||m&32&&h&32&&n.symbol.escapedName===a.symbol.escapedName&&Mde(n.symbol,a.symbol,_)||m&1024&&h&1024&&(m&1048576&&h&1048576&&Mde(n.symbol,a.symbol,_)||m&2944&&h&2944&&n.value===a.value&&Mde(n.symbol,a.symbol,_))||m&32768&&(!H&&!(h&3145728)||h&49152)||m&65536&&(!H&&!(h&3145728)||h&65536)||m&524288&&h&67108864&&!(l===Wf&&vh(n)&&!(Pn(n)&8192))||(l===R_||l===Yu)&&(m&1||m&8&&(h&32||h&256&&h&1024)||m&256&&!(m&1024)&&(h&32||h&256&&h&1024&&n.value===a.value)||frt(a)))}function Kd(n,a,l){if(M2(n)&&(n=n.regularType),M2(a)&&(a=a.regularType),n===a)return!0;if(l!==K_){if(l===Yu&&!(a.flags&131072)&&VN(a,n,l)||VN(n,a,l))return!0}else if(!((n.flags|a.flags)&61865984)){if(n.flags!==a.flags)return!1;if(n.flags&67358815)return!0}if(n.flags&524288&&a.flags&524288){const _=l.get(gY(n,a,0,l,!1));if(_!==void 0)return!!(_&1)}return n.flags&469499904||a.flags&469499904?Kf(n,a,l,void 0):!1}function H8e(n,a){return Pn(n)&2048&&Fme(a.escapedName)}function fR(n,a){for(;;){const l=M2(n)?n.regularType:k0(n)?drt(n,a):Pn(n)&4?n.node?v0(n.target,uo(n)):Vde(n)||n:n.flags&3145728?prt(n,a):n.flags&33554432?a?n.baseType:nde(n):n.flags&25165824?gh(n,a):n;if(l===n)return l;n=l}}function prt(n,a){const l=hd(n);if(l!==n)return l;if(n.flags&2097152&&ut(n.types,vh)){const _=Yc(n.types,m=>fR(m,a));if(_!==n.types)return fa(_)}return n}function drt(n,a){const l=rv(n),_=Yc(l,m=>m.flags&25165824?gh(m,a):m);return l!==_?fde(n.target,_):n}function Kf(n,a,l,_,m,h,x){var N;let F,V,ne,le,xe,Ne,nt=0,kt=0,Xt=0,_r=0,Yr=!1,gr=0,Ut=0,Nr,Sr,Er=16e6-l.size>>3;E.assert(l!==K_||!_,"no error reporting in identity checking");const hr=Wr(n,a,3,!!_,m);if(Sr&&vs(),Yr){const Ge=gY(n,a,0,l,!1);l.set(Ge,6),(N=Jr)==null||N.instant(Jr.Phase.CheckTypes,"checkTypeRelatedTo_DepthLimit",{sourceId:n.id,targetId:a.id,depth:kt,targetDepth:Xt});const _t=Er<=0?d.Excessive_complexity_comparing_types_0_and_1:d.Excessive_stack_depth_comparing_types_0_and_1,zt=je(_||D,_t,mr(n),mr(a));x&&(x.errors||(x.errors=[])).push(zt)}else if(F){if(h){const zt=h();zt&&(ere(zt,F),F=zt)}let Ge;if(m&&_&&!hr&&n.symbol){const zt=yi(n.symbol);if(zt.originatingImport&&!G_(zt.originatingImport)&&Kf(Br(zt.target),a,l,void 0)){const ln=mn(zt.originatingImport,d.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);Ge=lr(Ge,ln)}}const _t=Hg(Or(_),_,F,Ge);V&&ua(_t,...V),x&&(x.errors||(x.errors=[])).push(_t),(!x||!x.skipLogging)&&wa.add(_t)}return _&&x&&x.skipLogging&&hr===0&&E.assert(!!x.errors,"missed opportunity to interact with error."),hr!==0;function sn(Ge){F=Ge.errorInfo,Nr=Ge.lastSkippedInfo,Sr=Ge.incompatibleStack,gr=Ge.overrideNextErrorInfo,Ut=Ge.skipParentCounter,V=Ge.relatedInfo}function ms(){return{errorInfo:F,lastSkippedInfo:Nr,incompatibleStack:Sr?.slice(),overrideNextErrorInfo:gr,skipParentCounter:Ut,relatedInfo:V?.slice()}}function xs(Ge,..._t){gr++,Nr=void 0,(Sr||(Sr=[])).push([Ge,..._t])}function vs(){const Ge=Sr||[];Sr=void 0;const _t=Nr;if(Nr=void 0,Ge.length===1){Vi(...Ge[0]),_t&&fr(void 0,..._t);return}let zt="";const Pr=[];for(;Ge.length;){const[ln,...ir]=Ge.pop();switch(ln.code){case d.Types_of_property_0_are_incompatible.code:{zt.indexOf("new ")===0&&(zt=`(${zt})`);const nn=""+ir[0];zt.length===0?zt=`${nn}`:lf(nn,Da(J))?zt=`${zt}.${nn}`:nn[0]==="["&&nn[nn.length-1]==="]"?zt=`${zt}${nn}`:zt=`${zt}[${nn}]`;break}case d.Call_signature_return_types_0_and_1_are_incompatible.code:case d.Construct_signature_return_types_0_and_1_are_incompatible.code:case d.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:case d.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:{if(zt.length===0){let nn=ln;ln.code===d.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?nn=d.Call_signature_return_types_0_and_1_are_incompatible:ln.code===d.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code&&(nn=d.Construct_signature_return_types_0_and_1_are_incompatible),Pr.unshift([nn,ir[0],ir[1]])}else{const nn=ln.code===d.Construct_signature_return_types_0_and_1_are_incompatible.code||ln.code===d.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"new ":"",Kn=ln.code===d.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code||ln.code===d.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"":"...";zt=`${nn}${zt}(${Kn})`}break}case d.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code:{Pr.unshift([d.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,ir[0],ir[1]]);break}case d.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code:{Pr.unshift([d.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,ir[0],ir[1],ir[2]]);break}default:return E.fail(`Unhandled Diagnostic: ${ln.code}`)}}zt?Vi(zt[zt.length-1]===")"?d.The_types_returned_by_0_are_incompatible_between_these_types:d.The_types_of_0_are_incompatible_between_these_types,zt):Pr.shift();for(const[ln,...ir]of Pr){const nn=ln.elidedInCompatabilityPyramid;ln.elidedInCompatabilityPyramid=!1,Vi(ln,...ir),ln.elidedInCompatabilityPyramid=nn}_t&&fr(void 0,..._t)}function Vi(Ge,..._t){E.assert(!!_),Sr&&vs(),!Ge.elidedInCompatabilityPyramid&&(Ut===0?F=ps(F,Ge,..._t):Ut--)}function Cu(Ge,..._t){Vi(Ge,..._t),Ut++}function If(Ge){E.assert(!!F),V?V.push(Ge):V=[Ge]}function fr(Ge,_t,zt){Sr&&vs();const[Pr,ln]=vy(_t,zt);let ir=_t,nn=Pr;if(qN(_t)&&!Rde(zt)&&(ir=bh(_t),E.assert(!ca(ir,zt),"generalized source shouldn't be assignable"),nn=m0(ir)),(zt.flags&8388608&&!(_t.flags&8388608)?zt.objectType.flags:zt.flags)&262144&&zt!==A&&zt!==Pe){const oi=Ku(zt);let cs;oi&&(ca(ir,oi)||(cs=ca(_t,oi)))?Vi(d._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,cs?Pr:nn,ln,mr(oi)):(F=void 0,Vi(d._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,ln,nn))}if(Ge)Ge===d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1&&he&&G8e(_t,zt).length&&(Ge=d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties);else if(l===Yu)Ge=d.Type_0_is_not_comparable_to_type_1;else if(Pr===ln)Ge=d.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;else if(he&&G8e(_t,zt).length)Ge=d.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;else{if(_t.flags&128&&zt.flags&1048576){const oi=bst(_t,zt);if(oi){Vi(d.Type_0_is_not_assignable_to_type_1_Did_you_mean_2,nn,ln,mr(oi));return}}Ge=d.Type_0_is_not_assignable_to_type_1}Vi(Ge,nn,ln)}function jr(Ge,_t){const zt=hS(Ge.symbol)?mr(Ge,Ge.symbol.valueDeclaration):mr(Ge),Pr=hS(_t.symbol)?mr(_t,_t.symbol.valueDeclaration):mr(_t);(uc===Ge&&Fe===_t||hc===Ge&&vt===_t||jo===Ge&&On===_t||$Pe()===Ge&&Ln===_t)&&Vi(d._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,Pr,zt)}function vi(Ge,_t,zt){return pa(Ge)?Ge.target.readonly&&gR(_t)?(zt&&Vi(d.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,mr(Ge),mr(_t)),!1):j2(_t):bD(Ge)&&gR(_t)?(zt&&Vi(d.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,mr(Ge),mr(_t)),!1):pa(_t)?ep(Ge):!0}function Cs(Ge,_t,zt){return Wr(Ge,_t,3,zt)}function Wr(Ge,_t,zt=3,Pr=!1,ln,ir=0){if(Ge===_t)return-1;if(Ge.flags&524288&&_t.flags&402784252)return l===Yu&&!(_t.flags&131072)&&VN(_t,Ge,l)||VN(Ge,_t,l,Pr?Vi:void 0)?-1:(Pr&&Ta(Ge,_t,Ge,_t,ln),0);const nn=fR(Ge,!1);let Kn=fR(_t,!0);if(nn===Kn)return-1;if(l===K_)return nn.flags!==Kn.flags?0:nn.flags&67358815?-1:(so(nn,Kn),Xn(nn,Kn,!1,0,zt));if(nn.flags&262144&&CS(nn)===Kn)return-1;if(nn.flags&470302716&&Kn.flags&1048576){const oi=Kn.types,cs=oi.length===2&&oi[0].flags&98304?oi[1]:oi.length===3&&oi[0].flags&98304&&oi[1].flags&98304?oi[2]:void 0;if(cs&&!(cs.flags&98304)&&(Kn=fR(cs,!0),nn===Kn))return-1}if(l===Yu&&!(Kn.flags&131072)&&VN(Kn,nn,l)||VN(nn,Kn,l,Pr?Vi:void 0))return-1;if(nn.flags&469499904||Kn.flags&469499904){if(!(ir&2)&&uv(nn)&&Pn(nn)&8192&&Ra(nn,Kn,Pr))return Pr&&fr(ln,nn,_t.aliasSymbol?_t:Kn),0;const cs=(l!==Yu||bd(nn))&&!(ir&2)&&nn.flags&405405692&&nn!==ye&&Kn.flags&2621440&&X8e(Kn)&&(Wa(nn).length>0||xZ(nn)),Js=!!(Pn(nn)&2048);if(cs&&!grt(nn,Kn,Js)){if(Pr){const bs=mr(Ge.aliasSymbol?Ge:nn),Ks=mr(_t.aliasSymbol?_t:Kn),ao=Ts(nn,0),Fa=Ts(nn,1);ao.length>0&&Wr(Ma(ao[0]),Kn,1,!1)||Fa.length>0&&Wr(Ma(Fa[0]),Kn,1,!1)?Vi(d.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,bs,Ks):Vi(d.Type_0_has_no_properties_in_common_with_type_1,bs,Ks)}return 0}so(nn,Kn);const ti=nn.flags&1048576&&nn.types.length<4&&!(Kn.flags&1048576)||Kn.flags&1048576&&Kn.types.length<4&&!(nn.flags&469499904)?Ec(nn,Kn,Pr,ir):Xn(nn,Kn,Pr,ir,zt);if(ti)return ti}return Pr&&Ta(Ge,_t,nn,Kn,ln),0}function Ta(Ge,_t,zt,Pr,ln){var ir,nn;const Kn=!!Vde(Ge),oi=!!Vde(_t);zt=Ge.aliasSymbol||Kn?Ge:zt,Pr=_t.aliasSymbol||oi?_t:Pr;let cs=gr>0;if(cs&&gr--,zt.flags&524288&&Pr.flags&524288){const Js=F;vi(zt,Pr,!0),F!==Js&&(cs=!!F)}if(zt.flags&524288&&Pr.flags&402784252)jr(zt,Pr);else if(zt.symbol&&zt.flags&524288&&ye===zt)Vi(d.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);else if(Pn(zt)&2048&&Pr.flags&2097152){const Js=Pr.types,Vs=U2(mf.IntrinsicAttributes,_),ti=U2(mf.IntrinsicClassAttributes,_);if(!et(Vs)&&!et(ti)&&(_s(Js,Vs)||_s(Js,ti)))return}else F=qpe(F,_t);if(!ln&&cs){Nr=[zt,Pr];return}if(fr(ln,zt,Pr),zt.flags&262144&&((nn=(ir=zt.symbol)==null?void 0:ir.declarations)!=null&&nn[0])&&!CS(zt)){const Js=oY(zt);if(Js.constraint=Ri(Pr,R2(zt,Js)),IN(Js)){const Vs=mr(Pr,zt.symbol.declarations[0]);If(mn(zt.symbol.declarations[0],d.This_type_parameter_might_need_an_extends_0_constraint,Vs))}}}function so(Ge,_t){if(Jr&&Ge.flags&3145728&&_t.flags&3145728){const zt=Ge,Pr=_t;if(zt.objectFlags&Pr.objectFlags&32768)return;const ln=zt.types.length,ir=Pr.types.length;ln*ir>1e6&&Jr.instant(Jr.Phase.CheckTypes,"traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:Ge.id,sourceSize:ln,targetId:_t.id,targetSize:ir,pos:_?.pos,end:_?.end})}}function il(Ge,_t){return Mn(Eu(Ge,(Pr,ln)=>{var ir;ln=e_(ln);const nn=ln.flags&3145728?Upe(ln,_t):K1(ln,_t),Kn=nn&&Br(nn)||((ir=Wx(ln,_t))==null?void 0:ir.type)||j;return lr(Pr,Kn)},void 0)||ze)}function Ra(Ge,_t,zt){var Pr;if(!NR(_t)||!se&&Pn(_t)&4096)return!1;const ln=!!(Pn(Ge)&2048);if((l===R_||l===Yu)&&(CD(ye,_t)||!ln&&yh(_t)))return!1;let ir=_t,nn;_t.flags&1048576&&(ir=oIe(Ge,_t,Wr)||S_t(_t),nn=ir.flags&1048576?ir.types:[ir]);for(const Kn of Wa(Ge))if(vl(Kn,Ge.symbol)&&!H8e(Ge,Kn)){if(!Mme(ir,Kn.escapedName,ln)){if(zt){const oi=jc(ir,NR);if(!_)return E.fail();if(Hv(_)||qu(_)||qu(_.parent)){Kn.valueDeclaration&&Rd(Kn.valueDeclaration)&&Or(_)===Or(Kn.valueDeclaration.name)&&(_=Kn.valueDeclaration.name);const cs=ii(Kn),Js=IAe(cs,oi),Vs=Js?ii(Js):void 0;Vs?Vi(d.Property_0_does_not_exist_on_type_1_Did_you_mean_2,cs,mr(oi),Vs):Vi(d.Property_0_does_not_exist_on_type_1,cs,mr(oi))}else{const cs=((Pr=Ge.symbol)==null?void 0:Pr.declarations)&&bl(Ge.symbol.declarations);let Js;if(Kn.valueDeclaration&&Ar(Kn.valueDeclaration,Vs=>Vs===cs)&&Or(cs)===Or(_)){const Vs=Kn.valueDeclaration;E.assertNode(Vs,qg);const ti=Vs.name;_=ti,Ie(ti)&&(Js=qme(ti,oi))}Js!==void 0?Cu(d.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,ii(Kn),mr(oi),Js):Cu(d.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,ii(Kn),mr(oi))}}return!0}if(nn&&!Wr(Br(Kn),il(nn,Kn.escapedName),3,zt))return zt&&xs(d.Types_of_property_0_are_incompatible,ii(Kn)),!0}return!1}function vl(Ge,_t){return Ge.valueDeclaration&&_t.valueDeclaration&&Ge.valueDeclaration.parent===_t.valueDeclaration}function Ec(Ge,_t,zt,Pr){if(Ge.flags&1048576){if(_t.flags&1048576){const ln=Ge.origin;if(ln&&ln.flags&2097152&&_t.aliasSymbol&&_s(ln.types,_t))return-1;const ir=_t.origin;if(ir&&ir.flags&1048576&&Ge.aliasSymbol&&_s(ir.types,Ge))return-1}return l===Yu?de(Ge,_t,zt&&!(Ge.flags&402784252),Pr):dn(Ge,_t,zt&&!(Ge.flags&402784252),Pr)}if(_t.flags&1048576)return af($N(Ge),_t,zt&&!(Ge.flags&402784252)&&!(_t.flags&402784252));if(_t.flags&2097152)return $e(Ge,_t,zt,2);if(l===Yu&&_t.flags&402784252){const ln=Yc(Ge.types,ir=>ir.flags&465829888?Ku(ir)||or:ir);if(ln!==Ge.types){if(Ge=fa(ln),Ge.flags&131072)return 0;if(!(Ge.flags&2097152))return Wr(Ge,_t,1,!1)||Wr(_t,Ge,1,!1)}}return de(Ge,_t,!1,1)}function So(Ge,_t){let zt=-1;const Pr=Ge.types;for(const ln of Pr){const ir=af(ln,_t,!1);if(!ir)return 0;zt&=ir}return zt}function af(Ge,_t,zt){const Pr=_t.types;if(_t.flags&1048576){if(wy(Pr,Ge))return-1;if(l!==Yu&&Pn(_t)&32768&&!(Ge.flags&1024)&&(Ge.flags&2688||(l===Lm||l===Wf)&&Ge.flags&256)){const ir=Ge===Ge.regularType?Ge.freshType:Ge.regularType,nn=Ge.flags&128?Fe:Ge.flags&256?vt:Ge.flags&2048?Lt:void 0;return nn&&wy(Pr,nn)||ir&&wy(Pr,ir)?-1:0}const ln=kwe(_t,Ge);if(ln){const ir=Wr(Ge,ln,2,!1);if(ir)return ir}}for(const ln of Pr){const ir=Wr(Ge,ln,2,!1);if(ir)return ir}if(zt){const ln=$8e(Ge,_t,Wr);ln&&Wr(Ge,ln,2,!0)}return 0}function $e(Ge,_t,zt,Pr){let ln=-1;const ir=_t.types;for(const nn of ir){const Kn=Wr(Ge,nn,2,zt,void 0,Pr);if(!Kn)return 0;ln&=Kn}return ln}function de(Ge,_t,zt,Pr){const ln=Ge.types;if(Ge.flags&1048576&&wy(ln,_t))return-1;const ir=ln.length;for(let nn=0;nn=nn.types.length&&ir.length%nn.types.length===0){const Js=Wr(oi,nn.types[Kn%nn.types.length],3,!1,void 0,Pr);if(Js){ln&=Js;continue}}const cs=Wr(oi,_t,1,zt,void 0,Pr);if(!cs)return 0;ln&=cs}return ln}function Zn(Ge=ze,_t=ze,zt=ze,Pr,ln){if(Ge.length!==_t.length&&l===K_)return 0;const ir=Ge.length<=_t.length?Ge.length:_t.length;let nn=-1;for(let Kn=0;Kn(bs|=Fa?16:8,ti(Fa)));let Ks;return _r===3?((ir=Jr)==null||ir.instant(Jr.Phase.CheckTypes,"recursiveTypeRelatedTo_DepthLimit",{sourceId:Ge.id,sourceIdStack:xe.map(Fa=>Fa.id),targetId:_t.id,targetIdStack:Ne.map(Fa=>Fa.id),depth:kt,targetDepth:Xt}),Ks=3):((nn=Jr)==null||nn.push(Jr.Phase.CheckTypes,"structuredTypeRelatedTo",{sourceId:Ge.id,targetId:_t.id}),Ks=ui(Ge,_t,zt,Pr),(Kn=Jr)==null||Kn.pop()),Ws&&(Ws=ti),ln&1&&kt--,ln&2&&Xt--,_r=Vs,Ks?(Ks===-1||kt===0&&Xt===0)&&ao(Ks===-1||Ks===3):(l.set(oi,(zt?4:0)|2|bs),Er--,ao(!1)),Ks;function ao(Fa){for(let Dl=Js;DlKn!==Ge)&&(ir=Wr(nn,_t,1,!1,void 0,Pr))}ir&&!(Pr&2)&&_t.flags&2097152&&!O2(_t)&&Ge.flags&2621440?(ir&=vr(Ge,_t,zt,void 0,!1,0),ir&&uv(Ge)&&Pn(Ge)&8192&&(ir&=Bo(Ge,_t,!1,zt,0))):ir&&eY(_t)&&!j2(_t)&&Ge.flags&2097152&&e_(Ge).flags&3670016&&!ut(Ge.types,nn=>nn===_t||!!(Pn(nn)&262144))&&(ir&=vr(Ge,_t,zt,void 0,!0,Pr))}return ir&&sn(ln),ir}function Sn(Ge,_t,zt,Pr,ln){let ir,nn,Kn=!1,oi=Ge.flags;const cs=_t.flags;if(l===K_){if(oi&3145728){let ti=So(Ge,_t);return ti&&(ti&=So(_t,Ge)),ti}if(oi&4194304)return Wr(Ge.type,_t.type,3,!1);if(oi&8388608&&(ir=Wr(Ge.objectType,_t.objectType,3,!1))&&(ir&=Wr(Ge.indexType,_t.indexType,3,!1))||oi&16777216&&Ge.root.isDistributive===_t.root.isDistributive&&(ir=Wr(Ge.checkType,_t.checkType,3,!1))&&(ir&=Wr(Ge.extendsType,_t.extendsType,3,!1))&&(ir&=Wr(iv(Ge),iv(_t),3,!1))&&(ir&=Wr(sv(Ge),sv(_t),3,!1))||oi&33554432&&(ir=Wr(Ge.baseType,_t.baseType,3,!1))&&(ir&=Wr(Ge.constraint,_t.constraint,3,!1)))return ir;if(!(oi&524288))return 0}else if(oi&3145728||cs&3145728){if(ir=Ec(Ge,_t,zt,Pr))return ir;if(!(oi&465829888||oi&524288&&cs&1048576||oi&2097152&&cs&467402752))return 0}if(oi&17301504&&Ge.aliasSymbol&&Ge.aliasTypeArguments&&Ge.aliasSymbol===_t.aliasSymbol&&!(dY(Ge)||dY(_t))){const ti=Q8e(Ge.aliasSymbol);if(ti===ze)return 1;const bs=yi(Ge.aliasSymbol).typeParameters,Ks=Hm(bs),ao=Dy(Ge.aliasTypeArguments,bs,Ks,Hr(Ge.aliasSymbol.valueDeclaration)),Fa=Dy(_t.aliasTypeArguments,bs,Ks,Hr(Ge.aliasSymbol.valueDeclaration)),Dl=Vs(ao,Fa,ti,Pr);if(Dl!==void 0)return Dl}if(swe(Ge)&&!Ge.target.readonly&&(ir=Wr(uo(Ge)[0],_t,1))||swe(_t)&&(_t.target.readonly||gR(Ku(Ge)||Ge))&&(ir=Wr(Ge,uo(_t)[0],2)))return ir;if(cs&262144){if(Pn(Ge)&32&&!Ge.declaration.nameType&&Wr($m(_t),Ep(Ge),3)&&!(qm(Ge)&4)){const ti=dh(Ge),bs=J_(_t,md(Ge));if(ir=Wr(ti,bs,3,zt))return ir}if(l===Yu&&oi&262144){let ti=ku(Ge);if(ti&&IN(Ge))for(;ti&&em(ti,bs=>!!(bs.flags&262144));){if(ir=Wr(ti,_t,1,!1))return ir;ti=ku(ti)}return 0}}else if(cs&4194304){const ti=_t.type;if(oi&4194304&&(ir=Wr(ti,Ge.type,3,!1)))return ir;if(pa(ti)){if(ir=Wr(Ge,n8e(ti),2,zt))return ir}else{const bs=jpe(ti);if(bs){if(Wr(Ge,$m(bs,_t.indexFlags|4),2,zt)===-1)return-1}else if(Af(ti)){const Ks=y0(ti),ao=Ep(ti);let Fa;if(Ks&&NN(ti)){const Dl=e_(Jx(ti)),sm=[];Mpe(Dl,8576,!1,am=>void sm.push(Ri(Ks,zN(ti.mapper,md(ti),am)))),Fa=Mn([...sm,Ks])}else Fa=Ks||ao;if(Wr(Ge,Fa,2,zt)===-1)return-1}}}else if(cs&8388608){if(oi&8388608){if((ir=Wr(Ge.objectType,_t.objectType,3,zt))&&(ir&=Wr(Ge.indexType,_t.indexType,3,zt)),ir)return ir;zt&&(nn=F)}if(l===R_||l===Yu){const ti=_t.objectType,bs=_t.indexType,Ks=Ku(ti)||ti,ao=Ku(bs)||bs;if(!O2(Ks)&&!nv(ao)){const Fa=4|(Ks!==ti?2:0),Dl=Ay(Ks,ao,Fa);if(Dl){if(zt&&nn&&sn(ln),ir=Wr(Ge,Dl,2,zt,void 0,Pr))return ir;zt&&nn&&F&&(F=Js([nn])<=Js([F])?nn:F)}}}zt&&(nn=void 0)}else if(Af(_t)&&l!==K_){const ti=!!_t.declaration.nameType,bs=dh(_t),Ks=qm(_t);if(!(Ks&8)){if(!ti&&bs.flags&8388608&&bs.objectType===Ge&&bs.indexType===md(_t))return-1;if(!Af(Ge)){const ao=ti?y0(_t):Ep(_t),Fa=$m(Ge,2),Dl=Ks&4,sm=Dl?YM(ao,Fa):void 0;if(Dl?!(sm.flags&131072):Wr(ao,Fa,3)){const am=dh(_t),$2=md(_t),a4=ED(am,-98305);if(!ti&&a4.flags&8388608&&a4.indexType===$2){if(ir=Wr(Ge,a4.objectType,2,zt))return ir}else{const ek=ti?sm||ao:sm?fa([sm,$2]):$2,kh=J_(Ge,ek);if(ir=Wr(kh,am,3,zt))return ir}}nn=F,sn(ln)}}}else if(cs&16777216){if(vD(_t,Ne,Xt,10))return 3;const ti=_t;if(!ti.root.inferTypeParameters&&!wtt(ti.root)&&!(Ge.flags&16777216&&Ge.root===ti.root)){const bs=!ca(lY(ti.checkType),lY(ti.extendsType)),Ks=!bs&&ca(wS(ti.checkType),wS(ti.extendsType));if((ir=bs?-1:Wr(Ge,iv(ti),2,!1,void 0,Pr))&&(ir&=Ks?-1:Wr(Ge,sv(ti),2,!1,void 0,Pr),ir))return ir}}else if(cs&134217728){if(oi&134217728){if(l===Yu)return rnt(Ge,_t)?0:-1;Ri(Ge,el)}if(NY(Ge,_t))return-1}else if(_t.flags&268435456&&!(Ge.flags&268435456)&&sme(Ge,_t))return-1;if(oi&8650752){if(!(oi&8388608&&cs&8388608)){const ti=CS(Ge)||or;if(ir=Wr(ti,_t,1,!1,void 0,Pr))return ir;if(ir=Wr(rf(ti,Ge),_t,1,zt&&ti!==or&&!(cs&oi&262144),void 0,Pr))return ir;if(Wpe(Ge)){const bs=CS(Ge.indexType);if(bs&&(ir=Wr(J_(Ge.objectType,bs),_t,1,zt)))return ir}}}else if(oi&4194304){if(ir=Wr(Tc,_t,1,zt))return ir}else if(oi&134217728&&!(cs&524288)){if(!(cs&134217728)){const ti=Ku(Ge);if(ti&&ti!==Ge&&(ir=Wr(ti,_t,1,zt)))return ir}}else if(oi&268435456)if(cs&268435456){if(Ge.symbol!==_t.symbol)return 0;if(ir=Wr(Ge.type,_t.type,3,zt))return ir}else{const ti=Ku(Ge);if(ti&&(ir=Wr(ti,_t,1,zt)))return ir}else if(oi&16777216){if(vD(Ge,xe,kt,10))return 3;if(cs&16777216){const bs=Ge.root.inferTypeParameters;let Ks=Ge.extendsType,ao;if(bs){const Fa=XN(bs,void 0,0,Cs);Th(Fa.inferences,_t.extendsType,Ks,1536),Ks=Ri(Ks,Fa.mapper),ao=Fa.mapper}if(hh(Ks,_t.extendsType)&&(Wr(Ge.checkType,_t.checkType,3)||Wr(_t.checkType,Ge.checkType,3))&&((ir=Wr(Ri(iv(Ge),ao),iv(_t),3,zt))&&(ir&=Wr(sv(Ge),sv(_t),3,zt)),ir))return ir}else{const bs=IN(Ge)?hPe(Ge):void 0;if(bs&&(ir=Wr(bs,_t,1,zt)))return ir}const ti=Bpe(Ge);if(ti&&(ir=Wr(ti,_t,1,zt)))return ir}else{if(l!==Lm&&l!==Wf&&jKe(_t)&&yh(Ge))return-1;if(Af(_t))return Af(Ge)&&(ir=un(Ge,_t,zt))?ir:0;const ti=!!(oi&402784252);if(l!==K_)Ge=e_(Ge),oi=Ge.flags;else if(Af(Ge))return 0;if(Pn(Ge)&4&&Pn(_t)&4&&Ge.target===_t.target&&!pa(Ge)&&!(dY(Ge)||dY(_t))){if(vY(Ge))return-1;const bs=Bde(Ge.target);if(bs===ze)return 1;const Ks=Vs(uo(Ge),uo(_t),bs,Pr);if(Ks!==void 0)return Ks}else{if(bD(_t)?Nf(Ge,j2):ep(_t)&&Nf(Ge,bs=>pa(bs)&&!bs.target.readonly))return l!==K_?Wr(ev(Ge,vt)||G,ev(_t,vt)||G,3,zt):0;if(k0(Ge)&&pa(_t)&&!k0(_t)){const bs=mh(Ge);if(bs!==Ge)return Wr(bs,_t,1,zt)}else if((l===Lm||l===Wf)&&yh(_t)&&Pn(_t)&8192&&!yh(Ge))return 0}if(oi&2621440&&cs&524288){const bs=zt&&F===ln.errorInfo&&!ti;if(ir=vr(Ge,_t,bs,void 0,!1,Pr),ir&&(ir&=Un(Ge,_t,0,bs,Pr),ir&&(ir&=Un(Ge,_t,1,bs,Pr),ir&&(ir&=Bo(Ge,_t,ti,bs,Pr)))),Kn&&ir)F=nn||F||ln.errorInfo;else if(ir)return ir}if(oi&2621440&&cs&1048576){const bs=ED(_t,36175872);if(bs.flags&1048576){const Ks=Ke(Ge,bs);if(Ks)return Ks}}}return 0;function Js(ti){return ti?Eu(ti,(bs,Ks)=>bs+1+Js(Ks.next),0):0}function Vs(ti,bs,Ks,ao){if(ir=Zn(ti,bs,Ks,zt,ao))return ir;if(ut(Ks,Dl=>!!(Dl&24))){nn=void 0,sn(ln);return}const Fa=bs&&hrt(bs,Ks);if(Kn=!Fa,Ks!==ze&&!Fa){if(Kn&&!(zt&&ut(Ks,Dl=>(Dl&7)===0)))return 0;nn=F,sn(ln)}}}function un(Ge,_t,zt){if(l===Yu||(l===K_?qm(Ge)===qm(_t):Rpe(Ge)<=Rpe(_t))){let ln;const ir=Ep(_t),nn=Ri(Ep(Ge),Rpe(Ge)<0?yo:el);if(ln=Wr(ir,nn,3,zt)){const Kn=k_([md(Ge)],[md(_t)]);if(Ri(y0(Ge),Kn)===Ri(y0(_t),Kn))return ln&Wr(Ri(dh(Ge),Kn),dh(_t),3,zt)}}return 0}function Ke(Ge,_t){var zt;const Pr=Wa(Ge),ln=xwe(Pr,_t);if(!ln)return 0;let ir=1;for(const Vs of ln)if(ir*=Ant(ky(Vs)),ir>25)return(zt=Jr)==null||zt.instant(Jr.Phase.CheckTypes,"typeRelatedToDiscriminatedType_DepthLimit",{sourceId:Ge.id,targetId:_t.id,numCombinations:ir}),0;const nn=new Array(ln.length),Kn=new Set;for(let Vs=0;VsVs[Ks],!1,0,H||l===Yu))continue e}tp(cs,bs,w0),ti=!0}if(!ti)return 0}let Js=-1;for(const Vs of cs)if(Js&=vr(Ge,Vs,!1,Kn,!1,0),Js&&(Js&=Un(Ge,Vs,0,!1,0),Js&&(Js&=Un(Ge,Vs,1,!1,0),Js&&!(pa(Ge)&&pa(Vs))&&(Js&=Bo(Ge,Vs,!1,!1,0)))),!Js)return Js;return Js}function xt(Ge,_t){if(!_t||Ge.length===0)return Ge;let zt;for(let Pr=0;Pr5?Vi(d.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,mr(Ge),mr(_t),Yt(ir.slice(0,4),nn=>ii(nn)).join(", "),ir.length-4):Vi(d.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,mr(Ge),mr(_t),Yt(ir,nn=>ii(nn)).join(", ")),ln&&F&&gr++)}function vr(Ge,_t,zt,Pr,ln,ir){if(l===K_)return ai(Ge,_t,Pr);let nn=-1;if(pa(_t)){if(j2(Ge)){if(!_t.target.readonly&&(bD(Ge)||pa(Ge)&&Ge.target.readonly))return 0;const Vs=b0(Ge),ti=b0(_t),bs=pa(Ge)?Ge.target.combinedFlags&4:4,Ks=_t.target.combinedFlags&4,ao=pa(Ge)?Ge.target.minLength:0,Fa=_t.target.minLength;if(!bs&&Vs=am?ti-1-Math.min(sj,$2):kh,yt=_t.target.elementFlags[z_];if(yt&8&&!(fv&8))return zt&&Vi(d.Source_provides_no_match_for_variadic_element_at_position_0_in_target,z_),0;if(fv&8&&!(yt&12))return zt&&Vi(d.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,kh,z_),0;if(yt&1&&!(fv&1))return zt&&Vi(d.Source_provides_no_match_for_required_element_at_position_0_in_target,z_),0;if(ek&&((fv&12||yt&12)&&(ek=!1),ek&&Pr?.has(""+kh)))continue;const hn=My(Dl[kh],!!(fv&yt&2)),Gn=sm[z_],Bn=fv&8&&yt&4?uu(Gn):My(Gn,!!(yt&2)),$n=Wr(hn,Bn,3,zt,void 0,ir);if(!$n)return zt&&(ti>1||Vs>1)&&(a4&&kh>=am&&sj>=$2&&am!==Vs-$2-1?xs(d.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,am,Vs-$2-1,z_):xs(d.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,kh,z_)),0;nn&=$n}return nn}if(_t.target.combinedFlags&12)return 0}const Kn=(l===Lm||l===Wf)&&!uv(Ge)&&!vY(Ge)&&!pa(Ge),oi=nme(Ge,_t,Kn,!1);if(oi)return zt&&Hi(Ge,_t)&&$t(Ge,_t,oi,Kn),0;if(uv(_t)){for(const Vs of xt(Wa(Ge),Pr))if(!K1(_t,Vs.escapedName)&&!(Br(Vs).flags&32768))return zt&&Vi(d.Property_0_does_not_exist_on_type_1,ii(Vs),mr(_t)),0}const cs=Wa(_t),Js=pa(Ge)&&pa(_t);for(const Vs of xt(cs,Pr)){const ti=Vs.escapedName;if(!(Vs.flags&4194304)&&(!Js||_g(ti)||ti==="length")&&(!ln||Vs.flags&16777216)){const bs=Gs(Ge,ti);if(bs&&bs!==Vs){const Ks=jt(Ge,_t,bs,Vs,ky,zt,ir,l===Yu);if(!Ks)return 0;nn&=Ks}}}return nn}function ai(Ge,_t,zt){if(!(Ge.flags&524288&&_t.flags&524288))return 0;const Pr=xt(Ey(Ge),zt),ln=xt(Ey(_t),zt);if(Pr.length!==ln.length)return 0;let ir=-1;for(const nn of Pr){const Kn=K1(_t,nn.escapedName);if(!Kn)return 0;const oi=zde(nn,Kn,Wr);if(!oi)return 0;ir&=oi}return ir}function Un(Ge,_t,zt,Pr,ln){var ir,nn;if(l===K_)return Bi(Ge,_t,zt);if(_t===qt||Ge===qt)return-1;const Kn=Ge.symbol&&nm(Ge.symbol.valueDeclaration),oi=_t.symbol&&nm(_t.symbol.valueDeclaration),cs=Ts(Ge,Kn&&zt===1?0:zt),Js=Ts(_t,oi&&zt===1?0:zt);if(zt===1&&cs.length&&Js.length){const ao=!!(cs[0].flags&4),Fa=!!(Js[0].flags&4);if(ao&&!Fa)return Pr&&Vi(d.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type),0;if(!Jo(cs[0],Js[0],Pr))return 0}let Vs=-1;const ti=zt===1?Vn:pr,bs=Pn(Ge),Ks=Pn(_t);if(bs&64&&Ks&64&&Ge.symbol===_t.symbol||bs&4&&Ks&4&&Ge.target===_t.target)for(let ao=0;aoYd(am,void 0,262144,zt);return Vi(d.Type_0_is_not_assignable_to_type_1,sm(Fa),sm(Dl)),Vi(d.Types_of_construct_signatures_are_incompatible),Vs}}else e:for(const ao of Js){const Fa=ms();let Dl=Pr;for(const sm of cs){const am=mi(sm,ao,!0,Dl,ln,ti(sm,ao));if(am){Vs&=am,sn(Fa);continue e}Dl=!1}return Dl&&Vi(d.Type_0_provides_no_match_for_the_signature_1,mr(Ge),Yd(ao,void 0,void 0,zt)),0}return Vs}function Hi(Ge,_t){const zt=eR(Ge,0),Pr=eR(Ge,1),ln=Ey(Ge);return(zt.length||Pr.length)&&!ln.length?!!(Ts(_t,0).length&&zt.length||Ts(_t,1).length&&Pr.length):!0}function pr(Ge,_t){return Ge.parameters.length===0&&_t.parameters.length===0?(zt,Pr)=>xs(d.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,mr(zt),mr(Pr)):(zt,Pr)=>xs(d.Call_signature_return_types_0_and_1_are_incompatible,mr(zt),mr(Pr))}function Vn(Ge,_t){return Ge.parameters.length===0&&_t.parameters.length===0?(zt,Pr)=>xs(d.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,mr(zt),mr(Pr)):(zt,Pr)=>xs(d.Construct_signature_return_types_0_and_1_are_incompatible,mr(zt),mr(Pr))}function mi(Ge,_t,zt,Pr,ln,ir){const nn=l===Lm?16:l===Wf?24:0;return Ode(zt?MN(Ge):Ge,zt?MN(_t):_t,nn,Pr,Vi,ir,Kn,el);function Kn(oi,cs,Js){return Wr(oi,cs,3,Js,void 0,ln)}}function Bi(Ge,_t,zt){const Pr=Ts(Ge,zt),ln=Ts(_t,zt);if(Pr.length!==ln.length)return 0;let ir=-1;for(let nn=0;nnoi.keyType===Fe);let Kn=-1;for(const oi of ir){const cs=l!==Wf&&!zt&&nn&&oi.type.flags&1?-1:Af(Ge)&&nn?Wr(dh(Ge),oi.type,3,Pr):Fo(Ge,oi,Pr,ln);if(!cs)return 0;Kn&=cs}return Kn}function Fo(Ge,_t,zt,Pr){const ln=FN(Ge,_t.keyType);return ln?_l(ln,_t,zt,Pr):!(Pr&1)&&(l!==Wf||Pn(Ge)&8192)&&EY(Ge)?$s(Ge,_t,zt,Pr):(zt&&Vi(d.Index_signature_for_type_0_is_missing_in_type_1,mr(_t.keyType),mr(Ge)),0)}function _u(Ge,_t){const zt=zu(Ge),Pr=zu(_t);if(zt.length!==Pr.length)return 0;for(const ln of Pr){const ir=Og(Ge,ln.keyType);if(!(ir&&Wr(ir.type,ln.type,3)&&ir.isReadonly===ln.isReadonly))return 0}return-1}function Jo(Ge,_t,zt){if(!Ge.declaration||!_t.declaration)return!0;const Pr=dT(Ge.declaration,6),ln=dT(_t.declaration,6);return ln===2||ln===4&&Pr!==2||ln!==4&&!Pr?!0:(zt&&Vi(d.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type,Ng(Pr),Ng(ln)),!1)}}function Rde(n){if(n.flags&16)return!1;if(n.flags&3145728)return!!Zt(n.types,Rde);if(n.flags&465829888){const a=CS(n);if(a&&a!==n)return Rde(a)}return bd(n)||!!(n.flags&134217728)||!!(n.flags&268435456)}function G8e(n,a){return pa(n)&&pa(a)?ze:Wa(a).filter(l=>pY(q(n,l.escapedName),Br(l)))}function pY(n,a){return!!n&&!!a&&Yo(n,32768)&&!!GN(a)}function mrt(n){return Wa(n).filter(a=>GN(Br(a)))}function $8e(n,a,l=Ide){return oIe(n,a,l)||h_t(n,a)||y_t(n,a)||v_t(n,a)||b_t(n,a)}function jde(n,a,l){const _=n.types,m=_.map(x=>x.flags&402784252?0:-1);for(const[x,N]of a){let F=!1;for(let V=0;V<_.length;V++)if(m[V]){const ne=ge(_[V],N);ne&&l(x(),ne)?F=!0:m[V]=3}for(let V=0;V<_.length;V++)m[V]===3&&(m[V]=F?0:-1)}const h=_s(m,0)?Mn(_.filter((x,N)=>m[N]),0):n;return h.flags&131072?n:h}function X8e(n){if(n.flags&524288){const a=gd(n);return a.callSignatures.length===0&&a.constructSignatures.length===0&&a.indexInfos.length===0&&a.properties.length>0&&qi(a.properties,l=>!!(l.flags&16777216))}return n.flags&2097152?qi(n.types,X8e):!1}function grt(n,a,l){for(const _ of Wa(n))if(Mme(a,_.escapedName,l))return!0;return!1}function Bde(n){return n===Ps||n===Fs||n.objectFlags&8?X:Y8e(n.symbol,n.typeParameters)}function Q8e(n){return Y8e(n,yi(n).typeParameters)}function Y8e(n,a=ze){var l,_;const m=yi(n);if(!m.variances){(l=Jr)==null||l.push(Jr.Phase.CheckTypes,"getVariancesWorker",{arity:a.length,id:Wu(bo(n))});const h=eS;eS||(eS=!0,_2=sh.length),m.variances=ze;const x=[];for(const N of a){const F=Jde(N);let V=F&16384?F&8192?0:1:F&8192?2:void 0;if(V===void 0){let ne=!1,le=!1;const xe=Ws;Ws=kt=>kt?le=!0:ne=!0;const Ne=pR(n,N,u_),nt=pR(n,N,vo);V=(ca(nt,Ne)?1:0)|(ca(Ne,nt)?2:0),V===3&&ca(pR(n,N,xc),Ne)&&(V=4),Ws=xe,(ne||le)&&(ne&&(V|=8),le&&(V|=16))}x.push(V)}h||(eS=!1,_2=0),m.variances=x,(_=Jr)==null||_.pop({variances:x.map(E.formatVariance)})}return m.variances}function pR(n,a,l){const _=R2(a,l),m=bo(n);if(et(m))return m;const h=n.flags&524288?H6(n,T0(yi(n).typeParameters,_)):v0(m,T0(m.typeParameters,_));return ft.add(Wu(h)),h}function dY(n){return ft.has(Wu(n))}function Jde(n){var a;return Eu((a=n.symbol)==null?void 0:a.declarations,(l,_)=>l|Fu(_),0)&28672}function hrt(n,a){for(let l=0;l!!(a.flags&262144)||mY(a))}function brt(n,a,l,_){const m=[];let h="";const x=F(n,0),N=F(a,0);return`${h}${x},${N}${l}`;function F(V,ne=0){let le=""+V.target.id;for(const xe of uo(V)){if(xe.flags&262144){if(_||yrt(xe)){let Ne=m.indexOf(xe);Ne<0&&(Ne=m.length,m.push(xe)),le+="="+Ne;continue}h="*"}else if(ne<4&&mY(xe)){le+="<"+F(xe,ne+1)+">";continue}le+="-"+xe.id}return le}}function gY(n,a,l,_,m){if(_===K_&&n.id>a.id){const x=n;n=a,a=x}const h=l?":"+l:"";return mY(n)&&mY(a)?brt(n,a,h,m):`${n.id},${a.id}${h}`}function dR(n,a){if(Ko(n)&6){for(const l of n.links.containingType.types){const _=Gs(l,n.escapedName),m=_&&dR(_,a);if(m)return m}return}return a(n)}function Xx(n){return n.parent&&n.parent.flags&32?bo(f_(n)):void 0}function hY(n){const a=Xx(n),l=a&&Qc(a)[0];return l&&q(l,n.escapedName)}function Srt(n,a){return dR(n,l=>{const _=Xx(l);return _?Bx(_,a):!1})}function Trt(n,a){return!dR(a,l=>Mf(l)&4?!Srt(n,Xx(l)):!1)}function Z8e(n,a,l){return dR(a,_=>Mf(_,l)&4?!Bx(n,Xx(_)):!1)?void 0:n}function vD(n,a,l,_=3){if(l>=_){if((Pn(n)&96)===96&&(n=K8e(n)),n.flags&2097152)return ut(n.types,N=>vD(N,a,l,_));const m=yY(n);let h=0,x=0;for(let N=0;N=x&&(h++,h>=_))return!0;x=F.id}}}return!1}function K8e(n){let a;for(;(Pn(n)&96)===96&&(a=Jx(n))&&(a.symbol||a.flags&2097152&&ut(a.types,l=>!!l.symbol));)n=a;return n}function ewe(n,a){return(Pn(n)&96)===96&&(n=K8e(n)),n.flags&2097152?ut(n.types,l=>ewe(l,a)):yY(n)===a}function yY(n){if(n.flags&524288&&!ame(n)){if(Pn(n)&4&&n.node)return n.node;if(n.symbol&&!(Pn(n)&16&&n.symbol.flags&32))return n.symbol;if(pa(n))return n.target}if(n.flags&262144)return n.symbol;if(n.flags&8388608){do n=n.objectType;while(n.flags&8388608);return n}return n.flags&16777216?n.root:n}function xrt(n,a){return zde(n,a,WN)!==0}function zde(n,a,l){if(n===a)return-1;const _=Mf(n)&6,m=Mf(a)&6;if(_!==m)return 0;if(_){if(i4(n)!==i4(a))return 0}else if((n.flags&16777216)!==(a.flags&16777216))return 0;return Td(n)!==Td(a)?0:l(Br(n),Br(a))}function krt(n,a,l){const _=sf(n),m=sf(a),h=im(n),x=im(a),N=Xm(n),F=Xm(a);return!!(_===m&&h===x&&N===F||l&&h<=x)}function mR(n,a,l,_,m,h){if(n===a)return-1;if(!krt(n,a,l)||Ir(n.typeParameters)!==Ir(a.typeParameters))return 0;if(a.typeParameters){const F=k_(n.typeParameters,a.typeParameters);for(let V=0;Va|(l.flags&1048576?twe(l.types):l.flags),0)}function Drt(n){if(n.length===1)return n[0];const a=H?Yc(n,_=>jc(_,m=>!(m.flags&98304))):n,l=Ert(a)?Mn(a):Eu(a,(_,m)=>Fy(_,m)?m:_);return a===n?l:TY(l,twe(n)&98304)}function Prt(n){return Eu(n,(a,l)=>Fy(l,a)?l:a)}function ep(n){return!!(Pn(n)&4)&&(n.target===Ps||n.target===Fs)}function bD(n){return!!(Pn(n)&4)&&n.target===Fs}function j2(n){return ep(n)||pa(n)}function gR(n){return ep(n)&&!bD(n)||pa(n)&&!n.target.readonly}function Wde(n){return ep(n)?uo(n)[0]:void 0}function x0(n){return ep(n)||!(n.flags&98304)&&ca(n,yp)}function Ude(n){return gR(n)||!(n.flags&98305)&&ca(n,nc)}function Vde(n){if(!(Pn(n)&4)||!(Pn(n.target)&3))return;if(Pn(n)&33554432)return Pn(n)&67108864?n.cachedEquivalentBaseType:void 0;n.objectFlags|=33554432;const a=n.target;if(Pn(a)&1){const m=pi(a);if(m&&m.expression.kind!==80&&m.expression.kind!==211)return}const l=Qc(a);if(l.length!==1||Cy(n.symbol).size)return;let _=Ir(a.typeParameters)?Ri(l[0],k_(a.typeParameters,uo(n).slice(0,a.typeParameters.length))):l[0];return Ir(uo(n))>Ir(a.typeParameters)&&(_=rf(_,Sa(uo(n)))),n.objectFlags|=67108864,n.cachedEquivalentBaseType=_}function rwe(n){return H?n===wr:n===ce}function vY(n){const a=Wde(n);return!!a&&rwe(a)}function SD(n){let a;return pa(n)||!!Gs(n,"0")||x0(n)&&!!(a=q(n,"length"))&&Nf(a,l=>!!(l.flags&256))}function bY(n){return x0(n)||SD(n)}function wrt(n,a){const l=q(n,""+a);if(l)return l;if(Nf(n,pa))return awe(n,a,J.noUncheckedIndexedAccess?j:void 0)}function Art(n){return!(n.flags&240544)}function bd(n){return!!(n.flags&109472)}function nwe(n){const a=mh(n);return a.flags&2097152?ut(a.types,bd):bd(a)}function Nrt(n){return n.flags&2097152&&kn(n.types,bd)||n}function qN(n){return n.flags&16?!0:n.flags&1048576?n.flags&1024?!0:qi(n.types,bd):bd(n)}function bh(n){return n.flags&1056?BQ(n):n.flags&402653312?Fe:n.flags&256?vt:n.flags&2048?Lt:n.flags&512?On:n.flags&1048576?Irt(n):n}function Irt(n){const a=`B${Wu(n)}`;return sS(a)??m2(a,Io(n,bh))}function qde(n){return n.flags&402653312?Fe:n.flags&288?vt:n.flags&2048?Lt:n.flags&512?On:n.flags&1048576?Io(n,qde):n}function B2(n){return n.flags&1056&&M2(n)?BQ(n):n.flags&128&&M2(n)?Fe:n.flags&256&&M2(n)?vt:n.flags&2048&&M2(n)?Lt:n.flags&512&&M2(n)?On:n.flags&1048576?Io(n,B2):n}function iwe(n){return n.flags&8192?Ln:n.flags&1048576?Io(n,iwe):n}function Hde(n,a){return oZ(n,a)||(n=iwe(B2(n))),t_(n)}function Frt(n,a,l){if(n&&bd(n)){const _=a?l?l7(a):a:void 0;n=Hde(n,_)}return n}function Gde(n,a,l,_){if(n&&bd(n)){const m=a?V2(l,a,_):void 0;n=Hde(n,m)}return n}function pa(n){return!!(Pn(n)&4&&n.target.objectFlags&8)}function k0(n){return pa(n)&&!!(n.target.combinedFlags&8)}function swe(n){return k0(n)&&n.target.elementFlags.length===1}function SY(n){return TD(n,n.target.fixedLength)}function awe(n,a,l){return Io(n,_=>{const m=_,h=SY(m);return h?l&&a>=pde(m.target)?Mn([h,l]):h:j})}function Ort(n){const a=SY(n);return a&&uu(a)}function TD(n,a,l=0,_=!1,m=!1){const h=b0(n)-l;if(a(l&12)===(a.target.elementFlags[_]&12))}function owe({value:n}){return n.base10Value==="0"}function cwe(n){return jc(n,a=>wp(a,4194304))}function Mrt(n){return Io(n,Rrt)}function Rrt(n){return n.flags&4?M_:n.flags&8?A1:n.flags&64?cy:n===Lr||n===Wt||n.flags&114691||n.flags&128&&n.value===""||n.flags&256&&n.value===0||n.flags&2048&&owe(n)?n:Cn}function TY(n,a){const l=a&~n.flags&98304;return l===0?n:Mn(l===32768?[n,j]:l===65536?[n,De]:[n,j,De])}function Ly(n,a=!1){E.assert(H);const l=a?ue:j;return n===l||n.flags&1048576&&n.types[0]===l?n:Mn([n,l])}function jrt(n){return xf||(xf=dD("NonNullable",524288,void 0)||dt),xf!==dt?H6(xf,[n]):fa([n,Us])}function Sh(n){return H?FS(n,2097152):n}function lwe(n){return H?Mn([n,M]):n}function xY(n){return H?OY(n,M):n}function kY(n,a,l){return l?A4(a)?Ly(n):lwe(n):n}function HN(n,a){return fI(a)?Sh(n):gu(a)?xY(n):n}function My(n,a){return he&&a?OY(n,ee):n}function GN(n){return n===ee||!!(n.flags&1048576)&&n.types[0]===ee}function CY(n){return he?OY(n,ee):Ap(n,524288)}function Brt(n,a){return(n.flags&524)!==0&&(a.flags&28)!==0}function EY(n){const a=Pn(n);return n.flags&2097152?qi(n.types,EY):!!(n.symbol&&n.symbol.flags&7040&&!(n.symbol.flags&32)&&!xZ(n))||!!(a&4194304)||!!(a&1024&&EY(n.source))}function AS(n,a){const l=Aa(n.flags,n.escapedName,Ko(n)&8);l.declarations=n.declarations,l.parent=n.parent,l.links.type=a,l.links.target=n,n.valueDeclaration&&(l.valueDeclaration=n.valueDeclaration);const _=yi(n).nameType;return _&&(l.links.nameType=_),l}function Jrt(n,a){const l=zs();for(const _ of Ey(n)){const m=Br(_),h=a(m);l.set(_.escapedName,h===m?_:AS(_,h))}return l}function $N(n){if(!(uv(n)&&Pn(n)&8192))return n;const a=n.regularType;if(a)return a;const l=n,_=Jrt(n,$N),m=Qo(l.symbol,_,l.callSignatures,l.constructSignatures,l.indexInfos);return m.flags=l.flags,m.objectFlags|=l.objectFlags&-8193,n.regularType=m,m}function uwe(n,a,l){return{parent:n,propertyName:a,siblings:l,resolvedProperties:void 0}}function _we(n){if(!n.siblings){const a=[];for(const l of _we(n.parent))if(uv(l)){const _=K1(l,n.propertyName);_&&OS(Br(_),m=>{a.push(m)})}n.siblings=a}return n.siblings}function zrt(n){if(!n.resolvedProperties){const a=new Map;for(const l of _we(n))if(uv(l)&&!(Pn(l)&2097152))for(const _ of Wa(l))a.set(_.escapedName,_);n.resolvedProperties=fs(a.values())}return n.resolvedProperties}function Wrt(n,a){if(!(n.flags&4))return n;const l=Br(n),_=a&&uwe(a,n.escapedName,void 0),m=$de(l,_);return m===l?n:AS(n,m)}function Urt(n){const a=rt.get(n.escapedName);if(a)return a;const l=AS(n,ue);return l.flags|=16777216,rt.set(n.escapedName,l),l}function Vrt(n,a){const l=zs();for(const m of Ey(n))l.set(m.escapedName,Wrt(m,a));if(a)for(const m of zrt(a))l.has(m.escapedName)||l.set(m.escapedName,Urt(m));const _=Qo(n.symbol,l,ze,ze,Yc(zu(n),m=>Gm(m.keyType,nf(m.type),m.isReadonly)));return _.objectFlags|=Pn(n)&266240,_}function nf(n){return $de(n,void 0)}function $de(n,a){if(Pn(n)&196608){if(a===void 0&&n.widened)return n.widened;let l;if(n.flags&98305)l=G;else if(uv(n))l=Vrt(n,a);else if(n.flags&1048576){const _=a||uwe(void 0,void 0,n.types),m=Yc(n.types,h=>h.flags&98304?h:$de(h,_));l=Mn(m,ut(m,yh)?2:1)}else n.flags&2097152?l=fa(Yc(n.types,nf)):j2(n)&&(l=v0(n.target,Yc(uo(n),nf)));return l&&a===void 0&&(n.widened=l),l||n}return n}function DY(n){let a=!1;if(Pn(n)&65536){if(n.flags&1048576)if(ut(n.types,yh))a=!0;else for(const l of n.types)DY(l)&&(a=!0);if(j2(n))for(const l of uo(n))DY(l)&&(a=!0);if(uv(n))for(const l of Ey(n)){const _=Br(l);Pn(_)&65536&&(DY(_)||je(l.valueDeclaration,d.Object_literal_s_property_0_implicitly_has_an_1_type,ii(l),mr(nf(_))),a=!0)}}return a}function cv(n,a,l){const _=mr(nf(a));if(Hr(n)&&!O8(Or(n),J))return;let m;switch(n.kind){case 226:case 172:case 171:m=se?d.Member_0_implicitly_has_an_1_type:d.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 169:const h=n;if(Ie(h.name)){const x=Xy(h.name);if((cC(h.parent)||fg(h.parent)||pg(h.parent))&&h.parent.parameters.includes(h)&&(_c(h,h.name.escapedText,788968,void 0,h.name.escapedText,!0)||x&&Oz(x))){const N="arg"+h.parent.parameters.indexOf(h),F=eo(h.name)+(h.dotDotDotToken?"[]":"");Uf(se,n,d.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,N,F);return}}m=n.dotDotDotToken?se?d.Rest_parameter_0_implicitly_has_an_any_type:d.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:se?d.Parameter_0_implicitly_has_an_1_type:d.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 208:if(m=d.Binding_element_0_implicitly_has_an_1_type,!se)return;break;case 324:je(n,d.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,_);return;case 330:se&&vC(n.parent)&&je(n.parent.tagName,d.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation,_);return;case 262:case 174:case 173:case 177:case 178:case 218:case 219:if(se&&!n.name){l===3?je(n,d.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation,_):je(n,d.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,_);return}m=se?l===3?d._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:d._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:d._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;break;case 200:se&&je(n,d.Mapped_object_type_implicitly_has_an_any_template_type);return;default:m=se?d.Variable_0_implicitly_has_an_1_type:d.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage}Uf(se,n,m,eo(as(n)),_)}function PY(n,a,l){r(()=>{se&&Pn(a)&65536&&(!l||!Ame(n))&&(DY(a)||cv(n,a,l))})}function Xde(n,a,l){const _=sf(n),m=sf(a),h=n7(n),x=n7(a),N=x?m-1:m,F=h?N:Math.min(_,N),V=tv(n);if(V){const ne=tv(a);ne&&l(V,ne)}for(let ne=0;nea.typeParameter),Yt(n.inferences,(a,l)=>()=>(a.isFixed||($rt(n),wY(n.inferences),a.isFixed=!0),ome(n,l))))}function Grt(n){return Dde(Yt(n.inferences,a=>a.typeParameter),Yt(n.inferences,(a,l)=>()=>ome(n,l)))}function wY(n){for(const a of n)a.isFixed||(a.inferredType=void 0)}function Zde(n,a,l){(n.intraExpressionInferenceSites??(n.intraExpressionInferenceSites=[])).push({node:a,type:l})}function $rt(n){if(n.intraExpressionInferenceSites){for(const{node:a,type:l}of n.intraExpressionInferenceSites){const _=a.kind===174?nAe(a,2):d_(a,2);_&&Th(n.inferences,l,_)}n.intraExpressionInferenceSites=void 0}}function Kde(n){return{typeParameter:n,candidates:void 0,contraCandidates:void 0,inferredType:void 0,priority:void 0,topLevel:!0,isFixed:!1,impliedArity:void 0}}function fwe(n){return{typeParameter:n.typeParameter,candidates:n.candidates&&n.candidates.slice(),contraCandidates:n.contraCandidates&&n.contraCandidates.slice(),inferredType:n.inferredType,priority:n.priority,topLevel:n.topLevel,isFixed:n.isFixed,impliedArity:n.impliedArity}}function Xrt(n){const a=wn(n.inferences,r4);return a.length?Yde(Yt(a,fwe),n.signature,n.flags,n.compareTypes):void 0}function eme(n){return n&&n.mapper}function lv(n){const a=Pn(n);if(a&524288)return!!(a&1048576);const l=!!(n.flags&465829888||n.flags&524288&&!pwe(n)&&(a&4&&(n.node||ut(uo(n),lv))||a&16&&n.symbol&&n.symbol.flags&14384&&n.symbol.declarations||a&12583968)||n.flags&3145728&&!(n.flags&1024)&&!pwe(n)&&ut(n.types,lv));return n.flags&3899393&&(n.objectFlags|=524288|(l?1048576:0)),l}function pwe(n){if(n.aliasSymbol&&!n.aliasTypeArguments){const a=Wo(n.aliasSymbol,265);return!!(a&&Ar(a.parent,l=>l.kind===312?!0:l.kind===267?!1:"quit"))}return!1}function QN(n,a,l=0){return!!(n===a||n.flags&3145728&&ut(n.types,_=>QN(_,a,l))||l<3&&n.flags&16777216&&(QN(iv(n),a,l+1)||QN(sv(n),a,l+1)))}function Qrt(n,a){const l=Yf(n);return l?!!l.type&&QN(l.type,a):QN(Ma(n),a)}function Yrt(n){const a=zs();OS(n,_=>{if(!(_.flags&128))return;const m=zo(_.value),h=Aa(4,m);h.links.type=G,_.symbol&&(h.declarations=_.symbol.declarations,h.valueDeclaration=_.symbol.valueDeclaration),a.set(m,h)});const l=n.flags&4?[Gm(Fe,Us,!1)]:ze;return Qo(void 0,a,ze,ze,l)}function dwe(n,a,l){const _=n.id+","+a.id+","+l.id;if(hl.has(_))return hl.get(_);const m=n.id+","+(a.target||a).id;if(_s($u,m))return;$u.push(m);const h=Zrt(n,a,l);return $u.pop(),hl.set(_,h),h}function tme(n){return!(Pn(n)&262144)||uv(n)&&ut(Wa(n),a=>tme(Br(a)))||pa(n)&&ut(rv(n),tme)}function Zrt(n,a,l){if(!(Og(n,Fe)||Wa(n).length!==0&&tme(n)))return;if(ep(n))return uu(AY(uo(n)[0],a,l),bD(n));if(pa(n)){const m=Yt(rv(n),x=>AY(x,a,l)),h=qm(a)&4?Yc(n.target.elementFlags,x=>x&2?1:x):n.target.elementFlags;return yd(m,h,n.target.readonly,n.target.labeledElementDeclarations)}const _=Hf(1040,void 0);return _.source=n,_.mappedType=a,_.constraintType=l,_}function Krt(n){const a=yi(n);return a.type||(a.type=AY(n.links.propertyType,n.links.mappedType,n.links.constraintType)),a.type}function AY(n,a,l){const _=J_(l.type,md(a)),m=dh(a),h=Kde(_);return Th([h],n,m),mwe(h)||or}function*rme(n,a,l,_){const m=Wa(a);for(const h of m)if(!iPe(h)&&(l||!(h.flags&16777216||Ko(h)&48))){const x=Gs(n,h.escapedName);if(!x)yield h;else if(_){const N=Br(h);if(N.flags&109472){const F=Br(x);F.flags&1||t_(F)===t_(N)||(yield h)}}}}function nme(n,a,l,_){return T7(rme(n,a,l,_))}function ent(n,a){return!(a.target.combinedFlags&8)&&a.target.minLength>n.target.minLength||!a.target.hasRestElement&&(n.target.hasRestElement||a.target.fixedLengthVx(h,m),n)===n&&sme(n,a)}return!1}function ywe(n,a){if(n===a||a.flags&5)return!0;if(a.flags&2097152)return qi(a.types,l=>l===Fc||ywe(n,l));if(n.flags&128){const l=n.value;return!!(a.flags&8&&hwe(l,!1)||a.flags&64&&U5(l,!1)||a.flags&98816&&l===a.intrinsicName||a.flags&268435456&&sme(p_(l),a)||a.flags&134217728&&NY(n,a))}if(n.flags&134217728){const l=n.texts;return l.length===2&&l[0]===""&&l[1]===""&&ca(n.types[0],a)}return ca(n,a)}function vwe(n,a){return n.flags&128?bwe([n.value],ze,a):n.flags&134217728?zD(n.texts,a.texts)?Yt(n.types,int):bwe(n.texts,n.types,a):void 0}function NY(n,a){const l=vwe(n,a);return!!l&&qi(l,(_,m)=>ywe(_,a.types[m]))}function int(n){return n.flags&402653317?n:PS(["",""],[n])}function bwe(n,a,l){const _=n.length-1,m=n[0],h=n[_],x=l.texts,N=x.length-1,F=x[0],V=x[N];if(_===0&&m.length0){let Yr=xe,gr=Ne;for(;gr=nt(Yr).indexOf(_r,gr),!(gr>=0);){if(Yr++,Yr===n.length)return;gr=0}kt(Yr,gr),Ne+=_r.length}else if(Ne!_s(Cs,Ta)):fr,Wr?wn(jr,Ta=>!_s(Wr,Ta)):jr]}function Yr(fr,jr,vi){const Cs=fr.length!!Nr(Wr));if(!Cs||jr&&Cs!==jr)return;jr=Cs}return jr}function Er(fr,jr,vi){let Cs=0;if(vi&1048576){let Wr;const Ta=fr.flags&1048576?fr.types:[fr],so=new Array(Ta.length);let il=!1;for(const Ra of jr)if(Nr(Ra))Wr=Ra,Cs++;else for(let vl=0;vlso[Ec]?void 0:vl);if(Ra.length){xe(Mn(Ra),Wr);return}}}else for(const Wr of jr)Nr(Wr)?Cs++:xe(fr,Wr);if(vi&2097152?Cs===1:Cs>0)for(const Wr of jr)Nr(Wr)&&Ne(fr,Wr,1)}function hr(fr,jr,vi){if(vi.flags&1048576){let Cs=!1;for(const Wr of vi.types)Cs=hr(fr,jr,Wr)||Cs;return Cs}if(vi.flags&4194304){const Cs=Nr(vi.type);if(Cs&&!Cs.isFixed&&!gwe(fr)){const Wr=dwe(fr,jr,vi);Wr&&Ne(Wr,Cs.typeParameter,Pn(fr)&262144?16:8)}return!0}if(vi.flags&262144){Ne($m(fr,fr.pattern?2:0),vi,32);const Cs=CS(vi);if(Cs&&hr(fr,jr,Cs))return!0;const Wr=Yt(Wa(fr),Br),Ta=Yt(zu(fr),so=>so!==yn?so.type:Cn);return xe(Mn(Xi(Wr,Ta)),dh(jr)),!0}return!1}function sn(fr,jr){if(fr.flags&16777216)xe(fr.checkType,jr.checkType),xe(fr.extendsType,jr.extendsType),xe(iv(fr),iv(jr)),xe(sv(fr),sv(jr));else{const vi=[iv(jr),sv(jr)];kt(fr,vi,jr.flags,m?64:0)}}function ms(fr,jr){const vi=vwe(fr,jr),Cs=jr.types;if(vi||qi(jr.texts,Wr=>Wr.length===0))for(let Wr=0;WrSo|af.flags,0);if(!(Ec&4)){const So=Ta.value;Ec&296&&!hwe(So,!0)&&(Ec&=-297),Ec&2112&&!U5(So,!0)&&(Ec&=-2113);const af=Eu(vl,($e,de)=>de.flags&Ec?$e.flags&4?$e:de.flags&4?Ta:$e.flags&134217728?$e:de.flags&134217728&&NY(Ta,de)?Ta:$e.flags&268435456?$e:de.flags&268435456&&So===g8e(de.symbol,So)?Ta:$e.flags&128?$e:de.flags&128&&de.value===So?de:$e.flags&8?$e:de.flags&8?vd(+So):$e.flags&32?$e:de.flags&32?vd(+So):$e.flags&256?$e:de.flags&256&&de.value===+So?de:$e.flags&64?$e:de.flags&64?nnt(So):$e.flags&2048?$e:de.flags&2048&&Bv(de.value)===So?de:$e.flags&16?$e:de.flags&16?So==="true"?Zr:So==="false"?Wt:On:$e.flags&512?$e:de.flags&512&&de.intrinsicName===So?de:$e.flags&32768?$e:de.flags&32768&&de.intrinsicName===So?de:$e.flags&65536?$e:de.flags&65536&&de.intrinsicName===So?de:$e:$e,Cn);if(!(af.flags&131072)){xe(af,so);continue}}}}xe(Ta,so)}}function xs(fr,jr){var vi,Cs;if(Pn(fr)&4&&Pn(jr)&4&&(fr.target===jr.target||ep(fr)&&ep(jr))){Yr(uo(fr),uo(jr),Bde(fr.target));return}if(Af(fr)&&Af(jr)){xe(Ep(fr),Ep(jr)),xe(dh(fr),dh(jr));const Wr=y0(fr),Ta=y0(jr);Wr&&Ta&&xe(Wr,Ta)}if(Pn(jr)&32&&!jr.declaration.nameType){const Wr=Ep(jr);if(hr(fr,jr,Wr))return}if(!tnt(fr,jr)){if(j2(fr)){if(pa(jr)){const Wr=b0(fr),Ta=b0(jr),so=uo(jr),il=jr.target.elementFlags;if(pa(fr)&&Lrt(fr,jr)){for(let Ec=0;Ec0){const Ta=Ts(jr,vi),so=Ta.length;for(let il=0;il1){const a=wn(n,ame);if(a.length){const l=Mn(a,2);return Xi(wn(n,_=>!ame(_)),[l])}}return n}function lnt(n){return n.priority&416?fa(n.contraCandidates):Prt(n.contraCandidates)}function unt(n,a){const l=cnt(n.candidates),_=ont(n.typeParameter)||zx(n.typeParameter),m=!_&&n.topLevel&&(n.isFixed||!Qrt(a,n.typeParameter)),h=_?Yc(l,t_):m?Yc(l,B2):l,x=n.priority&416?Mn(h,2):Drt(h);return nf(x)}function ome(n,a){const l=n.inferences[a];if(!l.inferredType){let _,m;if(n.signature){const x=l.candidates?unt(l,n.signature):void 0,N=l.contraCandidates?lnt(l):void 0;if(x||N){const F=x&&(!N||!(x.flags&131072)&&ut(l.contraCandidates,V=>Fy(x,V))&&qi(n.inferences,V=>V!==l&&ku(V.typeParameter)!==l.typeParameter||qi(V.candidates,ne=>Fy(ne,x))));_=F?x:N,m=F?N:x}else if(n.flags&1)_=Ki;else{const F=ES(l.typeParameter);F&&(_=Ri(F,ztt(Jtt(n,a),n.nonFixingMapper)))}}else _=mwe(l);l.inferredType=_||cme(!!(n.flags&2));const h=ku(l.typeParameter);if(h){const x=Ri(h,n.nonFixingMapper);(!_||!n.compareTypes(_,rf(x,_)))&&(l.inferredType=m&&n.compareTypes(m,rf(x,m))?m:x)}}return l.inferredType}function cme(n){return n?G:or}function lme(n){const a=[];for(let l=0;lMu(a)||Jp(a)||X_(a)))}function IY(n,a,l,_){switch(n.kind){case 80:if(!pT(n)){const x=Qp(n);return x!==dt?`${_?Oa(_):"-1"}|${Wu(a)}|${Wu(l)}|${Xs(x)}`:void 0}case 110:return`0|${_?Oa(_):"-1"}|${Wu(a)}|${Wu(l)}`;case 235:case 217:return IY(n.expression,a,l,_);case 166:const m=IY(n.left,a,l,_);return m&&m+"."+n.right.escapedText;case 211:case 212:const h=NS(n);if(h!==void 0){const x=IY(n.expression,a,l,_);return x&&x+"."+h}break;case 206:case 207:case 262:case 218:case 219:case 174:return`${Oa(n)}#${Wu(a)}`}}function Yl(n,a){switch(a.kind){case 217:case 235:return Yl(n,a.expression);case 226:return sl(a)&&Yl(n,a.left)||Gr(a)&&a.operatorToken.kind===28&&Yl(n,a.right)}switch(n.kind){case 236:return a.kind===236&&n.keywordToken===a.keywordToken&&n.name.escapedText===a.name.escapedText;case 80:case 81:return pT(n)?a.kind===110:a.kind===80&&Qp(n)===Qp(a)||(Ei(a)||Pa(a))&&kp(Qp(n))===cn(a);case 110:return a.kind===110;case 108:return a.kind===108;case 235:case 217:return Yl(n.expression,a);case 211:case 212:const l=NS(n),_=co(a)?NS(a):void 0;return l!==void 0&&_!==void 0&&_===l&&Yl(n.expression,a.expression);case 166:return co(a)&&n.right.escapedText===NS(a)&&Yl(n.left,a.expression);case 226:return Gr(n)&&n.operatorToken.kind===28&&Yl(n.right,a)}return!1}function NS(n){if(bn(n))return n.name.escapedText;if(mo(n))return _nt(n);if(Pa(n)){const a=Za(n);return a?zo(a):void 0}if(us(n))return""+n.parent.parameters.indexOf(n)}function _me(n){return n.flags&8192?n.escapedName:n.flags&384?zo(""+n.value):void 0}function _nt(n){return _f(n.argumentExpression)?zo(n.argumentExpression.text):oc(n.argumentExpression)?fnt(n.argumentExpression):void 0}function fnt(n){const a=lo(n,111551,!0);if(!a||!(DD(a)||a.flags&8))return;const l=a.valueDeclaration;if(l===void 0)return;const _=Le(l);if(_){const m=_me(_);if(m!==void 0)return m}if(ab(l)&&u0(l,n)){const m=XP(l);if(m)return _me(Zl(m));if($v(l))return Dk(l.name)}}function Twe(n,a){for(;co(n);)if(n=n.expression,Yl(n,a))return!0;return!1}function IS(n,a){for(;gu(n);)if(n=n.expression,Yl(n,a))return!0;return!1}function xD(n,a){if(n&&n.flags&1048576){const l=TPe(n,a);if(l&&Ko(l)&2)return l.links.isDiscriminantProperty===void 0&&(l.links.isDiscriminantProperty=(l.links.checkFlags&192)===192&&!hD(Br(l))),!!l.links.isDiscriminantProperty}return!1}function xwe(n,a){let l;for(const _ of n)if(xD(a,_.escapedName)){if(l){l.push(_);continue}l=[_]}return l}function pnt(n,a){const l=new Map;let _=0;for(const m of n)if(m.flags&61603840){const h=q(m,a);if(h){if(!qN(h))return;let x=!1;OS(h,N=>{const F=Wu(t_(N)),V=l.get(F);V?V!==or&&(l.set(F,or),x=!0):l.set(F,m)}),x||_++}}return _>=10&&_*2>=n.length?l:void 0}function hR(n){const a=n.types;if(!(a.length<10||Pn(n)&32768||Ch(a,l=>!!(l.flags&59506688))<10)){if(n.keyPropertyName===void 0){const l=Zt(a,m=>m.flags&59506688?Zt(Wa(m),h=>bd(Br(h))?h.escapedName:void 0):void 0),_=l&&pnt(a,l);n.keyPropertyName=_?l:"",n.constituentMap=_}return n.keyPropertyName.length?n.keyPropertyName:void 0}}function yR(n,a){var l;const _=(l=n.constituentMap)==null?void 0:l.get(Wu(t_(a)));return _!==or?_:void 0}function kwe(n,a){const l=hR(n),_=l&&q(a,l);return _&&yR(n,_)}function dnt(n,a){const l=hR(n),_=l&&kn(a.properties,h=>h.symbol&&h.kind===303&&h.symbol.escapedName===l&&ER(h.initializer)),m=_&&GR(_.initializer);return m&&yR(n,m)}function Cwe(n,a){return Yl(n,a)||Twe(n,a)}function Ewe(n,a){if(n.arguments){for(const l of n.arguments)if(Cwe(a,l)||IS(l,a))return!0}return!!(n.expression.kind===211&&Cwe(a,n.expression.expression))}function fme(n){return(!n.id||n.id<0)&&(n.id=Mie,Mie++),n.id}function mnt(n,a){if(!(n.flags&1048576))return ca(n,a);for(const l of n.types)if(ca(l,a))return!0;return!1}function gnt(n,a){if(n===a)return n;if(a.flags&131072)return a;const l=`A${Wu(n)},${Wu(a)}`;return sS(l)??m2(l,hnt(n,a))}function hnt(n,a){const l=jc(n,m=>mnt(a,m)),_=a.flags&512&&M2(a)?Io(l,Gx):l;return ca(a,_)?_:n}function pme(n){const a=gd(n);return!!(a.callSignatures.length||a.constructSignatures.length||a.members.get("bind")&&Fy(n,St))}function kD(n,a){return dme(n,a)&a}function wp(n,a){return kD(n,a)!==0}function dme(n,a){n.flags&467927040&&(n=Ku(n)||or);const l=n.flags;if(l&268435460)return H?16317953:16776705;if(l&134217856){const _=l&128&&n.value==="";return H?_?12123649:7929345:_?12582401:16776705}if(l&40)return H?16317698:16776450;if(l&256){const _=n.value===0;return H?_?12123394:7929090:_?12582146:16776450}if(l&64)return H?16317188:16775940;if(l&2048){const _=owe(n);return H?_?12122884:7928580:_?12581636:16775940}return l&16?H?16316168:16774920:l&528?H?n===Wt||n===Lr?12121864:7927560:n===Wt||n===Lr?12580616:16774920:l&524288?a&(H?83427327:83886079)?Pn(n)&16&&yh(n)?H?83427327:83886079:pme(n)?H?7880640:16728e3:H?7888800:16736160:0:l&16384?9830144:l&32768?26607360:l&65536?42917664:l&12288?H?7925520:16772880:l&67108864?H?7888800:16736160:l&131072?0:l&1048576?Eu(n.types,(_,m)=>_|dme(m,a),0):l&2097152?ynt(n,a):83886079}function ynt(n,a){const l=Yo(n,402784252);let _=0,m=134217727;for(const h of n.types)if(!(l&&h.flags&524288)){const x=dme(h,a);_|=x,m&=x}return _&8256|m&134209471}function Ap(n,a){return jc(n,l=>wp(l,a))}function FS(n,a){const l=Dwe(Ap(H&&n.flags&2?Ao:n,a));if(H)switch(a){case 524288:return Io(l,_=>wp(_,65536)?fa([_,wp(_,131072)&&!Yo(l,65536)?Mn([Us,De]):Us]):_);case 1048576:return Io(l,_=>wp(_,131072)?fa([_,wp(_,65536)&&!Yo(l,32768)?Mn([Us,j]):Us]):_);case 2097152:case 4194304:return Io(l,_=>wp(_,262144)?jrt(_):_)}return l}function Dwe(n){return n===Ao?or:n}function mme(n,a){return a?Mn([di(n),Zl(a)]):n}function Pwe(n,a){var l;const _=S0(a);if(!pp(_))return st;const m=dp(_);return q(n,m)||YN((l=Wx(n,m))==null?void 0:l.type)||st}function wwe(n,a){return Nf(n,SD)&&wrt(n,a)||YN(E0(65,n,j,void 0))||st}function YN(n){return n&&(J.noUncheckedIndexedAccess?Mn([n,ee]):n)}function Awe(n){return uu(E0(65,n,j,void 0)||st)}function vnt(n){return n.parent.kind===209&&gme(n.parent)||n.parent.kind===303&&gme(n.parent.parent)?mme(vR(n),n.right):Zl(n.right)}function gme(n){return n.parent.kind===226&&n.parent.left===n||n.parent.kind===250&&n.parent.initializer===n}function bnt(n,a){return wwe(vR(n),n.elements.indexOf(a))}function Snt(n){return Awe(vR(n.parent))}function Nwe(n){return Pwe(vR(n.parent),n.name)}function Tnt(n){return mme(Nwe(n),n.objectAssignmentInitializer)}function vR(n){const{parent:a}=n;switch(a.kind){case 249:return Fe;case 250:return KR(a)||st;case 226:return vnt(a);case 220:return j;case 209:return bnt(a,n);case 230:return Snt(a);case 303:return Nwe(a);case 304:return Tnt(a)}return st}function xnt(n){const a=n.parent,l=Fwe(a.parent),_=a.kind===206?Pwe(l,n.propertyName||n.name):n.dotDotDotToken?Awe(l):wwe(l,a.elements.indexOf(n));return mme(_,n.initializer)}function Iwe(n){return Wn(n).resolvedType||Zl(n)}function knt(n){return n.initializer?Iwe(n.initializer):n.parent.parent.kind===249?Fe:n.parent.parent.kind===250&&KR(n.parent.parent)||st}function Fwe(n){return n.kind===260?knt(n):xnt(n)}function Cnt(n){return n.kind===260&&n.initializer&&Ig(n.initializer)||n.kind!==208&&n.parent.kind===226&&Ig(n.parent.right)}function J2(n){switch(n.kind){case 217:return J2(n.expression);case 226:switch(n.operatorToken.kind){case 64:case 76:case 77:case 78:return J2(n.left);case 28:return J2(n.right)}}return n}function Owe(n){const{parent:a}=n;return a.kind===217||a.kind===226&&a.operatorToken.kind===64&&a.left===n||a.kind===226&&a.operatorToken.kind===28&&a.right===n?Owe(a):n}function Ent(n){return n.kind===296?t_(Zl(n.expression)):Cn}function FY(n){const a=Wn(n);if(!a.switchTypes){a.switchTypes=[];for(const l of n.caseBlock.clauses)a.switchTypes.push(Ent(l))}return a.switchTypes}function Lwe(n){if(ut(n.caseBlock.clauses,l=>l.kind===296&&!Ja(l.expression)))return;const a=[];for(const l of n.caseBlock.clauses){const _=l.kind===296?l.expression.text:void 0;a.push(_&&!_s(a,_)?_:void 0)}return a}function Dnt(n,a){return n.flags&1048576?!Zt(n.types,l=>!_s(a,l)):_s(a,n)}function CD(n,a){return!!(n===a||n.flags&131072||a.flags&1048576&&Pnt(n,a))}function Pnt(n,a){if(n.flags&1048576){for(const l of n.types)if(!wy(a.types,l))return!1;return!0}return n.flags&1056&&BQ(n)===a?!0:wy(a.types,n)}function OS(n,a){return n.flags&1048576?Zt(n.types,a):a(n)}function em(n,a){return n.flags&1048576?ut(n.types,a):a(n)}function Nf(n,a){return n.flags&1048576?qi(n.types,a):a(n)}function wnt(n,a){return n.flags&3145728?qi(n.types,a):a(n)}function jc(n,a){if(n.flags&1048576){const l=n.types,_=wn(l,a);if(_===l)return n;const m=n.origin;let h;if(m&&m.flags&1048576){const x=m.types,N=wn(x,F=>!!(F.flags&1048576)||a(F));if(x.length-N.length===l.length-_.length){if(N.length===1)return N[0];h=mde(1048576,N)}}return hde(_,n.objectFlags&16809984,void 0,void 0,h)}return n.flags&131072||a(n)?n:Cn}function OY(n,a){return jc(n,l=>l!==a)}function Ant(n){return n.flags&1048576?n.types.length:1}function Io(n,a,l){if(n.flags&131072)return n;if(!(n.flags&1048576))return a(n);const _=n.origin,m=_&&_.flags&1048576?_.types:n.types;let h,x=!1;for(const N of m){const F=N.flags&1048576?Io(N,a,l):a(N);x||(x=N!==F),F&&(h?h.push(F):h=[F])}return x?h&&Mn(h,l?0:1):n}function Mwe(n,a,l,_){return n.flags&1048576&&l?Mn(Yt(n.types,a),1,l,_):Io(n,a)}function ED(n,a){return jc(n,l=>(l.flags&a)!==0)}function Rwe(n,a){return Yo(n,134217804)&&Yo(a,402655616)?Io(n,l=>l.flags&4?ED(a,402653316):qx(l)&&!Yo(a,402653188)?ED(a,128):l.flags&8?ED(a,264):l.flags&64?ED(a,2112):l):n}function Q6(n){return n.flags===0}function LS(n){return n.flags===0?n.type:n}function Y6(n,a){return a?{flags:0,type:n.flags&131072?Ki:n}:n}function Nnt(n){const a=Hf(256);return a.elementType=n,a}function hme(n){return Ue[n.id]||(Ue[n.id]=Nnt(n))}function jwe(n,a){const l=$N(bh(GR(a)));return CD(l,n.elementType)?n:hme(Mn([n.elementType,l]))}function Int(n){return n.flags&131072?Oc:uu(n.flags&1048576?Mn(n.types,2):n)}function Fnt(n){return n.finalArrayType||(n.finalArrayType=Int(n.elementType))}function bR(n){return Pn(n)&256?Fnt(n):n}function Ont(n){return Pn(n)&256?n.elementType:Cn}function Lnt(n){let a=!1;for(const l of n)if(!(l.flags&131072)){if(!(Pn(l)&256))return!1;a=!0}return a}function Bwe(n){const a=Owe(n),l=a.parent,_=bn(l)&&(l.name.escapedText==="length"||l.parent.kind===213&&Ie(l.name)&&lz(l.name)),m=l.kind===212&&l.expression===a&&l.parent.kind===226&&l.parent.operatorToken.kind===64&&l.parent.left===l&&!og(l.parent)&&Ml(Zl(l.argumentExpression),296);return _||m}function Mnt(n){return(Ei(n)||Es(n)||ff(n)||us(n))&&!!(Wl(n)||Hr(n)&&J0(n)&&n.initializer&&Jv(n.initializer)&&up(n.initializer))}function LY(n,a){if(n=Cc(n),n.flags&8752)return Br(n);if(n.flags&7){if(Ko(n)&262144){const _=n.links.syntheticOrigin;if(_&&LY(_))return Br(n)}const l=n.valueDeclaration;if(l){if(Mnt(l))return Br(n);if(Ei(l)&&l.parent.parent.kind===250){const _=l.parent.parent,m=SR(_.expression,void 0);if(m){const h=_.awaitModifier?15:13;return E0(h,m,j,void 0)}}a&&ua(a,mn(l,d._0_needs_an_explicit_type_annotation,ii(n)))}}}function SR(n,a){if(!(n.flags&67108864))switch(n.kind){case 80:const l=kp(Qp(n));return LY(l,a);case 110:return tit(n);case 108:return xme(n);case 211:{const _=SR(n.expression,a);if(_){const m=n.name;let h;if(Ti(m)){if(!_.symbol)return;h=Gs(_,f8(_.symbol,m.escapedText))}else h=Gs(_,m.escapedText);return h&&LY(h,a)}return}case 217:return SR(n.expression,a)}}function TR(n){const a=Wn(n);let l=a.effectsSignature;if(l===void 0){let _;if(Gr(n)){const x=Z6(n.right);_=dge(x)}else n.parent.kind===244?_=SR(n.expression,void 0):n.expression.kind!==108&&(gu(n)?_=tm(HN(Ui(n.expression),n.expression),n.expression):_=Z6(n.expression));const m=Ts(_&&e_(_)||or,0),h=m.length===1&&!m[0].typeParameters?m[0]:ut(m,Jwe)?e4(n):void 0;l=a.effectsSignature=h&&Jwe(h)?h:dr}return l===dr?void 0:l}function Jwe(n){return!!(Yf(n)||n.declaration&&(V6(n.declaration)||or).flags&131072)}function Rnt(n,a){if(n.kind===1||n.kind===3)return a.arguments[n.parameterIndex];const l=Ha(a.expression);return co(l)?Ha(l.expression):void 0}function jnt(n){const a=Ar(n,fJ),l=Or(n),_=Sm(l,a.statements.pos);wa.add(xl(l,_.start,_.length,d.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis))}function xR(n){const a=MY(n,!1);return Rr=n,nr=a,a}function kR(n){const a=Ha(n,!0);return a.kind===97||a.kind===226&&(a.operatorToken.kind===56&&(kR(a.left)||kR(a.right))||a.operatorToken.kind===57&&kR(a.left)&&kR(a.right))}function MY(n,a){for(;;){if(n===Rr)return nr;const l=n.flags;if(l&4096){if(!a){const _=fme(n),m=bx[_];return m!==void 0?m:bx[_]=MY(n,!0)}a=!1}if(l&368)n=n.antecedent;else if(l&512){const _=TR(n.node);if(_){const m=Yf(_);if(m&&m.kind===3&&!m.type){const h=n.node.arguments[m.parameterIndex];if(h&&kR(h))return!1}if(Ma(_).flags&131072)return!1}n=n.antecedent}else{if(l&4)return ut(n.antecedents,_=>MY(_,!1));if(l&8){const _=n.antecedents;if(_===void 0||_.length===0)return!1;n=_[0]}else if(l&128){if(n.clauseStart===n.clauseEnd&&gNe(n.switchStatement))return!1;n=n.antecedent}else if(l&1024){Rr=void 0;const _=n.target,m=_.antecedents;_.antecedents=n.antecedents;const h=MY(n.antecedent,!1);return _.antecedents=m,h}else return!(l&1)}}}function RY(n,a){for(;;){const l=n.flags;if(l&4096){if(!a){const _=fme(n),m=nS[_];return m!==void 0?m:nS[_]=RY(n,!0)}a=!1}if(l&496)n=n.antecedent;else if(l&512){if(n.node.expression.kind===108)return!0;n=n.antecedent}else{if(l&4)return qi(n.antecedents,_=>RY(_,!1));if(l&8)n=n.antecedents[0];else if(l&1024){const _=n.target,m=_.antecedents;_.antecedents=n.antecedents;const h=RY(n.antecedent,!1);return _.antecedents=m,h}else return!!(l&1)}}}function zwe(n){switch(n.kind){case 110:return!0;case 80:if(!pT(n)){const a=Qp(n);return DD(a)||Yz(a)&&!jY(a)}break;case 211:case 212:return zwe(n.expression)&&Td(Wn(n).resolvedSymbol||dt)}return!1}function Ry(n,a,l=a,_,m=(h=>(h=Jn(n,s8))==null?void 0:h.flowNode)()){let h,x=!1,N=0;if(Rt)return st;if(!m)return a;tr++;const F=bt,V=LS(xe(m));bt=F;const ne=Pn(V)&256&&Bwe(n)?Oc:bR(V);if(ne===_i||n.parent&&n.parent.kind===235&&!(ne.flags&131072)&&Ap(ne,2097152).flags&131072)return a;return ne===U?or:ne;function le(){return x?h:(x=!0,h=IY(n,a,l,_))}function xe(Ke){var xt;if(N===2e3)return(xt=Jr)==null||xt.instant(Jr.Phase.CheckTypes,"getTypeAtFlowNode_DepthLimit",{flowId:Ke.id}),Rt=!0,jnt(n),st;N++;let Vt;for(;;){const jt=Ke.flags;if(jt&4096){for(let vr=F;vr=0&&Vt.parameterIndex!(vr.flags&163840)):xt.kind===221&&IS(xt.expression,n)&&(jt=so(jt,Ke.switchStatement,Ke.clauseStart,Ke.clauseEnd,vr=>!(vr.flags&131072||vr.flags&128&&vr.value==="undefined"))));const $t=hr(xt,jt);$t&&(jt=xs(jt,$t,Ke.switchStatement,Ke.clauseStart,Ke.clauseEnd))}return Y6(jt,Q6(Vt))}function Ut(Ke){const xt=[];let Vt=!1,jt=!1,$t;for(const vr of Ke.antecedents){if(!$t&&vr.flags&128&&vr.clauseStart===vr.clauseEnd){$t=vr;continue}const ai=xe(vr),Un=LS(ai);if(Un===a&&a===l)return Un;tp(xt,Un),CD(Un,l)||(Vt=!0),Q6(ai)&&(jt=!0)}if($t){const vr=xe($t),ai=LS(vr);if(!(ai.flags&131072)&&!_s(xt,ai)&&!gNe($t.switchStatement)){if(ai===a&&a===l)return ai;xt.push(ai),CD(ai,l)||(Vt=!0),Q6(vr)&&(jt=!0)}}return Y6(Sr(xt,Vt?2:1),jt)}function Nr(Ke){const xt=fme(Ke),Vt=hx[xt]||(hx[xt]=new Map),jt=le();if(!jt)return a;const $t=Vt.get(jt);if($t)return $t;for(let pr=Ee;pr{const pr=ge(Hi,jt)||or;return!(pr.flags&131072)&&!(Un.flags&131072)&&uR(Un,pr)})}function ms(Ke,xt,Vt,jt,$t){if((Vt===37||Vt===38)&&Ke.flags&1048576){const vr=hR(Ke);if(vr&&vr===NS(xt)){const ai=yR(Ke,Zl(jt));if(ai)return Vt===($t?37:38)?ai:bd(q(ai,vr)||or)?OY(Ke,ai):Ke}}return sn(Ke,xt,vr=>Cs(vr,Vt,jt,$t))}function xs(Ke,xt,Vt,jt,$t){if(jt<$t&&Ke.flags&1048576&&hR(Ke)===NS(xt)){const vr=FY(Vt).slice(jt,$t),ai=Mn(Yt(vr,Un=>yR(Ke,Un)||or));if(ai!==or)return ai}return sn(Ke,xt,vr=>il(vr,Vt,jt,$t))}function vs(Ke,xt,Vt){if(Yl(n,xt))return FS(Ke,Vt?4194304:8388608);H&&Vt&&IS(xt,n)&&(Ke=FS(Ke,2097152));const jt=hr(xt,Ke);return jt?sn(Ke,jt,$t=>Ap($t,Vt?4194304:8388608)):Ke}function Vi(Ke,xt,Vt){const jt=Gs(Ke,xt);return jt?!!(jt.flags&16777216||Ko(jt)&48)||Vt:!!Wx(Ke,xt)||!Vt}function Cu(Ke,xt,Vt){const jt=dp(xt);if(em(Ke,vr=>Vi(vr,jt,!0)))return jc(Ke,vr=>Vi(vr,jt,Vt));if(Vt){const vr=Uet();if(vr)return fa([Ke,H6(vr,[xt,or])])}return Ke}function If(Ke,xt,Vt,jt,$t){return $t=$t!==(Vt.kind===112)!=(jt!==38&&jt!==36),Sn(Ke,xt,$t)}function fr(Ke,xt,Vt){switch(xt.operatorToken.kind){case 64:case 76:case 77:case 78:return vs(Sn(Ke,xt.right,Vt),xt.left,Vt);case 35:case 36:case 37:case 38:const jt=xt.operatorToken.kind,$t=J2(xt.left),vr=J2(xt.right);if($t.kind===221&&Ja(vr))return Wr(Ke,$t,jt,vr,Vt);if(vr.kind===221&&Ja($t))return Wr(Ke,vr,jt,$t,Vt);if(Yl(n,$t))return Cs(Ke,jt,vr,Vt);if(Yl(n,vr))return Cs(Ke,jt,$t,Vt);H&&(IS($t,n)?Ke=vi(Ke,jt,vr,Vt):IS(vr,n)&&(Ke=vi(Ke,jt,$t,Vt)));const ai=hr($t,Ke);if(ai)return ms(Ke,ai,jt,vr,Vt);const Un=hr(vr,Ke);if(Un)return ms(Ke,Un,jt,$t,Vt);if(af($t))return $e(Ke,jt,vr,Vt);if(af(vr))return $e(Ke,jt,$t,Vt);if(O4(vr)&&!co($t))return If(Ke,$t,vr,jt,Vt);if(O4($t)&&!co(vr))return If(Ke,vr,$t,jt,Vt);break;case 104:return de(Ke,xt,Vt);case 103:if(Ti(xt.left))return jr(Ke,xt,Vt);const Hi=J2(xt.right);if(GN(Ke)&&co(n)&&Yl(n.expression,Hi)){const pr=Zl(xt.left);if(pp(pr)&&NS(n)===dp(pr))return Ap(Ke,Vt?524288:65536)}if(Yl(n,Hi)){const pr=Zl(xt.left);if(pp(pr))return Cu(Ke,pr,Vt)}break;case 28:return Sn(Ke,xt.right,Vt);case 56:return Vt?Sn(Sn(Ke,xt.left,!0),xt.right,!0):Mn([Sn(Ke,xt.left,!1),Sn(Ke,xt.right,!1)]);case 57:return Vt?Mn([Sn(Ke,xt.left,!0),Sn(Ke,xt.right,!0)]):Sn(Sn(Ke,xt.left,!1),xt.right,!1)}return Ke}function jr(Ke,xt,Vt){const jt=J2(xt.right);if(!Yl(n,jt))return Ke;E.assertNode(xt.left,Ti);const $t=XY(xt.left);if($t===void 0)return Ke;const vr=$t.parent,ai=Uc(E.checkDefined($t.valueDeclaration,"should always have a declaration"))?Br(vr):bo(vr);return dn(Ke,ai,Vt,!0)}function vi(Ke,xt,Vt,jt){const $t=xt===35||xt===37,vr=xt===35||xt===36?98304:32768,ai=Zl(Vt);return $t!==jt&&Nf(ai,Hi=>!!(Hi.flags&vr))||$t===jt&&Nf(ai,Hi=>!(Hi.flags&(3|vr)))?FS(Ke,2097152):Ke}function Cs(Ke,xt,Vt,jt){if(Ke.flags&1)return Ke;(xt===36||xt===38)&&(jt=!jt);const $t=Zl(Vt),vr=xt===35||xt===36;if($t.flags&98304){if(!H)return Ke;const ai=vr?jt?262144:2097152:$t.flags&65536?jt?131072:1048576:jt?65536:524288;return FS(Ke,ai)}if(jt){if(!vr&&(Ke.flags&2||em(Ke,vh))){if($t.flags&469893116||vh($t))return $t;if($t.flags&524288)return ia}const ai=jc(Ke,Un=>uR(Un,$t)||vr&&Brt(Un,$t));return Rwe(ai,$t)}return bd($t)?jc(Ke,ai=>!(nwe(ai)&&uR(ai,$t))):Ke}function Wr(Ke,xt,Vt,jt,$t){(Vt===36||Vt===38)&&($t=!$t);const vr=J2(xt.expression);if(!Yl(n,vr)){H&&IS(vr,n)&&$t===(jt.text!=="undefined")&&(Ke=FS(Ke,2097152));const ai=hr(vr,Ke);return ai?sn(Ke,ai,Un=>Ta(Un,jt,$t)):Ke}return Ta(Ke,jt,$t)}function Ta(Ke,xt,Vt){return Vt?Ra(Ke,xt.text):FS(Ke,nV.get(xt.text)||32768)}function so(Ke,xt,Vt,jt,$t){return Vt!==jt&&qi(FY(xt).slice(Vt,jt),$t)?Ap(Ke,2097152):Ke}function il(Ke,xt,Vt,jt){const $t=FY(xt);if(!$t.length)return Ke;const vr=$t.slice(Vt,jt),ai=Vt===jt||_s(vr,Cn);if(Ke.flags&2&&!ai){let Vn;for(let mi=0;miuR(Un,Vn)),Un);if(!ai)return Hi;const pr=jc(Ke,Vn=>!(nwe(Vn)&&_s($t,t_(Nrt(Vn)))));return Hi.flags&131072?pr:Mn([Hi,pr])}function Ra(Ke,xt){switch(xt){case"string":return vl(Ke,Fe,1);case"number":return vl(Ke,vt,2);case"bigint":return vl(Ke,Lt,4);case"boolean":return vl(Ke,On,8);case"symbol":return vl(Ke,Ln,16);case"object":return Ke.flags&1?Ke:Mn([vl(Ke,ia,32),vl(Ke,De,131072)]);case"function":return Ke.flags&1?Ke:vl(Ke,St,64);case"undefined":return vl(Ke,j,65536)}return vl(Ke,ia,128)}function vl(Ke,xt,Vt){return Io(Ke,jt=>Kd(jt,xt,Wf)?wp(jt,Vt)?jt:Cn:Fy(xt,jt)?xt:wp(jt,Vt)?fa([jt,xt]):Cn)}function Ec(Ke,xt,Vt,jt){const $t=Lwe(xt);if(!$t)return Ke;const vr=Dc(xt.caseBlock.clauses,Hi=>Hi.kind===297);if(Vt===jt||vr>=Vt&&vrkD(pr,Hi)===Hi)}const Un=$t.slice(Vt,jt);return Mn(Yt(Un,Hi=>Hi?Ra(Ke,Hi):Cn))}function So(Ke,xt,Vt,jt){const $t=Dc(xt.caseBlock.clauses,Un=>Un.kind===297),vr=Vt===jt||$t>=Vt&&$tUn.kind===296?Sn(Ke,Un.expression,!0):Cn))}function af(Ke){return(bn(Ke)&&an(Ke.name)==="constructor"||mo(Ke)&&Ja(Ke.argumentExpression)&&Ke.argumentExpression.text==="constructor")&&Yl(n,Ke.expression)}function $e(Ke,xt,Vt,jt){if(jt?xt!==35&&xt!==37:xt!==36&&xt!==38)return Ke;const $t=Zl(Vt);if(!qge($t)&&!fi($t))return Ke;const vr=Gs($t,"prototype");if(!vr)return Ke;const ai=Br(vr),Un=Ae(ai)?void 0:ai;if(!Un||Un===ye||Un===St)return Ke;if(Ae(Ke))return Un;return jc(Ke,pr=>Hi(pr,Un));function Hi(pr,Vn){return pr.flags&524288&&Pn(pr)&1||Vn.flags&524288&&Pn(Vn)&1?pr.symbol===Vn.symbol:Fy(pr,Vn)}}function de(Ke,xt,Vt){const jt=J2(xt.left);if(!Yl(n,jt))return Vt&&H&&IS(jt,n)?FS(Ke,2097152):Ke;const $t=xt.right,vr=Zl($t);if(!ov(vr,ye))return Ke;const ai=TR(xt),Un=ai&&Yf(ai);if(Un&&Un.kind===1&&Un.parameterIndex===0)return dn(Ke,Un.type,Vt,!0);if(!ov(vr,St))return Ke;const Hi=Io(vr,qr);return Ae(Ke)&&(Hi===ye||Hi===St)||!Vt&&!(Hi.flags&524288&&!vh(Hi))?Ke:dn(Ke,Hi,Vt,!0)}function qr(Ke){const xt=q(Ke,"prototype");if(xt&&!Ae(xt))return xt;const Vt=Ts(Ke,1);return Vt.length?Mn(Yt(Vt,jt=>Ma(MN(jt)))):Us}function dn(Ke,xt,Vt,jt){const $t=Ke.flags&1048576?`N${Wu(Ke)},${Wu(xt)},${(Vt?1:0)|(jt?2:0)}`:void 0;return sS($t)??m2($t,Zn(Ke,xt,Vt,jt))}function Zn(Ke,xt,Vt,jt){if(!Vt){if(jt)return jc(Ke,Hi=>!ov(Hi,xt));const Un=dn(Ke,xt,!0,!1);return jc(Ke,Hi=>!CD(Hi,Un))}if(Ke.flags&3)return xt;const $t=jt?ov:Fy,vr=Ke.flags&1048576?hR(Ke):void 0,ai=Io(xt,Un=>{const Hi=vr&&q(Un,vr),pr=Hi&&yR(Ke,Hi),Vn=Io(pr||Ke,jt?mi=>ov(mi,Un)?mi:ov(Un,mi)?Un:Cn:mi=>j8e(mi,Un)?mi:j8e(Un,mi)?Un:Fy(mi,Un)?mi:Fy(Un,mi)?Un:Cn);return Vn.flags&131072?Io(Ke,mi=>Yo(mi,465829888)&&$t(Un,Ku(mi)||or)?fa([mi,Un]):Cn):Vn});return ai.flags&131072?Fy(xt,Ke)?xt:ca(Ke,xt)?Ke:ca(xt,Ke)?xt:fa([Ke,xt]):ai}function Xn(Ke,xt,Vt){if(Ewe(xt,n)){const jt=Vt||!tb(xt)?TR(xt):void 0,$t=jt&&Yf(jt);if($t&&($t.kind===0||$t.kind===1))return ui(Ke,$t,xt,Vt)}if(GN(Ke)&&co(n)&&bn(xt.expression)){const jt=xt.expression;if(Yl(n.expression,J2(jt.expression))&&Ie(jt.name)&&jt.name.escapedText==="hasOwnProperty"&&xt.arguments.length===1){const $t=xt.arguments[0];if(Ja($t)&&NS(n)===zo($t.text))return Ap(Ke,Vt?524288:65536)}}return Ke}function ui(Ke,xt,Vt,jt){if(xt.type&&!(Ae(Ke)&&(xt.type===ye||xt.type===St))){const $t=Rnt(xt,Vt);if($t){if(Yl(n,$t))return dn(Ke,xt.type,jt,!1);H&&IS($t,n)&&(jt&&!wp(xt.type,65536)||!jt&&Nf(xt.type,IR))&&(Ke=FS(Ke,2097152));const vr=hr($t,Ke);if(vr)return sn(Ke,vr,ai=>dn(ai,xt.type,jt,!1))}}return Ke}function Sn(Ke,xt,Vt){if(fI(xt)||Gr(xt.parent)&&(xt.parent.operatorToken.kind===61||xt.parent.operatorToken.kind===78)&&xt.parent.left===xt)return un(Ke,xt,Vt);switch(xt.kind){case 80:if(!Yl(n,xt)&&w<5){const jt=Qp(xt);if(DD(jt)){const $t=jt.valueDeclaration;if($t&&Ei($t)&&!$t.type&&$t.initializer&&zwe(n)){w++;const vr=Sn(Ke,$t.initializer,Vt);return w--,vr}}}case 110:case 108:case 211:case 212:return vs(Ke,xt,Vt);case 213:return Xn(Ke,xt,Vt);case 217:case 235:return Sn(Ke,xt.expression,Vt);case 226:return fr(Ke,xt,Vt);case 224:if(xt.operator===54)return Sn(Ke,xt.operand,!Vt);break}return Ke}function un(Ke,xt,Vt){if(Yl(n,xt))return FS(Ke,Vt?2097152:262144);const jt=hr(xt,Ke);return jt?sn(Ke,jt,$t=>Ap($t,Vt?2097152:262144)):Ke}}function Bnt(n,a){if(n=kp(n),(a.kind===80||a.kind===81)&&(cE(a)&&(a=a.parent),sg(a)&&(!og(a)||gT(a)))){const l=xY(gT(a)&&a.kind===211?GY(a,void 0,!0):Zl(a));if(kp(Wn(a).resolvedSymbol)===n)return l}return $g(a)&&Lh(a.parent)&&za(a.parent)?LQ(a.parent.symbol):Ez(a)&&gT(a.parent)?TS(n):ky(n)}function ZN(n){return Ar(n.parent,a=>ks(a)&&!_b(a)||a.kind===268||a.kind===312||a.kind===172)}function jY(n){if(!n.valueDeclaration)return!1;const a=Tm(n.valueDeclaration).parent,l=Wn(a);return l.flags&131072||(l.flags|=131072,Jnt(a)||Wwe(a)),n.isAssigned||!1}function Jnt(n){return!!Ar(n.parent,a=>(ks(a)||Gv(a))&&!!(Wn(a).flags&131072))}function Wwe(n){if(n.kind===80){if(og(n)){const a=Qp(n);Yz(a)&&(a.isAssigned=!0)}}else ds(n,Wwe)}function DD(n){return n.flags&3&&(Rme(n)&6)!==0}function znt(n){const a=Wn(n);if(a.parameterInitializerContainsUndefined===void 0){if(!Wm(n,9))return B6(n.symbol),!0;const l=!!wp(a7(n,0),16777216);if(!Zd())return B6(n.symbol),!0;a.parameterInitializerContainsUndefined=l}return a.parameterInitializerContainsUndefined}function Wnt(n,a){return H&&a.kind===169&&a.initializer&&wp(n,16777216)&&!znt(a)?Ap(n,524288):n}function Unt(n,a){const l=a.parent;return l.kind===211||l.kind===166||l.kind===213&&l.expression===a||l.kind===212&&l.expression===a&&!(em(n,Vwe)&&nv(Zl(l.argumentExpression)))}function Uwe(n){return n.flags&2097152?ut(n.types,Uwe):!!(n.flags&465829888&&mh(n).flags&1146880)}function Vwe(n){return n.flags&2097152?ut(n.types,Vwe):!!(n.flags&465829888&&!Yo(mh(n),98304))}function Vnt(n,a){const l=(Ie(n)||bn(n)||mo(n))&&!((Md(n.parent)||Nb(n.parent))&&n.parent.tagName===n)&&(a&&a&32?d_(n,8):d_(n,void 0));return l&&!hD(l)}function yme(n,a,l){return!(l&&l&2)&&em(n,Uwe)&&(Unt(n,a)||Vnt(a,l))?Io(n,mh):n}function qwe(n){return!!Ar(n,a=>{const l=a.parent;return l===void 0?"quit":cc(l)?l.expression===a&&oc(a):vu(l)?l.name===a||l.propertyName===a:!1})}function BY(n,a){if(ot&&W1(n,111551)&&!yb(a)){const l=ul(n);cu(n,!0)&1160127&&(nd(J)||Sb(J)&&qwe(a)||!m7(kp(l))?f0(n):Ll(n))}}function qnt(n,a){var l;const _=Br(n),m=n.valueDeclaration;if(m){if(Pa(m)&&!m.initializer&&!m.dotDotDotToken&&m.parent.elements.length>=2){const h=m.parent.parent;if(h.kind===260&&G2(m)&6||h.kind===169){const x=Wn(h);if(!(x.flags&4194304)){x.flags|=4194304;const N=wt(h,0),F=N&&Io(N,mh);if(x.flags&=-4194305,F&&F.flags&1048576&&!(h.kind===169&&jY(n))){const V=m.parent,ne=Ry(V,F,F,void 0,a.flowNode);return ne.flags&131072?Cn:$f(m,ne,!0)}}}}if(us(m)&&!m.type&&!m.initializer&&!m.dotDotDotToken){const h=m.parent;if(h.parameters.length>=2&&uY(h)){const x=e7(h);if(x&&x.parameters.length===1&&bu(x)){const N=_D(Ri(Br(x.parameters[0]),(l=W2(h))==null?void 0:l.nonFixingMapper));if(N.flags&1048576&&Nf(N,pa)&&!jY(n)){const F=Ry(h,N,N,void 0,a.flowNode),V=h.parameters.indexOf(m)-(Fv(h)?1:0);return J_(F,vd(V))}}}}}return _}function Hnt(n,a){if(pT(n))return CR(n);const l=Qp(n);if(l===dt)return st;if(l===it){if(PAe(n))return je(n,d.arguments_cannot_be_referenced_in_property_initializers),st;const Ut=uf(n);return ie<2&&(Ut.kind===219?je(n,d.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression):In(Ut,1024)&&je(n,d.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method)),Wn(Ut).flags|=512,Br(l)}$nt(n)&&BY(l,n);const _=kp(l),m=Bge(_,n);l0(m)&&vde(n,m)&&m.declarations&&xg(n,m.declarations,n.escapedText);let h=_.valueDeclaration;if(h&&_.flags&32&&Qn(h)&&h.name!==n){let Ut=i_(n,!1,!1);for(;Ut.kind!==312&&Ut.parent!==h;)Ut=i_(Ut,!1,!1);Ut.kind!==312&&(Wn(h).flags|=262144,Wn(Ut).flags|=262144,Wn(n).flags|=536870912)}Ynt(n,l);let x=qnt(_,n);const N=uT(n);if(N){if(!(_.flags&3)&&!(Hr(n)&&_.flags&512)){const Ut=_.flags&384?d.Cannot_assign_to_0_because_it_is_an_enum:_.flags&32?d.Cannot_assign_to_0_because_it_is_a_class:_.flags&1536?d.Cannot_assign_to_0_because_it_is_a_namespace:_.flags&16?d.Cannot_assign_to_0_because_it_is_a_function:_.flags&2097152?d.Cannot_assign_to_0_because_it_is_an_import:d.Cannot_assign_to_0_because_it_is_not_a_variable;return je(n,Ut,ii(l)),st}if(Td(_))return _.flags&3?je(n,d.Cannot_assign_to_0_because_it_is_a_constant,ii(l)):je(n,d.Cannot_assign_to_0_because_it_is_a_read_only_property,ii(l)),st}const F=_.flags&2097152;if(_.flags&3){if(N===1)return tz(n)?bh(x):x}else if(F)h=Sp(l);else return x;if(!h)return x;x=yme(x,n,a);const V=Tm(h).kind===169,ne=ZN(h);let le=ZN(n);const xe=le!==ne,Ne=n.parent&&n.parent.parent&&Hh(n.parent)&&gme(n.parent.parent),nt=l.flags&134217728,kt=x===ht||x===Oc,Xt=kt&&n.parent.kind===235;for(;le!==ne&&(le.kind===218||le.kind===219||JI(le))&&(DD(_)&&x!==Oc||V&&!jY(_));)le=ZN(le);const _r=V||F||xe||Ne||nt||Gnt(n,h)||x!==ht&&x!==Oc&&(!H||(x.flags&16387)!==0||yb(n)||ume(n)||n.parent.kind===281)||n.parent.kind===235||h.kind===260&&h.exclamationToken||h.flags&33554432,Yr=Xt?j:_r?V?Wnt(x,h):x:kt?j:Ly(x),gr=Xt?Sh(Ry(n,x,Yr,le)):Ry(n,x,Yr,le);if(!Bwe(n)&&(x===ht||x===Oc)){if(gr===ht||gr===Oc)return se&&(je(as(h),d.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,ii(l),mr(gr)),je(n,d.Variable_0_implicitly_has_an_1_type,ii(l),mr(gr))),d7(gr)}else if(!_r&&!yD(x)&&yD(gr))return je(n,d.Variable_0_is_used_before_being_assigned,ii(l)),x;return N?bh(gr):gr}function Gnt(n,a){if(Pa(a)){const l=Ar(n,Pa);return l&&Tm(l)===Tm(a)}}function $nt(n){var a;const l=n.parent;if(l){if(bn(l)&&l.expression===n||vu(l)&&l.isTypeOnly)return!1;const _=(a=l.parent)==null?void 0:a.parent;if(_&&qc(_)&&_.isTypeOnly)return!1}return!0}function Xnt(n,a){return!!Ar(n,l=>l===a?"quit":ks(l)||l.parent&&Es(l.parent)&&!Uc(l.parent)&&l.parent.initializer===l)}function Qnt(n,a){return Ar(n,l=>l===a?"quit":l===a.initializer||l===a.condition||l===a.incrementor||l===a.statement)}function vme(n){return Ar(n,a=>!a||uz(a)?"quit":j0(a,!1))}function Ynt(n,a){if(ie>=2||!(a.flags&34)||!a.valueDeclaration||Ai(a.valueDeclaration)||a.valueDeclaration.parent.kind===299)return;const l=bm(a.valueDeclaration),_=Xnt(n,l),m=vme(l);if(m){if(_){let h=!0;if(wb(l)){const x=r1(a.valueDeclaration,261);if(x&&x.parent===l){const N=Qnt(n.parent,l);if(N){const F=Wn(N);F.flags|=8192;const V=F.capturedBlockScopeBindings||(F.capturedBlockScopeBindings=[]);tp(V,a),N===l.initializer&&(h=!1)}}}h&&(Wn(m).flags|=4096)}if(wb(l)){const h=r1(a.valueDeclaration,261);h&&h.parent===l&&Knt(n,l)&&(Wn(a.valueDeclaration).flags|=65536)}Wn(a.valueDeclaration).flags|=32768}_&&(Wn(a.valueDeclaration).flags|=16384)}function Znt(n,a){const l=Wn(n);return!!l&&_s(l.capturedBlockScopeBindings,cn(a))}function Knt(n,a){let l=n;for(;l.parent.kind===217;)l=l.parent;let _=!1;if(og(l))_=!0;else if(l.parent.kind===224||l.parent.kind===225){const m=l.parent;_=m.operator===46||m.operator===47}return _?!!Ar(l,m=>m===a?"quit":m===a.statement):!1}function bme(n,a){if(Wn(n).flags|=2,a.kind===172||a.kind===176){const l=a.parent;Wn(l).flags|=4}else Wn(a).flags|=4}function Hwe(n){return ub(n)?n:ks(n)?void 0:ds(n,Hwe)}function Sme(n){const a=cn(n),l=bo(a);return Xc(l)===Ve}function Gwe(n,a,l){const _=a.parent;Nv(_)&&!Sme(_)&&s8(n)&&n.flowNode&&!RY(n.flowNode,!1)&&je(n,l)}function eit(n,a){Es(a)&&Uc(a)&&Y&&a.initializer&&pP(a.initializer,n.pos)&&Of(a.parent)&&je(n,d.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class)}function CR(n){const a=yb(n);let l=i_(n,!0,!0),_=!1,m=!1;for(l.kind===176&&Gwe(n,l,d.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);;){if(l.kind===219&&(l=i_(l,!1,!m),_=!0),l.kind===167){l=i_(l,!_,!1),m=!0;continue}break}if(eit(n,l),m)je(n,d.this_cannot_be_referenced_in_a_computed_property_name);else switch(l.kind){case 267:je(n,d.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 266:je(n,d.this_cannot_be_referenced_in_current_location);break;case 176:$we(n,l)&&je(n,d.this_cannot_be_referenced_in_constructor_arguments);break}!a&&_&&ie<2&&bme(n,l);const h=Tme(n,!0,l);if(Z){const x=Br(Xe);if(h===x&&_)je(n,d.The_containing_arrow_function_captures_the_global_value_of_this);else if(!h){const N=je(n,d.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!Ai(l)){const F=Tme(l);F&&F!==x&&ua(N,mn(l,d.An_outer_value_of_this_is_shadowed_by_this_container))}}}return h||G}function Tme(n,a=!0,l=i_(n,!1,!1)){const _=Hr(n);if(ks(l)&&(!Cme(n)||Fv(l))){let m=xy(l)||_&&nit(l);if(!m){const h=rit(l);if(_&&h){const x=Ui(h).symbol;x&&x.members&&x.flags&16&&(m=bo(x).thisType)}else nm(l)&&(m=bo(Na(l.symbol)).thisType);m||(m=Zwe(l))}if(m)return Ry(n,m)}if(Qn(l.parent)){const m=cn(l.parent),h=Ls(l)?Br(m):bo(m).thisType;return Ry(n,h)}if(Ai(l))if(l.commonJsModuleIndicator){const m=cn(l);return m&&Br(m)}else{if(l.externalModuleIndicator)return j;if(a)return Br(Xe)}}function tit(n){const a=i_(n,!1,!1);if(ks(a)){const l=Dp(a);if(l.thisParameter)return LY(l.thisParameter)}if(Qn(a.parent)){const l=cn(a.parent);return Ls(a)?Br(l):bo(l).thisType}}function rit(n){if(n.kind===218&&Gr(n.parent)&&ac(n.parent)===3)return n.parent.left.expression.expression;if(n.kind===174&&n.parent.kind===210&&Gr(n.parent.parent)&&ac(n.parent.parent)===6)return n.parent.parent.left.expression;if(n.kind===218&&n.parent.kind===303&&n.parent.parent.kind===210&&Gr(n.parent.parent.parent)&&ac(n.parent.parent.parent)===6)return n.parent.parent.parent.left.expression;if(n.kind===218&&Hc(n.parent)&&Ie(n.parent.name)&&(n.parent.name.escapedText==="value"||n.parent.name.escapedText==="get"||n.parent.name.escapedText==="set")&&ma(n.parent.parent)&&Rs(n.parent.parent.parent)&&n.parent.parent.parent.arguments[2]===n.parent.parent&&ac(n.parent.parent.parent)===9)return n.parent.parent.parent.arguments[0].expression;if(mc(n)&&Ie(n.name)&&(n.name.escapedText==="value"||n.name.escapedText==="get"||n.name.escapedText==="set")&&ma(n.parent)&&Rs(n.parent.parent)&&n.parent.parent.arguments[2]===n.parent&&ac(n.parent.parent)===9)return n.parent.parent.arguments[0].expression}function nit(n){const a=lI(n);if(a&&a.typeExpression)return si(a.typeExpression);const l=fD(n);if(l)return tv(l)}function $we(n,a){return!!Ar(n,l=>po(l)?"quit":l.kind===169&&l.parent===a)}function xme(n){const a=n.parent.kind===213&&n.parent.expression===n,l=UP(n,!0);let _=l,m=!1,h=!1;if(!a){for(;_&&_.kind===219;)In(_,1024)&&(h=!0),_=UP(_,!0),m=ie<2;_&&In(_,1024)&&(h=!0)}let x=0;if(!_||!ne(_)){const le=Ar(n,xe=>xe===_?"quit":xe.kind===167);return le&&le.kind===167?je(n,d.super_cannot_be_referenced_in_a_computed_property_name):a?je(n,d.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):!_||!_.parent||!(Qn(_.parent)||_.parent.kind===210)?je(n,d.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions):je(n,d.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class),st}if(!a&&l.kind===176&&Gwe(n,_,d.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class),Ls(_)||a?(x=32,!a&&ie>=2&&ie<=8&&(Es(_)||Go(_))&&Lee(n.parent,le=>{(!Ai(le)||H_(le))&&(Wn(le).flags|=2097152)})):x=16,Wn(n).flags|=x,_.kind===174&&h&&(s_(n.parent)&&og(n.parent)?Wn(_).flags|=256:Wn(_).flags|=128),m&&bme(n.parent,_),_.parent.kind===210)return ie<2?(je(n,d.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),st):G;const N=_.parent;if(!Nv(N))return je(n,d.super_can_only_be_referenced_in_a_derived_class),st;if(Sme(N))return a?st:Ve;const F=bo(cn(N)),V=F&&Qc(F)[0];if(!V)return st;if(_.kind===176&&$we(n,_))return je(n,d.super_cannot_be_referenced_in_constructor_arguments),st;return x===32?Xc(F):rf(V,F.thisType);function ne(le){return a?le.kind===176:Qn(le.parent)||le.parent.kind===210?Ls(le)?le.kind===174||le.kind===173||le.kind===177||le.kind===178||le.kind===172||le.kind===175:le.kind===174||le.kind===173||le.kind===177||le.kind===178||le.kind===172||le.kind===171||le.kind===176:!1}}function Xwe(n){return(n.kind===174||n.kind===177||n.kind===178)&&n.parent.kind===210?n.parent:n.kind===218&&n.parent.kind===303?n.parent.parent:void 0}function Qwe(n){return Pn(n)&4&&n.target===kc?uo(n)[0]:void 0}function iit(n){return Io(n,a=>a.flags&2097152?Zt(a.types,Qwe):Qwe(a))}function Ywe(n,a){let l=n,_=a;for(;_;){const m=iit(_);if(m)return m;if(l.parent.kind!==303)break;l=l.parent.parent,_=_v(l,void 0)}}function Zwe(n){if(n.kind===219)return;if(uY(n)){const l=e7(n);if(l){const _=l.thisParameter;if(_)return Br(_)}}const a=Hr(n);if(Z||a){const l=Xwe(n);if(l){const m=_v(l,void 0),h=Ywe(l,m);return h?Ri(h,eme(W2(l))):nf(m?Sh(m):Bc(l))}const _=Rh(n.parent);if(sl(_)){const m=_.left;if(co(m)){const{expression:h}=m;if(a&&Ie(h)){const x=Or(_);if(x.commonJsModuleIndicator&&Qp(h)===x.symbol)return}return nf(Bc(h))}}}}function Kwe(n){const a=n.parent;if(!uY(a))return;const l=_b(a);if(l&&l.arguments){const m=eZ(l),h=a.parameters.indexOf(n);if(n.dotDotDotToken)return Yme(m,h,m.length,G,void 0,0);const x=Wn(l),N=x.resolvedSignature;x.resolvedSignature=Tt;const F=h0)return jx(l.name,!0,!1)}}function cit(n,a){const l=uf(n);if(l){let _=JY(l,a);if(_){const m=pl(l);if(m&1){const h=(m&2)!==0;_.flags&1048576&&(_=jc(_,N=>!!V2(1,N,h)));const x=V2(1,_,(m&2)!==0);if(!x)return;_=x}if(m&2){const h=Io(_,C0);return h&&Mn([h,fNe(h)])}return _}}}function lit(n,a){const l=d_(n,a);if(l){const _=C0(l);return _&&Mn([_,fNe(_)])}}function uit(n,a){const l=uf(n);if(l){const _=pl(l);let m=JY(l,a);if(m){const h=(_&2)!==0;return!n.asteriskToken&&m.flags&1048576&&(m=jc(m,x=>!!V2(1,x,h))),n.asteriskToken?m:V2(0,m,h)}}}function Cme(n){let a=!1;for(;n.parent&&!ks(n.parent);){if(us(n.parent)&&(a||n.parent.initializer===n))return!0;Pa(n.parent)&&n.parent.initializer===n&&(a=!0),n=n.parent}return!1}function eAe(n,a){const l=!!(pl(a)&2),_=JY(a,void 0);if(_)return V2(n,_,l)||void 0}function JY(n,a){const l=V6(n);if(l)return l;const _=Ame(n);if(_&&!WQ(_)){const h=Ma(_),x=pl(n);return x&1?jc(h,N=>!!(N.flags&58998787)||vge(N,x,void 0)):x&2?jc(h,N=>!!(N.flags&58998787)||!!ID(N)):h}const m=_b(n);if(m)return d_(m,a)}function tAe(n,a){const _=eZ(n).indexOf(a);return _===-1?void 0:Eme(n,_)}function Eme(n,a){if(G_(n))return a===0?Fe:a===1?HPe(!1):G;const l=Wn(n).resolvedSignature===En?En:e4(n);if(qu(n)&&a===0)return VY(l,n);const _=l.parameters.length-1;return bu(l)&&a>=_?J_(Br(l.parameters[_]),vd(a-_),256):Sd(l,a)}function _it(n){const a=uge(n);return a?DS(a):void 0}function fit(n,a){if(n.parent.kind===215)return tAe(n.parent,a)}function pit(n,a){const l=n.parent,{left:_,operatorToken:m,right:h}=l;switch(m.kind){case 64:case 77:case 76:case 78:return n===h?mit(l):void 0;case 57:case 61:const x=d_(l,a);return n===h&&(x&&x.pattern||!x&&!rte(l))?Zl(_):x;case 56:case 28:return n===h?d_(l,a):void 0;default:return}}function dit(n){if(Ed(n)&&n.symbol)return n.symbol;if(Ie(n))return Qp(n);if(bn(n)){const l=Zl(n.expression);return Ti(n.name)?a(l,n.name):Gs(l,n.name.escapedText)}if(mo(n)){const l=Bc(n.argumentExpression);if(!pp(l))return;const _=Zl(n.expression);return Gs(_,dp(l))}return;function a(l,_){const m=$Y(_.escapedText,_);return m&&zme(l,m)}}function mit(n){var a,l;const _=ac(n);switch(_){case 0:case 4:const m=dit(n.left),h=m&&m.valueDeclaration;if(h&&(Es(h)||ff(h))){const F=Wl(h);return F&&Ri(si(F),yi(m).mapper)||(Es(h)?h.initializer&&Zl(n.left):void 0)}return _===0?Zl(n.left):rAe(n);case 5:if(zY(n,_))return rAe(n);if(!Ed(n.left)||!n.left.symbol)return Zl(n.left);{const F=n.left.symbol.valueDeclaration;if(!F)return;const V=Ms(n.left,co),ne=Wl(F);if(ne)return si(ne);if(Ie(V.expression)){const le=V.expression,xe=_c(le,le.escapedText,111551,void 0,le.escapedText,!0);if(xe){const Ne=xe.valueDeclaration&&Wl(xe.valueDeclaration);if(Ne){const nt=Gg(V);if(nt!==void 0)return z2(si(Ne),nt)}return}}return Hr(F)||F===n.left?void 0:Zl(n.left)}case 1:case 6:case 3:case 2:let x;_!==2&&(x=Ed(n.left)?(a=n.left.symbol)==null?void 0:a.valueDeclaration:void 0),x||(x=(l=n.symbol)==null?void 0:l.valueDeclaration);const N=x&&Wl(x);return N?si(N):void 0;case 7:case 8:case 9:return E.fail("Does not apply");default:return E.assertNever(_)}}function zY(n,a=ac(n)){if(a===4)return!0;if(!Hr(n)||a!==5||!Ie(n.left.expression))return!1;const l=n.left.expression.escapedText,_=_c(n.left,l,111551,void 0,void 0,!0,!0);return qI(_?.valueDeclaration)}function rAe(n){if(!n.symbol)return Zl(n.left);if(n.symbol.valueDeclaration){const m=Wl(n.symbol.valueDeclaration);if(m){const h=si(m);if(h)return h}}const a=Ms(n.left,co);if(!Mp(i_(a.expression,!1,!1)))return;const l=CR(a.expression),_=Gg(a);return _!==void 0&&z2(l,_)||void 0}function git(n){return!!(Ko(n)&262144&&!n.links.type&&Q1(n,0)>=0)}function z2(n,a,l){return Io(n,_=>{var m;if(Af(_)&&!_.declaration.nameType){const h=Ep(_),x=Ku(h)||h,N=l||p_(bi(a));if(ca(N,x))return KQ(_,N)}else if(_.flags&3670016){const h=Gs(_,a);if(h)return git(h)?void 0:My(Br(h),!!(h&&h.flags&16777216));if(pa(_)&&_g(a)&&+a>=0){const x=TD(_,_.target.fixedLength,0,!1,!0);if(x)return x}return(m=Gpe($pe(_),l||p_(bi(a))))==null?void 0:m.type}},!0)}function nAe(n,a){if(E.assert(Mp(n)),!(n.flags&67108864))return Dme(n,a)}function Dme(n,a){const l=n.parent,_=Hc(n)&&kme(n,a);if(_)return _;const m=_v(l,a);if(m){if(W6(n)){const h=cn(n);return z2(m,h.escapedName,yi(h).nameType)}if(V0(n)){const h=as(n);if(h&&xa(h)){const x=Ui(h.expression),N=pp(x)&&z2(m,dp(x));if(N)return N}}if(n.name){const h=S0(n.name);return Io(m,x=>{var N;return(N=Gpe($pe(x),h))==null?void 0:N.type},!0)}}}function hit(n){let a,l;for(let _=0;_{if(pa(h)){if((_===void 0||a<_)&&am)?l-a:0,N=x>0&&h.target.hasRestElement?jN(h.target,3):0;return x>0&&x<=N?uo(h)[b0(h)-x]:TD(h,_===void 0?h.target.fixedLength:Math.min(h.target.fixedLength,_),l===void 0||m===void 0?N:Math.min(N,l-m),!1,!0)}return(!_||a<_)&&z2(h,""+a)||Age(1,h,j,void 0,!1)},!0)}function yit(n,a){const l=n.parent;return n===l.whenTrue||n===l.whenFalse?d_(l,a):void 0}function vit(n,a,l){const _=_v(n.openingElement.attributes,l),m=wR(MS(n));if(!(_&&!Ae(_)&&m&&m!==""))return;const h=Vk(n.children),x=h.indexOf(a),N=z2(_,m);return N&&(h.length===1?N:Io(N,F=>x0(F)?J_(F,vd(x)):F,!0))}function bit(n,a){const l=n.parent;return bI(l)?d_(n,a):dg(l)?vit(l,n,a):void 0}function iAe(n,a){if(Rd(n)){const l=_v(n.parent,a);return!l||Ae(l)?void 0:z2(l,DE(n.name))}else return d_(n.parent,a)}function ER(n){switch(n.kind){case 11:case 9:case 10:case 15:case 228:case 112:case 97:case 106:case 80:case 157:return!0;case 211:case 217:return ER(n.expression);case 294:return!n.expression||ER(n.expression)}return!1}function Sit(n,a){return dnt(a,n)||jde(a,Xi(Yt(wn(n.properties,l=>l.symbol?l.kind===303?ER(l.initializer)&&xD(a,l.symbol.escapedName):l.kind===304?xD(a,l.symbol.escapedName):!1:!1),l=>[()=>GR(l.kind===303?l.initializer:l.name),l.symbol.escapedName]),Yt(wn(Wa(a),l=>{var _;return!!(l.flags&16777216)&&!!((_=n?.symbol)!=null&&_.members)&&!n.symbol.members.has(l.escapedName)&&xD(a,l.escapedName)}),l=>[()=>j,l.escapedName])),ca)}function Tit(n,a){const l=wR(MS(n));return jde(a,Xi(Yt(wn(n.properties,_=>!!_.symbol&&_.kind===291&&xD(a,_.symbol.escapedName)&&(!_.initializer||ER(_.initializer))),_=>[_.initializer?()=>GR(_.initializer):()=>Zr,_.symbol.escapedName]),Yt(wn(Wa(a),_=>{var m;if(!(_.flags&16777216)||!((m=n?.symbol)!=null&&m.members))return!1;const h=n.parent.parent;return _.escapedName===l&&dg(h)&&Vk(h.children).length?!1:!n.symbol.members.has(_.escapedName)&&xD(a,_.escapedName)}),_=>[()=>j,_.escapedName])),ca)}function _v(n,a){const l=Mp(n)?nAe(n,a):d_(n,a),_=WY(l,n,a);if(_&&!(a&&a&2&&_.flags&8650752)){const m=Io(_,h=>Pn(h)&32?h:e_(h),!0);return m.flags&1048576&&ma(n)?Sit(n,m):m.flags&1048576&&Hv(n)?Tit(n,m):m}}function WY(n,a,l){if(n&&Yo(n,465829888)){const _=W2(a);if(_&&l&1&&ut(_.inferences,not))return UY(n,_.nonFixingMapper);if(_?.returnMapper){const m=UY(n,_.returnMapper);return m.flags&1048576&&wy(m.types,Lr)&&wy(m.types,gn)?jc(m,h=>h!==Lr&&h!==gn):m}}return n}function UY(n,a){return n.flags&465829888?Ri(n,a):n.flags&1048576?Mn(Yt(n.types,l=>UY(l,a)),0):n.flags&2097152?fa(Yt(n.types,l=>UY(l,a))):n}function d_(n,a){var l;if(n.flags&67108864)return;const _=aAe(n,!a);if(_>=0)return _n[_];const{parent:m}=n;switch(m.kind){case 260:case 169:case 172:case 171:case 208:return oit(n,a);case 219:case 253:return cit(n,a);case 229:return uit(m,a);case 223:return lit(m,a);case 213:case 214:return tAe(m,n);case 170:return _it(m);case 216:case 234:return Vg(m.type)?d_(m,a):si(m.type);case 226:return pit(n,a);case 303:case 304:return Dme(m,a);case 305:return d_(m.parent,a);case 209:{const h=m,x=_v(h,a),N=Ek(h.elements,n),F=(l=Wn(h)).spreadIndices??(l.spreadIndices=hit(h.elements));return Pme(x,N,h.elements.length,F.first,F.last)}case 227:return yit(n,a);case 239:return E.assert(m.parent.kind===228),fit(m.parent,n);case 217:{if(Hr(m)){if(Kz(m))return si(eW(m));const h=Qy(m);if(h&&!Vg(h.typeExpression.type))return si(h.typeExpression.type)}return d_(m,a)}case 235:return d_(m,a);case 238:return si(m.type);case 277:return Le(m);case 294:return bit(m,a);case 291:case 293:return iAe(m,a);case 286:case 285:return Cit(m,a)}}function sAe(n){DR(n,d_(n,void 0),!0)}function DR(n,a,l){ni[on]=n,_n[on]=a,fn[on]=l,on++}function KN(){on--}function aAe(n,a){for(let l=on-1;l>=0;l--)if(n===ni[l]&&(a||!fn[l]))return l;return-1}function xit(n,a){wi[Va]=n,Qa[Va]=a,Va++}function kit(){Va--}function W2(n){for(let a=Va-1;a>=0;a--)if(Av(n,wi[a]))return Qa[a]}function Cit(n,a){if(Md(n)&&a!==4){const l=aAe(n.parent,!a);if(l>=0)return _n[l]}return Eme(n,0)}function VY(n,a){return WAe(a)!==0?Eit(n,a):wit(n,a)}function Eit(n,a){let l=cge(n,or);l=oAe(a,MS(a),l);const _=U2(mf.IntrinsicAttributes,a);return et(_)||(l=YM(_,l)),l}function Dit(n,a){if(n.compositeSignatures){const _=[];for(const m of n.compositeSignatures){const h=Ma(m);if(Ae(h))return h;const x=q(h,a);if(!x)return;_.push(x)}return fa(_)}const l=Ma(n);return Ae(l)?l:q(l,a)}function Pit(n){if(Qx(n.tagName)){const l=gAe(n),_=tZ(n,l);return DS(_)}const a=Bc(n.tagName);if(a.flags&128){const l=mAe(a,n);if(!l)return st;const _=tZ(n,l);return DS(_)}return a}function oAe(n,a,l){const _=Xit(a);if(_){const m=Pit(n),h=vAe(_,Hr(n),m,l);if(h)return h}return l}function wit(n,a){const l=MS(a),_=Yit(l);let m=_===void 0?cge(n,or):_===""?Ma(n):Dit(n,_);if(!m)return _&&Ir(a.attributes.properties)&&je(a,d.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property,bi(_)),or;if(m=oAe(a,l,m),Ae(m))return m;{let h=m;const x=U2(mf.IntrinsicClassAttributes,a);if(!et(x)){const F=cr(x.symbol),V=Ma(n);let ne;if(F){const le=Dy([V],F,Hm(F),Hr(a));ne=Ri(x,k_(F,le))}else ne=x;h=YM(ne,h)}const N=U2(mf.IntrinsicAttributes,a);return et(N)||(h=YM(N,h)),h}}function Ait(n){return fp(J,"noImplicitAny")?Eu(n,(a,l)=>a===l||!a?a:lPe(a.typeParameters,l.typeParameters)?Fit(a,l):void 0):void 0}function Nit(n,a,l){if(!n||!a)return n||a;const _=Mn([Br(n),Ri(Br(a),l)]);return AS(n,_)}function Iit(n,a,l){const _=sf(n),m=sf(a),h=_>=m?n:a,x=h===n?a:n,N=h===n?_:m,F=Xm(n)||Xm(a),V=F&&!Xm(h),ne=new Array(N+(V?1:0));for(let le=0;le=im(h)&&le>=im(x),_r=le>=_?void 0:wD(n,le),Yr=le>=m?void 0:wD(a,le),gr=_r===Yr?_r:_r?Yr?void 0:_r:Yr,Ut=Aa(1|(Xt&&!kt?16777216:0),gr||`arg${le}`);Ut.links.type=kt?uu(nt):nt,ne[le]=Ut}if(V){const le=Aa(1,"args");le.links.type=uu(Sd(x,N)),x===a&&(le.links.type=Ri(le.links.type,l)),ne[N]=le}return ne}function Fit(n,a){const l=n.typeParameters||a.typeParameters;let _;n.typeParameters&&a.typeParameters&&(_=k_(a.typeParameters,n.typeParameters));const m=n.declaration,h=Iit(n,a,_),x=Nit(n.thisParameter,a.thisParameter,_),N=Math.max(n.minArgumentCount,a.minArgumentCount),F=Fg(m,l,x,h,void 0,void 0,N,(n.flags|a.flags)&167);return F.compositeKind=2097152,F.compositeSignatures=Xi(n.compositeKind===2097152&&n.compositeSignatures||[n],[a]),_&&(F.mapper=n.compositeKind===2097152&&n.mapper&&n.compositeSignatures?av(n.mapper,_):_),F}function wme(n,a){const l=Ts(n,0),_=wn(l,m=>!Oit(m,a));return _.length===1?_[0]:Ait(_)}function Oit(n,a){let l=0;for(;lx[Ne]&8?Ay(xe,vt)||G:xe),2):H?wr:ce,F))}function lAe(n){if(!(Pn(n)&4))return n;let a=n.literalType;return a||(a=n.literalType=OPe(n),a.objectFlags|=147456),a}function jit(n){switch(n.kind){case 167:return Bit(n);case 80:return _g(n.escapedText);case 9:case 11:return _g(n.text);default:return!1}}function Bit(n){return Ml(Lg(n),296)}function Lg(n){const a=Wn(n.expression);if(!a.resolvedType){if((X_(n.parent.parent)||Qn(n.parent.parent)||Mu(n.parent.parent))&&Gr(n.expression)&&n.expression.operatorToken.kind===103&&n.parent.kind!==177&&n.parent.kind!==178)return a.resolvedType=st;if(a.resolvedType=Ui(n.expression),Es(n.parent)&&!Uc(n.parent)&&Nl(n.parent.parent)){const l=bm(n.parent.parent),_=vme(l);_&&(Wn(_).flags|=4096,Wn(n).flags|=32768,Wn(n.parent.parent).flags|=32768)}(a.resolvedType.flags&98304||!Ml(a.resolvedType,402665900)&&!ca(a.resolvedType,Cr))&&je(n,d.A_computed_property_name_must_be_of_type_string_number_symbol_or_any)}return a.resolvedType}function Jit(n){var a;const l=(a=n.declarations)==null?void 0:a[0];return _g(n.escapedName)||l&&Au(l)&&jit(l.name)}function uAe(n){var a;const l=(a=n.declarations)==null?void 0:a[0];return p8(n)||l&&Au(l)&&xa(l.name)&&Ml(Lg(l.name),4096)}function Nme(n,a,l,_){const m=[];for(let x=a;x0&&(N=L2(N,Nr(),n.symbol,kt,ne),x=[],h=zs(),_r=!1,Yr=!1,gr=!1);const sn=hd(Ui(Sr.expression,a&2));if(PR(sn)){const ms=kde(sn,ne);if(m&&fAe(ms,m,Sr),Ut=x.length,et(N))continue;N=L2(N,ms,n.symbol,kt,ne)}else je(Sr,d.Spread_types_may_only_be_created_from_object_types),N=st;continue}else E.assert(Sr.kind===177||Sr.kind===178),Yx(Sr);hr&&!(hr.flags&8576)?ca(hr,Cr)&&(ca(hr,vt)?Yr=!0:ca(hr,Ln)?gr=!0:_r=!0,_&&(Xt=!0)):h.set(Er.escapedName,Er),x.push(Er)}if(KN(),V){const Sr=Ar(F.pattern.parent,hr=>hr.kind===260||hr.kind===226||hr.kind===169);if(Ar(n,hr=>hr===Sr||hr.kind===305).kind!==305)for(const hr of Wa(F))!h.get(hr.escapedName)&&!Gs(N,hr.escapedName)&&(hr.flags&16777216||je(hr.valueDeclaration||((l=Jn(hr,ym))==null?void 0:l.links.bindingElement),d.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value),h.set(hr.escapedName,hr),x.push(hr))}if(et(N))return st;if(N!==Us)return x.length>0&&(N=L2(N,Nr(),n.symbol,kt,ne),x=[],h=zs(),_r=!1,Yr=!1),Io(N,Sr=>Sr===Us?Nr():Sr);return Nr();function Nr(){const Sr=[];_r&&Sr.push(Nme(n,Ut,x,Fe)),Yr&&Sr.push(Nme(n,Ut,x,vt)),gr&&Sr.push(Nme(n,Ut,x,Ln));const Er=Qo(n.symbol,h,ze,ze,Sr);return Er.objectFlags|=kt|128|131072,nt&&(Er.objectFlags|=4096),Xt&&(Er.objectFlags|=512),_&&(Er.pattern=n),Er}}function PR(n){const a=cwe(Io(n,mh));return!!(a.flags&126615553||a.flags&3145728&&qi(a.types,PR))}function Wit(n){Lme(n)}function Uit(n,a){return Yx(n),AR(n)||G}function Vit(n){Lme(n.openingElement),Qx(n.closingElement.tagName)?HY(n.closingElement):Ui(n.closingElement.tagName),qY(n)}function qit(n,a){return Yx(n),AR(n)||G}function Hit(n){Lme(n.openingFragment);const a=Or(n);return F5(J)&&(J.jsxFactory||a.pragmas.has("jsx"))&&!J.jsxFragmentFactory&&!a.pragmas.has("jsxfrag")&&je(n,J.jsxFactory?d.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:d.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments),qY(n),AR(n)||G}function Fme(n){return n.includes("-")}function Qx(n){return Ie(n)&&Hk(n.escapedText)||sd(n)}function _Ae(n,a){return n.initializer?ND(n.initializer,a):Zr}function Git(n,a=0){const l=n.attributes,_=d_(l,0),m=H?zs():void 0;let h=zs(),x=Ic,N=!1,F,V=!1,ne=2048;const le=wR(MS(n));for(const nt of l.properties){const kt=nt.symbol;if(Rd(nt)){const Xt=_Ae(nt,a);ne|=Pn(Xt)&458752;const _r=Aa(4|kt.flags,kt.escapedName);if(_r.declarations=kt.declarations,_r.parent=kt.parent,kt.valueDeclaration&&(_r.valueDeclaration=kt.valueDeclaration),_r.links.type=Xt,_r.links.target=kt,h.set(_r.escapedName,_r),m?.set(_r.escapedName,_r),DE(nt.name)===le&&(V=!0),_){const Yr=Gs(_,kt.escapedName);Yr&&Yr.declarations&&l0(Yr)&&Ie(nt.name)&&xg(nt.name,Yr.declarations,nt.name.escapedText)}if(_&&a&2&&!(a&4)&&Zf(nt)){const Yr=W2(l);E.assert(Yr);const gr=nt.initializer.expression;Zde(Yr,gr,Xt)}}else{E.assert(nt.kind===293),h.size>0&&(x=L2(x,Ne(),l.symbol,ne,!1),h=zs());const Xt=hd(Ui(nt.expression,a&2));Ae(Xt)&&(N=!0),PR(Xt)?(x=L2(x,Xt,l.symbol,ne,!1),m&&fAe(Xt,m,nt)):(je(nt.expression,d.Spread_types_may_only_be_created_from_object_types),F=F?fa([F,Xt]):Xt)}}N||h.size>0&&(x=L2(x,Ne(),l.symbol,ne,!1));const xe=n.parent.kind===284?n.parent:void 0;if(xe&&xe.openingElement===n&&Vk(xe.children).length>0){const nt=qY(xe,a);if(!N&&le&&le!==""){V&&je(l,d._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,bi(le));const kt=_v(n.attributes,void 0),Xt=kt&&z2(kt,le),_r=Aa(4,le);_r.links.type=nt.length===1?nt[0]:Xt&&em(Xt,SD)?yd(nt):uu(Mn(nt)),_r.valueDeclaration=I.createPropertySignature(void 0,bi(le),void 0,void 0),ga(_r.valueDeclaration,l),_r.valueDeclaration.symbol=_r;const Yr=zs();Yr.set(le,_r),x=L2(x,Qo(l.symbol,Yr,ze,ze,ze),l.symbol,ne,!1)}}if(N)return G;if(F&&x!==Ic)return fa([F,x]);return F||(x===Ic?Ne():x);function Ne(){ne|=ke;const nt=Qo(l.symbol,h,ze,ze,ze);return nt.objectFlags|=ne|128|131072,nt}}function qY(n,a){const l=[];for(const _ of n.children)if(_.kind===12)_.containsOnlyTriviaWhiteSpaces||l.push(Fe);else{if(_.kind===294&&!_.expression)continue;l.push(ND(_,a))}return l}function fAe(n,a,l){for(const _ of Wa(n))if(!(_.flags&16777216)){const m=a.get(_.escapedName);if(m){const h=je(m.valueDeclaration,d._0_is_specified_more_than_once_so_this_usage_will_be_overwritten,bi(m.escapedName));ua(h,mn(l,d.This_spread_always_overwrites_this_property))}}}function $it(n,a){return Git(n.parent,a)}function U2(n,a){const l=MS(a),_=l&&j_(l),m=_&&S_(_,n,788968);return m?bo(m):st}function HY(n){const a=Wn(n);if(!a.resolvedSymbol){const l=U2(mf.IntrinsicElements,n);if(et(l))return se&&je(n,d.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,bi(mf.IntrinsicElements)),a.resolvedSymbol=dt;{if(!Ie(n.tagName)&&!sd(n.tagName))return E.fail();const _=sd(n.tagName)?TT(n.tagName):n.tagName.escapedText,m=Gs(l,_);if(m)return a.jsxFlags|=1,a.resolvedSymbol=m;const h=j7e(l,p_(bi(_)));return h?(a.jsxFlags|=2,a.resolvedSymbol=h):ge(l,_)?(a.jsxFlags|=2,a.resolvedSymbol=l.symbol):(je(n,d.Property_0_does_not_exist_on_type_1,tW(n.tagName),"JSX."+mf.IntrinsicElements),a.resolvedSymbol=dt)}}return a.resolvedSymbol}function Ome(n){const a=n&&Or(n),l=a&&Wn(a);if(l&&l.jsxImplicitImportContainer===!1)return;if(l&&l.jsxImplicitImportContainer)return l.jsxImplicitImportContainer;const _=L5(O5(J,a),J);if(!_)return;const h=Vl(J)===1?d.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:d.Cannot_find_module_0_or_its_corresponding_type_declarations,x=lh(n,_,h,n),N=x&&x!==dt?Na(Cc(x)):void 0;return l&&(l.jsxImplicitImportContainer=N||!1),N}function MS(n){const a=n&&Wn(n);if(a&&a.jsxNamespace)return a.jsxNamespace;if(!a||a.jsxNamespace!==!1){let _=Ome(n);if(!_||_===dt){const m=O1(n);_=_c(n,m,1920,void 0,m,!1)}if(_){const m=Cc(S_(j_(Cc(_)),mf.JSX,1920));if(m&&m!==dt)return a&&(a.jsxNamespace=m),m}a&&(a.jsxNamespace=!1)}const l=Cc(dD(mf.JSX,1920,void 0));if(l!==dt)return l}function pAe(n,a){const l=a&&S_(a.exports,n,788968),_=l&&bo(l),m=_&&Wa(_);if(m){if(m.length===0)return"";if(m.length===1)return m[0].escapedName;m.length>1&&l.declarations&&je(l.declarations[0],d.The_global_type_JSX_0_may_not_have_more_than_one_property,bi(n))}}function Xit(n){return n&&S_(n.exports,mf.LibraryManagedAttributes,788968)}function Qit(n){return n&&S_(n.exports,mf.ElementType,788968)}function Yit(n){return pAe(mf.ElementAttributesPropertyNameContainer,n)}function wR(n){return pAe(mf.ElementChildrenAttributeNameContainer,n)}function dAe(n,a){if(n.flags&4)return[Tt];if(n.flags&128){const m=mAe(n,a);return m?[tZ(a,m)]:(je(a,d.Property_0_does_not_exist_on_type_1,n.value,"JSX."+mf.IntrinsicElements),ze)}const l=e_(n);let _=Ts(l,1);return _.length===0&&(_=Ts(l,0)),_.length===0&&l.flags&1048576&&(_=Ope(Yt(l.types,m=>dAe(m,a)))),_}function mAe(n,a){const l=U2(mf.IntrinsicElements,a);if(!et(l)){const _=n.value,m=Gs(l,zo(_));if(m)return Br(m);const h=ev(l,Fe);return h||void 0}return G}function Zit(n,a,l){if(n===1){const m=yAe(l);m&&Kf(a,m,R_,l.tagName,d.Its_return_type_0_is_not_a_valid_JSX_element,_)}else if(n===0){const m=hAe(l);m&&Kf(a,m,R_,l.tagName,d.Its_instance_type_0_is_not_a_valid_JSX_element,_)}else{const m=yAe(l),h=hAe(l);if(!m||!h)return;const x=Mn([m,h]);Kf(a,x,R_,l.tagName,d.Its_element_type_0_is_not_a_valid_JSX_element,_)}function _(){const m=Wc(l.tagName);return ps(void 0,d._0_cannot_be_used_as_a_JSX_component,m)}}function gAe(n){var a;E.assert(Qx(n.tagName));const l=Wn(n);if(!l.resolvedJsxElementAttributesType){const _=HY(n);if(l.jsxFlags&1)return l.resolvedJsxElementAttributesType=Br(_)||st;if(l.jsxFlags&2){const m=sd(n.tagName)?TT(n.tagName):n.tagName.escapedText;return l.resolvedJsxElementAttributesType=((a=Wx(U2(mf.IntrinsicElements,n),m))==null?void 0:a.type)||st}else return l.resolvedJsxElementAttributesType=st}return l.resolvedJsxElementAttributesType}function hAe(n){const a=U2(mf.ElementClass,n);if(!et(a))return a}function AR(n){return U2(mf.Element,n)}function yAe(n){const a=AR(n);if(a)return Mn([a,De])}function Kit(n){const a=MS(n);if(!a)return;const l=Qit(a);if(!l)return;const _=vAe(l,Hr(n));if(!(!_||et(_)))return _}function vAe(n,a,...l){const _=bo(n);if(n.flags&524288){const m=yi(n).typeParameters;if(Ir(m)>=l.length){const h=Dy(l,m,l.length,a);return Ir(h)===0?_:H6(n,h)}}if(Ir(_.typeParameters)>=l.length){const m=Dy(l,_.typeParameters,l.length,a);return v0(_,m)}}function est(n){const a=U2(mf.IntrinsicElements,n);return a?Wa(a):ze}function tst(n){(J.jsx||0)===0&&je(n,d.Cannot_use_JSX_unless_the_jsx_flag_is_provided),AR(n)===void 0&&se&&je(n,d.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist)}function Lme(n){const a=qu(n);if(a&&Hut(n),tst(n),!Ome(n)){const l=wa&&J.jsx===2?d.Cannot_find_name_0:void 0,_=O1(n),m=a?n.tagName:n;let h;if(jT(n)&&_==="null"||(h=_c(m,_,111551,l,_,!0)),h&&(h.isReferenced=67108863,ot&&h.flags&2097152&&!qf(h)&&f0(h)),jT(n)){const x=Or(n),N=aS(x);N&&_c(m,N,111551,l,N,!0)}}if(a){const l=n,_=e4(l);nZ(_,n);const m=Kit(l);if(m!==void 0){const h=l.tagName,x=Qx(h)?p_(tW(h)):Ui(h);Kf(x,m,R_,h,d.Its_type_0_is_not_a_valid_JSX_element_type,()=>{const N=Wc(h);return ps(void 0,d._0_cannot_be_used_as_a_JSX_component,N)})}else Zit(WAe(l),Ma(_),l)}}function Mme(n,a,l){if(n.flags&524288){if(K1(n,a)||Wx(n,a)||wN(a)&&Og(n,Fe)||l&&Fme(a))return!0}else if(n.flags&3145728&&NR(n)){for(const _ of n.types)if(Mme(_,a,l))return!0}return!1}function NR(n){return!!(n.flags&524288&&!(Pn(n)&512)||n.flags&67108864||n.flags&1048576&&ut(n.types,NR)||n.flags&2097152&&qi(n.types,NR))}function rst(n,a){if($ut(n),n.expression){const l=Ui(n.expression,a);return n.dotDotDotToken&&l!==G&&!ep(l)&&je(n,d.JSX_spread_child_must_be_an_array_type),l}else return st}function Rme(n){return n.valueDeclaration?G2(n.valueDeclaration):0}function jme(n){if(n.flags&8192||Ko(n)&4)return!0;if(Hr(n.valueDeclaration)){const a=n.valueDeclaration.parent;return a&&Gr(a)&&ac(a)===3}}function Bme(n,a,l,_,m,h=!0){const x=h?n.kind===166?n.right:n.kind===205?n:n.kind===208&&n.propertyName?n.propertyName:n.name:void 0;return bAe(n,a,l,_,m,x)}function bAe(n,a,l,_,m,h){var x;const N=Mf(m,l);if(a){if(ie<2&&SAe(m))return h&&je(h,d.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword),!1;if(N&64)return h&&je(h,d.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression,ii(m),mr(Xx(m))),!1;if(!(N&256)&&((x=m.declarations)!=null&&x.some(eee)))return h&&je(h,d.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super,ii(m)),!1}if(N&64&&SAe(m)&&(VP(n)||Kee(n)||jp(n.parent)&&qI(n.parent.parent))){const V=Qg(f_(m));if(V&&qlt(n))return h&&je(h,d.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor,ii(m),cp(V.name)),!1}if(!(N&6))return!0;if(N&2){const V=Qg(f_(m));return Wge(n,V)?!0:(h&&je(h,d.Property_0_is_private_and_only_accessible_within_class_1,ii(m),mr(Xx(m))),!1)}if(a)return!0;let F=M7e(n,V=>{const ne=bo(cn(V));return Z8e(ne,m,l)});return!F&&(F=nst(n),F=F&&Z8e(F,m,l),N&256||!F)?(h&&je(h,d.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses,ii(m),mr(Xx(m)||_)),!1):N&256?!0:(_.flags&262144&&(_=_.isThisType?ku(_):Ku(_)),!_||!Bx(_,F)?(h&&je(h,d.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2,ii(m),mr(F),mr(_)),!1):!0)}function nst(n){const a=ist(n);let l=a?.type&&si(a.type);if(l&&l.flags&262144&&(l=ku(l)),l&&Pn(l)&7)return J6(l)}function ist(n){const a=i_(n,!1,!1);return a&&ks(a)?Fv(a):void 0}function SAe(n){return!!dR(n,a=>!(a.flags&8192))}function Z6(n){return tm(Ui(n),n)}function IR(n){return wp(n,50331648)}function Jme(n){return IR(n)?Sh(n):n}function sst(n,a){const l=oc(n)?D_(n):void 0;if(n.kind===106){je(n,d.The_value_0_cannot_be_used_here,"null");return}if(l!==void 0&&l.length<100){if(Ie(n)&&l==="undefined"){je(n,d.The_value_0_cannot_be_used_here,"undefined");return}je(n,a&16777216?a&33554432?d._0_is_possibly_null_or_undefined:d._0_is_possibly_undefined:d._0_is_possibly_null,l)}else je(n,a&16777216?a&33554432?d.Object_is_possibly_null_or_undefined:d.Object_is_possibly_undefined:d.Object_is_possibly_null)}function ast(n,a){je(n,a&16777216?a&33554432?d.Cannot_invoke_an_object_which_is_possibly_null_or_undefined:d.Cannot_invoke_an_object_which_is_possibly_undefined:d.Cannot_invoke_an_object_which_is_possibly_null)}function TAe(n,a,l){if(H&&n.flags&2){if(oc(a)){const m=D_(a);if(m.length<100)return je(a,d._0_is_of_type_unknown,m),st}return je(a,d.Object_is_of_type_unknown),st}const _=kD(n,50331648);if(_&50331648){l(a,_);const m=Sh(n);return m.flags&229376?st:m}return n}function tm(n,a){return TAe(n,a,sst)}function xAe(n,a){const l=tm(n,a);if(l.flags&16384){if(oc(a)){const _=D_(a);if(Ie(a)&&_==="undefined")return je(a,d.The_value_0_cannot_be_used_here,_),l;if(_.length<100)return je(a,d._0_is_possibly_undefined,_),l}je(a,d.Object_is_possibly_undefined)}return l}function GY(n,a,l){return n.flags&64?ost(n,a):Wme(n,n.expression,Z6(n.expression),n.name,a,l)}function ost(n,a){const l=Ui(n.expression),_=HN(l,n.expression);return kY(Wme(n,n.expression,tm(_,n.expression),n.name,a),n,_!==l)}function kAe(n,a){const l=XI(n)&&Lv(n.left)?tm(CR(n.left),n.left):Z6(n.left);return Wme(n,n.left,l,n.right,a)}function CAe(n){for(;n.parent.kind===217;)n=n.parent;return gm(n.parent)&&n.parent.expression===n}function $Y(n,a){for(let l=UI(a);l;l=wl(l)){const{symbol:_}=l,m=f8(_,n),h=_.members&&_.members.get(m)||_.exports&&_.exports.get(m);if(h)return h}}function cst(n){if(!wl(n))return Kt(n,d.Private_identifiers_are_not_allowed_outside_class_bodies);if(!UF(n.parent)){if(!sg(n))return Kt(n,d.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);const a=Gr(n.parent)&&n.parent.operatorToken.kind===103;if(!XY(n)&&!a)return Kt(n,d.Cannot_find_name_0,an(n))}return!1}function lst(n){cst(n);const a=XY(n);return a&&OR(a,void 0,!1),G}function XY(n){if(!sg(n))return;const a=Wn(n);return a.resolvedSymbol===void 0&&(a.resolvedSymbol=$Y(n.escapedText,n)),a.resolvedSymbol}function zme(n,a){return Gs(n,a.escapedName)}function ust(n,a,l){let _;const m=Wa(n);m&&Zt(m,x=>{const N=x.valueDeclaration;if(N&&Au(N)&&Ti(N.name)&&N.name.escapedText===a.escapedText)return _=x,!0});const h=Gp(a);if(_){const x=E.checkDefined(_.valueDeclaration),N=E.checkDefined(wl(x));if(l?.valueDeclaration){const F=l.valueDeclaration,V=wl(F);if(E.assert(!!V),Ar(V,ne=>N===ne)){const ne=je(a,d.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling,h,mr(n));return ua(ne,mn(F,d.The_shadowing_declaration_of_0_is_defined_here,h),mn(x,d.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here,h)),!0}}return je(a,d.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier,h,Gp(N.name||PO)),!0}return!1}function EAe(n,a){return(sD(a)||VP(n)&&M6(a))&&i_(n,!0,!1)===R6(a)}function Wme(n,a,l,_,m,h){const x=Wn(a).resolvedSymbol,N=uT(n),F=e_(N!==0||CAe(n)?nf(l):l),V=Ae(F)||F===Ki;let ne;if(Ti(_)){ie<99&&(N!==0&&nl(n,1048576),N!==1&&nl(n,524288));const xe=$Y(_.escapedText,_);if(N&&xe&&xe.valueDeclaration&&mc(xe.valueDeclaration)&&Kt(_,d.Cannot_assign_to_private_method_0_Private_methods_are_not_writable,an(_)),V){if(xe)return et(F)?st:F;if(UI(_)===void 0)return Kt(_,d.Private_identifiers_are_not_allowed_outside_class_bodies),G}if(ne=xe&&zme(l,xe),ne===void 0){if(ust(l,_,xe))return st;const Ne=UI(_);Ne&&FP(Or(Ne),J.checkJs)&&Kt(_,d.Private_field_0_must_be_declared_in_an_enclosing_class,an(_))}else ne.flags&65536&&!(ne.flags&32768)&&N!==1&&je(n,d.Private_accessor_was_defined_without_a_getter)}else{if(V)return Ie(a)&&x&&BY(x,n),et(F)?st:F;ne=Gs(F,_.escapedText,aZ(F),n.kind===166)}Ie(a)&&x&&(nd(J)||!(ne&&(m7(ne)||ne.flags&8&&n.parent.kind===306))||Sb(J)&&qwe(n))&&BY(x,n);let le;if(ne){const xe=Bge(ne,_);if(l0(xe)&&vde(n,xe)&&xe.declarations&&xg(_,xe.declarations,_.escapedText),_st(ne,n,_),OR(ne,n,FAe(a,x)),Wn(n).resolvedSymbol=ne,Bme(n,a.kind===108,gT(n),F,ne),bNe(n,ne,N))return je(_,d.Cannot_assign_to_0_because_it_is_a_read_only_property,an(_)),st;le=EAe(n,ne)?ht:h||x5(n)?TS(ne):Br(ne)}else{const xe=!Ti(_)&&(N===0||!O2(l)||CE(l))?Wx(F,_.escapedText):void 0;if(!(xe&&xe.type)){const Ne=Ume(n,l.symbol,!0);return!Ne&&BN(l)?G:l.symbol===Xe?(Xe.exports.has(_.escapedText)&&Xe.exports.get(_.escapedText).flags&418?je(_,d.Property_0_does_not_exist_on_type_1,bi(_.escapedText),mr(l)):se&&je(_,d.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature,mr(l)),G):(_.escapedText&&!C6(n)&&wAe(_,CE(l)?F:l,Ne),st)}xe.isReadonly&&(og(n)||nz(n))&&je(n,d.Index_signature_in_type_0_only_permits_reading,mr(F)),le=J.noUncheckedIndexedAccess&&!og(n)?Mn([xe.type,ee]):xe.type,J.noPropertyAccessFromIndexSignature&&bn(n)&&je(_,d.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0,bi(_.escapedText)),xe.declaration&&M1(xe.declaration)&&xg(_,[xe.declaration],_.escapedText)}return DAe(n,ne,le,_,m)}function Ume(n,a,l){var _;const m=Or(n);if(m&&J.checkJs===void 0&&m.checkJsDirective===void 0&&(m.scriptKind===1||m.scriptKind===2)){const h=Zt(a?.declarations,Or),x=!a?.valueDeclaration||!Qn(a.valueDeclaration)||((_=a.valueDeclaration.heritageClauses)==null?void 0:_.length)||Mh(!1,a.valueDeclaration);return!(m!==h&&h&&qd(h))&&!(l&&a&&a.flags&32&&x)&&!(n&&l&&bn(n)&&n.expression.kind===110&&x)}return!1}function DAe(n,a,l,_,m){const h=uT(n);if(h===1)return My(l,!!(a&&a.flags&16777216));if(a&&!(a.flags&98311)&&!(a.flags&8192&&l.flags&1048576)&&!bZ(a.declarations))return l;if(l===ht)return Pf(n,a);l=yme(l,n,m);let x=!1;if(H&&Se&&co(n)&&n.expression.kind===110){const F=a&&a.valueDeclaration;if(F&&x7e(F)&&!Ls(F)){const V=ZN(n);V.kind===176&&V.parent===F.parent&&!(F.flags&33554432)&&(x=!0)}}else H&&a&&a.valueDeclaration&&bn(a.valueDeclaration)&&e8(a.valueDeclaration)&&ZN(n)===ZN(a.valueDeclaration)&&(x=!0);const N=Ry(n,l,x?Ly(l):l);return x&&!yD(l)&&yD(N)?(je(_,d.Property_0_is_used_before_being_assigned,ii(a)),l):h?bh(N):N}function _st(n,a,l){const{valueDeclaration:_}=n;if(!_||Or(a).isDeclarationFile)return;let m;const h=an(l);PAe(a)&&!eet(_)&&!(co(a)&&co(a.expression))&&!u0(_,l)&&!(mc(_)&&wZ(_)&256)&&(ae||!fst(n))?m=je(l,d.Property_0_is_used_before_its_initialization,h):_.kind===263&&a.parent.kind!==183&&!(_.flags&33554432)&&!u0(_,l)&&(m=je(l,d.Class_0_used_before_its_declaration,h)),m&&ua(m,mn(_,d._0_is_declared_here,h))}function PAe(n){return!!Ar(n,a=>{switch(a.kind){case 172:return!0;case 303:case 174:case 177:case 178:case 305:case 167:case 239:case 294:case 291:case 292:case 293:case 286:case 233:case 298:return!1;case 219:case 244:return Ss(a.parent)&&Go(a.parent.parent)?!0:"quit";default:return sg(a)?!1:"quit"}})}function fst(n){if(!(n.parent.flags&32))return!1;let a=Br(n.parent);for(;;){if(a=a.symbol&&pst(a),!a)return!1;const l=Gs(a,n.escapedName);if(l&&l.valueDeclaration)return!0}}function pst(n){const a=Qc(n);if(a.length!==0)return fa(a)}function wAe(n,a,l){let _,m;if(!Ti(n)&&a.flags&1048576&&!(a.flags&402784252)){for(const x of a.types)if(!Gs(x,n.escapedText)&&!Wx(x,n.escapedText)){_=ps(_,d.Property_0_does_not_exist_on_type_1,eo(n),mr(x));break}}if(AAe(n.escapedText,a)){const x=eo(n),N=mr(a);_=ps(_,d.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,x,N,N+"."+x)}else{const x=l7(a);if(x&&Gs(x,n.escapedText))_=ps(_,d.Property_0_does_not_exist_on_type_1,eo(n),mr(a)),m=mn(n,d.Did_you_forget_to_use_await);else{const N=eo(n),F=mr(a),V=gst(N,a);if(V!==void 0)_=ps(_,d.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later,N,F,V);else{const ne=Vme(n,a);if(ne!==void 0){const le=pc(ne),xe=l?d.Property_0_may_not_exist_on_type_1_Did_you_mean_2:d.Property_0_does_not_exist_on_type_1_Did_you_mean_2;_=ps(_,xe,N,F,le),m=ne.valueDeclaration&&mn(ne.valueDeclaration,d._0_is_declared_here,le)}else{const le=dst(a)?d.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:d.Property_0_does_not_exist_on_type_1;_=ps(qpe(_,a),le,N,F)}}}}const h=Hg(Or(n),n,_);m&&ua(h,m),Ol(!l||_.code!==d.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,h)}function dst(n){return J.lib&&!J.lib.includes("dom")&&wnt(n,a=>a.symbol&&/^(EventTarget|Node|((HTML[a-zA-Z]*)?Element))$/.test(bi(a.symbol.escapedName)))&&yh(n)}function AAe(n,a){const l=a.symbol&&Gs(Br(a.symbol),n);return l!==void 0&&!!l.valueDeclaration&&Ls(l.valueDeclaration)}function mst(n){const a=Gp(n),_=Y5().get(a);return _&&hj(_.keys())}function gst(n,a){const l=e_(a).symbol;if(!l)return;const _=pc(l),h=Y5().get(_);if(h){for(const[x,N]of h)if(_s(N,n))return x}}function NAe(n,a){return FR(n,Wa(a),106500)}function Vme(n,a){let l=Wa(a);if(typeof n!="string"){const _=n.parent;bn(_)&&(l=wn(l,m=>OAe(_,a,m))),n=an(n)}return FR(n,l,111551)}function IAe(n,a){const l=ns(n)?n:an(n),_=Wa(a);return(l==="for"?kn(_,h=>pc(h)==="htmlFor"):l==="class"?kn(_,h=>pc(h)==="className"):void 0)??FR(l,_,111551)}function qme(n,a){const l=Vme(n,a);return l&&pc(l)}function Hme(n,a,l){return E.assert(a!==void 0,"outername should always be defined"),Ju(n,a,l,void 0,a,!1,!1,!0,(m,h,x)=>{E.assertEqual(a,h,"name should equal outerName");const N=S_(m,h,x);if(N)return N;let F;return m===me?F=Ii(["string","number","boolean","object","bigint","symbol"],ne=>m.has(ne.charAt(0).toUpperCase()+ne.slice(1))?Aa(524288,ne):void 0).concat(fs(m.values())):F=fs(m.values()),FR(bi(h),F,x)})}function hst(n,a,l){const _=Hme(n,a,l);return _&&pc(_)}function QY(n,a){return a.exports&&FR(an(n),p0(a),2623475)}function yst(n,a){const l=QY(n,a);return l&&pc(l)}function vst(n,a,l){function _(x){const N=K1(n,x);if(N){const F=jS(Br(N));return!!F&&im(F)>=1&&ca(l,Sd(F,0))}return!1}const m=og(a)?"set":"get";if(!_(m))return;let h=k8(a.expression);return h===void 0?h=m:h+="."+m,h}function bst(n,a){const l=a.types.filter(_=>!!(_.flags&128));return m4(n.value,l,_=>_.value)}function FR(n,a,l){return m4(n,a,_);function _(m){const h=pc(m);if(!Qi(h,'"')){if(m.flags&l)return h;if(m.flags&2097152){const x=Px(m);if(x&&x.flags&l)return h}}}}function OR(n,a,l){const _=n&&n.flags&106500&&n.valueDeclaration;if(!_)return;const m=w_(_,2),h=n.valueDeclaration&&Au(n.valueDeclaration)&&Ti(n.valueDeclaration.name);if(!(!m&&!h)&&!(a&&x5(a)&&!(n.flags&65536))){if(l){const x=Ar(a,po);if(x&&x.symbol===n)return}(Ko(n)&1?yi(n).target:n).isReferenced=67108863}}function FAe(n,a){return n.kind===110||!!a&&oc(n)&&a===Qp($_(n))}function Sst(n,a){switch(n.kind){case 211:return Gme(n,n.expression.kind===108,a,nf(Ui(n.expression)));case 166:return Gme(n,!1,a,nf(Ui(n.left)));case 205:return Gme(n,!1,a,si(n))}}function OAe(n,a,l){return $me(n,n.kind===211&&n.expression.kind===108,!1,a,l)}function Gme(n,a,l,_){if(Ae(_))return!0;const m=Gs(_,l);return!!m&&$me(n,a,!1,_,m)}function $me(n,a,l,_,m){if(Ae(_))return!0;if(m.valueDeclaration&&Nu(m.valueDeclaration)){const h=wl(m.valueDeclaration);return!gu(n)&&!!Ar(n,x=>x===h)}return bAe(n,a,l,_,m)}function Tst(n){const a=n.initializer;if(a.kind===261){const l=a.declarations[0];if(l&&!As(l.name))return cn(l)}else if(a.kind===80)return Qp(a)}function xst(n){return zu(n).length===1&&!!Og(n,vt)}function kst(n){const a=Ha(n);if(a.kind===80){const l=Qp(a);if(l.flags&3){let _=n,m=n.parent;for(;m;){if(m.kind===249&&_===m.statement&&Tst(m)===l&&xst(Zl(m.expression)))return!0;_=m,m=m.parent}}}return!1}function Cst(n,a){return n.flags&64?Est(n,a):LAe(n,Z6(n.expression),a)}function Est(n,a){const l=Ui(n.expression),_=HN(l,n.expression);return kY(LAe(n,tm(_,n.expression),a),n,_!==l)}function LAe(n,a,l){const _=uT(n)!==0||CAe(n)?nf(a):a,m=n.argumentExpression,h=Ui(m);if(et(_)||_===Ki)return _;if(aZ(_)&&!Ja(m))return je(m,d.A_const_enum_member_can_only_be_accessed_using_a_string_literal),st;const x=kst(m)?vt:h,N=og(n)?4|(O2(_)&&!CE(_)?2:0):32,F=Ay(_,x,N,n)||st;return zNe(DAe(n,Wn(n).resolvedSymbol,F,m,l),n)}function MAe(n){return gm(n)||Db(n)||qu(n)}function RS(n){return MAe(n)&&Zt(n.typeArguments,oa),n.kind===215?Ui(n.template):qu(n)?Ui(n.attributes):Gr(n)?Ui(n.left):gm(n)&&Zt(n.arguments,a=>{Ui(a)}),Tt}function rm(n){return RS(n),dr}function Dst(n,a,l){let _,m,h=0,x,N=-1,F;E.assert(!a.length);for(const V of n){const ne=V.declaration&&cn(V.declaration),le=V.declaration&&V.declaration.parent;!m||ne===m?_&&le===_?x=x+1:(_=le,x=h):(x=h=a.length,_=le),m=ne,tV(V)?(N++,F=N,h++):F=x,a.splice(F,0,l?xKe(V,l):V)}}function YY(n){return!!n&&(n.kind===230||n.kind===237&&n.isSpread)}function ZY(n){return Dc(n,YY)}function RAe(n){return!!(n.flags&16384)}function Pst(n){return!!(n.flags&49155)}function KY(n,a,l,_=!1){let m,h=!1,x=sf(l),N=im(l);if(n.kind===215)if(m=a.length,n.template.kind===228){const F=Sa(n.template.templateSpans);h=sc(F.literal)||!!F.literal.isUnterminated}else{const F=n.template;E.assert(F.kind===15),h=!!F.isUnterminated}else if(n.kind===170)m=VAe(n,l);else if(n.kind===226)m=1;else if(qu(n)){if(h=n.attributes.end===n.end,h)return!0;m=N===0?a.length:1,x=a.length===0?x:1,N=Math.min(N,1)}else if(n.arguments){m=_?a.length+1:a.length,h=n.arguments.end===n.end;const F=ZY(a);if(F>=0)return F>=im(l)&&(Xm(l)||Fx)return!1;if(h||m>=N)return!0;for(let F=m;F=_&&a.length<=l}function jS(n){return t7(n,0,!1)}function jAe(n){return t7(n,0,!1)||t7(n,1,!1)}function t7(n,a,l){if(n.flags&524288){const _=gd(n);if(l||_.properties.length===0&&_.indexInfos.length===0){if(a===0&&_.callSignatures.length===1&&_.constructSignatures.length===0)return _.callSignatures[0];if(a===1&&_.constructSignatures.length===1&&_.callSignatures.length===0)return _.constructSignatures[0]}}}function BAe(n,a,l,_){const m=XN(n.typeParameters,n,0,_),h=n7(a),x=l&&(h&&h.flags&262144?l.nonFixingMapper:l.mapper),N=x?X6(a,x):a;return Xde(N,n,(F,V)=>{Th(m.inferences,F,V)}),l||Qde(a,n,(F,V)=>{Th(m.inferences,F,V,128)}),LN(n,lme(m),Hr(a.declaration))}function wst(n,a,l,_){const m=VY(a,n),h=t4(n.attributes,m,_,l);return Th(_.inferences,h,m),lme(_)}function JAe(n){if(!n)return Ni;const a=Ui(n);return Ote(n)?a:w4(n.parent)?Sh(a):gu(n.parent)?xY(a):a}function Qme(n,a,l,_,m){if(qu(n))return wst(n,a,_,m);if(n.kind!==170&&n.kind!==226){const F=qi(a.typeParameters,ne=>!!ES(ne)),V=d_(n,F?8:0);if(V){const ne=Ma(a);if(lv(ne)){const le=W2(n);if(!(!F&&d_(n,8)!==V)){const kt=eme(qrt(le,1)),Xt=Ri(V,kt),_r=jS(Xt),Yr=_r&&_r.typeParameters?DS(Zpe(_r,_r.typeParameters)):Xt;Th(m.inferences,Yr,ne,128)}const Ne=XN(a.typeParameters,a,m.flags),nt=Ri(V,le&&le.returnMapper);Th(Ne.inferences,nt,ne),m.returnMapper=ut(Ne.inferences,r4)?eme(Xrt(Ne)):void 0}}}const h=i7(a),x=h?Math.min(sf(a)-1,l.length):l.length;if(h&&h.flags&262144){const F=kn(m.inferences,V=>V.typeParameter===h);F&&(F.impliedArity=Dc(l,YY,x)<0?l.length-x:void 0)}const N=tv(a);if(N&&lv(N)){const F=UAe(n);Th(m.inferences,JAe(F),N)}for(let F=0;F=l-1){const ne=n[l-1];if(YY(ne)){const le=ne.kind===237?ne.type:t4(ne.expression,_,m,h);return x0(le)?zAe(le):uu(E0(33,le,j,ne.kind===230?ne.expression:ne),x)}}const N=[],F=[],V=[];for(let ne=a;neps(void 0,d.Type_0_does_not_satisfy_the_constraint_1):void 0,le=_||d.Type_0_does_not_satisfy_the_constraint_1;N||(N=k_(h,x));const xe=x[F];if(!Uu(xe,rf(Ri(V,N),xe),l?a[F]:void 0,le,ne))return}}return x}function WAe(n){if(Qx(n.tagName))return 2;const a=e_(Ui(n.tagName));return Ir(Ts(a,1))?0:Ir(Ts(a,0))?1:2}function Ast(n,a,l,_,m,h,x){const N=VY(a,n),F=t4(n.attributes,N,void 0,_),V=_&4?$N(F):F;return ne()&&Fde(V,N,l,m?n.tagName:void 0,n.attributes,void 0,h,x);function ne(){var le;if(Ome(n))return!0;const xe=(Md(n)||Nb(n))&&!(Qx(n.tagName)||sd(n.tagName))?Ui(n.tagName):void 0;if(!xe)return!0;const Ne=Ts(xe,0);if(!Ir(Ne))return!0;const nt=$7e(n);if(!nt)return!0;const kt=lo(nt,111551,!0,!1,n);if(!kt)return!0;const Xt=Br(kt),_r=Ts(Xt,0);if(!Ir(_r))return!0;let Yr=!1,gr=0;for(const Nr of _r){const Sr=Sd(Nr,0),Er=Ts(Sr,0);if(Ir(Er))for(const hr of Er){if(Yr=!0,Xm(hr))return!0;const sn=sf(hr);sn>gr&&(gr=sn)}}if(!Yr)return!0;let Ut=1/0;for(const Nr of Ne){const Sr=im(Nr);Sr{m.push(h.expression)}),m}if(n.kind===170)return Nst(n);if(n.kind===226)return[n.left];if(qu(n))return n.attributes.properties.length>0||Md(n)&&n.parent.children.length>0?[n.attributes]:ze;const a=n.arguments||ze,l=ZY(a);if(l>=0){const _=a.slice(0,l);for(let m=l;m{var V;const ne=x.target.elementFlags[F],le=MR(h,ne&4?uu(N):N,!!(ne&12),(V=x.target.labeledElementDeclarations)==null?void 0:V[F]);_.push(le)}):_.push(h)}return _}return a}function Nst(n){const a=n.expression,l=uge(n);if(l){const _=[];for(const m of l.parameters){const h=Br(m);_.push(MR(a,h))}return _}return E.fail()}function VAe(n,a){return J.experimentalDecorators?Ist(n,a):2}function Ist(n,a){switch(n.parent.kind){case 263:case 231:return 1;case 172:return Ad(n.parent)?3:2;case 174:case 177:case 178:return ie===0||a.parameters.length<=2?2:3;case 169:return 3;default:return E.fail()}}function qAe(n,a){let l,_;const m=Or(n);if(bn(n.expression)){const h=kv(m,n.expression.name);l=h.start,_=a?h.length:n.end-l}else{const h=kv(m,n.expression);l=h.start,_=a?h.length:n.end-l}return{start:l,length:_,sourceFile:m}}function RR(n,a,...l){if(Rs(n)){const{sourceFile:_,start:m,length:h}=qAe(n);return"message"in a?xl(_,m,h,a,...l):BJ(_,a)}else return"message"in a?mn(n,a,...l):Hg(Or(n),n,a)}function Fst(n){if(!Rs(n)||!Ie(n.expression))return!1;const a=_c(n.expression,n.expression.escapedText,111551,void 0,void 0,!1),l=a?.valueDeclaration;if(!l||!us(l)||!Jv(l.parent)||!Wv(l.parent.parent)||!Ie(l.parent.parent.expression))return!1;const _=ade(!1);return _?Yp(l.parent.parent.expression,!0)===_:!1}function HAe(n,a,l,_){var m;const h=ZY(l);if(h>-1)return mn(l[h],d.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);let x=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,F=Number.NEGATIVE_INFINITY,V=Number.POSITIVE_INFINITY,ne;for(const kt of a){const Xt=im(kt),_r=sf(kt);XtF&&(F=Xt),l.length<_r&&_rm?x=Math.min(x,F):V1&&(gr=Sr(xe,Lm,nt,Ut)),gr||(gr=Sr(xe,R_,nt,Ut)),gr)return gr;if(gr=Lst(n,xe,Ne,!!l,_),Wn(n).resolvedSignature=gr,ne)if(!h&&V&&(h=d.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method),Xt)if(Xt.length===1||Xt.length>3){const Er=Xt[Xt.length-1];let hr;Xt.length>3&&(hr=ps(hr,d.The_last_overload_gave_the_following_error),hr=ps(hr,d.No_overload_matches_this_call)),h&&(hr=ps(hr,h));const sn=LR(n,Ne,Er,R_,0,!0,()=>hr);if(sn)for(const ms of sn)Er.declaration&&Xt.length>3&&ua(ms,mn(Er.declaration,d.The_last_overload_is_declared_here)),Nr(Er,ms),wa.add(ms);else E.fail("No error for last overload signature")}else{const Er=[];let hr=0,sn=Number.MAX_VALUE,ms=0,xs=0;for(const fr of Xt){const vi=LR(n,Ne,fr,R_,0,!0,()=>ps(void 0,d.Overload_0_of_1_2_gave_the_following_error,xs+1,xe.length,Yd(fr)));vi?(vi.length<=sn&&(sn=vi.length,ms=xs),hr=Math.max(hr,vi.length),Er.push(vi)):E.fail("No error for 3 or fewer overload signatures"),xs++}const vs=hr>1?Er[ms]:Np(Er);E.assert(vs.length>0,"No errors reported for 3 or fewer overload signatures");let Vi=ps(Yt(vs,jee),d.No_overload_matches_this_call);h&&(Vi=ps(Vi,h));const Cu=[...ta(vs,fr=>fr.relatedInformation)];let If;if(qi(vs,fr=>fr.start===vs[0].start&&fr.length===vs[0].length&&fr.file===vs[0].file)){const{file:fr,start:jr,length:vi}=vs[0];If={file:fr,start:jr,length:vi,code:Vi.code,category:Vi.category,messageText:Vi,relatedInformation:Cu}}else If=Hg(Or(n),n,Vi,Cu);Nr(Xt[0],If),wa.add(If)}else if(_r)wa.add(HAe(n,[_r],Ne,h));else if(Yr)Zme(Yr,n.typeArguments,!0,h);else{const Er=wn(a,hr=>Xme(hr,le));Er.length===0?wa.add(Ost(n,a,le,h)):wa.add(HAe(n,Er,Ne,h))}return gr;function Nr(Er,hr){var sn,ms;const xs=Xt,vs=_r,Vi=Yr,Cu=((ms=(sn=Er.declaration)==null?void 0:sn.symbol)==null?void 0:ms.declarations)||ze,fr=Cu.length>1?kn(Cu,jr=>po(jr)&&ip(jr.body)):void 0;if(fr){const jr=Dp(fr),vi=!jr.typeParameters;Sr([jr],R_,vi)&&ua(hr,mn(fr,d.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible))}Xt=xs,_r=vs,Yr=Vi}function Sr(Er,hr,sn,ms=!1){if(Xt=void 0,_r=void 0,Yr=void 0,sn){const xs=Er[0];if(ut(le)||!KY(n,Ne,xs,ms))return;if(LR(n,Ne,xs,hr,0,!1,void 0)){Xt=[xs];return}return xs}for(let xs=0;xs0),Yx(n),_||a.length===1||a.some(h=>!!h.typeParameters)?jst(n,a,l,m):Mst(a)}function Mst(n){const a=Ii(n,F=>F.thisParameter);let l;a.length&&(l=GAe(a,a.map(JR)));const{min:_,max:m}=fre(n,Rst),h=[];for(let F=0;Fbu(ne)?FBS(ne,F))))}const x=Ii(n,F=>bu(F)?Sa(F.parameters):void 0);let N=128;if(x.length!==0){const F=uu(Mn(Ii(n,wPe),2));h.push($Ae(x,F)),N|=1}return n.some(tV)&&(N|=2),Fg(n[0].declaration,void 0,l,h,fa(n.map(Ma)),void 0,_,N)}function Rst(n){const a=n.parameters.length;return bu(n)?a-1:a}function GAe(n,a){return $Ae(n,Mn(a,2))}function $Ae(n,a){return AS(ba(n),a)}function jst(n,a,l,_){const m=zst(a,Bt===void 0?l.length:Bt),h=a[m],{typeParameters:x}=h;if(!x)return h;const N=MAe(n)?n.typeArguments:void 0,F=N?UQ(h,Bst(N,x,Hr(n))):Jst(n,x,h,l,_);return a[m]=F,F}function Bst(n,a,l){const _=n.map(Zx);for(;_.length>a.length;)_.pop();for(;_.length=a)return m;x>_&&(_=x,l=m)}return l}function Wst(n,a,l){if(n.expression.kind===108){const F=xme(n.expression);if(Ae(F)){for(const V of n.arguments)Ui(V);return Tt}if(!et(F)){const V=Pd(wl(n));if(V){const ne=Ka(F,V.typeArguments,V);return K6(n,ne,a,l,0)}}return RS(n)}let _,m=Ui(n.expression);if(tb(n)){const F=HN(m,n.expression);_=F===m?0:A4(n)?16:8,m=F}else _=0;if(m=TAe(m,n.expression,ast),m===Ki)return $r;const h=e_(m);if(et(h))return rm(n);const x=Ts(h,0),N=Ts(h,1).length;if(jR(m,h,x.length,N))return!et(m)&&n.typeArguments&&je(n,d.Untyped_function_calls_may_not_accept_type_arguments),RS(n);if(!x.length){if(N)je(n,d.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,mr(m));else{let F;if(n.arguments.length===1){const V=Or(n).text;mu(V.charCodeAt(la(V,n.expression.end,!0)-1))&&(F=mn(n.expression,d.Are_you_missing_a_semicolon))}ege(n.expression,h,0,F)}return rm(n)}return l&8&&!n.typeArguments&&x.some(Ust)?(ANe(n,l),En):x.some(F=>Hr(F.declaration)&&!!KB(F.declaration))?(je(n,d.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,mr(m)),rm(n)):K6(n,x,a,l,_)}function Ust(n){return!!(n.typeParameters&&qge(Ma(n)))}function jR(n,a,l,_){return Ae(n)||Ae(a)&&!!(n.flags&262144)||!l&&!_&&!(a.flags&1048576)&&!(hd(a).flags&131072)&&ca(n,St)}function Vst(n,a,l){if(n.arguments&&ie<1){const x=ZY(n.arguments);x>=0&&je(n.arguments[x],d.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher)}let _=Z6(n.expression);if(_===Ki)return $r;if(_=e_(_),et(_))return rm(n);if(Ae(_))return n.typeArguments&&je(n,d.Untyped_function_calls_may_not_accept_type_arguments),RS(n);const m=Ts(_,1);if(m.length){if(!qst(n,m[0]))return rm(n);if(XAe(m,N=>!!(N.flags&4)))return je(n,d.Cannot_create_an_instance_of_an_abstract_class),rm(n);const x=_.symbol&&Qg(_.symbol);return x&&In(x,64)?(je(n,d.Cannot_create_an_instance_of_an_abstract_class),rm(n)):K6(n,m,a,l,0)}const h=Ts(_,0);if(h.length){const x=K6(n,h,a,l,0);return se||(x.declaration&&!nm(x.declaration)&&Ma(x)!==Ni&&je(n,d.Only_a_void_function_can_be_called_with_the_new_keyword),tv(x)===Ni&&je(n,d.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)),x}return ege(n.expression,_,1),rm(n)}function XAe(n,a){return es(n)?ut(n,l=>XAe(l,a)):n.compositeKind===1048576?ut(n.compositeSignatures,a):a(n)}function Kme(n,a){const l=Qc(a);if(!Ir(l))return!1;const _=l[0];if(_.flags&2097152){const m=_.types,h=_Pe(m);let x=0;for(const N of _.types){if(!h[x]&&Pn(N)&3&&(N.symbol===n||Kme(n,N)))return!0;x++}return!1}return _.symbol===n?!0:Kme(n,_)}function qst(n,a){if(!a||!a.declaration)return!0;const l=a.declaration,_=dT(l,6);if(!_||l.kind!==176)return!0;const m=Qg(l.parent.symbol),h=bo(l.parent.symbol);if(!Wge(n,m)){const x=wl(n);if(x&&_&4){const N=Zx(x);if(Kme(l.parent.symbol,N))return!0}return _&2&&je(n,d.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,mr(h)),_&4&&je(n,d.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,mr(h)),!1}return!0}function QAe(n,a,l){let _;const m=l===0,h=zS(a),x=h&&Ts(h,l).length>0;if(a.flags&1048576){const F=a.types;let V=!1;for(const ne of F)if(Ts(ne,l).length!==0){if(V=!0,_)break}else if(_||(_=ps(_,m?d.Type_0_has_no_call_signatures:d.Type_0_has_no_construct_signatures,mr(ne)),_=ps(_,m?d.Not_all_constituents_of_type_0_are_callable:d.Not_all_constituents_of_type_0_are_constructable,mr(a))),V)break;V||(_=ps(void 0,m?d.No_constituent_of_type_0_is_callable:d.No_constituent_of_type_0_is_constructable,mr(a))),_||(_=ps(_,m?d.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:d.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other,mr(a)))}else _=ps(_,m?d.Type_0_has_no_call_signatures:d.Type_0_has_no_construct_signatures,mr(a));let N=m?d.This_expression_is_not_callable:d.This_expression_is_not_constructable;if(Rs(n.parent)&&n.parent.arguments.length===0){const{resolvedSymbol:F}=Wn(n);F&&F.flags&32768&&(N=d.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without)}return{messageChain:ps(_,N),relatedMessage:x?d.Did_you_forget_to_use_await:void 0}}function ege(n,a,l,_){const{messageChain:m,relatedMessage:h}=QAe(n,a,l),x=Hg(Or(n),n,m);if(h&&ua(x,mn(n,h)),Rs(n.parent)){const{start:N,length:F}=qAe(n.parent,!0);x.start=N,x.length=F}wa.add(x),YAe(a,l,_?ua(x,_):x)}function YAe(n,a,l){if(!n.symbol)return;const _=yi(n.symbol).originatingImport;if(_&&!G_(_)){const m=Ts(Br(yi(n.symbol).target),a);if(!m||!m.length)return;ua(l,mn(_,d.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead))}}function Hst(n,a,l){const _=Ui(n.tag),m=e_(_);if(et(m))return rm(n);const h=Ts(m,0),x=Ts(m,1).length;if(jR(_,m,h.length,x))return RS(n);if(!h.length){if(Lu(n.parent)){const N=mn(n.tag,d.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);return wa.add(N),rm(n)}return ege(n.tag,m,0),rm(n)}return K6(n,h,a,l,0)}function Gst(n){switch(n.parent.kind){case 263:case 231:return d.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;case 169:return d.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;case 172:return d.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;case 174:case 177:case 178:return d.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;default:return E.fail()}}function $st(n,a,l){const _=Ui(n.expression),m=e_(_);if(et(m))return rm(n);const h=Ts(m,0),x=Ts(m,1).length;if(jR(_,m,h.length,x))return RS(n);if(Yst(n,h)&&!y_(n.expression)){const F=Wc(n.expression,!1);return je(n,d._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0,F),rm(n)}const N=Gst(n);if(!h.length){const F=QAe(n.expression,m,0),V=ps(F.messageChain,N),ne=Hg(Or(n.expression),n.expression,V);return F.relatedMessage&&ua(ne,mn(n.expression,F.relatedMessage)),wa.add(ne),YAe(m,0,ne),rm(n)}return K6(n,h,a,l,0,N)}function tZ(n,a){const l=MS(n),_=l&&j_(l),m=_&&S_(_,mf.Element,788968),h=m&&pt.symbolToEntityName(m,788968,n),x=I.createFunctionTypeNode(void 0,[I.createParameterDeclaration(void 0,void 0,"props",void 0,pt.typeToTypeNode(a,n))],h?I.createTypeReferenceNode(h,void 0):I.createKeywordTypeNode(133)),N=Aa(1,"props");return N.links.type=a,Fg(x,void 0,void 0,[N],m?bo(m):st,void 0,1,0)}function Xst(n,a,l){if(Qx(n.tagName)){const x=gAe(n),N=tZ(n,x);return Oy(t4(n.attributes,VY(N,n),void 0,0),x,n.tagName,n.attributes),Ir(n.typeArguments)&&(Zt(n.typeArguments,oa),wa.add(Pk(Or(n),n.typeArguments,d.Expected_0_type_arguments_but_got_1,0,Ir(n.typeArguments)))),N}const _=Ui(n.tagName),m=e_(_);if(et(m))return rm(n);const h=dAe(_,n);return jR(_,m,h.length,0)?RS(n):h.length===0?(je(n.tagName,d.JSX_element_type_0_does_not_have_any_construct_or_call_signatures,Wc(n.tagName)),rm(n)):K6(n,h,a,l,0)}function Qst(n,a,l){const _=Ui(n.right);if(!Ae(_)){const m=dge(_);if(m){const h=e_(m);if(et(h))return rm(n);const x=Ts(h,0),N=Ts(h,1);if(jR(m,h,x.length,N.length))return RS(n);if(x.length)return K6(n,x,a,l,0)}else if(!(xZ(_)||Fy(_,St)))return je(n.right,d.The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method),rm(n)}return Tt}function Yst(n,a){return a.length&&qi(a,l=>l.minArgumentCount===0&&!bu(l)&&l.parameters.length1?Bc(n.arguments[1]):void 0;for(let h=2;h{const x=nf(m);_Y(h,x)||V8e(m,h,l,d.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first)})}function aat(n){const a=Ui(n.expression),l=HN(a,n.expression);return kY(Sh(l),n,l!==a)}function oat(n){return n.flags&64?aat(n):Sh(Ui(n.expression))}function iNe(n){if(Y7e(n),Zt(n.typeArguments,oa),n.kind===233){const l=Rh(n.parent);l.kind===226&&l.operatorToken.kind===104&&Av(n,l.right)&&je(n,d.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression)}const a=n.kind===233?Ui(n.expression):Lv(n.exprName)?CR(n.exprName):Ui(n.exprName);return sNe(a,n)}function sNe(n,a){const l=a.typeArguments;if(n===Ki||et(n)||!ut(l))return n;let _=!1,m;const h=N(n),x=_?m:n;return x&&wa.add(Pk(Or(a),l,d.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable,mr(x))),h;function N(V){let ne=!1,le=!1;const xe=Ne(V);return _||(_=le),ne&&!le&&(m??(m=V)),xe;function Ne(nt){if(nt.flags&524288){const kt=gd(nt),Xt=F(kt.callSignatures),_r=F(kt.constructSignatures);if(ne||(ne=kt.callSignatures.length!==0||kt.constructSignatures.length!==0),le||(le=Xt.length!==0||_r.length!==0),Xt!==kt.callSignatures||_r!==kt.constructSignatures){const Yr=Qo(void 0,kt.members,Xt,_r,kt.indexInfos);return Yr.objectFlags|=8388608,Yr.node=a,Yr}}else if(nt.flags&58982400){const kt=Ku(nt);if(kt){const Xt=Ne(kt);if(Xt!==kt)return Xt}}else{if(nt.flags&1048576)return Io(nt,N);if(nt.flags&2097152)return fa(Yc(nt.types,Ne))}return nt}}function F(V){const ne=wn(V,le=>!!le.typeParameters&&Xme(le,l));return Yc(ne,le=>{const xe=Zme(le,l,!0);return xe?LN(le,xe,Hr(le.declaration)):le})}}function cat(n){return oa(n.type),ige(n.expression,n.type)}function ige(n,a,l){const _=Ui(n,l),m=si(a);if(et(m))return m;const h=Ar(a.parent,x=>x.kind===238||x.kind===357);return Oy(_,m,h,n,d.Type_0_does_not_satisfy_the_expected_type_1),_}function lat(n){return i_t(n),n.keywordToken===105?sge(n):n.keywordToken===102?uat(n):E.assertNever(n.keywordToken)}function aNe(n){switch(n.keywordToken){case 102:return qPe();case 105:const a=sge(n);return et(a)?st:Dat(a);default:E.assertNever(n.keywordToken)}}function sge(n){const a=Zee(n);if(a)if(a.kind===176){const l=cn(a.parent);return Br(l)}else{const l=cn(a);return Br(l)}else return je(n,d.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor,"new.target"),st}function uat(n){B===100||B===199?Or(n).impliedNodeFormat!==99&&je(n,d.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output):B<6&&B!==4&&je(n,d.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);const a=Or(n);return E.assert(!!(a.flags&8388608),"Containing file is missing import meta node flag."),n.name.escapedText==="meta"?VPe():st}function JR(n){const a=n.valueDeclaration;return El(Br(n),!1,!!a&&(J0(a)||EE(a)))}function age(n,a,l="arg"){return n?(E.assert(Ie(n.name)),n.name.escapedText):`${l}_${a}`}function wD(n,a,l){const _=n.parameters.length-(bu(n)?1:0);if(a<_)return n.parameters[a].escapedName;const m=n.parameters[_]||dt,h=l||Br(m);if(pa(h)){const x=h.target.labeledElementDeclarations,N=a-_;return age(x?.[N],N,m.escapedName)}return m.escapedName}function _at(n,a){var l;if(((l=n.declaration)==null?void 0:l.kind)===324)return;const _=n.parameters.length-(bu(n)?1:0);if(a<_){const N=n.parameters[a],F=oNe(N);return F?{parameter:F,parameterName:N.escapedName,isRestParameter:!1}:void 0}const m=n.parameters[_]||dt,h=oNe(m);if(!h)return;const x=Br(m);if(pa(x)){const N=x.target.labeledElementDeclarations,F=a-_,V=N?.[F],ne=!!V?.dotDotDotToken;return V?(E.assert(Ie(V.name)),{parameter:V.name,parameterName:V.name.escapedText,isRestParameter:ne}):void 0}if(a===_)return{parameter:h,parameterName:m.escapedName,isRestParameter:!0}}function oNe(n){return n.valueDeclaration&&us(n.valueDeclaration)&&Ie(n.valueDeclaration.name)&&n.valueDeclaration.name}function cNe(n){return n.kind===202||us(n)&&n.name&&Ie(n.name)}function fat(n,a){const l=n.parameters.length-(bu(n)?1:0);if(a=_-1)return a===_-1?h:uu(J_(h,vt));const x=[],N=[],F=[];for(let V=a;V<_;V++)!h||V<_-1?(x.push(Sd(n,V)),N.push(V!(F&1)),N=x<0?h.target.fixedLength:x;N>0&&(m=n.parameters.length-1+N)}}if(m===void 0){if(!l&&n.flags&32)return 0;m=n.minArgumentCount}if(_)return m;for(let h=m-1;h>=0;h--){const x=Sd(n,h);if(jc(x,RAe).flags&131072)break;m=h}n.resolvedMinArgumentCount=m}return n.resolvedMinArgumentCount}function Xm(n){if(bu(n)){const a=Br(n.parameters[n.parameters.length-1]);return!pa(a)||a.target.hasRestElement}return!1}function n7(n){if(bu(n)){const a=Br(n.parameters[n.parameters.length-1]);if(!pa(a))return a;if(a.target.hasRestElement)return mD(a,a.target.fixedLength)}}function i7(n){const a=n7(n);return a&&!ep(a)&&!Ae(a)?a:void 0}function oge(n){return cge(n,Cn)}function cge(n,a){return n.parameters.length>0?Sd(n,0):a}function lNe(n,a,l){const _=n.parameters.length-(bu(n)?1:0);for(let m=0;m<_;m++){const h=n.parameters[m].valueDeclaration,x=Wl(h);if(x){const N=El(si(x),!1,EE(h)),F=Sd(a,m);Th(l.inferences,N,F)}}}function pat(n,a){if(a.typeParameters)if(!n.typeParameters)n.typeParameters=a.typeParameters;else return;if(a.thisParameter){const _=n.thisParameter;(!_||_.valueDeclaration&&!_.valueDeclaration.type)&&(_||(n.thisParameter=AS(a.thisParameter,void 0)),zR(n.thisParameter,Br(a.thisParameter)))}const l=n.parameters.length-(bu(n)?1:0);for(let _=0;_=0);const h=gc(_.parent)?Br(cn(_.parent.parent)):J7e(_.parent),x=gc(_.parent)?j:z7e(_.parent),N=vd(m),F=pd("target",h),V=pd("propertyKey",x),ne=pd("parameterIndex",N);l.decoratorSignature=_7(void 0,void 0,[F,V,ne],Ni);break}case 174:case 177:case 178:case 172:{const _=a;if(!Qn(_.parent))break;const m=J7e(_),h=pd("target",m),x=z7e(_),N=pd("propertyKey",x),F=Es(_)?Ni:ZPe(Zx(_));if(ie!==0&&(!Es(a)||Ad(a))){const ne=ZPe(Zx(_)),le=pd("descriptor",ne);l.decoratorSignature=_7(void 0,void 0,[h,N,le],Mn([F,Ni]))}else l.decoratorSignature=_7(void 0,void 0,[h,N],Mn([F,Ni]));break}}return l.decoratorSignature===Tt?void 0:l.decoratorSignature}function uge(n){return Y?Eat(n):Cat(n)}function WR(n){const a=nR(!0);return a!==rs?(n=C0(FD(n))||or,v0(a,[n])):or}function fNe(n){const a=XPe(!0);return a!==rs?(n=C0(FD(n))||or,v0(a,[n])):or}function UR(n,a){const l=WR(a);return l===or?(je(n,G_(n)?d.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:d.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option),st):(ade(!0)||je(n,G_(n)?d.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:d.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option),l)}function Dat(n){const a=Aa(0,"NewTargetExpression"),l=Aa(4,"target",8);l.parent=a,l.links.type=n;const _=zs([l]);return a.members=_,Qo(a,_,ze,ze,ze)}function iZ(n,a){if(!n.body)return st;const l=pl(n),_=(l&2)!==0,m=(l&1)!==0;let h,x,N,F=Ni;if(n.body.kind!==241)h=Bc(n.body,a&&a&-9),_&&(h=FD(u7(h,!1,n,d.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)));else if(m){const V=yNe(n,a);V?V.length>0&&(h=Mn(V,2)):F=Cn;const{yieldTypes:ne,nextTypes:le}=Pat(n,a);x=ut(ne)?Mn(ne,2):void 0,N=ut(le)?fa(le):void 0}else{const V=yNe(n,a);if(!V)return l&2?UR(n,Cn):Cn;if(V.length===0){const ne=JY(n,void 0),le=ne&&(ej(ne,l)||Ni).flags&32768?j:Ni;return l&2?UR(n,le):le}h=Mn(V,2)}if(h||x||N){if(x&&PY(n,x,3),h&&PY(n,h,1),N&&PY(n,N,2),h&&bd(h)||x&&bd(x)||N&&bd(N)){const V=Ame(n),ne=V?V===Dp(n)?m?void 0:h:WY(Ma(V),n,void 0):void 0;m?(x=Gde(x,ne,0,_),h=Gde(h,ne,1,_),N=Gde(N,ne,2,_)):h=Frt(h,ne,_)}x&&(x=nf(x)),h&&(h=nf(h)),N&&(N=nf(N))}return m?pNe(x||Cn,h||F,N||eAe(2,n)||or,_):_?WR(h||F):h||F}function pNe(n,a,l,_){const m=_?no:rl,h=m.getGlobalGeneratorType(!1);if(n=m.resolveIterationType(n,void 0)||or,a=m.resolveIterationType(a,void 0)||or,l=m.resolveIterationType(l,void 0)||or,h===rs){const x=m.getGlobalIterableIteratorType(!1),N=x!==rs?s7e(x,m):void 0,F=N?N.returnType:G,V=N?N.nextType:j;return ca(a,F)&&ca(V,l)?x!==rs?RN(x,[n]):(m.getGlobalIterableIteratorType(!0),Us):(m.getGlobalGeneratorType(!0),Us)}return RN(h,[n,a,l])}function Pat(n,a){const l=[],_=[],m=(pl(n)&2)!==0;return zee(n.body,h=>{const x=h.expression?Ui(h.expression,a):ce;tp(l,dNe(h,x,G,m));let N;if(h.asteriskToken){const F=gZ(x,m?19:17,h.expression);N=F&&F.nextType}else N=d_(h,void 0);N&&tp(_,N)}),{yieldTypes:l,nextTypes:_}}function dNe(n,a,l,_){const m=n.expression||n,h=n.asteriskToken?E0(_?19:17,a,l,m):a;return _?zS(h,m,n.asteriskToken?d.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:d.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):h}function mNe(n,a,l){let _=0;for(let m=0;m=a?l[m]:void 0;_|=h!==void 0?nV.get(h)||32768:0}return _}function gNe(n){const a=Wn(n);if(a.isExhaustive===void 0){a.isExhaustive=0;const l=wat(n);a.isExhaustive===0&&(a.isExhaustive=l)}else a.isExhaustive===0&&(a.isExhaustive=!1);return a.isExhaustive}function wat(n){if(n.expression.kind===221){const _=Lwe(n);if(!_)return!1;const m=mh(Bc(n.expression.expression)),h=mNe(0,0,_);return m.flags&3?(556800&h)===556800:!em(m,x=>kD(x,h)===h)}const a=Bc(n.expression);if(!qN(a))return!1;const l=FY(n);return!l.length||ut(l,Art)?!1:Dnt(Io(a,t_),l)}function hNe(n){return n.endFlowNode&&xR(n.endFlowNode)}function yNe(n,a){const l=pl(n),_=[];let m=hNe(n),h=!1;if(Ev(n.body,x=>{let N=x.expression;if(N){if(N=Ha(N,!0),l&2&&N.kind===223&&(N=Ha(N.expression,!0)),N.kind===213&&N.expression.kind===80&&Bc(N.expression).symbol===n.symbol){h=!0;return}let F=Bc(N,a&&a&-9);l&2&&(F=FD(u7(F,!1,n,d.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member))),F.flags&131072&&(h=!0),tp(_,F)}else m=!0}),!(_.length===0&&!m&&(h||Aat(n))))return H&&_.length&&m&&!(nm(n)&&_.some(x=>x.symbol===n.symbol))&&tp(_,j),_}function Aat(n){switch(n.kind){case 218:case 219:return!0;case 174:return n.parent.kind===210;default:return!1}}function _ge(n,a){r(l);return;function l(){const _=pl(n),m=a&&ej(a,_);if(m&&(Yo(m,16384)||m.flags&32769)||n.kind===173||sc(n.body)||n.body.kind!==241||!hNe(n))return;const h=n.flags&1024,x=up(n)||n;if(m&&m.flags&131072)je(x,d.A_function_returning_never_cannot_have_a_reachable_end_point);else if(m&&!h)je(x,d.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value);else if(m&&H&&!ca(j,m))je(x,d.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);else if(J.noImplicitReturns){if(!m){if(!h)return;const N=Ma(Dp(n));if(p7e(n,N))return}je(x,d.Not_all_code_paths_return_a_value)}}}function vNe(n,a){if(E.assert(n.kind!==174||Mp(n)),Yx(n),ro(n)&&OD(n,n.name),a&&a&4&&Zf(n)){if(!up(n)&&!V5(n)){const _=e7(n);if(_&&lv(Ma(_))){const m=Wn(n);if(m.contextFreeType)return m.contextFreeType;const h=iZ(n,a),x=Fg(void 0,void 0,void 0,ze,h,void 0,0,64),N=Qo(n.symbol,W,[x],ze,ze);return N.objectFlags|=262144,m.contextFreeType=N}}return qt}return!DZ(n)&&n.kind===218&&$ge(n),Nat(n,a),Br(cn(n))}function Nat(n,a){const l=Wn(n);if(!(l.flags&64)){const _=e7(n);if(!(l.flags&64)){l.flags|=64;const m=bl(Ts(Br(cn(n)),0));if(!m)return;if(Zf(n))if(_){const h=W2(n);let x;if(a&&a&2){lNe(m,_,h);const N=n7(_);N&&N.flags&262144&&(x=X6(_,h.nonFixingMapper))}x||(x=h?X6(_,h.mapper):_),pat(m,x)}else dat(m);else if(_&&!n.typeParameters&&_.parameters.length>n.parameters.length){const h=W2(n);a&&a&2&&lNe(m,_,h)}if(_&&!V6(n)&&!m.resolvedReturnType){const h=iZ(n,a);m.resolvedReturnType||(m.resolvedReturnType=h)}o7(n)}}}function Iat(n){E.assert(n.kind!==174||Mp(n));const a=pl(n),l=V6(n);if(_ge(n,l),n.body)if(up(n)||Ma(Dp(n)),n.body.kind===241)oa(n.body);else{const _=Ui(n.body),m=l&&ej(l,a);if(m)if((a&3)===2){const h=u7(_,!1,n.body,d.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);Oy(h,m,n.body,n.body)}else Oy(_,m,n.body,n.body)}}function sZ(n,a,l,_=!1){if(!ca(a,os)){const m=_&&ID(a);return Bu(n,!!m&&ca(m,os),l),!1}return!0}function Fat(n){if(!Rs(n)||!pb(n))return!1;const a=Bc(n.arguments[2]);if(q(a,"value")){const m=Gs(a,"writable"),h=m&&Br(m);if(!h||h===Wt||h===Lr)return!0;if(m&&m.valueDeclaration&&Hc(m.valueDeclaration)){const x=m.valueDeclaration.initializer,N=Ui(x);if(N===Wt||N===Lr)return!0}return!1}return!Gs(a,"set")}function Td(n){return!!(Ko(n)&8||n.flags&4&&Mf(n)&8||n.flags&3&&Rme(n)&6||n.flags&98304&&!(n.flags&65536)||n.flags&8||ut(n.declarations,Fat))}function bNe(n,a,l){var _,m;if(l===0)return!1;if(Td(a)){if(a.flags&4&&co(n)&&n.expression.kind===110){const h=uf(n);if(!(h&&(h.kind===176||nm(h))))return!0;if(a.valueDeclaration){const x=Gr(a.valueDeclaration),N=h.parent===a.valueDeclaration.parent,F=h===a.valueDeclaration.parent,V=x&&((_=a.parent)==null?void 0:_.valueDeclaration)===h.parent,ne=x&&((m=a.parent)==null?void 0:m.valueDeclaration)===h;return!(N||F||V||ne)}}return!0}if(co(n)){const h=Ha(n.expression);if(h.kind===80){const x=Wn(h).resolvedSymbol;if(x.flags&2097152){const N=Sp(x);return!!N&&N.kind===274}}}return!1}function s7(n,a,l){const _=bc(n,7);return _.kind!==80&&!co(_)?(je(n,a),!1):_.flags&64?(je(n,l),!1):!0}function Oat(n){Ui(n.expression);const a=Ha(n.expression);if(!co(a))return je(a,d.The_operand_of_a_delete_operator_must_be_a_property_reference),On;bn(a)&&Ti(a.name)&&je(a,d.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);const l=Wn(a),_=kp(l.resolvedSymbol);return _&&(Td(_)?je(a,d.The_operand_of_a_delete_operator_cannot_be_a_read_only_property):Lat(a,_)),On}function Lat(n,a){const l=Br(a);H&&!(l.flags&131075)&&!(he?a.flags&16777216:wp(l,16777216))&&je(n,d.The_operand_of_a_delete_operator_must_be_optional)}function Mat(n){return Ui(n.expression),v6}function Rat(n){return Yx(n),ce}function SNe(n){let a=!1;const l=WI(n);if(l&&Go(l)){const _=Z0(n)?d.await_expression_cannot_be_used_inside_a_class_static_block:d.await_using_statements_cannot_be_used_inside_a_class_static_block;je(n,_),a=!0}else if(!(n.flags&65536))if(VI(n)){const _=Or(n);if(!q2(_)){let m;if(!sT(_,J)){m??(m=Sm(_,n.pos));const h=Z0(n)?d.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:d.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module,x=xl(_,m.start,m.length,h);wa.add(x),a=!0}switch(B){case 100:case 199:if(_.impliedNodeFormat===1){m??(m=Sm(_,n.pos)),wa.add(xl(_,m.start,m.length,d.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)),a=!0;break}case 7:case 99:case 4:if(ie>=4)break;default:m??(m=Sm(_,n.pos));const h=Z0(n)?d.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:d.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher;wa.add(xl(_,m.start,m.length,h)),a=!0;break}}}else{const _=Or(n);if(!q2(_)){const m=Sm(_,n.pos),h=Z0(n)?d.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:d.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules,x=xl(_,m.start,m.length,h);if(l&&l.kind!==176&&!(pl(l)&2)){const N=mn(l,d.Did_you_mean_to_mark_this_function_as_async);ua(x,N)}wa.add(x),a=!0}}return Z0(n)&&Cme(n)&&(je(n,d.await_expressions_cannot_be_used_in_a_parameter_initializer),a=!0),a}function jat(n){r(()=>SNe(n));const a=Ui(n.expression),l=u7(a,!0,n,d.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);return l===a&&!et(l)&&!(a.flags&3)&&Ol(!1,mn(n,d.await_has_no_effect_on_the_type_of_this_expression)),l}function Bat(n){const a=Ui(n.operand);if(a===Ki)return Ki;switch(n.operand.kind){case 9:switch(n.operator){case 41:return Gx(vd(-n.operand.text));case 40:return Gx(vd(+n.operand.text))}break;case 10:if(n.operator===41)return Gx(rY({negative:!0,base10Value:bE(n.operand.text)}))}switch(n.operator){case 40:case 41:case 55:return tm(a,n.operand),VR(a,12288)&&je(n.operand,d.The_0_operator_cannot_be_applied_to_type_symbol,Hs(n.operator)),n.operator===40?(VR(a,2112)&&je(n.operand,d.Operator_0_cannot_be_applied_to_type_1,Hs(n.operator),mr(bh(a))),vt):fge(a);case 54:wge(a,n.operand);const l=kD(a,12582912);return l===4194304?Wt:l===8388608?Zr:On;case 46:case 47:return sZ(n.operand,tm(a,n.operand),d.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&s7(n.operand,d.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,d.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),fge(a)}return st}function Jat(n){const a=Ui(n.operand);return a===Ki?Ki:(sZ(n.operand,tm(a,n.operand),d.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&s7(n.operand,d.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,d.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),fge(a))}function fge(n){return Yo(n,2112)?Ml(n,3)||Yo(n,296)?os:Lt:vt}function VR(n,a){if(Yo(n,a))return!0;const l=mh(n);return!!l&&Yo(l,a)}function Yo(n,a){if(n.flags&a)return!0;if(n.flags&3145728){const l=n.types;for(const _ of l)if(Yo(_,a))return!0}return!1}function Ml(n,a,l){return n.flags&a?!0:l&&n.flags&114691?!1:!!(a&296)&&ca(n,vt)||!!(a&2112)&&ca(n,Lt)||!!(a&402653316)&&ca(n,Fe)||!!(a&528)&&ca(n,On)||!!(a&16384)&&ca(n,Ni)||!!(a&131072)&&ca(n,Cn)||!!(a&65536)&&ca(n,De)||!!(a&32768)&&ca(n,j)||!!(a&4096)&&ca(n,Ln)||!!(a&67108864)&&ca(n,ia)}function qR(n,a,l){return n.flags&1048576?qi(n.types,_=>qR(_,a,l)):Ml(n,a,l)}function aZ(n){return!!(Pn(n)&16)&&!!n.symbol&&pge(n.symbol)}function pge(n){return(n.flags&128)!==0}function dge(n){const a=o7e("hasInstance"),l=K1(n,a);if(l){const _=Br(l);if(_&&Ts(_,0).length!==0)return _}}function zat(n,a,l,_,m){if(l===Ki||_===Ki)return Ki;!Ae(l)&&qR(l,402784252)&&je(n,d.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter),E.assert(v5(n.parent));const h=e4(n.parent,void 0,m);if(h===En)return Ki;const x=Ma(h);return Uu(x,On,a,d.An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression),On}function Wat(n){return em(n,a=>a===$o||!!(a.flags&2097152)&&vh(mh(a)))}function Uat(n,a,l,_){if(l===Ki||_===Ki)return Ki;if(Ti(n)){if(ie<99&&nl(n,2097152),!Wn(n).resolvedSymbol&&wl(n)){const m=Ume(n,_.symbol,!0);wAe(n,_,m)}}else Uu(tm(l,n),Cr,n);return Uu(tm(_,a),ia,a)&&Wat(_)&&je(a,d.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator,mr(_)),On}function Vat(n,a,l){const _=n.properties;if(H&&_.length===0)return tm(a,n);for(let m=0;m<_.length;m++)TNe(n,a,m,_,l);return a}function TNe(n,a,l,_,m=!1){const h=n.properties,x=h[l];if(x.kind===303||x.kind===304){const N=x.name,F=S0(N);if(pp(F)){const le=dp(F),xe=Gs(a,le);xe&&(OR(xe,x,m),Bme(x,!1,!0,a,xe))}const V=J_(a,F,32,N),ne=ci(x,V);return JS(x.kind===304?x:x.initializer,ne)}else if(x.kind===305)if(lmD(V,l)):uu(_);return JS(N,F,m)}}}}function JS(n,a,l,_){let m;if(n.kind===304){const h=n;h.objectAssignmentInitializer&&(H&&!wp(Ui(h.objectAssignmentInitializer),16777216)&&(a=Ap(a,524288)),Xat(h.name,h.equalsToken,h.objectAssignmentInitializer,l)),m=n.name}else m=n;return m.kind===226&&m.operatorToken.kind===64&&(be(m,l),m=m.left,H&&(a=Ap(a,524288))),m.kind===210?Vat(m,a,_):m.kind===209?qat(m,a,l):Hat(m,a,l)}function Hat(n,a,l){const _=Ui(n,l),m=n.parent.kind===305?d.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:d.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,h=n.parent.kind===305?d.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:d.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;return s7(n,m,h)&&Oy(a,_,n,n),hk(n)&&nl(n.parent,1048576),a}function HR(n){switch(n=Ha(n),n.kind){case 80:case 11:case 14:case 215:case 228:case 15:case 9:case 10:case 112:case 97:case 106:case 157:case 218:case 231:case 219:case 209:case 210:case 221:case 235:case 285:case 284:return!0;case 227:return HR(n.whenTrue)&&HR(n.whenFalse);case 226:return Bh(n.operatorToken.kind)?!1:HR(n.left)&&HR(n.right);case 224:case 225:switch(n.operator){case 54:case 40:case 41:case 55:return!0}return!1;case 222:case 216:case 234:default:return!1}}function mge(n,a){return(a.flags&98304)!==0||_Y(n,a)}function Gat(){const n=rO(a,l,_,m,h,x);return(xe,Ne)=>{const nt=n(xe,Ne);return E.assertIsDefined(nt),nt};function a(xe,Ne,nt){return Ne?(Ne.stackIndex++,Ne.skip=!1,V(Ne,void 0),le(Ne,void 0)):Ne={checkMode:nt,skip:!1,stackIndex:0,typeStack:[void 0,void 0]},Hr(xe)&&aT(xe)?(Ne.skip=!0,le(Ne,Ui(xe.right,nt)),Ne):($at(xe),xe.operatorToken.kind===64&&(xe.left.kind===210||xe.left.kind===209)&&(Ne.skip=!0,le(Ne,JS(xe.left,Ui(xe.right,nt),nt,xe.right.kind===110))),Ne)}function l(xe,Ne,nt){if(!Ne.skip)return N(Ne,xe)}function _(xe,Ne,nt){if(!Ne.skip){const kt=ne(Ne);E.assertIsDefined(kt),V(Ne,kt),le(Ne,void 0);const Xt=xe.kind;if(b8(Xt)){let _r=nt.parent;for(;_r.kind===217||S8(_r);)_r=_r.parent;(Xt===56||Pb(_r))&&Pge(nt.left,kt,Pb(_r)?_r.thenStatement:void 0),wge(kt,nt.left)}}}function m(xe,Ne,nt){if(!Ne.skip)return N(Ne,xe)}function h(xe,Ne){let nt;if(Ne.skip)nt=ne(Ne);else{const kt=F(Ne);E.assertIsDefined(kt);const Xt=ne(Ne);E.assertIsDefined(Xt),nt=kNe(xe.left,xe.operatorToken,xe.right,kt,Xt,Ne.checkMode,xe)}return Ne.skip=!1,V(Ne,void 0),le(Ne,void 0),Ne.stackIndex--,nt}function x(xe,Ne,nt){return le(xe,Ne),xe}function N(xe,Ne){if(Gr(Ne))return Ne;le(xe,Ui(Ne,xe.checkMode))}function F(xe){return xe.typeStack[xe.stackIndex]}function V(xe,Ne){xe.typeStack[xe.stackIndex]=Ne}function ne(xe){return xe.typeStack[xe.stackIndex+1]}function le(xe,Ne){xe.typeStack[xe.stackIndex+1]=Ne}}function $at(n){const{left:a,operatorToken:l,right:_}=n;l.kind===61&&(Gr(a)&&(a.operatorToken.kind===57||a.operatorToken.kind===56)&&Kt(a,d._0_and_1_operations_cannot_be_mixed_without_parentheses,Hs(a.operatorToken.kind),Hs(l.kind)),Gr(_)&&(_.operatorToken.kind===57||_.operatorToken.kind===56)&&Kt(_,d._0_and_1_operations_cannot_be_mixed_without_parentheses,Hs(_.operatorToken.kind),Hs(l.kind)))}function Xat(n,a,l,_,m){const h=a.kind;if(h===64&&(n.kind===210||n.kind===209))return JS(n,Ui(l,_),_,l.kind===110);let x;b8(h)?x=LD(n,_):x=Ui(n,_);const N=Ui(l,_);return kNe(n,a,l,x,N,_,m)}function kNe(n,a,l,_,m,h,x){const N=a.kind;switch(N){case 42:case 43:case 67:case 68:case 44:case 69:case 45:case 70:case 41:case 66:case 48:case 71:case 49:case 72:case 50:case 73:case 52:case 75:case 53:case 79:case 51:case 74:if(_===Ki||m===Ki)return Ki;_=tm(_,n),m=tm(m,l);let Ut;if(_.flags&528&&m.flags&528&&(Ut=xe(a.kind))!==void 0)return je(x||a,d.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead,Hs(a.kind),Hs(Ut)),vt;{const Er=sZ(n,_,d.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0),hr=sZ(l,m,d.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0);let sn;if(Ml(_,3)&&Ml(m,3)||!(Yo(_,2112)||Yo(m,2112)))sn=vt;else if(F(_,m)){switch(N){case 50:case 73:Xt();break;case 43:case 68:ie<3&&je(x,d.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later)}sn=Lt}else Xt(F),sn=st;return Er&&hr&&Ne(sn),sn}case 40:case 65:if(_===Ki||m===Ki)return Ki;!Ml(_,402653316)&&!Ml(m,402653316)&&(_=tm(_,n),m=tm(m,l));let Nr;return Ml(_,296,!0)&&Ml(m,296,!0)?Nr=vt:Ml(_,2112,!0)&&Ml(m,2112,!0)?Nr=Lt:Ml(_,402653316,!0)||Ml(m,402653316,!0)?Nr=Fe:(Ae(_)||Ae(m))&&(Nr=et(_)||et(m)?st:G),Nr&&!le(N)?Nr:Nr?(N===65&&Ne(Nr),Nr):(Xt((hr,sn)=>Ml(hr,402655727)&&Ml(sn,402655727)),G);case 30:case 32:case 33:case 34:return le(N)&&(_=qde(tm(_,n)),m=qde(tm(m,l)),kt((Er,hr)=>{if(Ae(Er)||Ae(hr))return!0;const sn=ca(Er,os),ms=ca(hr,os);return sn&&ms||!sn&&!ms&&uR(Er,hr)})),On;case 35:case 36:case 37:case 38:if(!(h&&h&64)){if((lJ(n)||lJ(l))&&(!Hr(n)||N===37||N===38)){const Er=N===35||N===37;je(x,d.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value,Er?"false":"true")}Yr(x,N,n,l),kt((Er,hr)=>mge(Er,hr)||mge(hr,Er))}return On;case 104:return zat(n,l,_,m,h);case 103:return Uat(n,l,_,m);case 56:case 77:{const Er=wp(_,4194304)?Mn([Mrt(H?_:bh(m)),m]):_;return N===77&&Ne(m),Er}case 57:case 76:{const Er=wp(_,8388608)?Mn([Sh(cwe(_)),m],2):_;return N===76&&Ne(m),Er}case 61:case 78:{const Er=wp(_,262144)?Mn([Sh(_),m],2):_;return N===78&&Ne(m),Er}case 64:const Sr=Gr(n.parent)?ac(n.parent):0;return V(Sr,m),nt(Sr)?((!(m.flags&524288)||Sr!==2&&Sr!==6&&!yh(m)&&!pme(m)&&!(Pn(m)&1))&&Ne(m),_):(Ne(m),m);case 28:if(!J.allowUnreachableCode&&HR(n)&&!ne(n.parent)){const Er=Or(n),hr=Er.text,sn=la(hr,n.pos);Er.parseDiagnostics.some(xs=>xs.code!==d.JSX_expressions_must_have_one_parent_element.code?!1:XB(xs,sn))||je(n,d.Left_side_of_comma_operator_is_unused_and_has_no_side_effects)}return m;default:return E.fail()}function F(Ut,Nr){return Ml(Ut,2112)&&Ml(Nr,2112)}function V(Ut,Nr){if(Ut===2)for(const Sr of Ey(Nr)){const Er=Br(Sr);if(Er.symbol&&Er.symbol.flags&32){const hr=Sr.escapedName,sn=_c(Sr.valueDeclaration,hr,788968,void 0,hr,!1);sn?.declarations&&sn.declarations.some(bC)&&(dd(sn,d.Duplicate_identifier_0,bi(hr),Sr),dd(Sr,d.Duplicate_identifier_0,bi(hr),sn))}}}function ne(Ut){return Ut.parent.kind===217&&A_(Ut.left)&&Ut.left.text==="0"&&(Rs(Ut.parent.parent)&&Ut.parent.parent.expression===Ut.parent||Ut.parent.parent.kind===215)&&(co(Ut.right)||Ie(Ut.right)&&Ut.right.escapedText==="eval")}function le(Ut){const Nr=VR(_,12288)?n:VR(m,12288)?l:void 0;return Nr?(je(Nr,d.The_0_operator_cannot_be_applied_to_type_symbol,Hs(Ut)),!1):!0}function xe(Ut){switch(Ut){case 52:case 75:return 57;case 53:case 79:return 38;case 51:case 74:return 56;default:return}}function Ne(Ut){Bh(N)&&r(Nr);function Nr(){let Sr=_;if(a3(a.kind)&&n.kind===211&&(Sr=GY(n,void 0,!0)),s7(n,d.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,d.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)){let Er;if(he&&bn(n)&&Yo(Ut,32768)){const hr=q(Zl(n.expression),n.name.escapedText);pY(Ut,hr)&&(Er=d.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target)}Oy(Ut,Sr,n,l,Er)}}}function nt(Ut){var Nr;switch(Ut){case 2:return!0;case 1:case 5:case 6:case 3:case 4:const Sr=tf(n),Er=aT(l);return!!Er&&ma(Er)&&!!((Nr=Sr?.exports)!=null&&Nr.size);default:return!1}}function kt(Ut){return Ut(_,m)?!1:(Xt(Ut),!0)}function Xt(Ut){let Nr=!1;const Sr=x||a;if(Ut){const xs=C0(_),vs=C0(m);Nr=!(xs===_&&vs===m)&&!!(xs&&vs)&&Ut(xs,vs)}let Er=_,hr=m;!Nr&&Ut&&([Er,hr]=Qat(_,m,Ut));const[sn,ms]=vy(Er,hr);_r(Sr,Nr,sn,ms)||Bu(Sr,Nr,d.Operator_0_cannot_be_applied_to_types_1_and_2,Hs(a.kind),sn,ms)}function _r(Ut,Nr,Sr,Er){switch(a.kind){case 37:case 35:case 38:case 36:return Bu(Ut,Nr,d.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap,Sr,Er);default:return}}function Yr(Ut,Nr,Sr,Er){const hr=gr(Ha(Sr)),sn=gr(Ha(Er));if(hr||sn){const ms=je(Ut,d.This_condition_will_always_return_0,Hs(Nr===37||Nr===35?97:112));if(hr&&sn)return;const xs=Nr===38||Nr===36?Hs(54):"",vs=hr?Er:Sr,Vi=Ha(vs);ua(ms,mn(vs,d.Did_you_mean_0,`${xs}Number.isNaN(${oc(Vi)?D_(Vi):"..."})`))}}function gr(Ut){if(Ie(Ut)&&Ut.escapedText==="NaN"){const Nr=Wet();return!!Nr&&Nr===Qp(Ut)}return!1}}function Qat(n,a,l){let _=n,m=a;const h=bh(n),x=bh(a);return l(h,x)||(_=h,m=x),[_,m]}function Yat(n){r(xe);const a=uf(n);if(!a)return G;const l=pl(a);if(!(l&1))return G;const _=(l&2)!==0;n.asteriskToken&&(_&&ie<99&&nl(n,26624),!_&&ie<2&&J.downlevelIteration&&nl(n,256));let m=V6(a);m&&m.flags&1048576&&(m=jc(m,Ne=>vge(Ne,l,void 0)));const h=m&&f7e(m,_),x=h&&h.yieldType||G,N=h&&h.nextType||G,F=_?zS(N)||G:N,V=n.expression?Ui(n.expression):ce,ne=dNe(n,V,F,_);if(m&&ne&&Oy(ne,x,n.expression||n,n.expression),n.asteriskToken)return Nge(_?19:17,1,V,n.expression)||G;if(m)return V2(2,m,_)||G;let le=eAe(2,a);return le||(le=G,r(()=>{if(se&&!hre(n)){const Ne=d_(n,void 0);(!Ne||Ae(Ne))&&je(n,d.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation)}})),le;function xe(){n.flags&16384||Rl(n,d.A_yield_expression_is_only_allowed_in_a_generator_body),Cme(n)&&je(n,d.yield_expressions_cannot_be_used_in_a_parameter_initializer)}}function Zat(n,a){const l=LD(n.condition,a);Pge(n.condition,l,n.whenTrue);const _=Ui(n.whenTrue,a),m=Ui(n.whenFalse,a);return Mn([_,m],2)}function CNe(n){const a=n.parent;return y_(a)&&CNe(a)||mo(a)&&a.argumentExpression===n}function Kat(n){const a=[n.head.text],l=[];for(const m of n.templateSpans){const h=Ui(m.expression);VR(h,12288)&&je(m.expression,d.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String),a.push(m.literal.text),l.push(ca(h,Ga)?h:Fe)}if(AD(n)||CNe(n)||em(d_(n,void 0)||or,eot))return PS(a,l);const _=n.parent.kind!==215&&D7e(n);return _?Gx(p_(_)):Fe}function eot(n){return!!(n.flags&134217856||n.flags&58982400&&Yo(Ku(n)||or,402653316))}function tot(n){return Hv(n)&&!Nb(n.parent)?n.parent.parent:n}function t4(n,a,l,_){const m=tot(n);DR(m,a,!1),xit(m,l);const h=Ui(n,_|1|(l?2:0));l&&l.intraExpressionInferenceSites&&(l.intraExpressionInferenceSites=void 0);const x=Yo(h,2944)&&oZ(h,WY(a,n,void 0))?t_(h):h;return kit(),KN(),x}function Bc(n,a){if(a)return Ui(n,a);const l=Wn(n);if(!l.resolvedType){const _=Ee,m=xr;Ee=We,xr=void 0,l.resolvedType=Ui(n,a),xr=m,Ee=_}return l.resolvedType}function ENe(n){return n=Ha(n,!0),n.kind===216||n.kind===234||GE(n)}function a7(n,a,l){const _=XP(n);if(Hr(n)){const h=G5(n);if(h)return ige(_,h,a)}const m=yge(_)||(l?t4(_,l,void 0,a||0):Bc(_,a));return us(n)&&n.name.kind===207&&pa(m)&&!m.target.hasRestElement&&b0(m)oZ(n,_))}if(a.flags&58982400){const l=Ku(a)||or;return Yo(l,4)&&Yo(n,128)||Yo(l,8)&&Yo(n,256)||Yo(l,64)&&Yo(n,2048)||Yo(l,4096)&&Yo(n,8192)||oZ(n,l)}return!!(a.flags&406847616&&Yo(n,128)||a.flags&256&&Yo(n,256)||a.flags&2048&&Yo(n,2048)||a.flags&512&&Yo(n,512)||a.flags&8192&&Yo(n,8192))}return!1}function AD(n){const a=n.parent;return sb(a)&&Vg(a.type)||GE(a)&&Vg(ZF(a))||nge(n)&&zx(d_(n,0))||(y_(a)||Lu(a)||Od(a))&&AD(a)||(Hc(a)||Y_(a)||zE(a))&&AD(a.parent)}function ND(n,a,l){const _=Ui(n,a,l);return AD(n)||Vee(n)?t_(_):ENe(n)?_:Hde(_,WY(d_(n,void 0),n,void 0))}function DNe(n,a){return n.name.kind===167&&Lg(n.name),ND(n.initializer,a)}function PNe(n,a){eIe(n),n.name.kind===167&&Lg(n.name);const l=vNe(n,a);return wNe(n,l,a)}function wNe(n,a,l){if(l&&l&10){const _=t7(a,0,!0),m=t7(a,1,!0),h=_||m;if(h&&h.typeParameters){const x=_v(n,2);if(x){const N=t7(Sh(x),_?0:1,!1);if(N&&!N.typeParameters){if(l&8)return ANe(n,l),qt;const F=W2(n),V=F.signature&&Ma(F.signature),ne=V&&jAe(V);if(ne&&!ne.typeParameters&&!qi(F.inferences,r4)){const le=aot(F,h.typeParameters),xe=Zpe(h,le),Ne=Yt(F.inferences,nt=>Kde(nt.typeParameter));if(Xde(xe,N,(nt,kt)=>{Th(Ne,nt,kt,0,!0)}),ut(Ne,r4)&&(Qde(xe,N,(nt,kt)=>{Th(Ne,nt,kt)}),!iot(F.inferences,Ne)))return sot(F.inferences,Ne),F.inferredTypeParameters=Xi(F.inferredTypeParameters,le),DS(xe)}return DS(BAe(h,N,F))}}}}return a}function ANe(n,a){if(a&2){const l=W2(n);l.flags|=4}}function r4(n){return!!(n.candidates||n.contraCandidates)}function not(n){return!!(n.candidates||n.contraCandidates||bPe(n.typeParameter))}function iot(n,a){for(let l=0;ll.symbol.escapedName===a)}function oot(n,a){let l=a.length;for(;l>1&&a.charCodeAt(l-1)>=48&&a.charCodeAt(l-1)<=57;)l--;const _=a.slice(0,l);for(let m=1;;m++){const h=_+m;if(!hge(n,h))return h}}function NNe(n){const a=jS(n);if(a&&!a.typeParameters)return Ma(a)}function cot(n){const a=Ui(n.expression),l=HN(a,n.expression),_=NNe(a);return _&&kY(_,n,l!==a)}function Zl(n){const a=yge(n);if(a)return a;if(n.flags&268435456&&xr){const m=xr[Oa(n)];if(m)return m}const l=tr,_=Ui(n,64);if(tr!==l){const m=xr||(xr=[]);m[Oa(n)]=_,gre(n,n.flags|268435456)}return _}function yge(n){let a=Ha(n,!0);if(GE(a)){const l=ZF(a);if(!Vg(l))return si(l)}if(a=Ha(n),Z0(a)){const l=yge(a.expression);return l?zS(l):void 0}if(Rs(a)&&a.expression.kind!==108&&!g_(a,!0)&&!ZAe(a))return tb(a)?cot(a):NNe(Z6(a.expression));if(sb(a)&&!Vg(a.type))return si(a.type);if(vv(n)||O4(n))return Ui(n)}function GR(n){const a=Wn(n);if(a.contextFreeType)return a.contextFreeType;DR(n,G,!1);const l=a.contextFreeType=Ui(n,4);return KN(),l}function Ui(n,a,l){var _,m;(_=Jr)==null||_.push(Jr.Phase.Check,"checkExpression",{kind:n.kind,pos:n.pos,end:n.end,path:n.tracingPath});const h=D;D=n,T=0;const x=_ot(n,a,l),N=wNe(n,x,a);return aZ(N)&&lot(n,N),D=h,(m=Jr)==null||m.pop(),N}function lot(n,a){n.parent.kind===211&&n.parent.expression===n||n.parent.kind===212&&n.parent.expression===n||(n.kind===80||n.kind===166)&&SZ(n)||n.parent.kind===186&&n.parent.exprName===n||n.parent.kind===281||je(n,d.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query),nd(J)&&(E.assert(!!(a.symbol.flags&128)),a.symbol.valueDeclaration.flags&33554432&&!o1(n)&&je(n,d.Cannot_access_ambient_const_enums_when_0_is_enabled,Je))}function uot(n,a){if(q_(n)){if(Kz(n))return ige(n.expression,eW(n),a);if(GE(n))return rNe(n,a)}return Ui(n.expression,a)}function _ot(n,a,l){const _=n.kind;if(i)switch(_){case 231:case 218:case 219:i.throwIfCancellationRequested()}switch(_){case 80:return Hnt(n,a);case 81:return lst(n);case 110:return CR(n);case 108:return xme(n);case 106:return Ve;case 15:case 11:return ime(n)?Re:Gx(p_(n.text));case 9:return Zge(n),Gx(vd(+n.text));case 10:return f_t(n),Gx(rY({negative:!1,base10Value:bE(n.text)}));case 112:return Zr;case 97:return Wt;case 228:return Kat(n);case 14:return qo;case 209:return cAe(n,a,l);case 210:return zit(n,a);case 211:return GY(n,a);case 166:return kAe(n,a);case 212:return Cst(n,a);case 213:if(n.expression.kind===102)return rat(n);case 214:return tat(n,a);case 215:return nat(n);case 217:return uot(n,a);case 231:return Zct(n);case 218:case 219:return vNe(n,a);case 221:return Mat(n);case 216:case 234:return iat(n,a);case 235:return oat(n);case 233:return iNe(n);case 238:return cat(n);case 236:return lat(n);case 220:return Oat(n);case 222:return Rat(n);case 223:return jat(n);case 224:return Bat(n);case 225:return Jat(n);case 226:return be(n,a);case 227:return Zat(n,a);case 230:return Lit(n,a);case 232:return ce;case 229:return Yat(n);case 237:return Mit(n);case 294:return rst(n,a);case 284:return qit(n,a);case 285:return Uit(n,a);case 288:return Hit(n);case 292:return $it(n,a);case 286:E.fail("Shouldn't ever directly check a JsxOpeningElement")}return st}function INe(n){Rg(n),n.expression&&Rl(n.expression,d.Type_expected),oa(n.constraint),oa(n.default);const a=kS(cn(n));Ku(a),HKe(a)||je(n.default,d.Type_parameter_0_has_a_circular_default,mr(a));const l=ku(a),_=ES(a);l&&_&&Uu(_,rf(Ri(l,R2(a,_)),_),n.default,d.Type_0_does_not_satisfy_the_constraint_1),Yx(n),r(()=>MD(n.name,d.Type_parameter_name_cannot_be_0))}function fot(n){var a,l;if(Mu(n.parent)||Qn(n.parent)||Jp(n.parent)){const _=kS(cn(n)),m=Jde(_)&24576;if(m){const h=cn(n.parent);if(Jp(n.parent)&&!(Pn(bo(h))&48))je(n,d.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);else if(m===8192||m===16384){(a=Jr)==null||a.push(Jr.Phase.CheckTypes,"checkTypeParameterDeferred",{parent:Wu(bo(h)),id:Wu(_)});const x=pR(h,_,m===16384?Pe:A),N=pR(h,_,m===16384?A:Pe),F=_;O=_,Uu(x,N,n,d.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation),O=F,(l=Jr)==null||l.pop()}}}}function FNe(n){Rg(n),ZR(n);const a=uf(n);In(n,31)&&(a.kind===176&&ip(a.body)||je(n,d.A_parameter_property_is_only_allowed_in_a_constructor_implementation),a.kind===176&&Ie(n.name)&&n.name.escapedText==="constructor"&&je(n.name,d.constructor_cannot_be_used_as_a_parameter_property_name)),!n.initializer&&EE(n)&&As(n.name)&&a.body&&je(n,d.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),n.name&&Ie(n.name)&&(n.name.escapedText==="this"||n.name.escapedText==="new")&&(a.parameters.indexOf(n)!==0&&je(n,d.A_0_parameter_must_be_the_first_parameter,n.name.escapedText),(a.kind===176||a.kind===180||a.kind===185)&&je(n,d.A_constructor_cannot_have_a_this_parameter),a.kind===219&&je(n,d.An_arrow_function_cannot_have_a_this_parameter),(a.kind===177||a.kind===178)&&je(n,d.get_and_set_accessors_cannot_declare_this_parameters)),n.dotDotDotToken&&!As(n.name)&&!ca(hd(Br(n.symbol)),yp)&&je(n,d.A_rest_parameter_must_be_of_an_array_type)}function pot(n){const a=dot(n);if(!a){je(n,d.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);return}const l=Dp(a),_=Yf(l);if(!_)return;oa(n.type);const{parameterName:m}=n;if(_.kind===0||_.kind===2)nY(m);else if(_.parameterIndex>=0){if(bu(l)&&_.parameterIndex===l.parameters.length-1)je(m,d.A_type_predicate_cannot_reference_a_rest_parameter);else if(_.type){const h=()=>ps(void 0,d.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type);Uu(_.type,Br(l.parameters[_.parameterIndex]),n.type,void 0,h)}}else if(m){let h=!1;for(const{name:x}of a.parameters)if(As(x)&&ONe(x,m,_.parameterName)){h=!0;break}h||je(n.parameterName,d.Cannot_find_parameter_0,_.parameterName)}}function dot(n){switch(n.parent.kind){case 219:case 179:case 262:case 218:case 184:case 174:case 173:const a=n.parent;if(n===a.type)return a}}function ONe(n,a,l){for(const _ of n.elements){if(dl(_))continue;const m=_.name;if(m.kind===80&&m.escapedText===l)return je(a,d.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern,l),!0;if((m.kind===207||m.kind===206)&&ONe(m,a,l))return!0}}function o7(n){n.kind===181?Jut(n):(n.kind===184||n.kind===262||n.kind===185||n.kind===179||n.kind===176||n.kind===180)&&DZ(n);const a=pl(n);a&4||((a&3)===3&&ie<99&&nl(n,6144),(a&3)===2&&ie<4&&nl(n,64),a&3&&ie<2&&nl(n,128)),tj(L0(n)),Xct(n),Zt(n.parameters,FNe),n.type&&oa(n.type),r(l);function l(){fct(n);let _=up(n),m=_;if(Hr(n)){const h=Qy(n);if(h&&h.typeExpression&&mp(h.typeExpression.type)){const x=jS(si(h.typeExpression));x&&x.declaration&&(_=up(x.declaration),m=h.typeExpression.type)}}if(se&&!_)switch(n.kind){case 180:je(n,d.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break;case 179:je(n,d.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break}if(_&&m){const h=pl(n);if((h&5)===1){const x=si(_);x===Ni?je(m,d.A_generator_cannot_have_a_void_type_annotation):vge(x,h,m)}else(h&3)===2&&qot(n,_,m)}n.kind!==181&&n.kind!==324&&jy(n)}}function vge(n,a,l){const _=V2(0,n,(a&2)!==0)||G,m=V2(1,n,(a&2)!==0)||_,h=V2(2,n,(a&2)!==0)||or,x=pNe(_,m,h,!!(a&2));return Uu(x,n,l)}function mot(n){const a=new Map,l=new Map,_=new Map;for(const h of n.members)if(h.kind===176)for(const x of h.parameters)E_(x,h)&&!As(x.name)&&m(a,x.name,x.name.escapedText,3);else{const x=Ls(h),N=h.name;if(!N)continue;const F=Ti(N),V=F&&x?16:0,ne=F?_:x?l:a,le=N&&Kge(N);if(le)switch(h.kind){case 177:m(ne,N,le,1|V);break;case 178:m(ne,N,le,2|V);break;case 172:m(ne,N,le,3|V);break;case 174:m(ne,N,le,8|V);break}}function m(h,x,N,F){const V=h.get(N);if(V)if((V&16)!==(F&16))je(x,d.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name,Wc(x));else{const ne=!!(V&8),le=!!(F&8);ne||le?ne!==le&&je(x,d.Duplicate_identifier_0,Wc(x)):V&F&-17?je(x,d.Duplicate_identifier_0,Wc(x)):h.set(N,V|F)}else h.set(N,F)}}function got(n){for(const a of n.members){const l=a.name;if(Ls(a)&&l){const m=Kge(l);switch(m){case"name":case"length":case"caller":case"arguments":if(ae)break;case"prototype":const h=d.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1,x=zm(cn(n));je(l,h,m,x);break}}}}function LNe(n){const a=new Map;for(const l of n.members)if(l.kind===171){let _;const m=l.name;switch(m.kind){case 11:case 9:_=m.text;break;case 80:_=an(m);break;default:continue}a.get(_)?(je(as(l.symbol.valueDeclaration),d.Duplicate_identifier_0,_),je(l.name,d.Duplicate_identifier_0,_)):a.set(_,!0)}}function bge(n){if(n.kind===264){const l=cn(n);if(l.declarations&&l.declarations.length>0&&l.declarations[0]!==n)return}const a=APe(cn(n));if(a?.declarations){const l=new Map;for(const _ of a.declarations)_.parameters.length===1&&_.parameters[0].type&&OS(si(_.parameters[0].type),m=>{const h=l.get(Wu(m));h?h.declarations.push(_):l.set(Wu(m),{type:m,declarations:[_]})});l.forEach(_=>{if(_.declarations.length>1)for(const m of _.declarations)je(m,d.Duplicate_index_signature_for_type_0,mr(_.type))})}}function MNe(n){!Rg(n)&&!c_t(n)&&PZ(n.name),ZR(n),Sge(n),In(n,64)&&n.kind===172&&n.initializer&&je(n,d.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract,eo(n.name))}function hot(n){return Ti(n.name)&&je(n,d.Private_identifiers_are_not_allowed_outside_class_bodies),MNe(n)}function yot(n){eIe(n)||PZ(n.name),mc(n)&&n.asteriskToken&&Ie(n.name)&&an(n.name)==="constructor"&&je(n.name,d.Class_constructor_may_not_be_a_generator),XNe(n),In(n,64)&&n.kind===174&&n.body&&je(n,d.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,eo(n.name)),Ti(n.name)&&!wl(n)&&je(n,d.Private_identifiers_are_not_allowed_outside_class_bodies),Sge(n)}function Sge(n){if(Ti(n.name)&&ie<99){for(let a=bm(n);a;a=bm(a))Wn(a).flags|=1048576;if(Nl(n.parent)){const a=vme(n.parent);a&&(Wn(n.name).flags|=32768,Wn(a).flags|=4096)}}}function vot(n){Rg(n),ds(n,oa)}function bot(n){o7(n),a_t(n)||o_t(n),oa(n.body);const a=cn(n),l=Wo(a,n.kind);if(n===l&&uZ(a),sc(n.body))return;r(m);return;function _(h){return Nu(h)?!0:h.kind===172&&!Ls(h)&&!!h.initializer}function m(){const h=n.parent;if(Nv(h)){bme(n.parent,h);const x=Sme(h),N=Hwe(n.body);if(N){if(x&&je(N,d.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null),!_e&&(ut(n.parent.members,_)||ut(n.parameters,V=>In(V,31))))if(!Sot(N,n.body))je(N,d.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);else{let V;for(const ne of n.body.statements){if(kl(ne)&&ub(bc(ne.expression))){V=ne;break}if(RNe(ne))break}V===void 0&&je(n,d.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers)}}else x||je(n,d.Constructors_for_derived_classes_must_contain_a_super_call)}}}function Sot(n,a){const l=Rh(n.parent);return kl(l)&&l.parent===a}function RNe(n){return n.kind===108||n.kind===110?!0:Yee(n)?!1:!!ds(n,RNe)}function jNe(n){Ie(n.name)&&an(n.name)==="constructor"&&Qn(n.parent)&&je(n.name,d.Class_constructor_may_not_be_an_accessor),r(a),oa(n.body),Sge(n);function a(){if(!DZ(n)&&!Xut(n)&&PZ(n.name),XR(n),o7(n),n.kind===177&&!(n.flags&33554432)&&ip(n.body)&&n.flags&512&&(n.flags&1024||je(n.name,d.A_get_accessor_must_return_a_value)),n.name.kind===167&&Lg(n.name),W6(n)){const _=cn(n),m=Wo(_,177),h=Wo(_,178);if(m&&h&&!(s4(m)&1)){Wn(m).flags|=1;const x=Fu(m),N=Fu(h);(x&64)!==(N&64)&&(je(m.name,d.Accessors_must_both_be_abstract_or_non_abstract),je(h.name,d.Accessors_must_both_be_abstract_or_non_abstract)),(x&4&&!(N&6)||x&2&&!(N&2))&&(je(m.name,d.A_get_accessor_must_be_at_least_as_accessible_as_the_setter),je(h.name,d.A_get_accessor_must_be_at_least_as_accessible_as_the_setter))}}const l=Y1(cn(n));n.kind===177&&_ge(n,l)}}function Tot(n){XR(n)}function xot(n,a,l){return n.typeArguments&&l{const _=Tge(n);_&&BNe(n,_)});const l=Wn(n).resolvedSymbol;l&&ut(l.declarations,_=>rC(_)&&!!(_.flags&536870912))&&xg(BR(n),l.declarations,l.escapedName)}}function Cot(n){const a=Jn(n.parent,kI);if(!a)return;const l=Tge(a);if(!l)return;const _=ku(l[a.typeArguments.indexOf(n)]);return _&&Ri(_,k_(l,cZ(a,l)))}function Eot(n){zPe(n)}function Dot(n){Zt(n.members,oa),r(a);function a(){const l=P8e(n);hZ(l,l.symbol),bge(n),LNe(n)}}function Pot(n){oa(n.elementType)}function wot(n){const a=n.elements;let l=!1,_=!1;for(const m of a){const h=lde(m);if(h&8){const x=si(m.type);if(!x0(x)){je(m,d.A_rest_element_type_must_be_an_array_type);break}(ep(x)||pa(x)&&x.target.combinedFlags&4)&&(_=!0)}else if(h&4){if(_){Kt(m,d.A_rest_element_cannot_follow_another_rest_element);break}_=!0}else if(h&2){if(_){Kt(m,d.An_optional_element_cannot_follow_a_rest_element);break}l=!0}else if(l){Kt(m,d.A_required_element_cannot_follow_an_optional_element);break}}Zt(n.elements,oa),si(n)}function Aot(n){Zt(n.types,oa),si(n)}function zNe(n,a){if(!(n.flags&8388608))return n;const l=n.objectType,_=n.indexType;if(ca(_,$m(l,0)))return a.kind===212&&og(a)&&Pn(l)&32&&qm(l)&1&&je(a,d.Index_signature_in_type_0_only_permits_reading,mr(l)),n;const m=e_(l);if(Og(m,vt)&&Ml(_,296))return n;if(O2(l)){const h=ZQ(_,a);if(h){const x=OS(m,N=>Gs(N,h));if(x&&Mf(x)&6)return je(a,d.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter,bi(h)),st}}return je(a,d.Type_0_cannot_be_used_to_index_type_1,mr(_),mr(l)),st}function Not(n){oa(n.objectType),oa(n.indexType),zNe(T8e(n),n)}function Iot(n){Fot(n),oa(n.typeParameter),oa(n.nameType),oa(n.type),n.type||cv(n,G);const a=Sde(n),l=y0(a);if(l)Uu(l,Tc,n.nameType);else{const _=Ep(a);Uu(_,Tc,gk(n.typeParameter))}}function Fot(n){var a;if((a=n.members)!=null&&a.length)return Kt(n.members[0],d.A_mapped_type_may_not_declare_properties_or_methods)}function Oot(n){nY(n)}function Lot(n){Yut(n),oa(n.type)}function Mot(n){ds(n,oa)}function Rot(n){Ar(n,l=>l.parent&&l.parent.kind===194&&l.parent.extendsType===l)||Kt(n,d.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type),oa(n.typeParameter);const a=cn(n.typeParameter);if(a.declarations&&a.declarations.length>1){const l=yi(a);if(!l.typeParametersChecked){l.typeParametersChecked=!0;const _=kS(a),m=vee(a,168);if(!g7e(m,[_],h=>[h])){const h=ii(a);for(const x of m)je(x.name,d.All_declarations_of_0_must_have_identical_constraints,h)}}}jy(n)}function jot(n){for(const a of n.templateSpans){oa(a.type);const l=si(a.type);Uu(l,Ga,a.type)}si(n)}function Bot(n){oa(n.argument),n.attributes&&LC(n.attributes,Kt),JNe(n)}function Jot(n){n.dotDotDotToken&&n.questionToken&&Kt(n,d.A_tuple_member_cannot_be_both_optional_and_rest),n.type.kind===190&&Kt(n.type,d.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type),n.type.kind===191&&Kt(n.type,d.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type),oa(n.type),si(n)}function $R(n){return(w_(n,2)||Nu(n))&&!!(n.flags&33554432)}function lZ(n,a){let l=wZ(n);if(n.parent.kind!==264&&n.parent.kind!==263&&n.parent.kind!==231&&n.flags&33554432){const _=jJ(n);_&&_.flags&128&&!(l&128)&&!(Ld(n.parent)&&vc(n.parent.parent)&&Dd(n.parent.parent))&&(l|=32),l|=128}return l&a}function uZ(n){r(()=>zot(n))}function zot(n){function a(Ut,Nr){return Nr!==void 0&&Nr.parent===Ut[0].parent?Nr:Ut[0]}function l(Ut,Nr,Sr,Er,hr){if((Er^hr)!==0){const ms=lZ(a(Ut,Nr),Sr);Zt(Ut,xs=>{const vs=lZ(xs,Sr)^ms;vs&32?je(as(xs),d.Overload_signatures_must_all_be_exported_or_non_exported):vs&128?je(as(xs),d.Overload_signatures_must_all_be_ambient_or_non_ambient):vs&6?je(as(xs)||xs,d.Overload_signatures_must_all_be_public_private_or_protected):vs&64&&je(as(xs),d.Overload_signatures_must_all_be_abstract_or_non_abstract)})}}function _(Ut,Nr,Sr,Er){if(Sr!==Er){const hr=cT(a(Ut,Nr));Zt(Ut,sn=>{cT(sn)!==hr&&je(as(sn),d.Overload_signatures_must_all_be_optional_or_required)})}}const m=230;let h=0,x=m,N=!1,F=!0,V=!1,ne,le,xe;const Ne=n.declarations,nt=(n.flags&16384)!==0;function kt(Ut){if(Ut.name&&sc(Ut.name))return;let Nr=!1;const Sr=ds(Ut.parent,hr=>{if(Nr)return hr;Nr=hr===Ut});if(Sr&&Sr.pos===Ut.end&&Sr.kind===Ut.kind){const hr=Sr.name||Sr,sn=Sr.name;if(Ut.name&&sn&&(Ti(Ut.name)&&Ti(sn)&&Ut.name.escapedText===sn.escapedText||xa(Ut.name)&&xa(sn)&&hh(Lg(Ut.name),Lg(sn))||wd(Ut.name)&&wd(sn)&&K4(Ut.name)===K4(sn))){if((Ut.kind===174||Ut.kind===173)&&Ls(Ut)!==Ls(Sr)){const xs=Ls(Ut)?d.Function_overload_must_be_static:d.Function_overload_must_not_be_static;je(hr,xs)}return}if(ip(Sr.body)){je(hr,d.Function_implementation_name_must_be_0,eo(Ut.name));return}}const Er=Ut.name||Ut;nt?je(Er,d.Constructor_implementation_is_missing):In(Ut,64)?je(Er,d.All_declarations_of_an_abstract_method_must_be_consecutive):je(Er,d.Function_implementation_is_missing_or_not_immediately_following_the_declaration)}let Xt=!1,_r=!1,Yr=!1;const gr=[];if(Ne)for(const Ut of Ne){const Nr=Ut,Sr=Nr.flags&33554432,Er=Nr.parent&&(Nr.parent.kind===264||Nr.parent.kind===187)||Sr;if(Er&&(xe=void 0),(Nr.kind===263||Nr.kind===231)&&!Sr&&(Yr=!0),Nr.kind===262||Nr.kind===174||Nr.kind===173||Nr.kind===176){gr.push(Nr);const hr=lZ(Nr,m);h|=hr,x&=hr,N=N||cT(Nr),F=F&&cT(Nr);const sn=ip(Nr.body);sn&&ne?nt?_r=!0:Xt=!0:xe?.parent===Nr.parent&&xe.end!==Nr.pos&&kt(xe),sn?ne||(ne=Nr):V=!0,xe=Nr,Er||(le=Nr)}if(Hr(Ut)&&ks(Ut)&&Ut.jsDoc){for(const hr of Ut.jsDoc)if(hr.tags)for(const sn of hr.tags)vC(sn)&&(V=!0)}}if(_r&&Zt(gr,Ut=>{je(Ut,d.Multiple_constructor_implementations_are_not_allowed)}),Xt&&Zt(gr,Ut=>{je(as(Ut)||Ut,d.Duplicate_function_implementation)}),Yr&&!nt&&n.flags&16&&Ne){const Ut=wn(Ne,Nr=>Nr.kind===263).map(Nr=>mn(Nr,d.Consider_adding_a_declare_modifier_to_this_class));Zt(Ne,Nr=>{const Sr=Nr.kind===263?d.Class_declaration_cannot_implement_overload_list_for_0:Nr.kind===262?d.Function_with_bodies_can_only_merge_with_classes_that_are_ambient:void 0;Sr&&ua(je(as(Nr)||Nr,Sr,pc(n)),...Ut)})}if(le&&!le.body&&!In(le,64)&&!le.questionToken&&kt(le),V&&(Ne&&(l(Ne,ne,m,h,x),_(Ne,ne,N,F)),ne)){const Ut=I2(n),Nr=Dp(ne);for(const Sr of Ut)if(!_rt(Nr,Sr)){const Er=Sr.declaration&&m1(Sr.declaration)?Sr.declaration.parent.tagName:Sr.declaration;ua(je(Er,d.This_overload_signature_is_not_compatible_with_its_implementation_signature),mn(ne,d.The_implementation_signature_is_declared_here));break}}}function c7(n){r(()=>Wot(n))}function Wot(n){let a=n.localSymbol;if(!a&&(a=cn(n),!a.exportSymbol)||Wo(a,n.kind)!==n)return;let l=0,_=0,m=0;for(const V of a.declarations){const ne=F(V),le=lZ(V,2080);le&32?le&2048?m|=ne:l|=ne:_|=ne}const h=l|_,x=l&_,N=m&h;if(x||N)for(const V of a.declarations){const ne=F(V),le=as(V);ne&N?je(le,d.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead,eo(le)):ne&x&&je(le,d.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,eo(le))}function F(V){let ne=V;switch(ne.kind){case 264:case 265:case 353:case 345:case 347:return 2;case 267:return ru(ne)||rh(ne)!==0?5:4;case 263:case 266:case 306:return 3;case 312:return 7;case 277:case 226:const le=ne,xe=cc(le)?le.expression:le.right;if(!oc(xe))return 1;ne=xe;case 271:case 274:case 273:let Ne=0;const nt=ul(cn(ne));return Zt(nt.declarations,kt=>{Ne|=F(kt)}),Ne;case 260:case 208:case 262:case 276:case 80:return 1;case 173:case 171:return 2;default:return E.failBadSyntaxKind(ne)}}}function ID(n,a,l,..._){const m=l7(n,a);return m&&zS(m,a,l,..._)}function l7(n,a,l){if(Ae(n))return;const _=n;if(_.promisedTypeOfPromise)return _.promisedTypeOfPromise;if(Z1(n,nR(!1)))return _.promisedTypeOfPromise=uo(n)[0];if(qR(mh(n),402915324))return;const m=q(n,"then");if(Ae(m))return;const h=m?Ts(m,0):ze;if(h.length===0){a&&je(a,d.A_promise_must_have_a_then_method);return}let x,N;for(const ne of h){const le=tv(ne);le&&le!==Ni&&!Kd(n,le,Lm)?x=le:N=lr(N,ne)}if(!N){E.assertIsDefined(x),l&&(l.value=x),a&&je(a,d.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,mr(n),mr(x));return}const F=Ap(Mn(Yt(N,oge)),2097152);if(Ae(F))return;const V=Ts(F,0);if(V.length===0){a&&je(a,d.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback);return}return _.promisedTypeOfPromise=Mn(Yt(V,oge),2)}function u7(n,a,l,_,...m){return(a?zS(n,l,_,...m):C0(n,l,_,...m))||st}function WNe(n){if(qR(mh(n),402915324))return!1;const a=q(n,"then");return!!a&&Ts(Ap(a,2097152),0).length>0}function _Z(n){var a;if(n.flags&16777216){const l=cde(!1);return!!l&&n.aliasSymbol===l&&((a=n.aliasTypeArguments)==null?void 0:a.length)===1}return!1}function FD(n){return n.flags&1048576?Io(n,FD):_Z(n)?n.aliasTypeArguments[0]:n}function UNe(n){if(Ae(n)||_Z(n))return!1;if(O2(n)){const a=Ku(n);if(a?a.flags&3||yh(a)||em(a,WNe):Yo(n,8650752))return!0}return!1}function Uot(n){const a=cde(!0);if(a)return H6(a,[FD(n)])}function Vot(n){if(UNe(n)){const a=Uot(n);if(a)return a}return E.assert(_Z(n)||l7(n)===void 0,"type provided should not be a non-generic 'promise'-like."),n}function zS(n,a,l,..._){const m=C0(n,a,l,..._);return m&&Vot(m)}function C0(n,a,l,..._){if(Ae(n)||_Z(n))return n;const m=n;if(m.awaitedTypeOfType)return m.awaitedTypeOfType;if(n.flags&1048576){if(Ud.lastIndexOf(n.id)>=0){a&&je(a,d.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method);return}const N=a?V=>C0(V,a,l,..._):C0;Ud.push(n.id);const F=Io(n,N);return Ud.pop(),m.awaitedTypeOfType=F}if(UNe(n))return m.awaitedTypeOfType=n;const h={value:void 0},x=l7(n,void 0,h);if(x){if(n.id===x.id||Ud.lastIndexOf(x.id)>=0){a&&je(a,d.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method);return}Ud.push(n.id);const N=C0(x,a,l,..._);return Ud.pop(),N?m.awaitedTypeOfType=N:void 0}if(WNe(n)){if(a){E.assertIsDefined(l);let N;h.value&&(N=ps(N,d.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,mr(n),mr(h.value))),N=ps(N,l,..._),wa.add(Hg(Or(a),a,N))}return}return m.awaitedTypeOfType=n}function qot(n,a,l){const _=si(a);if(ie>=2){if(et(_))return;const h=nR(!0);if(h!==rs&&!Z1(_,h)){m(d.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,a,l,mr(C0(_)||Ni));return}}else{if(Got(a),et(_))return;const h=qP(a);if(h===void 0){m(d.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,a,l,mr(_));return}const x=lo(h,111551,!0),N=x?Br(x):st;if(et(N)){h.kind===80&&h.escapedText==="Promise"&&J6(_)===nR(!1)?je(l,d.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option):m(d.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,a,l,D_(h));return}const F=bet(!0);if(F===Us){m(d.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,a,l,D_(h));return}const V=d.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value;if(!Uu(N,F,l,V,()=>a===l?void 0:ps(void 0,d.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type)))return;const le=h&&$_(h),xe=S_(n.locals,le.escapedText,111551);if(xe){je(xe.valueDeclaration,d.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,an(le),D_(h));return}}u7(_,!1,n,d.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);function m(h,x,N,F){if(x===N)je(N,h,F);else{const V=je(N,d.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);ua(V,mn(x,h,F))}}}function Hot(n){const a=e4(n);nZ(a,n);const l=Ma(a);if(l.flags&1)return;const _=uge(n);if(!_?.resolvedReturnType)return;let m;const h=_.resolvedReturnType;switch(n.parent.kind){case 263:case 231:m=d.Decorator_function_return_type_0_is_not_assignable_to_type_1;break;case 172:if(!Y){m=d.Decorator_function_return_type_0_is_not_assignable_to_type_1;break}case 169:m=d.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;break;case 174:case 177:case 178:m=d.Decorator_function_return_type_0_is_not_assignable_to_type_1;break;default:return E.failBadSyntaxKind(n.parent)}Uu(l,h,n.expression,m)}function _7(n,a,l,_,m,h=l.length,x=0){const N=I.createFunctionTypeNode(void 0,ze,I.createKeywordTypeNode(133));return Fg(N,n,a,l,_,m,h,x)}function kge(n,a,l,_,m,h,x){const N=_7(n,a,l,_,m,h,x);return DS(N)}function VNe(n){return kge(void 0,void 0,ze,n)}function qNe(n){const a=pd("value",n);return kge(void 0,void 0,[a],Ni)}function Got(n){HNe(n&&qP(n),!1)}function HNe(n,a){if(!n)return;const l=$_(n),_=(n.kind===80?788968:1920)|2097152,m=_c(l,l.escapedText,_,void 0,void 0,!0);if(m&&m.flags&2097152){if(ot&&gy(m)&&!m7(ul(m))&&!qf(m))f0(m);else if(a&&nd(J)&&Ul(J)>=5&&!gy(m)&&!ut(m.declarations,bv)){const h=je(n,d.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled),x=kn(m.declarations||ze,j1);x&&ua(h,mn(x,d._0_was_imported_here,an(l)))}}}function n4(n){const a=Cge(n);a&&V_(a)&&HNe(a,!0)}function Cge(n){if(n)switch(n.kind){case 193:case 192:return GNe(n.types);case 194:return GNe([n.trueType,n.falseType]);case 196:case 202:return Cge(n.type);case 183:return n.typeName}}function GNe(n){let a;for(let l of n){for(;l.kind===196||l.kind===202;)l=l.type;if(l.kind===146||!H&&(l.kind===201&&l.literal.kind===106||l.kind===157))continue;const _=Cge(l);if(!_)return;if(a){if(!Ie(a)||!Ie(_)||a.escapedText!==_.escapedText)return}else a=_}return a}function fZ(n){const a=Wl(n);return rg(n)?WJ(a):a}function XR(n){if(!Lb(n)||!Of(n)||!n.modifiers||!GI(Y,n,n.parent,n.parent.parent))return;const a=kn(n.modifiers,ql);if(a){if(Y?(nl(a,8),n.kind===169&&nl(a,32)):ie<99&&(nl(a,8),Vc(n)?n.name?h7e(n)&&nl(a,8388608):nl(a,8388608):Nl(n)||(Ti(n.name)&&(mc(n)||R0(n)||n_(n))&&nl(a,8388608),xa(n.name)&&nl(a,16777216))),J.emitDecoratorMetadata)switch(nl(a,16),n.kind){case 263:const l=cg(n);if(l)for(const x of l.parameters)n4(fZ(x));break;case 177:case 178:const _=n.kind===177?178:177,m=Wo(cn(n),_);n4(za(n)||m&&za(m));break;case 174:for(const x of n.parameters)n4(fZ(x));n4(up(n));break;case 172:n4(Wl(n));break;case 169:n4(fZ(n));const h=n.parent;for(const x of h.parameters)n4(fZ(x));n4(up(h));break}for(const l of n.modifiers)ql(l)&&Hot(l)}}function $ot(n){r(a);function a(){XNe(n),$ge(n),OD(n,n.name)}}function Xot(n){n.typeExpression||je(n.name,d.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags),n.name&&MD(n.name,d.Type_alias_name_cannot_be_0),oa(n.typeExpression),tj(L0(n))}function Qot(n){oa(n.constraint);for(const a of n.typeParameters)oa(a)}function Yot(n){oa(n.typeExpression)}function Zot(n){oa(n.typeExpression);const a=mb(n);if(a){const l=nJ(a,XF);if(Ir(l)>1)for(let _=1;_0),l.length>1&&je(l[1],d.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);const _=$Ne(n.class.expression),m=Nv(a);if(m){const h=$Ne(m.expression);h&&_.escapedText!==h.escapedText&&je(_,d.JSDoc_0_1_does_not_match_the_extends_2_clause,an(n.tagName),an(_),an(h))}}function act(n){const a=lT(n);a&&Nu(a)&&je(n,d.An_accessibility_modifier_cannot_be_used_with_a_private_identifier)}function $Ne(n){switch(n.kind){case 80:return n;case 211:return n.name;default:return}}function XNe(n){var a;XR(n),o7(n);const l=pl(n);if(n.name&&n.name.kind===167&&Lg(n.name),W6(n)){const h=cn(n),x=n.localSymbol||h,N=(a=x.declarations)==null?void 0:a.find(F=>F.kind===n.kind&&!(F.flags&524288));n===N&&uZ(x),h.parent&&uZ(h)}const _=n.kind===173?void 0:n.body;if(oa(_),_ge(n,V6(n)),r(m),Hr(n)){const h=Qy(n);h&&h.typeExpression&&!wme(si(h.typeExpression),n)&&je(h.typeExpression.type,d.The_type_of_a_function_declaration_must_match_the_function_s_signature)}function m(){up(n)||(sc(_)&&!$R(n)&&cv(n,G),l&1&&ip(_)&&Ma(Dp(n)))}}function jy(n){r(a);function a(){const l=Or(n);let _=i0.get(l.path);_||(_=[],i0.set(l.path,_)),_.push(n)}}function QNe(n,a){for(const l of n)switch(l.kind){case 263:case 231:oct(l,a),Ege(l,a);break;case 312:case 267:case 241:case 269:case 248:case 249:case 250:KNe(l,a);break;case 176:case 218:case 262:case 219:case 174:case 177:case 178:l.body&&KNe(l,a),Ege(l,a);break;case 173:case 179:case 180:case 184:case 185:case 265:case 264:Ege(l,a);break;case 195:cct(l,a);break;default:E.assertNever(l,"Node should not have been registered for unused identifiers check")}}function YNe(n,a,l){const _=as(n)||n,m=rC(n)?d._0_is_declared_but_never_used:d._0_is_declared_but_its_value_is_never_read;l(n,0,mn(_,m,a))}function f7(n){return Ie(n)&&an(n).charCodeAt(0)===95}function oct(n,a){for(const l of n.members)switch(l.kind){case 174:case 172:case 177:case 178:if(l.kind===178&&l.symbol.flags&32768)break;const _=cn(l);!_.isReferenced&&(w_(l,2)||Au(l)&&Ti(l.name))&&!(l.flags&33554432)&&a(l,0,mn(l.name,d._0_is_declared_but_its_value_is_never_read,ii(_)));break;case 176:for(const m of l.parameters)!m.symbol.isReferenced&&In(m,2)&&a(m,0,mn(m.name,d.Property_0_is_declared_but_its_value_is_never_read,pc(m.symbol)));break;case 181:case 240:case 175:break;default:E.fail("Unexpected class member")}}function cct(n,a){const{typeParameter:l}=n;Dge(l)&&a(n,1,mn(n,d._0_is_declared_but_its_value_is_never_read,an(l.name)))}function Ege(n,a){const l=cn(n).declarations;if(!l||Sa(l)!==n)return;const _=L0(n),m=new Set;for(const h of _){if(!Dge(h))continue;const x=an(h.name),{parent:N}=h;if(N.kind!==195&&N.typeParameters.every(Dge)){if(zy(m,N)){const F=Or(N),V=od(N)?Gz(N):$z(F,N.typeParameters),le=N.typeParameters.length===1?[d._0_is_declared_but_its_value_is_never_read,x]:[d.All_type_parameters_are_unused];a(h,1,xl(F,V.pos,V.end-V.pos,...le))}}else a(h,1,mn(h,d._0_is_declared_but_its_value_is_never_read,x))}}function Dge(n){return!(Na(n.symbol).isReferenced&262144)&&!f7(n.name)}function QR(n,a,l,_){const m=String(_(a)),h=n.get(m);h?h[1].push(l):n.set(m,[a,[l]])}function ZNe(n){return Jn(Tm(n),us)}function lct(n){return Pa(n)?jp(n.parent)?!!(n.propertyName&&f7(n.name)):f7(n.name):ru(n)||(Ei(n)&&Sk(n.parent.parent)||e7e(n))&&f7(n.name)}function KNe(n,a){const l=new Map,_=new Map,m=new Map;n.locals.forEach(h=>{if(!(h.flags&262144?!(h.flags&3&&!(h.isReferenced&3)):h.isReferenced||h.exportSymbol)&&h.declarations){for(const x of h.declarations)if(!lct(x))if(e7e(x))QR(l,_ct(x),x,Oa);else if(Pa(x)&&jp(x.parent)){const N=Sa(x.parent.elements);(x===N||!Sa(x.parent.elements).dotDotDotToken)&&QR(_,x.parent,x,Oa)}else if(Ei(x)){const N=G2(x)&7,F=as(x);(N!==4&&N!==6||!F||!f7(F))&&QR(m,x.parent,x,Oa)}else{const N=h.valueDeclaration&&ZNe(h.valueDeclaration),F=h.valueDeclaration&&as(h.valueDeclaration);N&&F?!E_(N,N.parent)&&!Ov(N)&&!f7(F)&&(Pa(x)&&Eb(x.parent)?QR(_,x.parent,x,Oa):a(N,1,mn(F,d._0_is_declared_but_its_value_is_never_read,pc(h)))):YNe(x,pc(h),a)}}}),l.forEach(([h,x])=>{const N=h.parent;if((h.name?1:0)+(h.namedBindings?h.namedBindings.kind===274?1:h.namedBindings.elements.length:0)===x.length)a(N,0,x.length===1?mn(N,d._0_is_declared_but_its_value_is_never_read,an(ba(x).name)):mn(N,d.All_imports_in_import_declaration_are_unused));else for(const V of x)YNe(V,an(V.name),a)}),_.forEach(([h,x])=>{const N=ZNe(h.parent)?1:0;if(h.elements.length===x.length)x.length===1&&h.parent.kind===260&&h.parent.parent.kind===261?QR(m,h.parent.parent,h.parent,Oa):a(h,N,x.length===1?mn(h,d._0_is_declared_but_its_value_is_never_read,YR(ba(x).name)):mn(h,d.All_destructured_elements_are_unused));else for(const F of x)a(F,N,mn(F,d._0_is_declared_but_its_value_is_never_read,YR(F.name)))}),m.forEach(([h,x])=>{if(h.declarations.length===x.length)a(h,0,x.length===1?mn(ba(x).name,d._0_is_declared_but_its_value_is_never_read,YR(ba(x).name)):mn(h.parent.kind===243?h.parent:h,d.All_variables_are_unused));else for(const N of x)a(N,0,mn(N,d._0_is_declared_but_its_value_is_never_read,YR(N.name)))})}function uct(){var n;for(const a of d2)if(!((n=cn(a))!=null&&n.isReferenced)){const l=dk(a);E.assert(Iv(l),"Only parameter declaration should be checked here");const _=mn(a.name,d._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation,eo(a.name),eo(a.propertyName));l.type||ua(_,xl(Or(l),l.end,1,d.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here,eo(a.propertyName))),wa.add(_)}}function YR(n){switch(n.kind){case 80:return an(n);case 207:case 206:return YR(Ms(ba(n.elements),Pa).name);default:return E.assertNever(n)}}function e7e(n){return n.kind===273||n.kind===276||n.kind===274}function _ct(n){return n.kind===273?n:n.kind===274?n.parent:n.parent.parent}function pZ(n){if(n.kind===241&&xh(n),fJ(n)){const a=Rt;Zt(n.statements,oa),Rt=a}else Zt(n.statements,oa);n.locals&&jy(n)}function fct(n){ie>=2||!bJ(n)||n.flags&33554432||sc(n.body)||Zt(n.parameters,a=>{a.name&&!As(a.name)&&a.name.escapedText===it.escapedName&&c0("noEmit",a,d.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters)})}function p7(n,a,l){if(a?.escapedText!==l||n.kind===172||n.kind===171||n.kind===174||n.kind===173||n.kind===177||n.kind===178||n.kind===303||n.flags&33554432||(Em(n)||Hl(n)||v_(n))&&bv(n))return!1;const _=Tm(n);return!(us(_)&&sc(_.parent.body))}function pct(n){Ar(n,a=>s4(a)&4?(n.kind!==80?je(as(n),d.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference):je(n,d.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference),!0):!1)}function dct(n){Ar(n,a=>s4(a)&8?(n.kind!==80?je(as(n),d.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference):je(n,d.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference),!0):!1)}function mct(n,a){if(B>=5&&!(B>=100&&Or(n).impliedNodeFormat===1)||!a||!p7(n,a,"require")&&!p7(n,a,"exports")||vc(n)&&rh(n)!==1)return;const l=vS(n);l.kind===312&&H_(l)&&c0("noEmit",a,d.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,eo(a),eo(a))}function gct(n,a){if(!a||ie>=4||!p7(n,a,"Promise")||vc(n)&&rh(n)!==1)return;const l=vS(n);l.kind===312&&H_(l)&&l.flags&4096&&c0("noEmit",a,d.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,eo(a),eo(a))}function hct(n,a){ie<=8&&(p7(n,a,"WeakMap")||p7(n,a,"WeakSet"))&&I1.push(n)}function yct(n){const a=bm(n);s4(a)&1048576&&(E.assert(Au(n)&&Ie(n.name)&&typeof n.name.escapedText=="string","The target of a WeakMap/WeakSet collision check should be an identifier"),c0("noEmit",n,d.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel,n.name.escapedText))}function vct(n,a){a&&ie>=2&&ie<=8&&p7(n,a,"Reflect")&&s0.push(n)}function bct(n){let a=!1;if(Nl(n)){for(const l of n.members)if(s4(l)&2097152){a=!0;break}}else if(ro(n))s4(n)&2097152&&(a=!0);else{const l=bm(n);l&&s4(l)&2097152&&(a=!0)}a&&(E.assert(Au(n)&&Ie(n.name),"The target of a Reflect collision check should be an identifier"),c0("noEmit",n,d.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers,eo(n.name),"Reflect"))}function OD(n,a){a&&(mct(n,a),gct(n,a),hct(n,a),vct(n,a),Qn(n)?(MD(a,d.Class_name_cannot_be_0),n.flags&33554432||$ct(a)):p1(n)&&MD(a,d.Enum_name_cannot_be_0))}function Sct(n){if(G2(n)&7||Iv(n))return;const a=cn(n);if(a.flags&1){if(!Ie(n.name))return E.fail();const l=_c(n,n.name.escapedText,3,void 0,void 0,!1);if(l&&l!==a&&l.flags&2&&Rme(l)&7){const _=r1(l.valueDeclaration,261),m=_.parent.kind===243&&_.parent.parent?_.parent.parent:void 0;if(!(m&&(m.kind===241&&ks(m.parent)||m.kind===268||m.kind===267||m.kind===312))){const x=ii(l);je(n,d.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,x,x)}}}}function d7(n){return n===ht?G:n===Oc?nc:n}function ZR(n){var a;if(XR(n),Pa(n)||oa(n.type),!n.name)return;if(n.name.kind===167&&(Lg(n.name),ab(n)&&n.initializer&&Bc(n.initializer)),Pa(n)){if(n.propertyName&&Ie(n.name)&&Iv(n)&&sc(uf(n).body)){d2.push(n);return}jp(n.parent)&&n.dotDotDotToken&&ie<5&&nl(n,4),n.propertyName&&n.propertyName.kind===167&&Lg(n.propertyName);const m=n.parent.parent,h=n.dotDotDotToken?32:0,x=wt(m,h),N=n.propertyName||n.name;if(x&&!As(N)){const F=S0(N);if(pp(F)){const V=dp(F),ne=Gs(x,V);ne&&(OR(ne,void 0,!1),Bme(n,!!m.initializer&&m.initializer.kind===108,!1,x,ne))}}}if(As(n.name)&&(n.name.kind===207&&ie<2&&J.downlevelIteration&&nl(n,512),Zt(n.name.elements,oa)),n.initializer&&Iv(n)&&sc(uf(n).body)){je(n,d.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);return}if(As(n.name)){if(ume(n))return;const m=ab(n)&&n.initializer&&n.parent.parent.kind!==249,h=!ut(n.name.elements,A7(dl));if(m||h){const x=v(n);if(m){const N=Bc(n.initializer);H&&h?xAe(N,n):Oy(N,v(n),n,n.initializer)}h&&(Eb(n.name)?E0(65,x,j,n):H&&xAe(x,n))}return}const l=cn(n);if(l.flags&2097152&&(Pv(n)||tte(n))){yZ(n);return}const _=d7(Br(l));if(n===l.valueDeclaration){const m=ab(n)&&XP(n);if(m&&!(Hr(n)&&ma(m)&&(m.properties.length===0||H0(n.name))&&!!((a=l.exports)!=null&&a.size))&&n.parent.parent.kind!==249){const x=Bc(m);Oy(x,_,n,m,void 0);const N=G2(n)&7;if(N===6){const F=Aet(!0),V=QPe(!0);if(F!==Us&&V!==Us){const ne=Mn([F,V,De,j]);Uu(x,ne,m,d.The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined)}}else if(N===4){const F=QPe(!0);if(F!==Us){const V=Mn([F,De,j]);Uu(x,V,m,d.The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined)}}}l.declarations&&l.declarations.length>1&&ut(l.declarations,h=>h!==n&&Nk(h)&&!r7e(h,n))&&je(n.name,d.All_declarations_of_0_must_have_identical_modifiers,eo(n.name))}else{const m=d7(v(n));!et(_)&&!et(m)&&!hh(_,m)&&!(l.flags&67108864)&&t7e(l.valueDeclaration,_,n,m),ab(n)&&n.initializer&&Oy(Bc(n.initializer),m,n,n.initializer,void 0),l.valueDeclaration&&!r7e(n,l.valueDeclaration)&&je(n.name,d.All_declarations_of_0_must_have_identical_modifiers,eo(n.name))}n.kind!==172&&n.kind!==171&&(c7(n),(n.kind===260||n.kind===208)&&Sct(n),OD(n,n.name))}function t7e(n,a,l,_){const m=as(l),h=l.kind===172||l.kind===171?d.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:d.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2,x=eo(m),N=je(m,h,x,mr(a),mr(_));n&&ua(N,mn(n,d._0_was_also_declared_here,x))}function r7e(n,a){if(n.kind===169&&a.kind===260||n.kind===260&&a.kind===169)return!0;if(cT(n)!==cT(a))return!1;const l=1358;return dT(n,l)===dT(a,l)}function Tct(n){var a,l;(a=Jr)==null||a.push(Jr.Phase.Check,"checkVariableDeclaration",{kind:n.kind,pos:n.pos,end:n.end,path:n.tracingPath}),r_t(n),ZR(n),(l=Jr)==null||l.pop()}function xct(n){return Kut(n),ZR(n)}function dZ(n){const a=Fh(n)&7;(a===4||a===6)&&nl(n,33554432),Zt(n.declarations,oa)}function kct(n){!Rg(n)&&!Yge(n.declarationList)&&n_t(n),dZ(n.declarationList)}function Cct(n){xh(n),Ui(n.expression)}function Ect(n){xh(n);const a=LD(n.expression);Pge(n.expression,a,n.thenStatement),oa(n.thenStatement),n.thenStatement.kind===242&&je(n.thenStatement,d.The_body_of_an_if_statement_cannot_be_the_empty_statement),oa(n.elseStatement)}function Pge(n,a,l){if(!H)return;_(n,l);function _(h,x){for(h=Ha(h),m(h,x);Gr(h)&&(h.operatorToken.kind===57||h.operatorToken.kind===61);)h=Ha(h.left),m(h,x)}function m(h,x){const N=S8(h)?Ha(h.right):h;if(ag(N))return;if(S8(N)){_(N,x);return}const F=N===h?a:LD(N),V=bn(N)&&ENe(N.expression);if(!wp(F,4194304)||V)return;const ne=Ts(F,0),le=!!ID(F);if(ne.length===0&&!le)return;const xe=Ie(N)?N:bn(N)?N.name:void 0,Ne=xe&&Yp(xe);if(!Ne&&!le)return;Ne&&Gr(h.parent)&&Pct(h.parent,Ne)||Ne&&x&&Dct(h,x,xe,Ne)||(le?Bu(N,!0,d.This_condition_will_always_return_true_since_this_0_is_always_defined,m0(F)):je(N,d.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead))}}function Dct(n,a,l,_){return!!ds(a,function m(h){if(Ie(h)){const x=Yp(h);if(x&&x===_){if(Ie(n)||Ie(l)&&Gr(l.parent))return!0;let N=l.parent,F=h.parent;for(;N&&F;){if(Ie(N)&&Ie(F)||N.kind===110&&F.kind===110)return Yp(N)===Yp(F);if(bn(N)&&bn(F)){if(Yp(N.name)!==Yp(F.name))return!1;F=F.expression,N=N.expression}else if(Rs(N)&&Rs(F))F=F.expression,N=N.expression;else return!1}}}return ds(h,m)})}function Pct(n,a){for(;Gr(n)&&n.operatorToken.kind===56;){if(ds(n.right,function _(m){if(Ie(m)){const h=Yp(m);if(h&&h===a)return!0}return ds(m,_)}))return!0;n=n.parent}return!1}function wct(n){xh(n),oa(n.statement),LD(n.expression)}function Act(n){xh(n),LD(n.expression),oa(n.statement)}function wge(n,a){return n.flags&16384&&je(a,d.An_expression_of_type_void_cannot_be_tested_for_truthiness),n}function LD(n,a){return wge(Ui(n,a),n)}function Nct(n){xh(n)||n.initializer&&n.initializer.kind===261&&Yge(n.initializer),n.initializer&&(n.initializer.kind===261?dZ(n.initializer):Ui(n.initializer)),n.condition&&LD(n.condition),n.incrementor&&Ui(n.incrementor),oa(n.statement),n.locals&&jy(n)}function Ict(n){K7e(n);const a=WI(n);if(n.awaitModifier?a&&Go(a)?Kt(n.awaitModifier,d.for_await_loops_cannot_be_used_inside_a_class_static_block):(pl(a)&6)===2&&ie<99&&nl(n,16384):J.downlevelIteration&&ie<2&&nl(n,256),n.initializer.kind===261)dZ(n.initializer);else{const l=n.initializer,_=KR(n);if(l.kind===209||l.kind===210)JS(l,_||st);else{const m=Ui(l);s7(l,d.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access,d.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access),_&&Oy(_,m,l,n.expression)}}oa(n.statement),n.locals&&jy(n)}function Fct(n){K7e(n);const a=Jme(Ui(n.expression));if(n.initializer.kind===261){const l=n.initializer.declarations[0];l&&As(l.name)&&je(l.name,d.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern),dZ(n.initializer)}else{const l=n.initializer,_=Ui(l);l.kind===209||l.kind===210?je(l,d.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern):ca(gtt(a),_)?s7(l,d.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access,d.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access):je(l,d.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any)}(a===Cn||!Ml(a,126091264))&&je(n.expression,d.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0,mr(a)),oa(n.statement),n.locals&&jy(n)}function KR(n){const a=n.awaitModifier?15:13;return E0(a,Z6(n.expression),j,n.expression)}function E0(n,a,l,_){return Ae(a)?a:Age(n,a,l,_,!0)||G}function Age(n,a,l,_,m){const h=(n&2)!==0;if(a===Cn){Lge(_,a,h);return}const x=ie>=2,N=!x&&J.downlevelIteration,F=J.noUncheckedIndexedAccess&&!!(n&128);if(x||N||h){const nt=gZ(a,n,x?_:void 0);if(m&&nt){const kt=n&8?d.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:n&32?d.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:n&64?d.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:n&16?d.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;kt&&Uu(l,nt.nextType,_,kt)}if(nt||x)return F?YN(nt&&nt.yieldType):nt&&nt.yieldType}let V=a,ne=!1,le=!1;if(n&4){if(V.flags&1048576){const nt=a.types,kt=wn(nt,Xt=>!(Xt.flags&402653316));kt!==nt&&(V=Mn(kt,2))}else V.flags&402653316&&(V=Cn);if(le=V!==a,le&&(ie<1&&_&&(je(_,d.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher),ne=!0),V.flags&131072))return F?YN(Fe):Fe}if(!x0(V)){if(_&&!ne){const nt=!!(n&4)&&!le,[kt,Xt]=Ne(nt,N);Bu(_,Xt&&!!ID(V),kt,mr(V))}return le?F?YN(Fe):Fe:void 0}const xe=ev(V,vt);if(le&&xe)return xe.flags&402653316&&!J.noUncheckedIndexedAccess?Fe:Mn(F?[xe,Fe,j]:[xe,Fe],2);return n&128?YN(xe):xe;function Ne(nt,kt){var Xt;return kt?nt?[d.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:[d.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:Nge(n,0,a,void 0)?[d.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!1]:Oct((Xt=a.symbol)==null?void 0:Xt.escapedName)?[d.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!0]:nt?[d.Type_0_is_not_an_array_type_or_a_string_type,!0]:[d.Type_0_is_not_an_array_type,!0]}}function Oct(n){switch(n){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return!0}return!1}function Nge(n,a,l,_){if(Ae(l))return;const m=gZ(l,n,_);return m&&m[k2e(a)]}function D0(n=Cn,a=Cn,l=or){if(n.flags&67359327&&a.flags&180227&&l.flags&180227){const _=Pp([n,a,l]);let m=li.get(_);return m||(m={yieldType:n,returnType:a,nextType:l},li.set(_,m)),m}return{yieldType:n,returnType:a,nextType:l}}function n7e(n){let a,l,_;for(const m of n)if(!(m===void 0||m===Tn)){if(m===va)return va;a=lr(a,m.yieldType),l=lr(l,m.returnType),_=lr(_,m.nextType)}return a||l||_?D0(a&&Mn(a),l&&Mn(l),_&&fa(_)):Tn}function mZ(n,a){return n[a]}function Mg(n,a,l){return n[a]=l}function gZ(n,a,l){var _,m;if(Ae(n))return va;if(!(n.flags&1048576)){const V=l?{errors:void 0}:void 0,ne=i7e(n,a,l,V);if(ne===Tn){if(l){const le=Lge(l,n,!!(a&2));V?.errors&&ua(le,...V.errors)}return}else if((_=V?.errors)!=null&&_.length)for(const le of V.errors)wa.add(le);return ne}const h=a&2?"iterationTypesOfAsyncIterable":"iterationTypesOfIterable",x=mZ(n,h);if(x)return x===Tn?void 0:x;let N;for(const V of n.types){const ne=l?{errors:void 0}:void 0,le=i7e(V,a,l,ne);if(le===Tn){if(l){const xe=Lge(l,n,!!(a&2));ne?.errors&&ua(xe,...ne.errors)}Mg(n,h,Tn);return}else if((m=ne?.errors)!=null&&m.length)for(const xe of ne.errors)wa.add(xe);N=lr(N,le)}const F=N?n7e(N):Tn;return Mg(n,h,F),F===Tn?void 0:F}function Ige(n,a){if(n===Tn)return Tn;if(n===va)return va;const{yieldType:l,returnType:_,nextType:m}=n;return a&&cde(!0),D0(zS(l,a)||G,zS(_,a)||G,m)}function i7e(n,a,l,_){if(Ae(n))return va;let m=!1;if(a&2){const h=Fge(n,no)||a7e(n,no);if(h)if(h===Tn&&l)m=!0;else return a&8?Ige(h,l):h}if(a&1){let h=Fge(n,rl)||a7e(n,rl);if(h)if(h===Tn&&l)m=!0;else if(a&2){if(h!==Tn)return h=Ige(h,l),m?h:Mg(n,"iterationTypesOfAsyncIterable",h)}else return h}if(a&2){const h=Oge(n,no,l,_,m);if(h!==Tn)return h}if(a&1){let h=Oge(n,rl,l,_,m);if(h!==Tn)return a&2?(h=Ige(h,l),m?h:Mg(n,"iterationTypesOfAsyncIterable",h)):h}return Tn}function Fge(n,a){return mZ(n,a.iterableCacheKey)}function s7e(n,a){const l=Fge(n,a)||Oge(n,a,void 0,void 0,!1);return l===Tn?tl:l}function a7e(n,a){let l;if(Z1(n,l=a.getGlobalIterableType(!1))||Z1(n,l=a.getGlobalIterableIteratorType(!1))){const[_]=uo(n),{returnType:m,nextType:h}=s7e(l,a);return Mg(n,a.iterableCacheKey,D0(a.resolveIterationType(_,void 0)||_,a.resolveIterationType(m,void 0)||m,h))}if(Z1(n,a.getGlobalGeneratorType(!1))){const[_,m,h]=uo(n);return Mg(n,a.iterableCacheKey,D0(a.resolveIterationType(_,void 0)||_,a.resolveIterationType(m,void 0)||m,h))}}function o7e(n){const a=GPe(!1),l=a&&q(Br(a),zo(n));return l&&pp(l)?dp(l):`__@${n}`}function Oge(n,a,l,_,m){const h=Gs(n,o7e(a.iteratorSymbolName)),x=h&&!(h.flags&16777216)?Br(h):void 0;if(Ae(x))return m?va:Mg(n,a.iterableCacheKey,va);const N=x?Ts(x,0):void 0;if(!ut(N))return m?Tn:Mg(n,a.iterableCacheKey,Tn);const F=fa(Yt(N,Ma)),V=c7e(F,a,l,_,m)??Tn;return m?V:Mg(n,a.iterableCacheKey,V)}function Lge(n,a,l){const _=l?d.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:d.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator,m=!!ID(a)||!l&&iw(n.parent)&&n.parent.expression===n&&YQ(!1)!==rs&&ca(a,YQ(!1));return Bu(n,m,_,mr(a))}function Lct(n,a,l,_){return c7e(n,a,l,_,!1)}function c7e(n,a,l,_,m){if(Ae(n))return va;let h=l7e(n,a)||Mct(n,a);return h===Tn&&l&&(h=void 0,m=!0),h??(h=_7e(n,a,l,_,m)),h===Tn?void 0:h}function l7e(n,a){return mZ(n,a.iteratorCacheKey)}function Mct(n,a){const l=a.getGlobalIterableIteratorType(!1);if(Z1(n,l)){const[_]=uo(n),m=l7e(l,a)||_7e(l,a,void 0,void 0,!1),{returnType:h,nextType:x}=m===Tn?tl:m;return Mg(n,a.iteratorCacheKey,D0(_,h,x))}if(Z1(n,a.getGlobalIteratorType(!1))||Z1(n,a.getGlobalGeneratorType(!1))){const[_,m,h]=uo(n);return Mg(n,a.iteratorCacheKey,D0(_,m,h))}}function u7e(n,a){const l=q(n,"done")||Wt;return ca(a===0?Wt:Zr,l)}function Rct(n){return u7e(n,0)}function jct(n){return u7e(n,1)}function Bct(n){if(Ae(n))return va;const a=mZ(n,"iterationTypesOfIteratorResult");if(a)return a;if(Z1(n,Pet(!1))){const x=uo(n)[0];return Mg(n,"iterationTypesOfIteratorResult",D0(x,void 0,void 0))}if(Z1(n,wet(!1))){const x=uo(n)[0];return Mg(n,"iterationTypesOfIteratorResult",D0(void 0,x,void 0))}const l=jc(n,Rct),_=l!==Cn?q(l,"value"):void 0,m=jc(n,jct),h=m!==Cn?q(m,"value"):void 0;return!_&&!h?Mg(n,"iterationTypesOfIteratorResult",Tn):Mg(n,"iterationTypesOfIteratorResult",D0(_,h||Ni,void 0))}function Mge(n,a,l,_,m){var h,x,N,F;const V=Gs(n,l);if(!V&&l!=="next")return;const ne=V&&!(l==="next"&&V.flags&16777216)?l==="next"?Br(V):Ap(Br(V),2097152):void 0;if(Ae(ne))return l==="next"?va:lc;const le=ne?Ts(ne,0):ze;if(le.length===0){if(_){const Ut=l==="next"?a.mustHaveANextMethodDiagnostic:a.mustBeAMethodDiagnostic;m?(m.errors??(m.errors=[]),m.errors.push(mn(_,Ut,l))):je(_,Ut,l)}return l==="next"?Tn:void 0}if(ne?.symbol&&le.length===1){const Ut=a.getGlobalGeneratorType(!1),Nr=a.getGlobalIteratorType(!1),Sr=((x=(h=Ut.symbol)==null?void 0:h.members)==null?void 0:x.get(l))===ne.symbol,Er=!Sr&&((F=(N=Nr.symbol)==null?void 0:N.members)==null?void 0:F.get(l))===ne.symbol;if(Sr||Er){const hr=Sr?Ut:Nr,{mapper:sn}=ne;return D0(Iy(hr.typeParameters[0],sn),Iy(hr.typeParameters[1],sn),l==="next"?Iy(hr.typeParameters[2],sn):void 0)}}let xe,Ne;for(const Ut of le)l!=="throw"&&ut(Ut.parameters)&&(xe=lr(xe,Sd(Ut,0))),Ne=lr(Ne,Ma(Ut));let nt,kt;if(l!=="throw"){const Ut=xe?Mn(xe):or;if(l==="next")kt=Ut;else if(l==="return"){const Nr=a.resolveIterationType(Ut,_)||G;nt=lr(nt,Nr)}}let Xt;const _r=Ne?fa(Ne):Cn,Yr=a.resolveIterationType(_r,_)||G,gr=Bct(Yr);return gr===Tn?(_&&(m?(m.errors??(m.errors=[]),m.errors.push(mn(_,a.mustHaveAValueDiagnostic,l))):je(_,a.mustHaveAValueDiagnostic,l)),Xt=G,nt=lr(nt,G)):(Xt=gr.yieldType,nt=lr(nt,gr.returnType)),D0(Xt,Mn(nt),kt)}function _7e(n,a,l,_,m){const h=n7e([Mge(n,a,"next",l,_),Mge(n,a,"return",l,_),Mge(n,a,"throw",l,_)]);return m?h:Mg(n,a.iteratorCacheKey,h)}function V2(n,a,l){if(Ae(a))return;const _=f7e(a,l);return _&&_[k2e(n)]}function f7e(n,a){if(Ae(n))return va;const l=a?2:1,_=a?no:rl;return gZ(n,l,void 0)||Lct(n,_,void 0,void 0)}function Jct(n){xh(n)||Zut(n)}function ej(n,a){const l=!!(a&1),_=!!(a&2);if(l){const m=V2(1,n,_);return m?_?C0(FD(m)):m:st}return _?C0(n)||st:n}function p7e(n,a){const l=ej(a,pl(n));return!!(l&&(Yo(l,16384)||l.flags&32769))}function zct(n){if(xh(n))return;const a=WI(n);if(a&&Go(a)){Rl(n,d.A_return_statement_cannot_be_used_inside_a_class_static_block);return}if(!a){Rl(n,d.A_return_statement_can_only_be_used_within_a_function_body);return}const l=Dp(a),_=Ma(l),m=pl(a);if(H||n.expression||_.flags&131072){const h=n.expression?Bc(n.expression):j;if(a.kind===178)n.expression&&je(n,d.Setters_cannot_return_a_value);else if(a.kind===176)n.expression&&!Oy(h,_,n,n.expression)&&je(n,d.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);else if(V6(a)){const x=ej(_,m)??_,N=m&2?u7(h,!1,n,d.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):h;x&&Oy(N,x,n,n.expression)}}else a.kind!==176&&J.noImplicitReturns&&!p7e(a,_)&&je(n,d.Not_all_code_paths_return_a_value)}function Wct(n){xh(n)||n.flags&65536&&Rl(n,d.with_statements_are_not_allowed_in_an_async_function_block),Ui(n.expression);const a=Or(n);if(!q2(a)){const l=Sm(a,n.pos).start,_=n.statement.pos;H2(a,l,_-l,d.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any)}}function Uct(n){xh(n);let a,l=!1;const _=Ui(n.expression);Zt(n.caseBlock.clauses,m=>{m.kind===297&&!l&&(a===void 0?a=m:(Kt(m,d.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement),l=!0)),m.kind===296&&r(h(m)),Zt(m.statements,oa),J.noFallthroughCasesInSwitch&&m.fallthroughFlowNode&&xR(m.fallthroughFlowNode)&&je(m,d.Fallthrough_case_in_switch);function h(x){return()=>{const N=Ui(x.expression);mge(_,N)||V8e(N,_,x.expression,void 0)}}}),n.caseBlock.locals&&jy(n.caseBlock)}function Vct(n){xh(n)||Ar(n.parent,a=>ks(a)?"quit":a.kind===256&&a.label.escapedText===n.label.escapedText?(Kt(n.label,d.Duplicate_label_0,Wc(n.label)),!0):!1),oa(n.statement)}function qct(n){xh(n)||Ie(n.expression)&&!n.expression.escapedText&&p_t(n,d.Line_break_not_permitted_here),n.expression&&Ui(n.expression)}function Hct(n){xh(n),pZ(n.tryBlock);const a=n.catchClause;if(a){if(a.variableDeclaration){const l=a.variableDeclaration;ZR(l);const _=Wl(l);if(_){const m=si(_);m&&!(m.flags&3)&&Rl(_,d.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified)}else if(l.initializer)Rl(l.initializer,d.Catch_clause_variable_cannot_have_an_initializer);else{const m=a.block.locals;m&&ng(a.locals,h=>{const x=m.get(h);x?.valueDeclaration&&x.flags&2&&Kt(x.valueDeclaration,d.Cannot_redeclare_identifier_0_in_catch_clause,bi(h))})}}pZ(a.block)}n.finallyBlock&&pZ(n.finallyBlock)}function hZ(n,a,l){const _=zu(n);if(_.length===0)return;for(const h of Ey(n))l&&h.flags&4194304||d7e(n,h,gD(h,8576,!0),ky(h));const m=a.valueDeclaration;if(m&&Qn(m)){for(const h of m.members)if(!Ls(h)&&!W6(h)){const x=cn(h);d7e(n,x,Zl(h.name.expression),ky(x))}}if(_.length>1)for(const h of _)Gct(n,h)}function d7e(n,a,l,_){const m=a.valueDeclaration,h=as(m);if(h&&Ti(h))return;const x=Xpe(n,l),N=Pn(n)&2?Wo(n.symbol,264):void 0,F=m&&m.kind===226||h&&h.kind===167?m:void 0,V=f_(a)===n.symbol?m:void 0;for(const ne of x){const le=ne.declaration&&f_(cn(ne.declaration))===n.symbol?ne.declaration:void 0,xe=V||le||(N&&!ut(Qc(n),Ne=>!!K1(Ne,a.escapedName)&&!!ev(Ne,ne.keyType))?N:void 0);if(xe&&!ca(_,ne.type)){const Ne=Tg(xe,d.Property_0_of_type_1_is_not_assignable_to_2_index_type_3,ii(a),mr(_),mr(ne.keyType),mr(ne.type));F&&xe!==F&&ua(Ne,mn(F,d._0_is_declared_here,ii(a))),wa.add(Ne)}}}function Gct(n,a){const l=a.declaration,_=Xpe(n,a.keyType),m=Pn(n)&2?Wo(n.symbol,264):void 0,h=l&&f_(cn(l))===n.symbol?l:void 0;for(const x of _){if(x===a)continue;const N=x.declaration&&f_(cn(x.declaration))===n.symbol?x.declaration:void 0,F=h||N||(m&&!ut(Qc(n),V=>!!Og(V,a.keyType)&&!!ev(V,x.keyType))?m:void 0);F&&!ca(a.type,x.type)&&je(F,d._0_index_type_1_is_not_assignable_to_2_index_type_3,mr(a.keyType),mr(a.type),mr(x.keyType),mr(x.type))}}function MD(n,a){switch(n.escapedText){case"any":case"unknown":case"never":case"number":case"bigint":case"boolean":case"string":case"symbol":case"void":case"object":je(n,a,n.escapedText)}}function $ct(n){ie>=1&&n.escapedText==="Object"&&(B<5||Or(n).impliedNodeFormat===1)&&je(n,d.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0,y4[B])}function Xct(n){const a=wn(Zy(n),ad);if(!Ir(a))return;const l=Hr(n),_=new Set,m=new Set;if(Zt(n.parameters,({name:x},N)=>{Ie(x)&&_.add(x.escapedText),As(x)&&m.add(N)}),Ype(n)){const x=a.length-1,N=a[x];l&&N&&Ie(N.name)&&N.typeExpression&&N.typeExpression.type&&!_.has(N.name.escapedText)&&!m.has(x)&&!ep(si(N.typeExpression.type))&&je(N.name,d.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,an(N.name))}else Zt(a,({name:x,isNameFirst:N},F)=>{m.has(F)||Ie(x)&&_.has(x.escapedText)||(h_(x)?l&&je(x,d.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1,D_(x),D_(x.left)):N||Uf(l,x,d.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,an(x)))})}function tj(n){let a=!1;if(n)for(let _=0;_{_.default?(a=!0,Qct(_.default,n,m)):a&&je(_,d.Required_type_parameters_may_not_follow_optional_type_parameters);for(let h=0;h_)return!1;for(let F=0;FUc(l)&&Nu(l))&&Kt(a,d.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator),!n.name&&!In(n,2048)&&Rl(n,d.A_class_declaration_without_the_default_modifier_must_have_a_name),y7e(n),Zt(n.members,oa),jy(n)}function y7e(n){Rut(n),XR(n),OD(n,n.name),tj(L0(n)),c7(n);const a=cn(n),l=bo(a),_=rf(l),m=Br(a);m7e(a),uZ(a),mot(n),!!(n.flags&33554432)||got(n);const x=Pd(n);if(x){Zt(x.typeArguments,oa),ie<2&&nl(x.parent,1);const V=Nv(n);V&&V!==x&&Ui(V.expression);const ne=Qc(l);ne.length&&r(()=>{const le=ne[0],xe=Xc(l),Ne=e_(xe);if(rlt(Ne,x),oa(x.expression),ut(x.typeArguments)){Zt(x.typeArguments,oa);for(const kt of Ea(Ne,x.typeArguments,x))if(!BNe(x,kt.typeParameters))break}const nt=rf(le,l.thisType);if(Uu(_,nt,void 0)?Uu(m,R8e(Ne),n.name||n,d.Class_static_side_0_incorrectly_extends_base_class_static_side_1):S7e(n,_,nt,d.Class_0_incorrectly_extends_base_class_1),xe.flags&8650752&&(xn(m)?Ts(xe,1).some(Xt=>Xt.flags&4)&&!In(n,64)&&je(n.name||n,d.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract):je(n.name||n,d.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any)),!(Ne.symbol&&Ne.symbol.flags&32)&&!(xe.flags&8650752)){const kt=Ka(Ne,x.typeArguments,x);Zt(kt,Xt=>!nm(Xt.declaration)&&!hh(Ma(Xt),le))&&je(x.expression,d.Base_constructors_must_all_have_the_same_return_type)}slt(l,le)})}tlt(n,l,_,m);const N=Wk(n);if(N)for(const V of N)(!oc(V.expression)||gu(V.expression))&&je(V.expression,d.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments),xge(V),r(F(V));r(()=>{hZ(l,a),hZ(m,a,!0),bge(n),clt(n)});function F(V){return()=>{const ne=hd(si(V));if(!et(ne))if(xS(ne)){const le=ne.symbol&&ne.symbol.flags&32?d.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:d.Class_0_incorrectly_implements_interface_1,xe=rf(ne,l.thisType);Uu(_,xe,void 0)||S7e(n,_,xe,le)}else je(V,d.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members)}}}function tlt(n,a,l,_){const h=Pd(n)&&Qc(a),x=h?.length?rf(ba(h),a.thisType):void 0,N=Xc(a);for(const F of n.members)Sz(F)||(gc(F)&&Zt(F.parameters,V=>{E_(V,F)&&v7e(n,_,N,x,a,l,V,!0)}),v7e(n,_,N,x,a,l,F,!1))}function v7e(n,a,l,_,m,h,x,N,F=!0){const V=x.name&&Yp(x.name)||Yp(x);return V?b7e(n,a,l,_,m,h,y5(x),Mv(x),Ls(x),N,pc(V),F?x:void 0):0}function b7e(n,a,l,_,m,h,x,N,F,V,ne,le){const xe=Hr(n),Ne=!!(n.flags&33554432);if(_&&(x||J.noImplicitOverride)){const nt=zo(ne),kt=F?a:h,Xt=F?l:_,_r=Gs(kt,nt),Yr=Gs(Xt,nt),gr=mr(_);if(_r&&!Yr&&x){if(le){const Ut=NAe(ne,Xt);Ut?je(le,xe?d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:d.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,gr,ii(Ut)):je(le,xe?d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:d.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0,gr)}return 2}else if(_r&&Yr?.declarations&&J.noImplicitOverride&&!Ne){const Ut=ut(Yr.declarations,Mv);if(x)return 0;if(Ut){if(N&&Ut)return le&&je(le,d.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0,gr),1}else{if(le){const Nr=V?xe?d.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:d.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:xe?d.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:d.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;je(le,Nr,gr)}return 1}}}else if(x){if(le){const nt=mr(m);je(le,xe?d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:d.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class,nt)}return 2}return 0}function S7e(n,a,l,_){let m=!1;for(const h of n.members){if(Ls(h))continue;const x=h.name&&Yp(h.name)||Yp(h);if(x){const N=Gs(a,x.escapedName),F=Gs(l,x.escapedName);if(N&&F){const V=()=>ps(void 0,d.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,ii(x),mr(a),mr(l));Uu(Br(N),Br(F),h.name||h,void 0,V)||(m=!0)}}}m||Uu(a,l,n.name||n,_)}function rlt(n,a){const l=Ts(n,1);if(l.length){const _=l[0].declaration;if(_&&w_(_,2)){const m=Qg(n.symbol);Wge(a,m)||je(a,d.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private,xp(n.symbol))}}}function nlt(n,a,l){if(!a.name)return 0;const _=cn(n),m=bo(_),h=rf(m),x=Br(_),F=Pd(n)&&Qc(m),V=F?.length?rf(ba(F),m.thisType):void 0,ne=Xc(m),le=a.parent?y5(a):In(a,16);return b7e(n,x,ne,V,m,h,le,Mv(a),Ls(a),!1,pc(l))}function i4(n){return Ko(n)&1?n.links.target:n}function ilt(n){return wn(n.declarations,a=>a.kind===263||a.kind===264)}function slt(n,a){var l,_,m,h;const x=Wa(a);let N;e:for(const F of x){const V=i4(F);if(V.flags&4194304)continue;const ne=K1(n,V.escapedName);if(!ne)continue;const le=i4(ne),xe=Mf(V);if(E.assert(!!le,"derived should point to something, even if it is the base class' declaration."),le===V){const Ne=Qg(n.symbol);if(xe&64&&(!Ne||!In(Ne,64))){for(const nt of Qc(n)){if(nt===a)continue;const kt=K1(nt,V.escapedName),Xt=kt&&i4(kt);if(Xt&&Xt!==V)continue e}N||(N=je(Ne,d.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,mr(n),mr(a))),Ne.kind===231?ua(N,mn(F.valueDeclaration??(F.declarations&&ba(F.declarations))??Ne,d.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,ii(F),mr(a))):ua(N,mn(F.valueDeclaration??(F.declarations&&ba(F.declarations))??Ne,d.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,mr(n),ii(F),mr(a)))}}else{const Ne=Mf(le);if(xe&2||Ne&2)continue;let nt;const kt=V.flags&98308,Xt=le.flags&98308;if(kt&&Xt){if((Ko(V)&6?(l=V.declarations)!=null&&l.some(gr=>T7e(gr,xe)):(_=V.declarations)!=null&&_.every(gr=>T7e(gr,xe)))||Ko(V)&262144||le.valueDeclaration&&Gr(le.valueDeclaration))continue;const _r=kt!==4&&Xt===4;if(_r||kt===4&&Xt!==4){const gr=_r?d._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:d._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;je(as(le.valueDeclaration)||le.valueDeclaration,gr,ii(V),mr(a),mr(n))}else if(ae){const gr=(m=le.declarations)==null?void 0:m.find(Ut=>Ut.kind===172&&!Ut.initializer);if(gr&&!(le.flags&33554432)&&!(xe&64)&&!(Ne&64)&&!((h=le.declarations)!=null&&h.some(Ut=>!!(Ut.flags&33554432)))){const Ut=$p(Qg(n.symbol)),Nr=gr.name;if(gr.exclamationToken||!Ut||!Ie(Nr)||!H||!k7e(Nr,n,Ut)){const Sr=d.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;je(as(le.valueDeclaration)||le.valueDeclaration,Sr,ii(V),mr(a))}}}continue}else if(jme(V)){if(jme(le)||le.flags&4)continue;E.assert(!!(le.flags&98304)),nt=d.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor}else V.flags&98304?nt=d.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:nt=d.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;je(as(le.valueDeclaration)||le.valueDeclaration,nt,mr(a),ii(V),mr(n))}}}function T7e(n,a){return a&64&&(!Es(n)||!n.initializer)||Mu(n.parent)}function alt(n,a,l){if(!Ir(a))return l;const _=new Map;Zt(l,m=>{_.set(m.escapedName,m)});for(const m of a){const h=Wa(rf(m,n.thisType));for(const x of h){const N=_.get(x.escapedName);N&&x.parent===N.parent&&_.delete(x.escapedName)}}return fs(_.values())}function olt(n,a){const l=Qc(n);if(l.length<2)return!0;const _=new Map;Zt(Ape(n).declaredProperties,h=>{_.set(h.escapedName,{prop:h,containingType:n})});let m=!0;for(const h of l){const x=Wa(rf(h,n.thisType));for(const N of x){const F=_.get(N.escapedName);if(!F)_.set(N.escapedName,{prop:N,containingType:h});else if(F.containingType!==n&&!xrt(F.prop,N)){m=!1;const ne=mr(F.containingType),le=mr(h);let xe=ps(void 0,d.Named_property_0_of_types_1_and_2_are_not_identical,ii(N),ne,le);xe=ps(xe,d.Interface_0_cannot_simultaneously_extend_types_1_and_2,mr(n),ne,le),wa.add(Hg(Or(a),a,xe))}}}return m}function clt(n){if(!H||!Se||n.flags&33554432)return;const a=$p(n);for(const l of n.members)if(!(Fu(l)&128)&&!Ls(l)&&x7e(l)){const _=l.name;if(Ie(_)||Ti(_)||xa(_)){const m=Br(cn(l));m.flags&3||yD(m)||(!a||!k7e(_,m,a))&&je(l.name,d.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor,eo(_))}}}function x7e(n){return n.kind===172&&!Mv(n)&&!n.exclamationToken&&!n.initializer}function llt(n,a,l,_,m){for(const h of l)if(h.pos>=_&&h.pos<=m){const x=I.createPropertyAccessExpression(I.createThis(),n);ga(x.expression,x),ga(x,h),x.flowNode=h.returnFlowNode;const N=Ry(x,a,Ly(a));if(!yD(N))return!0}return!1}function k7e(n,a,l){const _=xa(n)?I.createElementAccessExpression(I.createThis(),n.expression):I.createPropertyAccessExpression(I.createThis(),n);ga(_.expression,_),ga(_,l),_.flowNode=l.returnFlowNode;const m=Ry(_,a,Ly(a));return!yD(m)}function ult(n){Rg(n)||Vut(n),tj(n.typeParameters),r(()=>{MD(n.name,d.Interface_name_cannot_be_0),c7(n);const a=cn(n);m7e(a);const l=Wo(a,264);if(n===l){const _=bo(a),m=rf(_);if(olt(_,n.name)){for(const h of Qc(_))Uu(m,rf(h,_.thisType),n.name,d.Interface_0_incorrectly_extends_interface_1);hZ(_,a)}}LNe(n)}),Zt(Y4(n),a=>{(!oc(a.expression)||gu(a.expression))&&je(a.expression,d.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments),xge(a)}),Zt(n.members,oa),r(()=>{bge(n),jy(n)})}function _lt(n){Rg(n),MD(n.name,d.Type_alias_name_cannot_be_0),c7(n),tj(n.typeParameters),n.type.kind===141?(!IO.has(n.name.escapedText)||Ir(n.typeParameters)!==1)&&je(n.type,d.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types):(oa(n.type),jy(n))}function C7e(n){const a=Wn(n);if(!(a.flags&1024)){a.flags|=1024;let l=0;for(const _ of n.members){const m=flt(_,l);Wn(_).enumMemberValue=m,l=typeof m=="number"?m+1:void 0}}}function flt(n,a){if(RP(n.name))je(n.name,d.Computed_property_names_are_not_allowed_in_enums);else{const l=Dk(n.name);_g(l)&&!kE(l)&&je(n.name,d.An_enum_member_cannot_have_a_numeric_name)}if(n.initializer)return plt(n);if(!(n.parent.flags&33554432&&!Cv(n.parent))){if(a!==void 0)return a;je(n.name,d.Enum_member_must_have_initializer)}}function plt(n){const a=Cv(n.parent),l=n.initializer,_=RD(l,n);return _!==void 0?a&&typeof _=="number"&&!isFinite(_)&&je(l,isNaN(_)?d.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:d.const_enum_member_initializer_was_evaluated_to_a_non_finite_value):a?je(l,d.const_enum_member_initializers_must_be_constant_expressions):n.parent.flags&33554432?je(l,d.In_ambient_enum_declarations_member_initializer_must_be_constant_expression):Uu(Ui(l),vt,l,d.Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values),_}function RD(n,a){switch(n.kind){case 224:const l=RD(n.operand,a);if(typeof l=="number")switch(n.operator){case 40:return l;case 41:return-l;case 55:return~l}break;case 226:const _=RD(n.left,a),m=RD(n.right,a);if(typeof _=="number"&&typeof m=="number")switch(n.operatorToken.kind){case 52:return _|m;case 51:return _&m;case 49:return _>>m;case 50:return _>>>m;case 48:return _<mlt(n))}function mlt(n){Rg(n),OD(n,n.name),c7(n),n.members.forEach(glt),C7e(n);const a=cn(n),l=Wo(a,n.kind);if(n===l){if(a.declarations&&a.declarations.length>1){const m=Cv(n);Zt(a.declarations,h=>{p1(h)&&Cv(h)!==m&&je(as(h),d.Enum_declarations_must_all_be_const_or_non_const)})}let _=!1;Zt(a.declarations,m=>{if(m.kind!==266)return!1;const h=m;if(!h.members.length)return!1;const x=h.members[0];x.initializer||(_?je(x.name,d.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):_=!0)})}}function glt(n){Ti(n.name)&&je(n,d.An_enum_member_cannot_be_named_with_a_private_identifier),n.initializer&&Ui(n.initializer)}function hlt(n){const a=n.declarations;if(a){for(const l of a)if((l.kind===263||l.kind===262&&ip(l.body))&&!(l.flags&33554432))return l}}function ylt(n,a){const l=bm(n),_=bm(a);return qd(l)?qd(_):qd(_)?!1:l===_}function vlt(n){n.body&&(oa(n.body),Dd(n)||jy(n)),r(a);function a(){var l,_;const m=Dd(n),h=n.flags&33554432;m&&!h&&je(n.name,d.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);const x=ru(n),N=x?d.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:d.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;if(rj(n,N))return;Rg(n)||!h&&n.name.kind===11&&Kt(n.name,d.Only_ambient_modules_can_use_quoted_names),Ie(n.name)&&OD(n,n.name),c7(n);const F=cn(n);if(F.flags&512&&!h&&eV(n,Sb(J))){if(nd(J)&&!Or(n).externalModuleIndicator&&je(n.name,d.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement,Je),((l=F.declarations)==null?void 0:l.length)>1){const V=hlt(F);V&&(Or(n)!==Or(V)?je(n.name,d.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged):n.posne.kind===95);V&&je(V,d.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}}if(x)if(xv(n)){if((m||cn(n).flags&33554432)&&n.body)for(const ne of n.body.statements)Rge(ne,m)}else qd(n.parent)?m?je(n.name,d.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations):Tl(cp(n.name))&&je(n.name,d.Ambient_module_declaration_cannot_specify_relative_module_name):m?je(n.name,d.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations):je(n.name,d.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces)}}function Rge(n,a){switch(n.kind){case 243:for(const _ of n.declarationList.declarations)Rge(_,a);break;case 277:case 278:Rl(n,d.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);break;case 271:case 272:Rl(n,d.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);break;case 208:case 260:const l=n.name;if(As(l)){for(const _ of l.elements)Rge(_,a);break}case 263:case 266:case 262:case 264:case 267:case 265:if(a)return;break}}function blt(n){switch(n.kind){case 80:return n;case 166:do n=n.left;while(n.kind!==80);return n;case 211:do{if(ag(n.expression)&&!Ti(n.name))return n.name;n=n.expression}while(n.kind!==80);return n}}function jge(n){const a=Rk(n);if(!a||sc(a))return!1;if(!ra(a))return je(a,d.String_literal_expected),!1;const l=n.parent.kind===268&&ru(n.parent.parent);if(n.parent.kind!==312&&!l)return je(a,n.kind===278?d.Export_declarations_are_not_permitted_in_a_namespace:d.Import_declarations_in_a_namespace_cannot_reference_a_module),!1;if(l&&Tl(a.text)&&!Rx(n))return je(n,d.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name),!1;if(!Hl(n)&&n.attributes){const _=n.attributes.token===118?d.Import_attribute_values_must_be_string_literal_expressions:d.Import_assertion_values_must_be_string_literal_expressions;let m=!1;for(const h of n.attributes.elements)ra(h.value)||(m=!0,je(h.value,_));return!m}return!0}function yZ(n){var a,l,_,m;let h=cn(n);const x=ul(h);if(x!==dt){if(h=Na(h.exportSymbol||h),Hr(n)&&!(x.flags&111551)&&!bv(n)){const V=rT(n)?n.propertyName||n.name:Au(n)?n.name:n;if(E.assert(n.kind!==280),n.kind===281){const ne=je(V,d.Types_cannot_appear_in_export_declarations_in_JavaScript_files),le=(l=(a=Or(n).symbol)==null?void 0:a.exports)==null?void 0:l.get((n.propertyName||n.name).escapedText);if(le===x){const xe=(_=le.declarations)==null?void 0:_.find(Tk);xe&&ua(ne,mn(xe,d._0_is_automatically_exported_here,bi(le.escapedName)))}}else{E.assert(n.kind!==260);const ne=Ar(n,ed(gl,Hl)),le=(ne&&((m=Mk(ne))==null?void 0:m.text))??"...",xe=bi(Ie(V)?V.escapedText:h.escapedName);je(V,d._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation,xe,`import("${le}").${xe}`)}return}const N=cu(x),F=(h.flags&1160127?111551:0)|(h.flags&788968?788968:0)|(h.flags&1920?1920:0);if(N&F){const V=n.kind===281?d.Export_declaration_conflicts_with_exported_declaration_of_0:d.Import_declaration_conflicts_with_local_declaration_of_0;je(n,V,ii(h))}if(nd(J)&&!bv(n)&&!(n.flags&33554432)){const V=qf(h),ne=!(N&111551);if(ne||V)switch(n.kind){case 273:case 276:case 271:{if(J.preserveValueImports||J.verbatimModuleSyntax){E.assertIsDefined(n.name,"An ImportClause with a symbol should have a name");const le=J.verbatimModuleSyntax&&Ok(n)?d.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled:ne?J.verbatimModuleSyntax?d._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:d._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:J.verbatimModuleSyntax?d._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:d._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled,xe=an(n.kind===276&&n.propertyName||n.name);ah(je(n,le,xe),ne?void 0:V,xe)}ne&&n.kind===271&&w_(n,32)&&je(n,d.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled,Je);break}case 281:if(J.verbatimModuleSyntax||Or(V)!==Or(n)){const le=an(n.propertyName||n.name),xe=ne?je(n,d.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type,Je):je(n,d._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled,le,Je);ah(xe,ne?void 0:V,le);break}}J.verbatimModuleSyntax&&n.kind!==271&&!Hr(n)&&(B===1||Or(n).impliedNodeFormat===1)&&je(n,d.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}if(v_(n)){const V=Bge(h,n);l0(V)&&V.declarations&&xg(n,V.declarations,V.escapedName)}}}function Bge(n,a){if(!(n.flags&2097152)||l0(n)||!Sp(n))return n;const l=ul(n);if(l===dt)return l;for(;n.flags&2097152;){const _=Ime(n);if(_){if(_===l)break;if(_.declarations&&Ir(_.declarations))if(l0(_)){xg(a,_.declarations,_.escapedName);break}else{if(n===l)break;n=_}}else break}return l}function vZ(n){OD(n,n.name),yZ(n),n.kind===276&&an(n.propertyName||n.name)==="default"&&xm(J)&&B!==4&&(B<5||Or(n).impliedNodeFormat===1)&&nl(n,131072)}function P7e(n){var a;const l=n.attributes;if(l){const _=WV(n),m=LC(l,_?Kt:void 0),h=n.attributes.token===118;if(_&&m)return;if((B===199&&n.moduleSpecifier&&Yi(n.moduleSpecifier))!==99&&B!==99){const N=h?B===199?d.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:d.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext:B===199?d.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:d.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;return Kt(l,N)}if(gl(n)?(a=n.importClause)!=null&&a.isTypeOnly:n.isTypeOnly)return Kt(l,h?d.Import_attributes_cannot_be_used_with_type_only_imports_or_exports:d.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);if(m)return Kt(l,d.resolution_mode_can_only_be_set_for_type_only_imports)}}function Slt(n){if(!rj(n,Hr(n)?d.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:d.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){if(!Rg(n)&&h5(n)&&Rl(n,d.An_import_declaration_cannot_have_modifiers),jge(n)){const a=n.importClause;a&&!m_t(a)&&(a.name&&vZ(a),a.namedBindings&&(a.namedBindings.kind===274?(vZ(a.namedBindings),B!==4&&(B<5||Or(n).impliedNodeFormat===1)&&xm(J)&&nl(n,65536)):Zu(n,n.moduleSpecifier)&&Zt(a.namedBindings.elements,vZ)))}P7e(n)}}function Tlt(n){if(!rj(n,Hr(n)?d.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:d.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)&&(Rg(n),Ok(n)||jge(n)))if(vZ(n),In(n,32)&&U1(n),n.moduleReference.kind!==283){const a=ul(cn(n));if(a!==dt){const l=cu(a);if(l&111551){const _=$_(n.moduleReference);lo(_,112575).flags&1920||je(_,d.Module_0_is_hidden_by_a_local_declaration_with_the_same_name,eo(_))}l&788968&&MD(n.name,d.Import_name_cannot_be_0)}n.isTypeOnly&&Kt(n,d.An_import_alias_cannot_use_import_type)}else B>=5&&Or(n).impliedNodeFormat===void 0&&!n.isTypeOnly&&!(n.flags&33554432)&&Kt(n,d.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead)}function xlt(n){if(!rj(n,Hr(n)?d.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:d.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){if(!Rg(n)&&Dte(n)&&Rl(n,d.An_export_declaration_cannot_have_modifiers),n.moduleSpecifier&&n.exportClause&&gp(n.exportClause)&&Ir(n.exportClause.elements)&&ie===0&&nl(n,4194304),klt(n),!n.moduleSpecifier||jge(n))if(n.exportClause&&!Dm(n.exportClause)){Zt(n.exportClause.elements,Alt);const a=n.parent.kind===268&&ru(n.parent.parent),l=!a&&n.parent.kind===268&&!n.moduleSpecifier&&n.flags&33554432;n.parent.kind!==312&&!a&&!l&&je(n,d.Export_declarations_are_not_permitted_in_a_namespace)}else{const a=Zu(n,n.moduleSpecifier);a&&C2(a)?je(n.moduleSpecifier,d.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk,ii(a)):n.exportClause&&yZ(n.exportClause),B!==4&&(B<5||Or(n).impliedNodeFormat===1)&&(n.exportClause?xm(J)&&nl(n,65536):nl(n,32768))}P7e(n)}}function klt(n){var a;return n.isTypeOnly&&((a=n.exportClause)==null?void 0:a.kind)===279?aIe(n.exportClause):!1}function rj(n,a){const l=n.parent.kind===312||n.parent.kind===268||n.parent.kind===267;return l||Rl(n,a),!l}function Clt(n){return n5(n,a=>!!cn(a).isReferenced)}function Elt(n){return n5(n,a=>!!yi(cn(a)).constEnumReferenced)}function Dlt(n){return gl(n)&&n.importClause&&!n.importClause.isTypeOnly&&Clt(n.importClause)&&!CZ(n.importClause,!0)&&!Elt(n.importClause)}function Plt(n){return Hl(n)&&Pm(n.moduleReference)&&!n.isTypeOnly&&cn(n).isReferenced&&!CZ(n,!1)&&!yi(cn(n)).constEnumReferenced}function wlt(n){if(ot)for(const a of n.statements)(Dlt(a)||Plt(a))&&je(a,d.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error)}function Alt(n){if(yZ(n),Rf(J)&&L6(n.propertyName||n.name,!0),n.parent.parent.moduleSpecifier)xm(J)&&B!==4&&(B<5||Or(n).impliedNodeFormat===1)&&an(n.propertyName||n.name)==="default"&&nl(n,131072);else{const a=n.propertyName||n.name,l=_c(a,a.escapedText,2998271,void 0,void 0,!0);if(l&&(l===Oe||l===Xe||l.declarations&&qd(vS(l.declarations[0]))))je(a,d.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,an(a));else{!n.isTypeOnly&&!n.parent.parent.isTypeOnly&&U1(n);const _=l&&(l.flags&2097152?ul(l):l);(!_||cu(_)&111551)&&Bc(n.propertyName||n.name)}}}function Nlt(n){const a=n.isExportEquals?d.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:d.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration;if(rj(n,a))return;const l=n.parent.kind===312?n.parent:n.parent.parent;if(l.kind===267&&!ru(l)){n.isExportEquals?je(n,d.An_export_assignment_cannot_be_used_in_a_namespace):je(n,d.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);return}!Rg(n)&&h5(n)&&Rl(n,d.An_export_assignment_cannot_have_modifiers);const _=Wl(n);_&&Uu(Bc(n.expression),si(_),n.expression);const m=!n.isExportEquals&&!(n.flags&33554432)&&J.verbatimModuleSyntax&&(B===1||Or(n).impliedNodeFormat===1);if(n.expression.kind===80){const h=n.expression,x=kp(lo(h,67108863,!0,!0,n));x?(BY(x,h),cu(x)&111551?(Bc(h),!m&&!(n.flags&33554432)&&J.verbatimModuleSyntax&&qf(x,111551)&&je(h,n.isExportEquals?d.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:d.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,an(h))):!m&&!(n.flags&33554432)&&J.verbatimModuleSyntax&&je(h,n.isExportEquals?d.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:d.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type,an(h))):Bc(h),Rf(J)&&L6(h,!0)}else Bc(n.expression);m&&je(n,d.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled),w7e(l),n.flags&33554432&&!oc(n.expression)&&Kt(n.expression,d.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context),n.isExportEquals&&(B>=5&&(n.flags&33554432&&Or(n).impliedNodeFormat===99||!(n.flags&33554432)&&Or(n).impliedNodeFormat!==1)?Kt(n,d.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead):B===4&&!(n.flags&33554432)&&Kt(n,d.Export_assignment_is_not_supported_when_module_flag_is_system))}function Ilt(n){return zl(n.exports,(a,l)=>l!=="export=")}function w7e(n){const a=cn(n),l=yi(a);if(!l.exportsChecked){const _=a.exports.get("export=");if(_&&Ilt(a)){const h=Sp(_)||_.valueDeclaration;h&&!Rx(h)&&!Hr(h)&&je(h,d.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements)}const m=wg(a);m&&m.forEach(({declarations:h,flags:x},N)=>{if(N==="__export"||x&1920)return;const F=Ch(h,w7(C2e,A7(Mu)));if(!(x&524288&&F<=2)&&F>1&&!bZ(h))for(const V of h)T2e(V)&&wa.add(mn(V,d.Cannot_redeclare_exported_variable_0,bi(N)))}),l.exportsChecked=!0}}function bZ(n){return n&&n.length>1&&n.every(a=>Hr(a)&&co(a)&&(fb(a.expression)||ag(a.expression)))}function oa(n){if(n){const a=D;D=n,T=0,Flt(n),D=a}}function Flt(n){a8(n)&&Zt(n.jsDoc,({comment:l,tags:_})=>{A7e(l),Zt(_,m=>{A7e(m.comment),Hr(n)&&oa(m)})});const a=n.kind;if(i)switch(a){case 267:case 263:case 264:case 262:i.throwIfCancellationRequested()}switch(a>=243&&a<=259&&s8(n)&&n.flowNode&&!xR(n.flowNode)&&Uf(J.allowUnreachableCode===!1,n,d.Unreachable_code_detected),a){case 168:return INe(n);case 169:return FNe(n);case 172:return MNe(n);case 171:return hot(n);case 185:case 184:case 179:case 180:case 181:return o7(n);case 174:case 173:return yot(n);case 175:return vot(n);case 176:return bot(n);case 177:case 178:return jNe(n);case 183:return xge(n);case 182:return pot(n);case 186:return Eot(n);case 187:return Dot(n);case 188:return Pot(n);case 189:return wot(n);case 192:case 193:return Aot(n);case 196:case 190:case 191:return oa(n.type);case 197:return Oot(n);case 198:return Lot(n);case 194:return Mot(n);case 195:return Rot(n);case 203:return jot(n);case 205:return Bot(n);case 202:return Jot(n);case 335:return sct(n);case 336:return ict(n);case 353:case 345:case 347:return Xot(n);case 352:return Qot(n);case 351:return Yot(n);case 331:case 332:case 333:return Kot(n);case 348:return ect(n);case 355:return tct(n);case 324:rct(n);case 322:case 321:case 319:case 320:case 329:N7e(n),ds(n,oa);return;case 325:Olt(n);return;case 316:return oa(n.type);case 340:case 342:case 341:return act(n);case 357:return Zot(n);case 350:return nct(n);case 199:return Not(n);case 200:return Iot(n);case 262:return $ot(n);case 241:case 268:return pZ(n);case 243:return kct(n);case 244:return Cct(n);case 245:return Ect(n);case 246:return wct(n);case 247:return Act(n);case 248:return Nct(n);case 249:return Fct(n);case 250:return Ict(n);case 251:case 252:return Jct(n);case 253:return zct(n);case 254:return Wct(n);case 255:return Uct(n);case 256:return Vct(n);case 257:return qct(n);case 258:return Hct(n);case 260:return Tct(n);case 208:return xct(n);case 263:return elt(n);case 264:return ult(n);case 265:return _lt(n);case 266:return dlt(n);case 267:return vlt(n);case 272:return Slt(n);case 271:return Tlt(n);case 278:return xlt(n);case 277:return Nlt(n);case 242:case 259:xh(n);return;case 282:return Tot(n)}}function A7e(n){es(n)&&Zt(n,a=>{iT(a)&&oa(a)})}function N7e(n){if(!Hr(n))if(qF(n)||gC(n)){const a=Hs(qF(n)?54:58),l=n.postfix?d._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:d._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1,_=n.type,m=si(_);Kt(n,l,a,mr(gC(n)&&!(m===Cn||m===Ni)?Mn(lr([m,j],n.postfix?void 0:De)):m))}else Kt(n,d.JSDoc_types_can_only_be_used_inside_documentation_comments)}function Olt(n){N7e(n),oa(n.type);const{parent:a}=n;if(us(a)&&hC(a.parent)){Sa(a.parent.parameters)!==a&&je(n,d.A_rest_parameter_must_be_last_in_a_parameter_list);return}Fb(a)||je(n,d.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);const l=n.parent.parent;if(!ad(l)){je(n,d.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);return}const _=o8(l);if(!_)return;const m=t1(l);(!m||Sa(m.parameters).symbol!==_)&&je(n,d.A_rest_parameter_must_be_last_in_a_parameter_list)}function Llt(n){const a=si(n.type),{parent:l}=n,_=n.parent.parent;if(Fb(n.parent)&&ad(_)){const m=t1(_),h=UW(_.parent.parent);if(m||h){const x=Mo(h?_.parent.parent.typeExpression.parameters:m.parameters),N=o8(_);if(!x||N&&x.symbol===N&&rg(x))return uu(a)}}return us(l)&&hC(l.parent)?uu(a):El(a)}function Yx(n){const a=Or(n),l=Wn(a);l.flags&1?E.assert(!l.deferredNodes,"A type-checked file should have no deferred nodes."):(l.deferredNodes||(l.deferredNodes=new Set),l.deferredNodes.add(n))}function Mlt(n){const a=Wn(n);a.deferredNodes&&a.deferredNodes.forEach(Rlt),a.deferredNodes=void 0}function Rlt(n){var a,l;(a=Jr)==null||a.push(Jr.Phase.Check,"checkDeferredNode",{kind:n.kind,pos:n.pos,end:n.end,path:n.tracingPath});const _=D;switch(D=n,T=0,n.kind){case 213:case 214:case 215:case 170:case 286:RS(n);break;case 218:case 219:case 174:case 173:Iat(n);break;case 177:case 178:jNe(n);break;case 231:Kct(n);break;case 168:fot(n);break;case 285:Wit(n);break;case 284:Vit(n);break;case 216:case 234:case 217:sat(n);break;case 222:Ui(n.expression);break;case 226:v5(n)&&RS(n);break}D=_,(l=Jr)==null||l.pop()}function jlt(n){var a,l;(a=Jr)==null||a.push(Jr.Phase.Check,"checkSourceFile",{path:n.path},!0),ko("beforeCheck"),Blt(n),ko("afterCheck"),cf("Check","beforeCheck","afterCheck"),(l=Jr)==null||l.pop()}function I7e(n,a){if(a)return!1;switch(n){case 0:return!!J.noUnusedLocals;case 1:return!!J.noUnusedParameters;default:return E.assertNever(n)}}function F7e(n){return i0.get(n.path)||ze}function Blt(n){const a=Wn(n);if(!(a.flags&1)){if(vE(n,J,e))return;__t(n),Ym(f2),Ym(p2),Ym(I1),Ym(s0),Ym(d2),Zt(n.statements,oa),oa(n.endOfFileToken),Mlt(n),H_(n)&&jy(n),r(()=>{!n.isDeclarationFile&&(J.noUnusedLocals||J.noUnusedParameters)&&QNe(F7e(n),(l,_,m)=>{!Ck(l)&&I7e(_,!!(l.flags&33554432))&&wa.add(m)}),n.isDeclarationFile||uct()}),J.importsNotUsedAsValues===2&&!n.isDeclarationFile&&Nc(n)&&wlt(n),H_(n)&&w7e(n),f2.length&&(Zt(f2,pct),Ym(f2)),p2.length&&(Zt(p2,dct),Ym(p2)),I1.length&&(Zt(I1,yct),Ym(I1)),s0.length&&(Zt(s0,bct),Ym(s0)),a.flags|=1}}function O7e(n,a){try{return i=a,Jlt(n)}finally{i=void 0}}function Jge(){for(const n of t)n();t=[]}function zge(n){Jge();const a=r;r=l=>l(),jlt(n),r=a}function Jlt(n){if(n){Jge();const a=wa.getGlobalDiagnostics(),l=a.length;zge(n);const _=wa.getDiagnostics(n.fileName),m=wa.getGlobalDiagnostics();if(m!==a){const h=BZ(a,m,mE);return Xi(h,_)}else if(l===0&&m.length>0)return Xi(m,_);return _}return Zt(e.getSourceFiles(),zge),wa.getDiagnostics()}function zlt(){return Jge(),wa.getGlobalDiagnostics()}function Wlt(n,a){if(n.flags&67108864)return[];const l=zs();let _=!1;return m(),l.delete("this"),Qpe(l);function m(){for(;n;){switch(hm(n)&&n.locals&&!qd(n)&&x(n.locals,a),n.kind){case 312:if(!Nc(n))break;case 267:N(cn(n).exports,a&2623475);break;case 266:x(cn(n).exports,a&8);break;case 231:n.name&&h(n.symbol,a);case 263:case 264:_||x(Cy(cn(n)),a&788968);break;case 218:n.name&&h(n.symbol,a);break}Hee(n)&&h(it,a),_=Ls(n),n=n.parent}x(me,a)}function h(F,V){if(fE(F)&V){const ne=F.escapedName;l.has(ne)||l.set(ne,F)}}function x(F,V){V&&F.forEach(ne=>{h(ne,V)})}function N(F,V){V&&F.forEach(ne=>{!Wo(ne,281)&&!Wo(ne,280)&&ne.escapedName!=="default"&&h(ne,V)})}}function Ult(n){return n.kind===80&&rC(n.parent)&&as(n.parent)===n}function L7e(n){for(;n.parent.kind===166;)n=n.parent;return n.parent.kind===183}function Vlt(n){for(;n.parent.kind===211;)n=n.parent;return n.parent.kind===233}function M7e(n,a){let l,_=wl(n);for(;_&&!(l=a(_));)_=wl(_);return l}function qlt(n){return!!Ar(n,a=>gc(a)&&ip(a.body)||Es(a)?!0:Qn(a)||po(a)?"quit":!1)}function Wge(n,a){return!!M7e(n,l=>l===a)}function Hlt(n){for(;n.parent.kind===166;)n=n.parent;if(n.parent.kind===271)return n.parent.moduleReference===n?n.parent:void 0;if(n.parent.kind===277)return n.parent.expression===n?n.parent:void 0}function SZ(n){return Hlt(n)!==void 0}function Glt(n){switch(ac(n.parent.parent)){case 1:case 3:return tf(n.parent);case 4:case 2:case 5:return cn(n.parent.parent)}}function $lt(n){let a=n.parent;for(;h_(a);)n=a,a=a.parent;if(a&&a.kind===205&&a.qualifier===n)return a}function Xlt(n){if(n.expression.kind===110){const a=i_(n,!1,!1);if(ks(a)){const l=Xwe(a);if(l){const _=_v(l,void 0),m=Ywe(l,_);return m&&!Ae(m)}}}}function R7e(n){if($g(n))return tf(n.parent);if(Hr(n)&&n.parent.kind===211&&n.parent===n.parent.parent.left&&!Ti(n)&&!d1(n)&&!Xlt(n.parent)){const a=Glt(n);if(a)return a}if(n.parent.kind===277&&oc(n)){const a=lo(n,2998271,!0);if(a&&a!==dt)return a}else if(V_(n)&&SZ(n)){const a=r1(n,271);return E.assert(a!==void 0),dS(n,!0)}if(V_(n)){const a=$lt(n);if(a){si(a);const l=Wn(n).resolvedSymbol;return l===dt?void 0:l}}for(;Fte(n);)n=n.parent;if(Vlt(n)){let a=0;n.parent.kind===233?(a=ig(n)?788968:111551,T8(n.parent)&&(a|=111551)):a=1920,a|=2097152;const l=oc(n)?lo(n,a,!0):void 0;if(l)return l}if(n.parent.kind===348)return o8(n.parent);if(n.parent.kind===168&&n.parent.parent.kind===352){E.assert(!Hr(n));const a=ste(n.parent);return a&&a.symbol}if(sg(n)){if(sc(n))return;const a=Ar(n,ed(iT,VE,d1)),l=a?901119:111551;if(n.kind===80){if(Fk(n)&&Qx(n)){const m=HY(n.parent);return m===dt?void 0:m}const _=lo(n,l,!0,!0,t1(n));if(!_&&a){const m=Ar(n,ed(Qn,Mu));if(m)return nj(n,!0,cn(m))}if(_&&a){const m=lT(n);if(m&&$v(m)&&m===_.valueDeclaration)return lo(n,l,!0,!0,Or(m))||_}return _}else{if(Ti(n))return XY(n);if(n.kind===211||n.kind===166){const _=Wn(n);return _.resolvedSymbol?_.resolvedSymbol:(n.kind===211?(GY(n,0),_.resolvedSymbol||(_.resolvedSymbol=j7e(Bc(n.expression),S0(n.name)))):kAe(n,0),!_.resolvedSymbol&&a&&h_(n)?nj(n):_.resolvedSymbol)}else if(d1(n))return nj(n)}}else if(L7e(n)){const a=n.parent.kind===183?788968:1920,l=lo(n,a,!1,!0);return l&&l!==dt?l:GQ(n)}if(n.parent.kind===182)return lo(n,1)}function j7e(n,a){const l=Xpe(n,a);if(l.length&&n.members){const _=VQ(gd(n).members);if(l===zu(n))return _;if(_){const m=yi(_),h=Ii(l,N=>N.declaration),x=Yt(h,Oa).join(",");if(m.filteredIndexSymbolCache||(m.filteredIndexSymbolCache=new Map),m.filteredIndexSymbolCache.has(x))return m.filteredIndexSymbolCache.get(x);{const N=Aa(131072,"__index");return N.declarations=Ii(l,F=>F.declaration),N.parent=n.aliasSymbol?n.aliasSymbol:n.symbol?n.symbol:Yp(N.declarations[0].parent),m.filteredIndexSymbolCache.set(x,N),N}}}}function nj(n,a,l){if(V_(n)){let x=lo(n,901119,a,!0,t1(n));if(!x&&Ie(n)&&l&&(x=Na(S_(j_(l),n.escapedText,901119))),x)return x}const _=Ie(n)?l:nj(n.left,a,l),m=Ie(n)?n.escapedText:n.right.escapedText;if(_){const h=_.flags&111551&&Gs(Br(_),"prototype"),x=h?Br(h):bo(_);return Gs(x,m)}}function Yp(n,a){if(Ai(n))return Nc(n)?Na(n.symbol):void 0;const{parent:l}=n,_=l.parent;if(!(n.flags&67108864)){if(x2e(n)){const m=cn(l);return rT(n.parent)&&n.parent.propertyName===n?Ime(m):m}else if(l8(n))return cn(l.parent);if(n.kind===80){if(SZ(n))return R7e(n);if(l.kind===208&&_.kind===206&&n===l.propertyName){const m=Zx(_),h=Gs(m,n.escapedText);if(h)return h}else if(BE(l)&&l.name===n)return l.keywordToken===105&&an(n)==="target"?sge(l).symbol:l.keywordToken===102&&an(n)==="meta"?qPe().members.get("meta"):void 0}switch(n.kind){case 80:case 81:case 211:case 166:if(!pT(n))return R7e(n);case 110:const m=i_(n,!1,!1);if(ks(m)){const N=Dp(m);if(N.thisParameter)return N.thisParameter}if($I(n))return Ui(n).symbol;case 197:return nY(n).symbol;case 108:return Ui(n).symbol;case 137:const h=n.parent;return h&&h.kind===176?h.parent.symbol:void 0;case 11:case 15:if(Ky(n.parent.parent)&&q4(n.parent.parent)===n||(n.parent.kind===272||n.parent.kind===278)&&n.parent.moduleSpecifier===n||Hr(n)&&Vl(J)!==100&&g_(n.parent,!1)||G_(n.parent)||_1(n.parent)&&U0(n.parent.parent)&&n.parent.parent.argument===n.parent)return Zu(n,n,a);if(Rs(l)&&pb(l)&&l.arguments[1]===n)return cn(l);case 9:const x=mo(l)?l.argumentExpression===n?Zl(l.expression):void 0:_1(l)&&OT(_)?si(_.objectType):void 0;return x&&Gs(x,zo(n.text));case 90:case 100:case 39:case 86:return tf(n.parent);case 205:return U0(n)?Yp(n.argument.literal,a):void 0;case 95:return cc(n.parent)?E.checkDefined(n.parent.symbol):void 0;case 102:case 105:return BE(n.parent)?aNe(n.parent).symbol:void 0;case 104:if(Gr(n.parent)){const N=Zl(n.parent.right),F=dge(N);return F?.symbol??N.symbol}return;case 236:return Ui(n).symbol;case 295:if(Fk(n)&&Qx(n)){const N=HY(n.parent);return N===dt?void 0:N}default:return}}}function Qlt(n){if(Ie(n)&&bn(n.parent)&&n.parent.name===n){const a=S0(n),l=Zl(n.parent.expression),_=l.flags&1048576?l.types:[l];return ta(_,m=>wn(zu(m),h=>U6(a,h.keyType)))}}function Ylt(n){if(n&&n.kind===304)return lo(n.name,2208703)}function Zlt(n){return vu(n)?n.parent.parent.moduleSpecifier?J1(n.parent.parent,n):lo(n.propertyName||n.name,2998271):lo(n,2998271)}function Zx(n){if(Ai(n)&&!Nc(n)||n.flags&67108864)return st;const a=Cz(n),l=a&&Qf(cn(a.class));if(ig(n)){const _=si(n);return l?rf(_,l.thisType):_}if(sg(n))return B7e(n);if(l&&!a.isImplements){const _=bl(Qc(l));return _?rf(_,l.thisType):st}if(rC(n)){const _=cn(n);return bo(_)}if(Ult(n)){const _=Yp(n);return _?bo(_):st}if(Pa(n))return _h(n,!0,0)||st;if(hu(n)){const _=cn(n);return _?Br(_):st}if(x2e(n)){const _=Yp(n);return _?Br(_):st}if(As(n))return _h(n.parent,!0,0)||st;if(SZ(n)){const _=Yp(n);if(_){const m=bo(_);return et(m)?Br(_):m}}return BE(n.parent)&&n.parent.keywordToken===n.kind?aNe(n.parent):st}function TZ(n){if(E.assert(n.kind===210||n.kind===209),n.parent.kind===250){const m=KR(n.parent);return JS(n,m||st)}if(n.parent.kind===226){const m=Zl(n.parent.right);return JS(n,m||st)}if(n.parent.kind===303){const m=Ms(n.parent.parent,ma),h=TZ(m)||st,x=Ek(m.properties,n.parent);return TNe(m,h,x)}const a=Ms(n.parent,Lu),l=TZ(a)||st,_=E0(65,l,j,n.parent)||st;return xNe(a,l,a.elements.indexOf(n),_)}function Klt(n){const a=TZ(Ms(n.parent.parent,L4));return a&&Gs(a,n.escapedText)}function B7e(n){return cE(n)&&(n=n.parent),t_(Zl(n))}function J7e(n){const a=tf(n.parent);return Ls(n)?Br(a):bo(a)}function z7e(n){const a=n.name;switch(a.kind){case 80:return p_(an(a));case 9:case 11:return p_(a.text);case 167:const l=Lg(a);return Ml(l,12288)?l:Fe;default:return E.fail("Unsupported property name.")}}function Uge(n){n=e_(n);const a=zs(Wa(n)),l=Ts(n,0).length?Fr:Ts(n,1).length?Wi:void 0;return l&&Zt(Wa(l),_=>{a.has(_.escapedName)||a.set(_.escapedName,_)}),w2(a)}function xZ(n){return Ts(n,0).length!==0||Ts(n,1).length!==0}function W7e(n){const a=eut(n);return a?ta(a,W7e):[n]}function eut(n){if(Ko(n)&6)return Ii(yi(n).containingType.types,a=>Gs(a,n.escapedName));if(n.flags&33554432){const{links:{leftSpread:a,rightSpread:l,syntheticOrigin:_}}=n;return a?[a,l]:_?[_]:Q2(tut(n))}}function tut(n){let a,l=n;for(;l=yi(l).target;)a=l;return a}function rut(n){if(Eo(n))return!1;const a=ss(n,Ie);if(!a)return!1;const l=a.parent;return l?!((bn(l)||Hc(l))&&l.name===a)&&h7(a)===it:!1}function nut(n){let a=Zu(n.parent,n);if(!a||B4(a))return!0;const l=C2(a);a=ef(a);const _=yi(a);return _.exportsSomeValue===void 0&&(_.exportsSomeValue=l?!!(a.flags&111551):zl(wg(a),m)),_.exportsSomeValue;function m(h){return h=Cc(h),h&&!!(cu(h)&111551)}}function iut(n){return PP(n.parent)&&n===n.parent.name}function sut(n,a){var l;const _=ss(n,Ie);if(_){let m=h7(_,iut(_));if(m){if(m.flags&1048576){const x=Na(m.exportSymbol);if(!a&&x.flags&944&&!(x.flags&3))return;m=x}const h=f_(m);if(h){if(h.flags&512&&((l=h.valueDeclaration)==null?void 0:l.kind)===312){const x=h.valueDeclaration,N=Or(_);return x!==N?void 0:x}return Ar(_.parent,x=>PP(x)&&cn(x)===h)}}}}function aut(n){const a=Vre(n);if(a)return a;const l=ss(n,Ie);if(l){const _=vut(l);if(W1(_,111551)&&!qf(_,111551))return Sp(_)}}function out(n){return n.valueDeclaration&&Pa(n.valueDeclaration)&&dk(n.valueDeclaration).parent.kind===299}function U7e(n){if(n.flags&418&&n.valueDeclaration&&!Ai(n.valueDeclaration)){const a=yi(n);if(a.isDeclarationWithCollidingName===void 0){const l=bm(n.valueDeclaration);if(Cee(l)||out(n)){const _=Wn(n.valueDeclaration);if(_c(l.parent,n.escapedName,111551,void 0,void 0,!1))a.isDeclarationWithCollidingName=!0;else if(_.flags&16384){const m=_.flags&32768,h=j0(l,!1),x=l.kind===241&&j0(l.parent,!1);a.isDeclarationWithCollidingName=!Iee(l)&&(!m||!h&&!x)}else a.isDeclarationWithCollidingName=!1}}return a.isDeclarationWithCollidingName}return!1}function cut(n){if(!Eo(n)){const a=ss(n,Ie);if(a){const l=h7(a);if(l&&U7e(l))return l.valueDeclaration}}}function lut(n){const a=ss(n,hu);if(a){const l=cn(a);if(l)return U7e(l)}return!1}function V7e(n){switch(E.assert(ot),n.kind){case 271:return kZ(cn(n));case 273:case 274:case 276:case 281:const a=cn(n);return!!a&&kZ(a,!0);case 278:const l=n.exportClause;return!!l&&(Dm(l)||ut(l.elements,V7e));case 277:return n.expression&&n.expression.kind===80?kZ(cn(n)):!0}return!1}function uut(n){const a=ss(n,Hl);return a===void 0||a.parent.kind!==312||!Ok(a)?!1:kZ(cn(a))&&a.moduleReference&&!sc(a.moduleReference)}function kZ(n,a){if(!n)return!1;const l=kp(ul(n));return l===dt?!a||!qf(n):!!(cu(n,a,!0)&111551)&&(Sb(J)||!m7(l))}function m7(n){return pge(n)||!!n.constEnumOnlyModule}function CZ(n,a){if(E.assert(ot),j1(n)){const l=cn(n),_=l&&yi(l);if(_?.referenced)return!0;const m=yi(l).aliasTarget;if(m&&Fu(n)&32&&cu(m)&111551&&(Sb(J)||!m7(m)))return!0}return a?!!ds(n,l=>CZ(l,a)):!1}function q7e(n){if(ip(n.body)){if(B0(n)||Lh(n))return!1;const a=cn(n),l=I2(a);return l.length>1||l.length===1&&l[0].declaration!==n}return!1}function H7e(n){return!!H&&!ON(n)&&!ad(n)&&!!n.initializer&&!In(n,31)}function _ut(n){return H&&ON(n)&&!n.initializer&&In(n,31)}function fut(n){const a=ss(n,Zc);if(!a)return!1;const l=cn(a);return!l||!(l.flags&16)?!1:!!zl(j_(l),_=>_.flags&111551&&$5(_.valueDeclaration))}function put(n){const a=ss(n,Zc);if(!a)return ze;const l=cn(a);return l&&Wa(Br(l))||ze}function s4(n){var a;const l=n.id||0;return l<0||l>=N1.length?0:((a=N1[l])==null?void 0:a.flags)||0}function g7(n){return C7e(n.parent),Wn(n).enumMemberValue}function G7e(n){switch(n.kind){case 306:case 211:case 212:return!0}return!1}function Vge(n){if(n.kind===306)return g7(n);const a=Wn(n).resolvedSymbol;if(a&&a.flags&8){const l=a.valueDeclaration;if(Cv(l.parent))return g7(l)}}function qge(n){return!!(n.flags&524288)&&Ts(n,0).length>0}function dut(n,a){var l;const _=ss(n,V_);if(!_||a&&(a=ss(a),!a))return 0;let m=!1;if(h_(_)){const V=lo($_(_),111551,!0,!0,a);m=!!((l=V?.declarations)!=null&&l.every(bv))}const h=lo(_,111551,!0,!0,a),x=h&&h.flags&2097152?ul(h):h;m||(m=!!(h&&qf(h,111551)));const N=lo(_,788968,!0,!1,a);if(x&&x===N){const V=ade(!1);if(V&&x===V)return 9;const ne=Br(x);if(ne&&fi(ne))return m?10:1}if(!N)return m?11:0;const F=bo(N);return et(F)?m?11:0:F.flags&3?11:Ml(F,245760)?2:Ml(F,528)?6:Ml(F,296)?3:Ml(F,2112)?4:Ml(F,402653316)?5:pa(F)?7:Ml(F,12288)?8:qge(F)?10:ep(F)?7:11}function mut(n,a,l,_,m){const h=ss(n,Uee);if(!h)return I.createToken(133);const x=cn(h);let N=x&&!(x.flags&133120)?B2(Br(x)):st;return N.flags&8192&&N.symbol===x&&(l|=1048576),m&&(N=Ly(N)),pt.typeToTypeNode(N,a,l|1024,_)}function gut(n,a,l,_){const m=ss(n,ks);if(!m)return I.createToken(133);const h=Dp(m);return pt.typeToTypeNode(Ma(h),a,l|1024,_)}function hut(n,a,l,_){const m=ss(n,ct);if(!m)return I.createToken(133);const h=nf(B7e(m));return pt.typeToTypeNode(h,a,l|1024,_)}function yut(n){return me.has(zo(n))}function h7(n,a){const l=Wn(n).resolvedSymbol;if(l)return l;let _=n;if(a){const m=n.parent;hu(m)&&n===m.name&&(_=vS(m))}return _c(_,n.escapedText,3257279,void 0,void 0,!0)}function vut(n){const a=Wn(n).resolvedSymbol;return a&&a!==dt?a:_c(n,n.escapedText,3257279,void 0,void 0,!0,void 0,void 0)}function but(n){if(!Eo(n)){const a=ss(n,Ie);if(a){const l=h7(a);if(l)return kp(l).valueDeclaration}}}function Sut(n){if(!Eo(n)){const a=ss(n,Ie);if(a){const l=h7(a);if(l)return wn(kp(l).declarations,_=>{switch(_.kind){case 260:case 169:case 208:case 172:case 303:case 304:case 306:case 210:case 262:case 218:case 219:case 263:case 231:case 266:case 174:case 177:case 178:case 267:return!0}return!1})}}}function Tut(n){return LI(n)||Ei(n)&&AZ(n)?M2(Br(cn(n))):!1}function xut(n,a,l){const _=n.flags&1056?pt.symbolToExpression(n.symbol,111551,a,void 0,l):n===Zr?I.createTrue():n===Wt&&I.createFalse();if(_)return _;const m=n.value;return typeof m=="object"?I.createBigIntLiteral(m):typeof m=="number"?I.createNumericLiteral(m):I.createStringLiteral(m)}function kut(n,a){const l=Br(cn(n));return xut(l,n,a)}function $7e(n){return n?(O1(n),Or(n).localJsxFactory||a0):a0}function Hge(n){if(n){const a=Or(n);if(a){if(a.localJsxFragmentFactory)return a.localJsxFragmentFactory;const l=a.pragmas.get("jsxfrag"),_=es(l)?l[0]:l;if(_)return a.localJsxFragmentFactory=WT(_.arguments.factory,ie),a.localJsxFragmentFactory}}if(J.jsxFragmentFactory)return WT(J.jsxFragmentFactory,ie)}function Cut(){const n=e.getResolvedTypeReferenceDirectives();let a;return n&&(a=new Map,n.forEach(({resolvedTypeReferenceDirective:F},V,ne)=>{if(!F?.resolvedFileName)return;const le=e.getSourceFile(F.resolvedFileName);le&&N(le,V,ne)})),{getReferencedExportContainer:sut,getReferencedImportDeclaration:aut,getReferencedDeclarationWithCollidingName:cut,isDeclarationWithCollidingName:lut,isValueAliasDeclaration:F=>{const V=ss(F);return V&&ot?V7e(V):!0},hasGlobalName:yut,isReferencedAliasDeclaration:(F,V)=>{const ne=ss(F);return ne&&ot?CZ(ne,V):!0},getNodeCheckFlags:F=>{const V=ss(F);return V?s4(V):0},isTopLevelValueImportEqualsWithEntityName:uut,isDeclarationVisible:uh,isImplementationOfOverload:q7e,isRequiredInitializedParameter:H7e,isOptionalUninitializedParameterProperty:_ut,isExpandoFunctionDeclaration:fut,getPropertiesOfContainerFunction:put,createTypeOfDeclaration:mut,createReturnTypeOfSignatureDeclaration:gut,createTypeOfExpression:hut,createLiteralConstValue:kut,isSymbolAccessible:pn,isEntityNameVisible:B_,getConstantValue:F=>{const V=ss(F,G7e);return V?Vge(V):void 0},collectLinkedAliases:L6,getReferencedValueDeclaration:but,getReferencedValueDeclarations:Sut,getTypeReferenceSerializationKind:dut,isOptionalParameter:ON,moduleExportsSomeValue:nut,isArgumentsLocalBinding:rut,getExternalModuleFileFromDeclaration:F=>{const V=ss(F,Oee);return V&&Gge(V)},getTypeReferenceDirectivesForEntityName:m,getTypeReferenceDirectivesForSymbol:h,isLiteralConstDeclaration:Tut,isLateBound:F=>{const V=ss(F,hu),ne=V&&cn(V);return!!(ne&&Ko(ne)&4096)},getJsxFactoryEntity:$7e,getJsxFragmentFactoryEntity:Hge,getAllAccessorDeclarations(F){F=ss(F,uI);const V=F.kind===178?177:178,ne=Wo(cn(F),V),le=ne&&ne.posPg(F,F,void 0),isBindingCapturedByNode:(F,V)=>{const ne=ss(F),le=ss(V);return!!ne&&!!le&&(Ei(le)||Pa(le))&&Znt(ne,le)},getDeclarationStatementsForSourceFile:(F,V,ne,le)=>{const xe=ss(F);E.assert(xe&&xe.kind===312,"Non-sourcefile node passed into getDeclarationsForSourceFile");const Ne=cn(F);return Ne?Ne.exports?pt.symbolTableToDeclarationStatements(Ne.exports,F,V,ne,le):[]:F.locals?pt.symbolTableToDeclarationStatements(F.locals,F,V,ne,le):[]},isImportRequiredByAugmentation:l,tryFindAmbientModule:F=>{const V=ss(F),ne=V&&Ja(V)?V.text:void 0;return ne!==void 0?zQ(ne,!0):void 0}};function l(F){const V=Or(F);if(!V.symbol)return!1;const ne=Gge(F);if(!ne||ne===V)return!1;const le=wg(V.symbol);for(const xe of fs(le.values()))if(xe.mergeId){const Ne=Na(xe);if(Ne.declarations){for(const nt of Ne.declarations)if(Or(nt)===ne)return!0}}return!1}function _(F){return F.parent&&F.parent.kind===233&&F.parent.parent&&F.parent.parent.kind===298}function m(F){if(!a)return;let V;F.parent.kind===167?V=1160127:(V=790504,(F.kind===80&&yb(F)||F.kind===211&&!_(F))&&(V=1160127));const ne=lo(F,V,!0);return ne&&ne!==dt?h(ne,V):void 0}function h(F,V){if(!a||!x(F))return;let ne;for(const le of F.declarations)if(le.symbol&&le.symbol.flags&V){const xe=Or(le),Ne=a.get(xe.path);if(Ne)(ne||(ne=[])).push(Ne);else return}return ne}function x(F){if(!F.declarations)return!1;let V=F;for(;;){const ne=f_(V);if(ne)V=ne;else break}if(V.valueDeclaration&&V.valueDeclaration.kind===312&&V.flags&512)return!1;for(const ne of F.declarations){const le=Or(ne);if(a.has(le.path))return!0}return!1}function N(F,V,ne){if(!a.has(F.path)){a.set(F.path,[V,ne]);for(const{fileName:le}of F.referencedFiles){const xe=e9(le,F.fileName),Ne=e.getSourceFile(xe);Ne&&N(Ne,V,ne||F.impliedNodeFormat)}}}}function Gge(n){const a=n.kind===267?Jn(n.name,ra):Rk(n),l=Pg(a,a,void 0);if(l)return Wo(l,312)}function Eut(){for(const a of e.getSourceFiles())Eie(a,J);Xa=new Map;let n;for(const a of e.getSourceFiles())if(!a.redirectInfo){if(!H_(a)){const l=a.locals.get("globalThis");if(l?.declarations)for(const _ of l.declarations)wa.add(mn(_,d.Declaration_name_conflicts_with_built_in_global_identifier_0,"globalThis"));Vd(me,a.locals)}a.jsGlobalAugmentations&&Vd(me,a.jsGlobalAugmentations),a.patternAmbientModules&&a.patternAmbientModules.length&&(Bf=Xi(Bf,a.patternAmbientModules)),a.moduleAugmentations.length&&(n||(n=[])).push(a.moduleAugmentations),a.symbol&&a.symbol.globalExports&&a.symbol.globalExports.forEach((_,m)=>{me.has(m)||me.set(m,_)})}if(n)for(const a of n)for(const l of a)Dd(l.parent)&&uS(l);if(T6(me,b6,d.Declaration_name_conflicts_with_built_in_global_identifier_0),yi(Oe).type=ce,yi(it).type=Rc("IArguments",0,!0),yi(dt).type=st,yi(Xe).type=Hf(16,Xe),Ps=Rc("Array",1,!0),ye=Rc("Object",0,!0),St=Rc("Function",0,!0),Fr=oe&&Rc("CallableFunction",0,!0)||St,Wi=oe&&Rc("NewableFunction",0,!0)||St,uc=Rc("String",0,!0),hc=Rc("Number",0,!0),jo=Rc("Boolean",0,!0),qo=Rc("RegExp",0,!0),nc=uu(G),Oc=uu(ht),Oc===Us&&(Oc=Qo(void 0,W,ze,ze,ze)),Fs=YPe("ReadonlyArray",1)||Ps,yp=Fs?RN(Fs,[G]):nc,kc=YPe("ThisType",1),n)for(const a of n)for(const l of a)Dd(l.parent)||uS(l);Xa.forEach(({firstFile:a,secondFile:l,conflictingSymbols:_})=>{if(_.size<8)_.forEach(({isBlockScoped:m,firstFileLocations:h,secondFileLocations:x},N)=>{const F=m?d.Cannot_redeclare_block_scoped_variable_0:d.Duplicate_identifier_0;for(const V of h)kg(V,F,N,x);for(const V of x)kg(V,F,N,h)});else{const m=fs(_.keys()).join(", ");wa.add(ua(mn(a,d.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,m),mn(l,d.Conflicts_are_in_this_file))),wa.add(ua(mn(l,d.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,m),mn(a,d.Conflicts_are_in_this_file)))}}),Xa=void 0}function nl(n,a){if((o&a)!==a&&J.importHelpers){const l=Or(n);if(sT(l,J)&&!(n.flags&33554432)){const _=Put(l,n);if(_!==dt){const m=a&~o;for(let h=1;h<=33554432;h<<=1)if(m&h)for(const x of Dut(h)){if(s.has(x))continue;s.add(x);const N=Cc(S_(wg(_),zo(x),111551));N?h&524288?ut(I2(N),F=>sf(F)>3)||je(n,d.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,X0,x,4):h&1048576?ut(I2(N),F=>sf(F)>4)||je(n,d.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,X0,x,5):h&1024&&(ut(I2(N),F=>sf(F)>2)||je(n,d.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,X0,x,3)):je(n,d.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,X0,x)}}o|=a}}}function Dut(n){switch(n){case 1:return["__extends"];case 2:return["__assign"];case 4:return["__rest"];case 8:return Y?["__decorate"]:["__esDecorate","__runInitializers"];case 16:return["__metadata"];case 32:return["__param"];case 64:return["__awaiter"];case 128:return["__generator"];case 256:return["__values"];case 512:return["__read"];case 1024:return["__spreadArray"];case 2048:return["__await"];case 4096:return["__asyncGenerator"];case 8192:return["__asyncDelegator"];case 16384:return["__asyncValues"];case 32768:return["__exportStar"];case 65536:return["__importStar"];case 131072:return["__importDefault"];case 262144:return["__makeTemplateObject"];case 524288:return["__classPrivateFieldGet"];case 1048576:return["__classPrivateFieldSet"];case 2097152:return["__classPrivateFieldIn"];case 4194304:return["__createBinding"];case 8388608:return["__setFunctionName"];case 16777216:return["__propKey"];case 33554432:return["__addDisposableResource","__disposeResources"];default:return E.fail("Unrecognized helper")}}function Put(n,a){return c||(c=lh(n,X0,d.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,a)||dt),c}function Rg(n){const a=Nut(n)||wut(n);if(a!==void 0)return a;if(us(n)&&Ov(n))return Rl(n,d.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters);const l=ec(n)?n.declarationList.flags&7:0;let _,m,h,x,N,F=0,V=!1,ne=!1;for(const le of n.modifiers)if(ql(le)){if(GI(Y,n,n.parent,n.parent.parent)){if(Y&&(n.kind===177||n.kind===178)){const xe=vb(n.parent.members,n);if(Of(xe.firstAccessor)&&n===xe.secondAccessor)return Rl(n,d.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}}else return n.kind===174&&!ip(n.body)?Rl(n,d.A_decorator_can_only_decorate_a_method_implementation_not_an_overload):Rl(n,d.Decorators_are_not_valid_here);if(F&-34849)return Kt(le,d.Decorators_are_not_valid_here);if(ne&&F&98303){E.assertIsDefined(N);const xe=Or(le);return q2(xe)?!1:(ua(je(le,d.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),mn(N,d.Decorator_used_before_export_here)),!0)}F|=32768,F&98303?F&32&&(V=!0):ne=!0,N??(N=le)}else{if(le.kind!==148){if(n.kind===171||n.kind===173)return Kt(le,d._0_modifier_cannot_appear_on_a_type_member,Hs(le.kind));if(n.kind===181&&(le.kind!==126||!Qn(n.parent)))return Kt(le,d._0_modifier_cannot_appear_on_an_index_signature,Hs(le.kind))}if(le.kind!==103&&le.kind!==147&&le.kind!==87&&n.kind===168)return Kt(le,d._0_modifier_cannot_appear_on_a_type_parameter,Hs(le.kind));switch(le.kind){case 87:if(n.kind!==266&&n.kind!==168)return Kt(n,d.A_class_member_cannot_have_the_0_keyword,Hs(87));const xe=n.parent;if(n.kind===168&&!(po(xe)||Qn(xe)||pg(xe)||ME(xe)||cC(xe)||rw(xe)||fg(xe)))return Kt(le,d._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class,Hs(le.kind));break;case 164:if(F&16)return Kt(le,d._0_modifier_already_seen,"override");if(F&128)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"override","declare");if(F&8)return Kt(le,d._0_modifier_must_precede_1_modifier,"override","readonly");if(F&512)return Kt(le,d._0_modifier_must_precede_1_modifier,"override","accessor");if(F&1024)return Kt(le,d._0_modifier_must_precede_1_modifier,"override","async");F|=16,x=le;break;case 125:case 124:case 123:const Ne=Ng(mT(le.kind));if(F&7)return Kt(le,d.Accessibility_modifier_already_seen);if(F&16)return Kt(le,d._0_modifier_must_precede_1_modifier,Ne,"override");if(F&256)return Kt(le,d._0_modifier_must_precede_1_modifier,Ne,"static");if(F&512)return Kt(le,d._0_modifier_must_precede_1_modifier,Ne,"accessor");if(F&8)return Kt(le,d._0_modifier_must_precede_1_modifier,Ne,"readonly");if(F&1024)return Kt(le,d._0_modifier_must_precede_1_modifier,Ne,"async");if(n.parent.kind===268||n.parent.kind===312)return Kt(le,d._0_modifier_cannot_appear_on_a_module_or_namespace_element,Ne);if(F&64)return le.kind===123?Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,Ne,"abstract"):Kt(le,d._0_modifier_must_precede_1_modifier,Ne,"abstract");if(Nu(n))return Kt(le,d.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);F|=mT(le.kind);break;case 126:if(F&256)return Kt(le,d._0_modifier_already_seen,"static");if(F&8)return Kt(le,d._0_modifier_must_precede_1_modifier,"static","readonly");if(F&1024)return Kt(le,d._0_modifier_must_precede_1_modifier,"static","async");if(F&512)return Kt(le,d._0_modifier_must_precede_1_modifier,"static","accessor");if(n.parent.kind===268||n.parent.kind===312)return Kt(le,d._0_modifier_cannot_appear_on_a_module_or_namespace_element,"static");if(n.kind===169)return Kt(le,d._0_modifier_cannot_appear_on_a_parameter,"static");if(F&64)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(F&16)return Kt(le,d._0_modifier_must_precede_1_modifier,"static","override");F|=256,_=le;break;case 129:if(F&512)return Kt(le,d._0_modifier_already_seen,"accessor");if(F&8)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"accessor","readonly");if(F&128)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"accessor","declare");if(n.kind!==172)return Kt(le,d.accessor_modifier_can_only_appear_on_a_property_declaration);F|=512;break;case 148:if(F&8)return Kt(le,d._0_modifier_already_seen,"readonly");if(n.kind!==172&&n.kind!==171&&n.kind!==181&&n.kind!==169)return Kt(le,d.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);if(F&512)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"readonly","accessor");F|=8;break;case 95:if(J.verbatimModuleSyntax&&!(n.flags&33554432)&&n.kind!==265&&n.kind!==264&&n.kind!==267&&n.parent.kind===312&&(B===1||Or(n).impliedNodeFormat===1))return Kt(le,d.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);if(F&32)return Kt(le,d._0_modifier_already_seen,"export");if(F&128)return Kt(le,d._0_modifier_must_precede_1_modifier,"export","declare");if(F&64)return Kt(le,d._0_modifier_must_precede_1_modifier,"export","abstract");if(F&1024)return Kt(le,d._0_modifier_must_precede_1_modifier,"export","async");if(Qn(n.parent))return Kt(le,d._0_modifier_cannot_appear_on_class_elements_of_this_kind,"export");if(n.kind===169)return Kt(le,d._0_modifier_cannot_appear_on_a_parameter,"export");if(l===4)return Kt(le,d._0_modifier_cannot_appear_on_a_using_declaration,"export");if(l===6)return Kt(le,d._0_modifier_cannot_appear_on_an_await_using_declaration,"export");F|=32;break;case 90:const nt=n.parent.kind===312?n.parent:n.parent.parent;if(nt.kind===267&&!ru(nt))return Kt(le,d.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);if(l===4)return Kt(le,d._0_modifier_cannot_appear_on_a_using_declaration,"default");if(l===6)return Kt(le,d._0_modifier_cannot_appear_on_an_await_using_declaration,"default");if(F&32){if(V)return Kt(N,d.Decorators_are_not_valid_here)}else return Kt(le,d._0_modifier_must_precede_1_modifier,"export","default");F|=2048;break;case 138:if(F&128)return Kt(le,d._0_modifier_already_seen,"declare");if(F&1024)return Kt(le,d._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(F&16)return Kt(le,d._0_modifier_cannot_be_used_in_an_ambient_context,"override");if(Qn(n.parent)&&!Es(n))return Kt(le,d._0_modifier_cannot_appear_on_class_elements_of_this_kind,"declare");if(n.kind===169)return Kt(le,d._0_modifier_cannot_appear_on_a_parameter,"declare");if(l===4)return Kt(le,d._0_modifier_cannot_appear_on_a_using_declaration,"declare");if(l===6)return Kt(le,d._0_modifier_cannot_appear_on_an_await_using_declaration,"declare");if(n.parent.flags&33554432&&n.parent.kind===268)return Kt(le,d.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);if(Nu(n))return Kt(le,d._0_modifier_cannot_be_used_with_a_private_identifier,"declare");if(F&512)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"declare","accessor");F|=128,m=le;break;case 128:if(F&64)return Kt(le,d._0_modifier_already_seen,"abstract");if(n.kind!==263&&n.kind!==185){if(n.kind!==174&&n.kind!==172&&n.kind!==177&&n.kind!==178)return Kt(le,d.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);if(!(n.parent.kind===263&&In(n.parent,64))){const _r=n.kind===172?d.Abstract_properties_can_only_appear_within_an_abstract_class:d.Abstract_methods_can_only_appear_within_an_abstract_class;return Kt(le,_r)}if(F&256)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(F&2)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"private","abstract");if(F&1024&&h)return Kt(h,d._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");if(F&16)return Kt(le,d._0_modifier_must_precede_1_modifier,"abstract","override");if(F&512)return Kt(le,d._0_modifier_must_precede_1_modifier,"abstract","accessor")}if(Au(n)&&n.name.kind===81)return Kt(le,d._0_modifier_cannot_be_used_with_a_private_identifier,"abstract");F|=64;break;case 134:if(F&1024)return Kt(le,d._0_modifier_already_seen,"async");if(F&128||n.parent.flags&33554432)return Kt(le,d._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(n.kind===169)return Kt(le,d._0_modifier_cannot_appear_on_a_parameter,"async");if(F&64)return Kt(le,d._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");F|=1024,h=le;break;case 103:case 147:const kt=le.kind===103?8192:16384,Xt=le.kind===103?"in":"out";if(n.kind!==168||!(Mu(n.parent)||Qn(n.parent)||Jp(n.parent)))return Kt(le,d._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias,Xt);if(F&kt)return Kt(le,d._0_modifier_already_seen,Xt);if(kt&8192&&F&16384)return Kt(le,d._0_modifier_must_precede_1_modifier,"in","out");F|=kt;break}}return n.kind===176?F&256?Kt(_,d._0_modifier_cannot_appear_on_a_constructor_declaration,"static"):F&16?Kt(x,d._0_modifier_cannot_appear_on_a_constructor_declaration,"override"):F&1024?Kt(h,d._0_modifier_cannot_appear_on_a_constructor_declaration,"async"):!1:(n.kind===272||n.kind===271)&&F&128?Kt(m,d.A_0_modifier_cannot_be_used_with_an_import_declaration,"declare"):n.kind===169&&F&31&&As(n.name)?Kt(n,d.A_parameter_property_may_not_be_declared_using_a_binding_pattern):n.kind===169&&F&31&&n.dotDotDotToken?Kt(n,d.A_parameter_property_cannot_be_declared_using_a_rest_parameter):F&1024?Fut(n,h):!1}function wut(n){if(!n.modifiers)return!1;const a=Aut(n);return a&&Rl(a,d.Modifiers_cannot_appear_here)}function EZ(n,a){const l=kn(n.modifiers,Ys);return l&&l.kind!==a?l:void 0}function Aut(n){switch(n.kind){case 177:case 178:case 176:case 172:case 171:case 174:case 173:case 181:case 267:case 272:case 271:case 278:case 277:case 218:case 219:case 169:case 168:return;case 175:case 303:case 304:case 270:case 282:return kn(n.modifiers,Ys);default:if(n.parent.kind===268||n.parent.kind===312)return;switch(n.kind){case 262:return EZ(n,134);case 263:case 185:return EZ(n,128);case 231:case 264:case 265:return kn(n.modifiers,Ys);case 243:return n.declarationList.flags&4?EZ(n,135):kn(n.modifiers,Ys);case 266:return EZ(n,87);default:E.assertNever(n)}}}function Nut(n){const a=Iut(n);return a&&Rl(a,d.Decorators_are_not_valid_here)}function Iut(n){return iU(n)?kn(n.modifiers,ql):void 0}function Fut(n,a){switch(n.kind){case 174:case 262:case 218:case 219:return!1}return Kt(a,d._0_modifier_cannot_be_used_here,"async")}function Kx(n,a=d.Trailing_comma_not_allowed){return n&&n.hasTrailingComma?H2(n[0],n.end-1,1,a):!1}function X7e(n,a){if(n&&n.length===0){const l=n.pos-1,_=la(a.text,n.end)+1;return H2(a,l,_-l,d.Type_parameter_list_cannot_be_empty)}return!1}function Out(n){let a=!1;const l=n.length;for(let _=0;_!!a.initializer||As(a.name)||rg(a))}function Mut(n){if(ie>=3){const a=n.body&&Ss(n.body)&&eU(n.body.statements);if(a){const l=Lut(n.parameters);if(Ir(l)){Zt(l,m=>{ua(je(m,d.This_parameter_is_not_allowed_with_use_strict_directive),mn(a,d.use_strict_directive_used_here))});const _=l.map((m,h)=>h===0?mn(m,d.Non_simple_parameter_declared_here):mn(m,d.and_here));return ua(je(a,d.use_strict_directive_cannot_be_used_with_non_simple_parameter_list),..._),!0}}}return!1}function DZ(n){const a=Or(n);return Rg(n)||X7e(n.typeParameters,a)||Out(n.parameters)||jut(n,a)||po(n)&&Mut(n)}function Rut(n){const a=Or(n);return Uut(n)||X7e(n.typeParameters,a)}function jut(n,a){if(!go(n))return!1;n.typeParameters&&!(Ir(n.typeParameters)>1||n.typeParameters.hasTrailingComma||n.typeParameters[0].constraint)&&a&&Jc(a.fileName,[".mts",".cts"])&&Kt(n.typeParameters[0],d.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);const{equalsGreaterThanToken:l}=n,_=qa(a,l.pos).line,m=qa(a,l.end).line;return _!==m&&Kt(l,d.Line_terminator_not_permitted_before_arrow)}function But(n){const a=n.parameters[0];if(n.parameters.length!==1)return Kt(a?a.name:n,d.An_index_signature_must_have_exactly_one_parameter);if(Kx(n.parameters,d.An_index_signature_cannot_have_a_trailing_comma),a.dotDotDotToken)return Kt(a.dotDotDotToken,d.An_index_signature_cannot_have_a_rest_parameter);if(h5(a))return Kt(a.name,d.An_index_signature_parameter_cannot_have_an_accessibility_modifier);if(a.questionToken)return Kt(a.questionToken,d.An_index_signature_parameter_cannot_have_a_question_mark);if(a.initializer)return Kt(a.name,d.An_index_signature_parameter_cannot_have_an_initializer);if(!a.type)return Kt(a.name,d.An_index_signature_parameter_must_have_a_type_annotation);const l=si(a.type);return em(l,_=>!!(_.flags&8576))||hD(l)?Kt(a.name,d.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead):Nf(l,qQ)?n.type?!1:Kt(n,d.An_index_signature_must_have_a_type_annotation):Kt(a.name,d.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type)}function Jut(n){return Rg(n)||But(n)}function zut(n,a){if(a&&a.length===0){const l=Or(n),_=a.pos-1,m=la(l.text,a.end)+1;return H2(l,_,m-_,d.Type_argument_list_cannot_be_empty)}return!1}function ij(n,a){return Kx(a)||zut(n,a)}function Wut(n){return n.questionDotToken||n.flags&64?Kt(n.template,d.Tagged_template_expressions_are_not_permitted_in_an_optional_chain):!1}function Q7e(n){const a=n.types;if(Kx(a))return!0;if(a&&a.length===0){const l=Hs(n.token);return H2(n,a.pos,0,d._0_list_cannot_be_empty,l)}return ut(a,Y7e)}function Y7e(n){return qh(n)&&LE(n.expression)&&n.typeArguments?Kt(n,d.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments):ij(n,n.typeArguments)}function Uut(n){let a=!1,l=!1;if(!Rg(n)&&n.heritageClauses)for(const _ of n.heritageClauses){if(_.token===96){if(a)return Rl(_,d.extends_clause_already_seen);if(l)return Rl(_,d.extends_clause_must_precede_implements_clause);if(_.types.length>1)return Rl(_.types[1],d.Classes_can_only_extend_a_single_class);a=!0}else{if(E.assert(_.token===119),l)return Rl(_,d.implements_clause_already_seen);l=!0}Q7e(_)}}function Vut(n){let a=!1;if(n.heritageClauses)for(const l of n.heritageClauses){if(l.token===96){if(a)return Rl(l,d.extends_clause_already_seen);a=!0}else return E.assert(l.token===119),Rl(l,d.Interface_declaration_cannot_have_implements_clause);Q7e(l)}return!1}function PZ(n){if(n.kind!==167)return!1;const a=n;return a.expression.kind===226&&a.expression.operatorToken.kind===28?Kt(a.expression,d.A_comma_expression_is_not_allowed_in_a_computed_property_name):!1}function $ge(n){if(n.asteriskToken){if(E.assert(n.kind===262||n.kind===218||n.kind===174),n.flags&33554432)return Kt(n.asteriskToken,d.Generators_are_not_allowed_in_an_ambient_context);if(!n.body)return Kt(n.asteriskToken,d.An_overload_signature_cannot_be_declared_as_a_generator)}}function Xge(n,a){return!!n&&Kt(n,a)}function Z7e(n,a){return!!n&&Kt(n,a)}function qut(n,a){const l=new Map;for(const _ of n.properties){if(_.kind===305){if(a){const x=Ha(_.expression);if(Lu(x)||ma(x))return Kt(_.expression,d.A_rest_element_cannot_contain_a_binding_pattern)}continue}const m=_.name;if(m.kind===167&&PZ(m),_.kind===304&&!a&&_.objectAssignmentInitializer&&Kt(_.equalsToken,d.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern),m.kind===81&&Kt(m,d.Private_identifiers_are_not_allowed_outside_class_bodies),Wp(_)&&_.modifiers)for(const x of _.modifiers)Ys(x)&&(x.kind!==134||_.kind!==174)&&Kt(x,d._0_modifier_cannot_be_used_here,Wc(x));else if(Ane(_)&&_.modifiers)for(const x of _.modifiers)Ys(x)&&Kt(x,d._0_modifier_cannot_be_used_here,Wc(x));let h;switch(_.kind){case 304:case 303:Z7e(_.exclamationToken,d.A_definite_assignment_assertion_is_not_permitted_in_this_context),Xge(_.questionToken,d.An_object_member_cannot_be_declared_optional),m.kind===9&&Zge(m),h=4;break;case 174:h=8;break;case 177:h=1;break;case 178:h=2;break;default:E.assertNever(_,"Unexpected syntax kind:"+_.kind)}if(!a){const x=Kge(m);if(x===void 0)continue;const N=l.get(x);if(!N)l.set(x,h);else if(h&8&&N&8)Kt(m,d.Duplicate_identifier_0,Wc(m));else if(h&4&&N&4)Kt(m,d.An_object_literal_cannot_have_multiple_properties_with_the_same_name,Wc(m));else if(h&3&&N&3)if(N!==3&&h!==N)l.set(x,h|N);else return Kt(m,d.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);else return Kt(m,d.An_object_literal_cannot_have_property_and_accessor_with_the_same_name)}}}function Hut(n){Gut(n.tagName),ij(n,n.typeArguments);const a=new Map;for(const l of n.attributes.properties){if(l.kind===293)continue;const{name:_,initializer:m}=l,h=DE(_);if(!a.get(h))a.set(h,!0);else return Kt(_,d.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);if(m&&m.kind===294&&!m.expression)return Kt(m,d.JSX_attributes_must_only_be_assigned_a_non_empty_expression)}}function Gut(n){if(bn(n)&&sd(n.expression))return Kt(n.expression,d.JSX_property_access_expressions_cannot_include_JSX_namespace_names);if(sd(n)&&F5(J)&&!Hk(n.namespace.escapedText))return Kt(n,d.React_components_cannot_include_JSX_namespace_names)}function $ut(n){if(n.expression&&HE(n.expression))return Kt(n.expression,d.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array)}function K7e(n){if(xh(n))return!0;if(n.kind===250&&n.awaitModifier&&!(n.flags&65536)){const a=Or(n);if(VI(n)){if(!q2(a))switch(sT(a,J)||wa.add(mn(n.awaitModifier,d.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)),B){case 100:case 199:if(a.impliedNodeFormat===1){wa.add(mn(n.awaitModifier,d.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));break}case 7:case 99:case 4:if(ie>=4)break;default:wa.add(mn(n.awaitModifier,d.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));break}}else if(!q2(a)){const l=mn(n.awaitModifier,d.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),_=uf(n);if(_&&_.kind!==176){E.assert((pl(_)&2)===0,"Enclosing function should never be an async function.");const m=mn(_,d.Did_you_mean_to_mark_this_function_as_async);ua(l,m)}return wa.add(l),!0}return!1}if(iw(n)&&!(n.flags&65536)&&Ie(n.initializer)&&n.initializer.escapedText==="async")return Kt(n.initializer,d.The_left_hand_side_of_a_for_of_statement_may_not_be_async),!1;if(n.initializer.kind===261){const a=n.initializer;if(!Yge(a)){const l=a.declarations;if(!l.length)return!1;if(l.length>1){const m=n.kind===249?d.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:d.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;return Rl(a.declarations[1],m)}const _=l[0];if(_.initializer){const m=n.kind===249?d.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:d.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return Kt(_.name,m)}if(_.type){const m=n.kind===249?d.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:d.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;return Kt(_,m)}}}return!1}function Xut(n){if(!(n.flags&33554432)&&n.parent.kind!==187&&n.parent.kind!==264){if(ie<1)return Kt(n.name,d.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);if(ie<2&&Ti(n.name))return Kt(n.name,d.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(n.body===void 0&&!In(n,64))return H2(n,n.end-1,1,d._0_expected,"{")}if(n.body){if(In(n,64))return Kt(n,d.An_abstract_accessor_cannot_have_an_implementation);if(n.parent.kind===187||n.parent.kind===264)return Kt(n.body,d.An_implementation_cannot_be_declared_in_ambient_contexts)}if(n.typeParameters)return Kt(n.name,d.An_accessor_cannot_have_type_parameters);if(!Qut(n))return Kt(n.name,n.kind===177?d.A_get_accessor_cannot_have_parameters:d.A_set_accessor_must_have_exactly_one_parameter);if(n.kind===178){if(n.type)return Kt(n.name,d.A_set_accessor_cannot_have_a_return_type_annotation);const a=E.checkDefined(iE(n),"Return value does not match parameter count assertion.");if(a.dotDotDotToken)return Kt(a.dotDotDotToken,d.A_set_accessor_cannot_have_rest_parameter);if(a.questionToken)return Kt(a.questionToken,d.A_set_accessor_cannot_have_an_optional_parameter);if(a.initializer)return Kt(n.name,d.A_set_accessor_parameter_cannot_have_an_initializer)}return!1}function Qut(n){return Qge(n)||n.parameters.length===(n.kind===177?0:1)}function Qge(n){if(n.parameters.length===(n.kind===177?1:2))return Fv(n)}function Yut(n){if(n.operator===158){if(n.type.kind!==155)return Kt(n.type,d._0_expected,Hs(155));let a=c8(n.parent);if(Hr(a)&&Fb(a)){const l=lT(a);l&&(a=Jk(l)||l)}switch(a.kind){case 260:const l=a;if(l.name.kind!==80)return Kt(n,d.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);if(!z4(l))return Kt(n,d.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement);if(!(l.parent.flags&2))return Kt(a.name,d.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);break;case 172:if(!Ls(a)||!sE(a))return Kt(a.name,d.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);break;case 171:if(!In(a,8))return Kt(a.name,d.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);break;default:return Kt(n,d.unique_symbol_types_are_not_allowed_here)}}else if(n.operator===148&&n.type.kind!==188&&n.type.kind!==189)return Rl(n,d.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types,Hs(155))}function jD(n,a){if(vKe(n))return Kt(n,a)}function eIe(n){if(DZ(n))return!0;if(n.kind===174){if(n.parent.kind===210){if(n.modifiers&&!(n.modifiers.length===1&&ba(n.modifiers).kind===134))return Rl(n,d.Modifiers_cannot_appear_here);if(Xge(n.questionToken,d.An_object_member_cannot_be_declared_optional))return!0;if(Z7e(n.exclamationToken,d.A_definite_assignment_assertion_is_not_permitted_in_this_context))return!0;if(n.body===void 0)return H2(n,n.end-1,1,d._0_expected,"{")}if($ge(n))return!0}if(Qn(n.parent)){if(ie<2&&Ti(n.name))return Kt(n.name,d.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(n.flags&33554432)return jD(n.name,d.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(n.kind===174&&!n.body)return jD(n.name,d.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else{if(n.parent.kind===264)return jD(n.name,d.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(n.parent.kind===187)return jD(n.name,d.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function Zut(n){let a=n;for(;a;){if(yk(a))return Kt(n,d.Jump_target_cannot_cross_function_boundary);switch(a.kind){case 256:if(n.label&&a.label.escapedText===n.label.escapedText)return n.kind===251&&!j0(a.statement,!0)?Kt(n,d.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement):!1;break;case 255:if(n.kind===252&&!n.label)return!1;break;default:if(j0(a,!1)&&!n.label)return!1;break}a=a.parent}if(n.label){const l=n.kind===252?d.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:d.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;return Kt(n,l)}else{const l=n.kind===252?d.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:d.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;return Kt(n,l)}}function Kut(n){if(n.dotDotDotToken){const a=n.parent.elements;if(n!==Sa(a))return Kt(n,d.A_rest_element_must_be_last_in_a_destructuring_pattern);if(Kx(a,d.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),n.propertyName)return Kt(n.name,d.A_rest_element_cannot_have_a_property_name)}if(n.dotDotDotToken&&n.initializer)return H2(n,n.initializer.pos-1,1,d.A_rest_element_cannot_have_an_initializer)}function tIe(n){return _f(n)||n.kind===224&&n.operator===41&&n.operand.kind===9}function e_t(n){return n.kind===10||n.kind===224&&n.operator===41&&n.operand.kind===10}function t_t(n){if((bn(n)||mo(n)&&tIe(n.argumentExpression))&&oc(n.expression))return!!(Bc(n).flags&1056)}function rIe(n){const a=n.initializer;if(a){const l=!(tIe(a)||t_t(a)||a.kind===112||a.kind===97||e_t(a));if((LI(n)||Ei(n)&&AZ(n))&&!n.type){if(l)return Kt(a,d.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference)}else return Kt(a,d.Initializers_are_not_allowed_in_ambient_contexts)}}function r_t(n){const a=G2(n),l=a&7;if(As(n.name))switch(l){case 6:return Kt(n,d._0_declarations_may_not_have_binding_patterns,"await using");case 4:return Kt(n,d._0_declarations_may_not_have_binding_patterns,"using")}if(n.parent.parent.kind!==249&&n.parent.parent.kind!==250){if(a&33554432)rIe(n);else if(!n.initializer){if(As(n.name)&&!As(n.parent))return Kt(n,d.A_destructuring_declaration_must_have_an_initializer);switch(l){case 6:return Kt(n,d._0_declarations_must_be_initialized,"await using");case 4:return Kt(n,d._0_declarations_must_be_initialized,"using");case 2:return Kt(n,d._0_declarations_must_be_initialized,"const")}}}if(n.exclamationToken&&(n.parent.parent.kind!==243||!n.type||n.initializer||a&33554432)){const _=n.initializer?d.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:n.type?d.A_definite_assignment_assertion_is_not_permitted_in_this_context:d.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return Kt(n.exclamationToken,_)}return(B<5||Or(n).impliedNodeFormat===1)&&B!==4&&!(n.parent.parent.flags&33554432)&&In(n.parent.parent,32)&&nIe(n.name),!!l&&iIe(n.name)}function nIe(n){if(n.kind===80){if(an(n)==="__esModule")return s_t("noEmit",n,d.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules)}else{const a=n.elements;for(const l of a)if(!dl(l))return nIe(l.name)}return!1}function iIe(n){if(n.kind===80){if(n.escapedText==="let")return Kt(n,d.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations)}else{const a=n.elements;for(const l of a)dl(l)||iIe(l.name)}return!1}function Yge(n){const a=n.declarations;if(Kx(n.declarations))return!0;if(!n.declarations.length)return H2(n,a.pos,a.end-a.pos,d.Variable_declaration_list_cannot_be_empty);const l=n.flags&7;return(l===4||l===6)&&UF(n.parent)?Kt(n,l===4?d.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration:d.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration):l===6?SNe(n):!1}function sIe(n){switch(n.kind){case 245:case 246:case 247:case 254:case 248:case 249:case 250:return!1;case 256:return sIe(n.parent)}return!0}function n_t(n){if(!sIe(n.parent)){const a=G2(n.declarationList)&7;if(a){const l=a===1?"let":a===2?"const":a===4?"using":a===6?"await using":E.fail("Unknown BlockScope flag");return Kt(n,d._0_declarations_can_only_be_declared_inside_a_block,l)}}}function i_t(n){const a=n.name.escapedText;switch(n.keywordToken){case 105:if(a!=="target")return Kt(n.name,d._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,bi(n.name.escapedText),Hs(n.keywordToken),"target");break;case 102:if(a!=="meta")return Kt(n.name,d._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,bi(n.name.escapedText),Hs(n.keywordToken),"meta");break}}function q2(n){return n.parseDiagnostics.length>0}function Rl(n,a,...l){const _=Or(n);if(!q2(_)){const m=Sm(_,n.pos);return wa.add(xl(_,m.start,m.length,a,...l)),!0}return!1}function H2(n,a,l,_,...m){const h=Or(n);return q2(h)?!1:(wa.add(xl(h,a,l,_,...m)),!0)}function s_t(n,a,l,..._){const m=Or(a);return q2(m)?!1:(c0(n,a,l,..._),!0)}function Kt(n,a,...l){const _=Or(n);return q2(_)?!1:(wa.add(mn(n,a,...l)),!0)}function a_t(n){const a=Hr(n)?g5(n):void 0,l=n.typeParameters||a&&bl(a);if(l){const _=l.pos===l.end?l.pos:la(Or(n).text,l.pos);return H2(n,_,l.end-_,d.Type_parameters_cannot_appear_on_a_constructor_declaration)}}function o_t(n){const a=n.type||up(n);if(a)return Kt(a,d.Type_annotation_cannot_appear_on_a_constructor_declaration)}function c_t(n){if(xa(n.name)&&Gr(n.name.expression)&&n.name.expression.operatorToken.kind===103)return Kt(n.parent.members[0],d.A_mapped_type_may_not_declare_properties_or_methods);if(Qn(n.parent)){if(ra(n.name)&&n.name.text==="constructor")return Kt(n.name,d.Classes_may_not_have_a_field_named_constructor);if(jD(n.name,d.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type))return!0;if(ie<2&&Ti(n.name))return Kt(n.name,d.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(ie<2&&n_(n))return Kt(n.name,d.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(n_(n)&&Xge(n.questionToken,d.An_accessor_property_cannot_be_declared_optional))return!0}else if(n.parent.kind===264){if(jD(n.name,d.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return!0;if(E.assertNode(n,ff),n.initializer)return Kt(n.initializer,d.An_interface_property_cannot_have_an_initializer)}else if(X_(n.parent)){if(jD(n.name,d.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return!0;if(E.assertNode(n,ff),n.initializer)return Kt(n.initializer,d.A_type_literal_property_cannot_have_an_initializer)}if(n.flags&33554432&&rIe(n),Es(n)&&n.exclamationToken&&(!Qn(n.parent)||!n.type||n.initializer||n.flags&33554432||Ls(n)||Mv(n))){const a=n.initializer?d.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:n.type?d.A_definite_assignment_assertion_is_not_permitted_in_this_context:d.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return Kt(n.exclamationToken,a)}}function l_t(n){return n.kind===264||n.kind===265||n.kind===272||n.kind===271||n.kind===278||n.kind===277||n.kind===270||In(n,2208)?!1:Rl(n,d.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function u_t(n){for(const a of n.statements)if((hu(a)||a.kind===243)&&l_t(a))return!0;return!1}function __t(n){return!!(n.flags&33554432)&&u_t(n)}function xh(n){if(n.flags&33554432){if(!Wn(n).hasReportedStatementInAmbientContext&&(ks(n.parent)||R0(n.parent)))return Wn(n).hasReportedStatementInAmbientContext=Rl(n,d.An_implementation_cannot_be_declared_in_ambient_contexts);if(n.parent.kind===241||n.parent.kind===268||n.parent.kind===312){const l=Wn(n.parent);if(!l.hasReportedStatementInAmbientContext)return l.hasReportedStatementInAmbientContext=Rl(n,d.Statements_are_not_allowed_in_ambient_contexts)}}return!1}function Zge(n){const a=Wc(n).includes("."),l=n.numericLiteralFlags&16;a||l||+n.text<=9007199254740991||Ol(!1,mn(n,d.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers))}function f_t(n){return!!(!(_1(n.parent)||f1(n.parent)&&_1(n.parent.parent))&&ie<7&&Kt(n,d.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020))}function p_t(n,a,...l){const _=Or(n);if(!q2(_)){const m=Sm(_,n.pos);return wa.add(xl(_,yc(m),0,a,...l)),!0}return!1}function d_t(){return xu||(xu=[],me.forEach((n,a)=>{rV.test(a)&&xu.push(n)})),xu}function m_t(n){var a;return n.isTypeOnly&&n.name&&n.namedBindings?Kt(n,d.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both):n.isTypeOnly&&((a=n.namedBindings)==null?void 0:a.kind)===275?aIe(n.namedBindings):!1}function aIe(n){return!!Zt(n.elements,a=>{if(a.isTypeOnly)return Rl(a,a.kind===276?d.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:d.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)})}function g_t(n){if(J.verbatimModuleSyntax&&B===1)return Kt(n,d.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);if(B===5)return Kt(n,d.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);if(n.typeArguments)return Kt(n,d.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);const a=n.arguments;if(B!==99&&B!==199&&B!==100&&(Kx(a),a.length>1)){const _=a[1];return Kt(_,d.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext)}if(a.length===0||a.length>2)return Kt(n,d.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);const l=kn(a,Od);return l?Kt(l,d.Argument_of_dynamic_import_cannot_be_spread_element):!1}function h_t(n,a){const l=Pn(n);if(l&20&&a.flags&1048576)return kn(a.types,_=>{if(_.flags&524288){const m=l&Pn(_);if(m&4)return n.target===_.target;if(m&16)return!!n.aliasSymbol&&n.aliasSymbol===_.aliasSymbol}return!1})}function y_t(n,a){if(Pn(n)&128&&em(a,x0))return kn(a.types,l=>!x0(l))}function v_t(n,a){let l=0;if(Ts(n,l).length>0||(l=1,Ts(n,l).length>0))return kn(a.types,m=>Ts(m,l).length>0)}function b_t(n,a){let l;if(!(n.flags&406978556)){let _=0;for(const m of a.types)if(!(m.flags&406978556)){const h=fa([$m(n),$m(m)]);if(h.flags&4194304)return m;if(bd(h)||h.flags&1048576){const x=h.flags&1048576?Ch(h.types,bd):1;x>=_&&(l=m,_=x)}}}return l}function S_t(n){if(Yo(n,67108864)){const a=jc(n,l=>!(l.flags&402784252));if(!(a.flags&131072))return a}return n}function oIe(n,a,l){if(a.flags&1048576&&n.flags&2621440){const _=kwe(a,n);if(_)return _;const m=Wa(n);if(m){const h=xwe(m,a);if(h){const x=jde(a,Yt(h,N=>[()=>Br(N),N.escapedName]),l);if(x!==a)return x}}}}function Kge(n){const a=gb(n);return a||(xa(n)?_me(Zl(n.expression)):void 0)}function wZ(n){return zr===n||(zr=n,ar=gv(n)),ar}function G2(n){return Ht===n||(Ht=n,br=Fh(n)),br}function AZ(n){const a=G2(n)&7;return a===2||a===4||a===6}}function D9e(e){return!R0(e)}function T2e(e){return e.kind!==262&&e.kind!==174||!!e.body}function x2e(e){switch(e.parent.kind){case 276:case 281:return Ie(e);default:return $g(e)}}function k2e(e){switch(e){case 0:return"yieldType";case 1:return"returnType";case 2:return"nextType"}}function bu(e){return!!(e.flags&1)}function tV(e){return!!(e.flags&2)}function P9e(e){return{getCommonSourceDirectory:e.getCommonSourceDirectory?()=>e.getCommonSourceDirectory():()=>"",getCurrentDirectory:()=>e.getCurrentDirectory(),getSymlinkCache:Os(e,e.getSymlinkCache),getPackageJsonInfoCache:()=>{var t;return(t=e.getPackageJsonInfoCache)==null?void 0:t.call(e)},useCaseSensitiveFileNames:Os(e,e.useCaseSensitiveFileNames),redirectTargetsMap:e.redirectTargetsMap,getProjectReferenceRedirect:t=>e.getProjectReferenceRedirect(t),isSourceOfProjectReferenceRedirect:t=>e.isSourceOfProjectReferenceRedirect(t),fileExists:t=>e.fileExists(t),getFileIncludeReasons:()=>e.getFileIncludeReasons(),readFile:e.readFile?t=>e.readFile(t):void 0}}var rV,PO,Fie,Oie,Lie,Mie,wO,nV,AO,NO,C2e,IO,Rie,mf,iV,w9e=Nt({"src/compiler/checker.ts"(){"use strict";Ns(),Nie(),Z2(),rV=/^".+"$/,PO="(anonymous)",Fie=1,Oie=1,Lie=1,Mie=1,wO=(e=>(e[e.None=0]="None",e[e.TypeofEQString=1]="TypeofEQString",e[e.TypeofEQNumber=2]="TypeofEQNumber",e[e.TypeofEQBigInt=4]="TypeofEQBigInt",e[e.TypeofEQBoolean=8]="TypeofEQBoolean",e[e.TypeofEQSymbol=16]="TypeofEQSymbol",e[e.TypeofEQObject=32]="TypeofEQObject",e[e.TypeofEQFunction=64]="TypeofEQFunction",e[e.TypeofEQHostObject=128]="TypeofEQHostObject",e[e.TypeofNEString=256]="TypeofNEString",e[e.TypeofNENumber=512]="TypeofNENumber",e[e.TypeofNEBigInt=1024]="TypeofNEBigInt",e[e.TypeofNEBoolean=2048]="TypeofNEBoolean",e[e.TypeofNESymbol=4096]="TypeofNESymbol",e[e.TypeofNEObject=8192]="TypeofNEObject",e[e.TypeofNEFunction=16384]="TypeofNEFunction",e[e.TypeofNEHostObject=32768]="TypeofNEHostObject",e[e.EQUndefined=65536]="EQUndefined",e[e.EQNull=131072]="EQNull",e[e.EQUndefinedOrNull=262144]="EQUndefinedOrNull",e[e.NEUndefined=524288]="NEUndefined",e[e.NENull=1048576]="NENull",e[e.NEUndefinedOrNull=2097152]="NEUndefinedOrNull",e[e.Truthy=4194304]="Truthy",e[e.Falsy=8388608]="Falsy",e[e.IsUndefined=16777216]="IsUndefined",e[e.IsNull=33554432]="IsNull",e[e.IsUndefinedOrNull=50331648]="IsUndefinedOrNull",e[e.All=134217727]="All",e[e.BaseStringStrictFacts=3735041]="BaseStringStrictFacts",e[e.BaseStringFacts=12582401]="BaseStringFacts",e[e.StringStrictFacts=16317953]="StringStrictFacts",e[e.StringFacts=16776705]="StringFacts",e[e.EmptyStringStrictFacts=12123649]="EmptyStringStrictFacts",e[e.EmptyStringFacts=12582401]="EmptyStringFacts",e[e.NonEmptyStringStrictFacts=7929345]="NonEmptyStringStrictFacts",e[e.NonEmptyStringFacts=16776705]="NonEmptyStringFacts",e[e.BaseNumberStrictFacts=3734786]="BaseNumberStrictFacts",e[e.BaseNumberFacts=12582146]="BaseNumberFacts",e[e.NumberStrictFacts=16317698]="NumberStrictFacts",e[e.NumberFacts=16776450]="NumberFacts",e[e.ZeroNumberStrictFacts=12123394]="ZeroNumberStrictFacts",e[e.ZeroNumberFacts=12582146]="ZeroNumberFacts",e[e.NonZeroNumberStrictFacts=7929090]="NonZeroNumberStrictFacts",e[e.NonZeroNumberFacts=16776450]="NonZeroNumberFacts",e[e.BaseBigIntStrictFacts=3734276]="BaseBigIntStrictFacts",e[e.BaseBigIntFacts=12581636]="BaseBigIntFacts",e[e.BigIntStrictFacts=16317188]="BigIntStrictFacts",e[e.BigIntFacts=16775940]="BigIntFacts",e[e.ZeroBigIntStrictFacts=12122884]="ZeroBigIntStrictFacts",e[e.ZeroBigIntFacts=12581636]="ZeroBigIntFacts",e[e.NonZeroBigIntStrictFacts=7928580]="NonZeroBigIntStrictFacts",e[e.NonZeroBigIntFacts=16775940]="NonZeroBigIntFacts",e[e.BaseBooleanStrictFacts=3733256]="BaseBooleanStrictFacts",e[e.BaseBooleanFacts=12580616]="BaseBooleanFacts",e[e.BooleanStrictFacts=16316168]="BooleanStrictFacts",e[e.BooleanFacts=16774920]="BooleanFacts",e[e.FalseStrictFacts=12121864]="FalseStrictFacts",e[e.FalseFacts=12580616]="FalseFacts",e[e.TrueStrictFacts=7927560]="TrueStrictFacts",e[e.TrueFacts=16774920]="TrueFacts",e[e.SymbolStrictFacts=7925520]="SymbolStrictFacts",e[e.SymbolFacts=16772880]="SymbolFacts",e[e.ObjectStrictFacts=7888800]="ObjectStrictFacts",e[e.ObjectFacts=16736160]="ObjectFacts",e[e.FunctionStrictFacts=7880640]="FunctionStrictFacts",e[e.FunctionFacts=16728e3]="FunctionFacts",e[e.VoidFacts=9830144]="VoidFacts",e[e.UndefinedFacts=26607360]="UndefinedFacts",e[e.NullFacts=42917664]="NullFacts",e[e.EmptyObjectStrictFacts=83427327]="EmptyObjectStrictFacts",e[e.EmptyObjectFacts=83886079]="EmptyObjectFacts",e[e.UnknownFacts=83886079]="UnknownFacts",e[e.AllTypeofNE=556800]="AllTypeofNE",e[e.OrFactsMask=8256]="OrFactsMask",e[e.AndFactsMask=134209471]="AndFactsMask",e))(wO||{}),nV=new Map(Object.entries({string:256,number:512,bigint:1024,boolean:2048,symbol:4096,undefined:524288,object:8192,function:16384})),AO=(e=>(e[e.Normal=0]="Normal",e[e.Contextual=1]="Contextual",e[e.Inferential=2]="Inferential",e[e.SkipContextSensitive=4]="SkipContextSensitive",e[e.SkipGenericFunctions=8]="SkipGenericFunctions",e[e.IsForSignatureHelp=16]="IsForSignatureHelp",e[e.RestBindingElement=32]="RestBindingElement",e[e.TypeOnly=64]="TypeOnly",e))(AO||{}),NO=(e=>(e[e.None=0]="None",e[e.BivariantCallback=1]="BivariantCallback",e[e.StrictCallback=2]="StrictCallback",e[e.IgnoreReturnTypes=4]="IgnoreReturnTypes",e[e.StrictArity=8]="StrictArity",e[e.StrictTopSignature=16]="StrictTopSignature",e[e.Callback=3]="Callback",e))(NO||{}),C2e=w7(T2e,D9e),IO=new Map(Object.entries({Uppercase:0,Lowercase:1,Capitalize:2,Uncapitalize:3})),Rie=class{},(e=>{e.JSX="JSX",e.IntrinsicElements="IntrinsicElements",e.ElementClass="ElementClass",e.ElementAttributesPropertyNameContainer="ElementAttributesProperty",e.ElementChildrenAttributeNameContainer="ElementChildrenAttribute",e.Element="Element",e.ElementType="ElementType",e.IntrinsicAttributes="IntrinsicAttributes",e.IntrinsicClassAttributes="IntrinsicClassAttributes",e.LibraryManagedAttributes="LibraryManagedAttributes"})(mf||(mf={})),iV=class lIe{constructor(t,r,i){this.moduleResolverHost=void 0,this.inner=void 0,this.disableTrackSymbol=!1;for(var s;r instanceof lIe;)r=r.inner;this.inner=r,this.moduleResolverHost=i,this.context=t,this.canTrackSymbol=!!((s=this.inner)!=null&&s.trackSymbol)}trackSymbol(t,r,i){var s,o;if((s=this.inner)!=null&&s.trackSymbol&&!this.disableTrackSymbol){if(this.inner.trackSymbol(t,r,i))return this.onDiagnosticReported(),!0;t.flags&262144||((o=this.context).trackedSymbols??(o.trackedSymbols=[])).push([t,r,i])}return!1}reportInaccessibleThisError(){var t;(t=this.inner)!=null&&t.reportInaccessibleThisError&&(this.onDiagnosticReported(),this.inner.reportInaccessibleThisError())}reportPrivateInBaseOfClassExpression(t){var r;(r=this.inner)!=null&&r.reportPrivateInBaseOfClassExpression&&(this.onDiagnosticReported(),this.inner.reportPrivateInBaseOfClassExpression(t))}reportInaccessibleUniqueSymbolError(){var t;(t=this.inner)!=null&&t.reportInaccessibleUniqueSymbolError&&(this.onDiagnosticReported(),this.inner.reportInaccessibleUniqueSymbolError())}reportCyclicStructureError(){var t;(t=this.inner)!=null&&t.reportCyclicStructureError&&(this.onDiagnosticReported(),this.inner.reportCyclicStructureError())}reportLikelyUnsafeImportRequiredError(t){var r;(r=this.inner)!=null&&r.reportLikelyUnsafeImportRequiredError&&(this.onDiagnosticReported(),this.inner.reportLikelyUnsafeImportRequiredError(t))}reportTruncationError(){var t;(t=this.inner)!=null&&t.reportTruncationError&&(this.onDiagnosticReported(),this.inner.reportTruncationError())}trackReferencedAmbientModule(t,r){var i;(i=this.inner)!=null&&i.trackReferencedAmbientModule&&(this.onDiagnosticReported(),this.inner.trackReferencedAmbientModule(t,r))}trackExternalModuleSymbolOfImportTypeNode(t){var r;(r=this.inner)!=null&&r.trackExternalModuleSymbolOfImportTypeNode&&(this.onDiagnosticReported(),this.inner.trackExternalModuleSymbolOfImportTypeNode(t))}reportNonlocalAugmentation(t,r,i){var s;(s=this.inner)!=null&&s.reportNonlocalAugmentation&&(this.onDiagnosticReported(),this.inner.reportNonlocalAugmentation(t,r,i))}reportNonSerializableProperty(t){var r;(r=this.inner)!=null&&r.reportNonSerializableProperty&&(this.onDiagnosticReported(),this.inner.reportNonSerializableProperty(t))}onDiagnosticReported(){this.context.reportedDiagnostic=!0}}}});function He(e,t,r,i){if(e===void 0)return e;const s=t(e);let o;if(s!==void 0)return es(s)?o=(i||O9e)(s):o=s,E.assertNode(o,r),o}function kr(e,t,r,i,s){if(e===void 0)return e;const o=e.length;(i===void 0||i<0)&&(i=0),(s===void 0||s>o-i)&&(s=o-i);let c,u=-1,f=-1;i>0||so-i)&&(s=o-i),E2e(e,t,r,i,s)}function E2e(e,t,r,i,s){let o;const c=e.length;(i>0||s=2&&(s=A9e(s,r)),r.setLexicalEnvironmentFlags(1,!1)),r.suspendLexicalEnvironment(),s}function A9e(e,t){let r;for(let i=0;i{const c=iu,addSource:Se,setSourceContent:se,addName:Z,addMapping:Me,appendSourceMap:ke,toJSON:me,toString:()=>JSON.stringify(me())};function Se(Xe){o();const it=KS(i,Xe,e.getCurrentDirectory(),e.getCanonicalFileName,!0);let mt=g.get(it);return mt===void 0&&(mt=f.length,f.push(it),u.push(Xe),g.set(it,mt)),c(),mt}function se(Xe,it){if(o(),it!==null){for(p||(p=[]);p.lengthit||ae===it&&_e>mt)}function Me(Xe,it,mt,Je,ot,Bt){E.assert(Xe>=ie,"generatedLine cannot backtrack"),E.assert(it>=0,"generatedCharacter cannot be negative"),E.assert(mt===void 0||mt>=0,"sourceIndex cannot be negative"),E.assert(Je===void 0||Je>=0,"sourceLine cannot be negative"),E.assert(ot===void 0||ot>=0,"sourceCharacter cannot be negative"),o(),(ve(Xe,it)||Te(mt,Je,ot))&&(lt(),ie=Xe,B=it,K=!1,oe=!1,H=!0),mt!==void 0&&Je!==void 0&&ot!==void 0&&(Y=mt,ae=Je,_e=ot,K=!0,Bt!==void 0&&($=Bt,oe=!0)),c()}function ke(Xe,it,mt,Je,ot,Bt){E.assert(Xe>=ie,"generatedLine cannot backtrack"),E.assert(it>=0,"generatedCharacter cannot be negative"),o();const Ht=[];let br;const zr=oV(mt.mappings);for(const ar of zr){if(Bt&&(ar.generatedLine>Bt.line||ar.generatedLine===Bt.line&&ar.generatedCharacter>Bt.character))break;if(ot&&(ar.generatedLine=1024&&pt()}function lt(){if(!(!H||!he())){if(o(),w0&&(C+=String.fromCharCode.apply(void 0,T),T.length=0)}function me(){return lt(),pt(),{version:3,file:t,sourceRoot:r,sources:f,names:y,mappings:C,sourcesContent:p}}function Oe(Xe){Xe<0?Xe=(-Xe<<1)+1:Xe=Xe<<1;do{let it=Xe&31;Xe=Xe>>5,Xe>0&&(it=it|32),be(R9e(it))}while(Xe>0)}}function sV(e,t){return{getLineCount:()=>t.length,getLineText:r=>e.substring(t[r],t[r+1])}}function Bie(e){for(let t=e.getLineCount()-1;t>=0;t--){const r=e.getLineText(t),i=OO.exec(r);if(i)return i[1].trimEnd();if(!r.match(LO))break}}function M9e(e){return typeof e=="string"||e===null}function Jie(e){return e!==null&&typeof e=="object"&&e.version===3&&typeof e.file=="string"&&typeof e.mappings=="string"&&es(e.sources)&&qi(e.sources,ns)&&(e.sourceRoot===void 0||e.sourceRoot===null||typeof e.sourceRoot=="string")&&(e.sourcesContent===void 0||e.sourcesContent===null||es(e.sourcesContent)&&qi(e.sourcesContent,M9e))&&(e.names===void 0||e.names===null||es(e.names)&&qi(e.names,ns))}function aV(e){try{const t=JSON.parse(e);if(Jie(t))return t}catch{}}function oV(e){let t=!1,r=0,i=0,s=0,o=0,c=0,u=0,f=0,g;return{get pos(){return r},get error(){return g},get state(){return p(!0,!0)},next(){for(;!t&&r=e.length)return S("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;const X=j9e(e.charCodeAt(r));if(X===-1)return S("Invalid character in VLQ"),-1;O=(X&32)!==0,W=W|(X&31)<>1,W=-W):W=W>>1,W}}function P2e(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex}function zie(e){return e.sourceIndex!==void 0&&e.sourceLine!==void 0&&e.sourceCharacter!==void 0}function R9e(e){return e>=0&&e<26?65+e:e>=26&&e<52?97+e-26:e>=52&&e<62?48+e-52:e===62?43:e===63?47:E.fail(`${e}: not a base64 value`)}function j9e(e){return e>=65&&e<=90?e-65:e>=97&&e<=122?e-97+26:e>=48&&e<=57?e-48+52:e===43?62:e===47?63:-1}function w2e(e){return e.sourceIndex!==void 0&&e.sourcePosition!==void 0}function A2e(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function B9e(e,t){return E.assert(e.sourceIndex===t.sourceIndex),xo(e.sourcePosition,t.sourcePosition)}function J9e(e,t){return xo(e.generatedPosition,t.generatedPosition)}function z9e(e){return e.sourcePosition}function W9e(e){return e.generatedPosition}function Wie(e,t,r){const i=qn(r),s=t.sourceRoot?is(t.sourceRoot,i):i,o=is(t.file,i),c=e.getSourceFileLike(o),u=t.sources.map(z=>is(z,s)),f=new Map(u.map((z,W)=>[e.getCanonicalFileName(z),W]));let g,p,y;return{getSourcePosition:O,getGeneratedPosition:D};function S(z){const W=c!==void 0?oP(c,z.generatedLine,z.generatedCharacter,!0):-1;let X,J;if(zie(z)){const ie=e.getSourceFileLike(u[z.sourceIndex]);X=t.sources[z.sourceIndex],J=ie!==void 0?oP(ie,z.sourceLine,z.sourceCharacter,!0):-1}return{generatedPosition:W,source:X,sourceIndex:z.sourceIndex,sourcePosition:J,nameIndex:z.nameIndex}}function T(){if(g===void 0){const z=oV(t.mappings),W=fs(z,S);z.error!==void 0?(e.log&&e.log(`Encountered error while decoding sourcemap: ${z.error}`),g=ze):g=W}return g}function C(z){if(y===void 0){const W=[];for(const X of T()){if(!w2e(X))continue;let J=W[X.sourceIndex];J||(W[X.sourceIndex]=J=[]),J.push(X)}y=W.map(X=>_4(X,B9e,A2e))}return y[z]}function w(){if(p===void 0){const z=[];for(const W of T())z.push(W);p=_4(z,J9e,A2e)}return p}function D(z){const W=f.get(e.getCanonicalFileName(z.fileName));if(W===void 0)return z;const X=C(W);if(!ut(X))return z;let J=HS(X,z.pos,z9e,xo);J<0&&(J=~J);const ie=X[J];return ie===void 0||ie.sourceIndex!==W?z:{fileName:o,pos:ie.generatedPosition}}function O(z){const W=w();if(!ut(W))return z;let X=HS(W,z.pos,W9e,xo);X<0&&(X=~X);const J=W[X];return J===void 0||!w2e(J)?z:{fileName:u[J.sourceIndex],pos:J.sourcePosition}}}var cV,OO,LO,MO,U9e=Nt({"src/compiler/sourcemap.ts"(){"use strict";Ns(),Z2(),cV=/\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,OO=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,LO=/^\s*(\/\/[@#] .*)?$/,MO={getSourcePosition:To,getGeneratedPosition:To}}});function iu(e){return e=Zo(e),e?Oa(e):0}function V9e(e){return!e||!Kg(e)?!1:ut(e.elements,N2e)}function N2e(e){return e.propertyName!==void 0&&e.propertyName.escapedText==="default"}function Up(e,t){return r;function r(s){return s.kind===312?t(s):i(s)}function i(s){return e.factory.createBundle(Yt(s.sourceFiles,t),s.prepends)}}function Uie(e){return!!jk(e)}function RO(e){if(jk(e))return!0;const t=e.importClause&&e.importClause.namedBindings;if(!t||!Kg(t))return!1;let r=0;for(const i of t.elements)N2e(i)&&r++;return r>0&&r!==t.elements.length||!!(t.elements.length-r)&&oT(e)}function lV(e){return!RO(e)&&(oT(e)||!!e.importClause&&Kg(e.importClause.namedBindings)&&V9e(e.importClause.namedBindings))}function uV(e,t){const r=e.getEmitResolver(),i=e.getCompilerOptions(),s=[],o=new dV,c=[],u=new Map;let f,g=!1,p,y=!1,S=!1,T=!1;for(const D of t.statements)switch(D.kind){case 272:s.push(D),!S&&RO(D)&&(S=!0),!T&&lV(D)&&(T=!0);break;case 271:D.moduleReference.kind===283&&s.push(D);break;case 278:if(D.moduleSpecifier)if(!D.exportClause)s.push(D),y=!0;else if(s.push(D),gp(D.exportClause))w(D);else{const O=D.exportClause.name;u.get(an(O))||(s3(c,iu(D),O),u.set(an(O),!0),f=lr(f,O)),S=!0}else w(D);break;case 277:D.isExportEquals&&!p&&(p=D);break;case 243:if(In(D,32))for(const O of D.declarationList.declarations)f=I2e(O,u,f,c);break;case 262:if(In(D,32))if(In(D,2048))g||(s3(c,iu(D),e.factory.getDeclarationName(D)),g=!0);else{const O=D.name;u.get(an(O))||(s3(c,iu(D),O),u.set(an(O),!0),f=lr(f,O))}break;case 263:if(In(D,32))if(In(D,2048))g||(s3(c,iu(D),e.factory.getDeclarationName(D)),g=!0);else{const O=D.name;O&&!u.get(an(O))&&(s3(c,iu(D),O),u.set(an(O),!0),f=lr(f,O))}break}const C=tU(e.factory,e.getEmitHelperFactory(),t,i,y,S,T);return C&&s.unshift(C),{externalImports:s,exportSpecifiers:o,exportEquals:p,hasExportStarsToExportValues:y,exportedBindings:c,exportedNames:f,externalHelpersImportDeclaration:C};function w(D){for(const O of Ms(D.exportClause,gp).elements)if(!u.get(an(O.name))){const z=O.propertyName||O.name;D.moduleSpecifier||o.add(z,O);const W=r.getReferencedImportDeclaration(z)||r.getReferencedValueDeclaration(z);W&&s3(c,iu(W),O.name),u.set(an(O.name),!0),f=lr(f,O.name)}}}function I2e(e,t,r,i){if(As(e.name))for(const s of e.name.elements)dl(s)||(r=I2e(s,t,r,i));else if(!Eo(e.name)){const s=an(e.name);t.get(s)||(t.set(s,!0),r=lr(r,e.name),eh(e.name)&&s3(i,iu(e),e.name))}return r}function s3(e,t,r){let i=e[t];return i?i.push(r):e[t]=i=[r],i}function Kv(e){return Ja(e)||e.kind===9||a_(e.kind)||Ie(e)}function jd(e){return!Ie(e)&&Kv(e)}function a3(e){return e>=65&&e<=79}function o3(e){switch(e){case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 45;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 75:return 52;case 79:return 53;case 76:return 57;case 77:return 56;case 78:return 61}}function jO(e){if(!kl(e))return;const t=Ha(e.expression);return ub(t)?t:void 0}function F2e(e,t,r){for(let i=t;iH9e(i,t,r))}function q9e(e){return G9e(e)||Go(e)}function JO(e){return wn(e.members,q9e)}function H9e(e,t,r){return Es(e)&&(!!e.initializer||!t)&&Uc(e)===r}function G9e(e){return Es(e)&&Uc(e)}function Uw(e){return e.kind===172&&e.initializer!==void 0}function Vie(e){return!Ls(e)&&(vk(e)||n_(e))&&Ti(e.name)}function qie(e){let t;if(e){const r=e.parameters,i=r.length>0&&Ov(r[0]),s=i?1:0,o=i?r.length-1:r.length;for(let c=0;cpV(r.privateEnv,t))}var $T,dV,Q9e=Nt({"src/compiler/transformers/utilities.ts"(){"use strict";Ns(),$T=class o4{constructor(){this._map=new Map}get size(){return this._map.size}has(t){return this._map.has(o4.toKey(t))}get(t){return this._map.get(o4.toKey(t))}set(t,r){return this._map.set(o4.toKey(t),r),this}delete(t){var r;return((r=this._map)==null?void 0:r.delete(o4.toKey(t)))??!1}clear(){this._map.clear()}values(){return this._map.values()}static toKey(t){if(rb(t)||Eo(t)){const r=t.emitNode.autoGenerate;if((r.flags&7)===4){const i=gw(t),s=tg(i)&&i!==t?o4.toKey(i):`(generated@${Oa(i)})`;return g1(!1,r.prefix,s,r.suffix,o4.toKey)}else{const i=`(auto@${r.id})`;return g1(!1,r.prefix,i,r.suffix,o4.toKey)}}return Ti(t)?an(t).slice(1):an(t)}},dV=class extends $T{add(e,t){let r=this.get(e);return r?r.push(t):this.set(e,r=[t]),r}remove(e,t){const r=this.get(e);r&&(X2(r,t),r.length||this.delete(e))}}}});function jb(e,t,r,i,s,o){let c=e,u;if(Jh(e))for(u=e.right;Lte(e.left)||Dz(e.left);)if(Jh(u))c=e=u,u=e.right;else return E.checkDefined(He(u,t,ct));let f;const g={context:r,level:i,downlevelIteration:!!r.getCompilerOptions().downlevelIteration,hoistTempVariables:!0,emitExpression:p,emitBindingOrAssignment:y,createArrayBindingOrAssignmentPattern:S=>iLe(r.factory,S),createObjectBindingOrAssignmentPattern:S=>aLe(r.factory,S),createArrayBindingOrAssignmentElement:cLe,visitor:t};if(u&&(u=He(u,t,ct),E.assert(u),Ie(u)&&Xie(e,u.escapedText)||Qie(e)?u=XT(g,u,!1,c):s?u=XT(g,u,!0,c):Po(e)&&(c=u)),c3(g,e,u,c,Jh(e)),u&&s){if(!ut(f))return u;f.push(u)}return r.factory.inlineExpressions(f)||r.factory.createOmittedExpression();function p(S){f=lr(f,S)}function y(S,T,C,w){E.assertNode(S,o?Ie:ct);const D=o?o(S,T,C):tt(r.factory.createAssignment(E.checkDefined(He(S,t,ct)),T),C);D.original=w,p(D)}}function Xie(e,t){const r=ey(e);return kP(r)?Y9e(r,t):Ie(r)?r.escapedText===t:!1}function Y9e(e,t){const r=xC(e);for(const i of r)if(Xie(i,t))return!0;return!1}function Qie(e){const t=tO(e);if(t&&xa(t)&&!vv(t.expression))return!0;const r=ey(e);return!!r&&kP(r)&&Z9e(r)}function Z9e(e){return!!Zt(xC(e),Qie)}function e2(e,t,r,i,s,o=!1,c){let u;const f=[],g=[],p={context:r,level:i,downlevelIteration:!!r.getCompilerOptions().downlevelIteration,hoistTempVariables:o,emitExpression:y,emitBindingOrAssignment:S,createArrayBindingOrAssignmentPattern:T=>nLe(r.factory,T),createObjectBindingOrAssignmentPattern:T=>sLe(r.factory,T),createArrayBindingOrAssignmentElement:T=>oLe(r.factory,T),visitor:t};if(Ei(e)){let T=dw(e);T&&(Ie(T)&&Xie(e,T.escapedText)||Qie(e))&&(T=XT(p,E.checkDefined(He(T,p.visitor,ct)),!1,T),e=r.factory.updateVariableDeclaration(e,e.name,void 0,void 0,T))}if(c3(p,e,s,e,c),u){const T=r.factory.createTempVariable(void 0);if(o){const C=r.factory.inlineExpressions(u);u=void 0,S(T,C,void 0,void 0)}else{r.hoistVariableDeclaration(T);const C=Sa(f);C.pendingExpressions=lr(C.pendingExpressions,r.factory.createAssignment(T,C.value)),Dn(C.pendingExpressions,u),C.value=T}}for(const{pendingExpressions:T,name:C,value:w,location:D,original:O}of f){const z=r.factory.createVariableDeclaration(C,void 0,void 0,T?r.factory.inlineExpressions(lr(T,w)):w);z.original=O,tt(z,D),g.push(z)}return g;function y(T){u=lr(u,T)}function S(T,C,w,D){E.assertNode(T,nb),u&&(C=r.factory.inlineExpressions(lr(u,C)),u=void 0),f.push({pendingExpressions:u,name:T,value:C,location:w,original:D})}}function c3(e,t,r,i,s){const o=ey(t);if(!s){const c=He(dw(t),e.visitor,ct);c?r?(r=tLe(e,r,c,i),!jd(c)&&kP(o)&&(r=XT(e,r,!0,i))):r=c:r||(r=e.context.factory.createVoidZero())}pJ(o)?K9e(e,t,o,r,i):dJ(o)?eLe(e,t,o,r,i):e.emitBindingOrAssignment(o,r,i,t)}function K9e(e,t,r,i,s){const o=xC(r),c=o.length;if(c!==1){const g=!xP(t)||c!==0;i=XT(e,i,g,s)}let u,f;for(let g=0;g=1&&!(p.transformFlags&98304)&&!(ey(p).transformFlags&98304)&&!xa(y))u=lr(u,He(p,e.visitor,nee));else{u&&(e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(u),i,s,r),u=void 0);const S=rLe(e,i,y);xa(y)&&(f=lr(f,S.argumentExpression)),c3(e,p,S,p)}}}u&&e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(u),i,s,r)}function eLe(e,t,r,i,s){const o=xC(r),c=o.length;if(e.level<1&&e.downlevelIteration)i=XT(e,tt(e.context.getEmitHelperFactory().createReadHelper(i,c>0&&eO(o[c-1])?void 0:c),s),!1,s);else if(c!==1&&(e.level<1||c===0)||qi(o,dl)){const g=!xP(t)||c!==0;i=XT(e,i,g,s)}let u,f;for(let g=0;g=1)if(p.transformFlags&65536||e.hasTransformedPriorElement&&!L2e(p)){e.hasTransformedPriorElement=!0;const y=e.context.factory.createTempVariable(void 0);e.hoistTempVariables&&e.context.hoistVariableDeclaration(y),f=lr(f,[y,p]),u=lr(u,e.createArrayBindingOrAssignmentElement(y))}else u=lr(u,p);else{if(dl(p))continue;if(eO(p)){if(g===c-1){const y=e.context.factory.createArraySliceCall(i,g);c3(e,p,y,p)}}else{const y=e.context.factory.createElementAccessExpression(i,g);c3(e,p,y,p)}}}if(u&&e.emitBindingOrAssignment(e.createArrayBindingOrAssignmentPattern(u),i,s,r),f)for(const[g,p]of f)c3(e,p,g,p)}function L2e(e){const t=ey(e);if(!t||dl(t))return!0;const r=tO(e);if(r&&!wd(r))return!1;const i=dw(e);return i&&!jd(i)?!1:kP(t)?qi(xC(t),L2e):Ie(t)}function tLe(e,t,r,i){return t=XT(e,t,!0,i),e.context.factory.createConditionalExpression(e.context.factory.createTypeCheck(t,"undefined"),void 0,r,void 0,t)}function rLe(e,t,r){const{factory:i}=e.context;if(xa(r)){const s=XT(e,E.checkDefined(He(r.expression,e.visitor,ct)),!1,r);return e.context.factory.createElementAccessExpression(t,s)}else if(_f(r)){const s=i.cloneNode(r);return e.context.factory.createElementAccessExpression(t,s)}else{const s=e.context.factory.createIdentifier(an(r));return e.context.factory.createPropertyAccessExpression(t,s)}}function XT(e,t,r,i){if(Ie(t)&&r)return t;{const s=e.context.factory.createTempVariable(void 0);return e.hoistTempVariables?(e.context.hoistVariableDeclaration(s),e.emitExpression(tt(e.context.factory.createAssignment(s,t),i))):e.emitBindingOrAssignment(s,t,i,void 0),s}}function nLe(e,t){return E.assertEachNode(t,hI),e.createArrayBindingPattern(t)}function iLe(e,t){return E.assertEachNode(t,EP),e.createArrayLiteralExpression(Yt(t,e.converters.convertToArrayAssignmentElement))}function sLe(e,t){return E.assertEachNode(t,Pa),e.createObjectBindingPattern(t)}function aLe(e,t){return E.assertEachNode(t,CP),e.createObjectLiteralExpression(Yt(t,e.converters.convertToObjectAssignmentElement))}function oLe(e,t){return e.createBindingElement(void 0,void 0,t)}function cLe(e){return e}var mV,lLe=Nt({"src/compiler/transformers/destructuring.ts"(){"use strict";Ns(),mV=(e=>(e[e.All=0]="All",e[e.ObjectRest=1]="ObjectRest",e))(mV||{})}});function Yie(e,t,r=e.createThis()){const i=e.createAssignment(t,r),s=e.createExpressionStatement(i),o=e.createBlock([s],!1),c=e.createClassStaticBlockDeclaration(o);return nu(c).classThis=t,c}function l3(e){var t;if(!Go(e)||e.body.statements.length!==1)return!1;const r=e.body.statements[0];return kl(r)&&sl(r.expression,!0)&&Ie(r.expression.left)&&((t=e.emitNode)==null?void 0:t.classThis)===r.expression.left&&r.expression.right.kind===110}function gV(e){var t;return!!((t=e.emitNode)!=null&&t.classThis)&&ut(e.members,l3)}function Zie(e,t,r,i){if(gV(t))return t;const s=Yie(e,r,i);t.name&&ya(s.body.statements[0],t.name);const o=e.createNodeArray([s,...t.members]);tt(o,t.members);const c=Vc(t)?e.updateClassDeclaration(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,o):e.updateClassExpression(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,o);return nu(c).classThis=r,c}var uLe=Nt({"src/compiler/transformers/classThis.ts"(){"use strict";Ns()}});function u3(e,t,r){const i=Zo(bc(r));return(Vc(i)||Zc(i))&&!i.name&&In(i,2048)?e.createStringLiteral("default"):e.createStringLiteralFromNode(t)}function M2e(e,t,r){const{factory:i}=e;if(r!==void 0)return{assignedName:i.createStringLiteral(r),name:t};if(wd(t)||Ti(t))return{assignedName:i.createStringLiteralFromNode(t),name:t};if(wd(t.expression)&&!Ie(t.expression))return{assignedName:i.createStringLiteralFromNode(t.expression),name:t};const s=i.getGeneratedNameForNode(t);e.hoistVariableDeclaration(s);const o=e.getEmitHelperFactory().createPropKeyHelper(t.expression),c=i.createAssignment(s,o),u=i.updateComputedPropertyName(t,c);return{assignedName:s,name:u}}function Kie(e,t,r=e.factory.createThis()){const{factory:i}=e,s=e.getEmitHelperFactory().createSetFunctionNameHelper(r,t),o=i.createExpressionStatement(s),c=i.createBlock([o],!1),u=i.createClassStaticBlockDeclaration(c);return nu(u).assignedName=t,u}function QT(e){var t;if(!Go(e)||e.body.statements.length!==1)return!1;const r=e.body.statements[0];return kl(r)&&IE(r.expression,"___setFunctionName")&&r.expression.arguments.length>=2&&r.expression.arguments[1]===((t=e.emitNode)==null?void 0:t.assignedName)}function WO(e){var t;return!!((t=e.emitNode)!=null&&t.assignedName)&&ut(e.members,QT)}function hV(e){return!!e.name||WO(e)}function UO(e,t,r,i){if(WO(t))return t;const{factory:s}=e,o=Kie(e,r,i);t.name&&ya(o.body.statements[0],t.name);const c=Dc(t.members,l3)+1,u=t.members.slice(0,c),f=t.members.slice(c),g=s.createNodeArray([...u,o,...f]);return tt(g,t.members),t=Vc(t)?s.updateClassDeclaration(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,g):s.updateClassExpression(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,g),nu(t).assignedName=r,t}function OC(e,t,r,i){if(i&&ra(r)&&qJ(r))return t;const{factory:s}=e,o=bc(t),c=Nl(o)?Ms(UO(e,o,r),Nl):e.getEmitHelperFactory().createSetFunctionNameHelper(o,r);return s.restoreOuterExpressions(t,c)}function _Le(e,t,r,i){const{factory:s}=e,{assignedName:o,name:c}=M2e(e,t.name,i),u=OC(e,t.initializer,o,r);return s.updatePropertyAssignment(t,c,u)}function fLe(e,t,r,i){const{factory:s}=e,o=i!==void 0?s.createStringLiteral(i):u3(s,t.name,t.objectAssignmentInitializer),c=OC(e,t.objectAssignmentInitializer,o,r);return s.updateShorthandPropertyAssignment(t,t.name,c)}function pLe(e,t,r,i){const{factory:s}=e,o=i!==void 0?s.createStringLiteral(i):u3(s,t.name,t.initializer),c=OC(e,t.initializer,o,r);return s.updateVariableDeclaration(t,t.name,t.exclamationToken,t.type,c)}function dLe(e,t,r,i){const{factory:s}=e,o=i!==void 0?s.createStringLiteral(i):u3(s,t.name,t.initializer),c=OC(e,t.initializer,o,r);return s.updateParameterDeclaration(t,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,t.type,c)}function mLe(e,t,r,i){const{factory:s}=e,o=i!==void 0?s.createStringLiteral(i):u3(s,t.name,t.initializer),c=OC(e,t.initializer,o,r);return s.updateBindingElement(t,t.dotDotDotToken,t.propertyName,t.name,c)}function gLe(e,t,r,i){const{factory:s}=e,{assignedName:o,name:c}=M2e(e,t.name,i),u=OC(e,t.initializer,o,r);return s.updatePropertyDeclaration(t,t.modifiers,c,t.questionToken??t.exclamationToken,t.type,u)}function hLe(e,t,r,i){const{factory:s}=e,o=i!==void 0?s.createStringLiteral(i):u3(s,t.left,t.right),c=OC(e,t.right,o,r);return s.updateBinaryExpression(t,t.left,t.operatorToken,c)}function yLe(e,t,r,i){const{factory:s}=e,o=i!==void 0?s.createStringLiteral(i):s.createStringLiteral(t.isExportEquals?"":"default"),c=OC(e,t.expression,o,r);return s.updateExportAssignment(t,t.modifiers,c)}function I_(e,t,r,i){switch(t.kind){case 303:return _Le(e,t,r,i);case 304:return fLe(e,t,r,i);case 260:return pLe(e,t,r,i);case 169:return dLe(e,t,r,i);case 208:return mLe(e,t,r,i);case 172:return gLe(e,t,r,i);case 226:return hLe(e,t,r,i);case 277:return yLe(e,t,r,i)}}var vLe=Nt({"src/compiler/transformers/namedEvaluation.ts"(){"use strict";Ns()}});function yV(e,t,r,i,s,o){const c=He(t.tag,r,ct);E.assert(c);const u=[void 0],f=[],g=[],p=t.template;if(o===0&&!dz(p))return sr(t,r,e);const{factory:y}=e;if(PT(p))f.push(ese(y,p)),g.push(tse(y,p,i));else{f.push(ese(y,p.head)),g.push(tse(y,p.head,i));for(const T of p.templateSpans)f.push(ese(y,T.literal)),g.push(tse(y,T.literal,i)),u.push(E.checkDefined(He(T.expression,r,ct)))}const S=e.getEmitHelperFactory().createTemplateObjectHelper(y.createArrayLiteralExpression(f),y.createArrayLiteralExpression(g));if(Nc(i)){const T=y.createUniqueName("templateObject");s(T),u[0]=y.createLogicalOr(T,y.createAssignment(T,S))}else u[0]=S;return y.createCallExpression(c,void 0,u)}function ese(e,t){return t.templateFlags&26656?e.createVoidZero():e.createStringLiteral(t.text)}function tse(e,t,r){let i=t.rawText;if(i===void 0){E.assertIsDefined(r,"Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."),i=Tv(r,t);const s=t.kind===15||t.kind===18;i=i.substring(1,i.length-(s?1:2))}return i=i.replace(/\r\n?/g,` +`),tt(e.createStringLiteral(i),t)}var vV,bLe=Nt({"src/compiler/transformers/taggedTemplate.ts"(){"use strict";Ns(),vV=(e=>(e[e.LiftRestriction=0]="LiftRestriction",e[e.All=1]="All",e))(vV||{})}});function rse(e){const{factory:t,getEmitHelperFactory:r,startLexicalEnvironment:i,resumeLexicalEnvironment:s,endLexicalEnvironment:o,hoistVariableDeclaration:c}=e,u=e.getEmitResolver(),f=e.getCompilerOptions(),g=Da(f),p=Ul(f),y=!!f.experimentalDecorators,S=f.emitDecoratorMetadata?ise(e):void 0,T=e.onEmitNode,C=e.onSubstituteNode;e.onEmitNode=Hp,e.onSubstituteNode=Fc,e.enableSubstitution(211),e.enableSubstitution(212);let w,D,O,z,W,X,J,ie;return B;function B(A){return A.kind===313?Y(A):ae(A)}function Y(A){return t.createBundle(A.sourceFiles.map(ae),Ii(A.prepends,Pe=>Pe.kind===315?vW(Pe,"js"):Pe))}function ae(A){if(A.isDeclarationFile)return A;w=A;const Pe=_e(A,Oe);return Yg(Pe,e.readEmitHelpers()),w=void 0,Pe}function _e(A,Pe){const qe=z,Tt=W,dr=X;$(A);const En=Pe(A);return z!==qe&&(W=Tt),z=qe,X=dr,En}function $(A){switch(A.kind){case 312:case 269:case 268:case 241:z=A,W=void 0;break;case 263:case 262:if(In(A,128))break;A.name?ue(A):E.assert(A.kind===263||In(A,2048));break}}function H(A){return _e(A,K)}function K(A){return A.transformFlags&1?me(A):A}function oe(A){return _e(A,Se)}function Se(A){switch(A.kind){case 272:case 271:case 277:case 278:return se(A);default:return K(A)}}function se(A){if(ss(A)!==A)return A.transformFlags&1?sr(A,H,e):A;switch(A.kind){case 272:return Wt(A);case 271:return ia(A);case 277:return On(A);case 278:return Ln(A);default:E.fail("Unhandled ellided statement")}}function Z(A){return _e(A,ve)}function ve(A){if(!(A.kind===278||A.kind===272||A.kind===273||A.kind===271&&A.moduleReference.kind===283))return A.transformFlags&1||In(A,32)?me(A):A}function Te(A){return Pe=>_e(Pe,qe=>Me(qe,A))}function Me(A,Pe){switch(A.kind){case 176:return Tr(A);case 172:return yr(A,Pe);case 177:return Qs(A,Pe);case 178:return Ds(A,Pe);case 174:return Di(A,Pe);case 175:return sr(A,H,e);case 240:return A;case 181:return;default:return E.failBadSyntaxKind(A)}}function ke(A){return Pe=>_e(Pe,qe=>he(qe,A))}function he(A,Pe){switch(A.kind){case 303:case 304:case 305:return H(A);case 177:return Qs(A,Pe);case 178:return Ds(A,Pe);case 174:return Di(A,Pe);default:return E.failBadSyntaxKind(A)}}function be(A){return ql(A)?void 0:H(A)}function lt(A){return Ys(A)?void 0:H(A)}function pt(A){if(!ql(A)&&!(mT(A.kind)&28895)&&!(D&&A.kind===95))return A}function me(A){if(Ci(A)&&In(A,128))return t.createNotEmittedStatement(A);switch(A.kind){case 95:case 90:return D?void 0:A;case 125:case 123:case 124:case 128:case 164:case 87:case 138:case 148:case 103:case 147:case 188:case 189:case 190:case 191:case 187:case 182:case 168:case 133:case 159:case 136:case 154:case 150:case 146:case 116:case 155:case 185:case 184:case 186:case 183:case 192:case 193:case 194:case 196:case 197:case 198:case 199:case 200:case 201:case 181:return;case 265:return t.createNotEmittedStatement(A);case 270:return;case 264:return t.createNotEmittedStatement(A);case 263:return ot(A);case 231:return Bt(A);case 298:return ur(A);case 233:return Dr(A);case 210:return Xe(A);case 176:case 172:case 174:case 177:case 178:case 175:return E.fail("Class and object literal elements must be visited with their respective visitors");case 262:return Ce(A);case 218:return Ue(A);case 219:return rt(A);case 169:return ft(A);case 217:return Be(A);case 216:case 234:return gt(A);case 238:return ht(A);case 213:return Dt(A);case 214:return Re(A);case 215:return st(A);case 235:return G(A);case 266:return or(A);case 243:return dt(A);case 260:return we(A);case 267:return Fe(A);case 271:return ia(A);case 285:return Ct(A);case 286:return Qt(A);default:return sr(A,H,e)}}function Oe(A){const Pe=fp(f,"alwaysStrict")&&!(Nc(A)&&p>=5)&&!ap(A);return t.updateSourceFile(A,FO(A.statements,oe,e,0,Pe))}function Xe(A){return t.updateObjectLiteralExpression(A,kr(A.properties,ke(A),qg))}function it(A){let Pe=0;ut(_V(A,!0,!0))&&(Pe|=1);const qe=Pd(A);return qe&&bc(qe.expression).kind!==106&&(Pe|=64),Mh(y,A)&&(Pe|=2),V4(y,A)&&(Pe|=4),Is(A)?Pe|=8:os(A)?Pe|=32:Tc(A)&&(Pe|=16),Pe}function mt(A){return!!(A.transformFlags&8192)}function Je(A){return Of(A)||ut(A.typeParameters)||ut(A.heritageClauses,mt)||ut(A.members,mt)}function ot(A){const Pe=it(A),qe=g<=1&&!!(Pe&7);if(!Je(A)&&!Mh(y,A)&&!Is(A))return t.updateClassDeclaration(A,kr(A.modifiers,pt,Ys),A.name,void 0,kr(A.heritageClauses,H,Q_),kr(A.members,Te(A),Pl));qe&&e.startLexicalEnvironment();const Tt=qe||Pe&8;let dr=Tt?kr(A.modifiers,lt,Do):kr(A.modifiers,H,Do);Pe&2&&(dr=br(dr,A));const $r=Tt&&!A.name||Pe&4||Pe&1?A.name??t.getGeneratedNameForNode(A):A.name,yn=t.updateClassDeclaration(A,dr,$r,void 0,kr(A.heritageClauses,H,Q_),Ht(A));let li=da(A);Pe&1&&(li|=64),Vr(yn,li);let Tn;if(qe){const va=[yn],lc=wz(la(w.text,A.members.end),20),tl=t.getInternalName(A),no=t.createPartiallyEmittedExpression(tl);eC(no,lc.end),Vr(no,3072);const rl=t.createReturnStatement(no);SE(rl,lc.pos),Vr(rl,3840),va.push(rl),vm(va,e.endLexicalEnvironment());const Xa=t.createImmediatelyInvokedArrowFunction(va);$8(Xa,1);const hl=t.createVariableDeclaration(t.getLocalName(A,!1,!1),void 0,void 0,Xa);rn(hl,A);const $u=t.createVariableStatement(void 0,t.createVariableDeclarationList([hl],1));rn($u,A),Ac($u,A),ya($u,Wh(A)),Ru($u),Tn=$u}else Tn=yn;if(Tt){if(Pe&8)return[Tn,Ga(A)];if(Pe&32)return[Tn,t.createExportDefault(t.getLocalName(A,!1,!0))];if(Pe&16)return[Tn,t.createExternalModuleExport(t.getDeclarationName(A,!1,!0))]}return Tn}function Bt(A){let Pe=kr(A.modifiers,lt,Do);return Mh(y,A)&&(Pe=br(Pe,A)),t.updateClassExpression(A,Pe,A.name,void 0,kr(A.heritageClauses,H,Q_),Ht(A))}function Ht(A){const Pe=kr(A.members,Te(A),Pl);let qe;const Tt=cg(A),dr=Tt&&wn(Tt.parameters,En=>E_(En,Tt));if(dr)for(const En of dr){const $r=t.createPropertyDeclaration(void 0,En.name,void 0,void 0,void 0);rn($r,En),qe=lr(qe,$r)}return qe?(qe=Dn(qe,Pe),tt(t.createNodeArray(qe),A.members)):Pe}function br(A,Pe){const qe=ar(Pe,Pe);if(ut(qe)){const Tt=[];Dn(Tt,I7(A,mw)),Dn(Tt,wn(A,ql)),Dn(Tt,qe),Dn(Tt,wn(tK(A,mw),Ys)),A=tt(t.createNodeArray(Tt),A)}return A}function zr(A,Pe,qe){if(Qn(qe)&&VJ(y,Pe,qe)){const Tt=ar(Pe,qe);if(ut(Tt)){const dr=[];Dn(dr,wn(A,ql)),Dn(dr,Tt),Dn(dr,wn(A,Ys)),A=tt(t.createNodeArray(dr),A)}}return A}function ar(A,Pe){if(y)return R2e?It(A,Pe):Jt(A,Pe)}function Jt(A,Pe){if(S){let qe;if(Nn(A)){const Tt=r().createMetadataHelper("design:type",S.serializeTypeOfNode({currentLexicalScope:z,currentNameScope:Pe},A));qe=lr(qe,t.createDecorator(Tt))}if(ei(A)){const Tt=r().createMetadataHelper("design:paramtypes",S.serializeParameterTypesOfNode({currentLexicalScope:z,currentNameScope:Pe},A,Pe));qe=lr(qe,t.createDecorator(Tt))}if(Fi(A)){const Tt=r().createMetadataHelper("design:returntype",S.serializeReturnTypeOfNode({currentLexicalScope:z,currentNameScope:Pe},A));qe=lr(qe,t.createDecorator(Tt))}return qe}}function It(A,Pe){if(S){let qe;if(Nn(A)){const Tt=t.createPropertyAssignment("type",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),S.serializeTypeOfNode({currentLexicalScope:z,currentNameScope:Pe},A)));qe=lr(qe,Tt)}if(ei(A)){const Tt=t.createPropertyAssignment("paramTypes",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),S.serializeParameterTypesOfNode({currentLexicalScope:z,currentNameScope:Pe},A,Pe)));qe=lr(qe,Tt)}if(Fi(A)){const Tt=t.createPropertyAssignment("returnType",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),S.serializeReturnTypeOfNode({currentLexicalScope:z,currentNameScope:Pe},A)));qe=lr(qe,Tt)}if(qe){const Tt=r().createMetadataHelper("design:typeinfo",t.createObjectLiteralExpression(qe,!0));return[t.createDecorator(Tt)]}}}function Nn(A){const Pe=A.kind;return Pe===174||Pe===177||Pe===178||Pe===172}function Fi(A){return A.kind===174}function ei(A){switch(A.kind){case 263:case 231:return cg(A)!==void 0;case 174:case 177:case 178:return!0}return!1}function zi(A,Pe){const qe=A.name;return Ti(qe)?t.createIdentifier(""):xa(qe)?Pe&&!jd(qe.expression)?t.getGeneratedNameForNode(qe):qe.expression:Ie(qe)?t.createStringLiteral(an(qe)):t.cloneNode(qe)}function Qe(A){const Pe=A.name;if(xa(Pe)&&(!Uc(A)&&X||Of(A)&&y)){const qe=He(Pe.expression,H,ct);E.assert(qe);const Tt=Fp(qe);if(!jd(Tt)){const dr=t.getGeneratedNameForNode(Pe);return c(dr),t.updateComputedPropertyName(Pe,t.createAssignment(dr,qe))}}return E.checkDefined(He(Pe,H,wc))}function ur(A){if(A.token!==119)return sr(A,H,e)}function Dr(A){return t.updateExpressionWithTypeArguments(A,E.checkDefined(He(A.expression,H,m_)),void 0)}function Ft(A){return!sc(A.body)}function yr(A,Pe){const qe=A.flags&33554432||In(A,64);if(qe&&!(y&&Of(A)))return;let Tt=Qn(Pe)?qe?kr(A.modifiers,lt,Do):kr(A.modifiers,H,Do):kr(A.modifiers,be,Do);return Tt=zr(Tt,A,Pe),qe?t.updatePropertyDeclaration(A,Xi(Tt,t.createModifiersFromModifierFlags(128)),E.checkDefined(He(A.name,H,wc)),void 0,void 0,void 0):t.updatePropertyDeclaration(A,Tt,Qe(A),void 0,void 0,He(A.initializer,H,ct))}function Tr(A){if(Ft(A))return t.updateConstructorDeclaration(A,void 0,Sc(A.parameters,H,e),Pi(A.body,A))}function Xr(A,Pe,qe,Tt,dr,En){const $r=Tt[dr],yn=Pe[$r];if(Dn(A,kr(Pe,H,Ci,qe,$r-qe)),Ab(yn)){const li=[];Xr(li,yn.tryBlock.statements,0,Tt,dr+1,En);const Tn=t.createNodeArray(li);tt(Tn,yn.tryBlock.statements),A.push(t.updateTryStatement(yn,t.updateBlock(yn.tryBlock,li),He(yn.catchClause,H,Gv),He(yn.finallyBlock,H,Ss)))}else Dn(A,kr(Pe,H,Ci,$r,1)),Dn(A,En);Dn(A,kr(Pe,H,Ci,$r+1))}function Pi(A,Pe){const qe=Pe&&wn(Pe.parameters,li=>E_(li,Pe));if(!ut(qe))return gf(A,H,e);let Tt=[];s();const dr=t.copyPrologue(A.statements,Tt,!1,H),En=BO(A.statements,dr),$r=Ii(qe,ji);En.length?Xr(Tt,A.statements,dr,En,0,$r):(Dn(Tt,$r),Dn(Tt,kr(A.statements,H,Ci,dr))),Tt=t.mergeLexicalEnvironment(Tt,o());const yn=t.createBlock(tt(t.createNodeArray(Tt),A.statements),!0);return tt(yn,A),rn(yn,A),yn}function ji(A){const Pe=A.name;if(!Ie(Pe))return;const qe=ga(tt(t.cloneNode(Pe),Pe),Pe.parent);Vr(qe,3168);const Tt=ga(tt(t.cloneNode(Pe),Pe),Pe.parent);return Vr(Tt,3072),Ru(G8(tt(rn(t.createExpressionStatement(t.createAssignment(tt(t.createPropertyAccessExpression(t.createThis(),qe),A.name),Tt)),A),i1(A,-1))))}function Di(A,Pe){if(!(A.transformFlags&1))return A;if(!Ft(A))return;let qe=Qn(Pe)?kr(A.modifiers,H,Do):kr(A.modifiers,be,Do);return qe=zr(qe,A,Pe),t.updateMethodDeclaration(A,qe,A.asteriskToken,Qe(A),void 0,void 0,Sc(A.parameters,H,e),void 0,gf(A.body,H,e))}function $i(A){return!(sc(A.body)&&In(A,64))}function Qs(A,Pe){if(!(A.transformFlags&1))return A;if(!$i(A))return;let qe=Qn(Pe)?kr(A.modifiers,H,Do):kr(A.modifiers,be,Do);return qe=zr(qe,A,Pe),t.updateGetAccessorDeclaration(A,qe,Qe(A),Sc(A.parameters,H,e),void 0,gf(A.body,H,e)||t.createBlock([]))}function Ds(A,Pe){if(!(A.transformFlags&1))return A;if(!$i(A))return;let qe=Qn(Pe)?kr(A.modifiers,H,Do):kr(A.modifiers,be,Do);return qe=zr(qe,A,Pe),t.updateSetAccessorDeclaration(A,qe,Qe(A),Sc(A.parameters,H,e),gf(A.body,H,e)||t.createBlock([]))}function Ce(A){if(!Ft(A))return t.createNotEmittedStatement(A);const Pe=t.updateFunctionDeclaration(A,kr(A.modifiers,pt,Ys),A.asteriskToken,A.name,void 0,Sc(A.parameters,H,e),void 0,gf(A.body,H,e)||t.createBlock([]));if(Is(A)){const qe=[Pe];return rc(qe,A),qe}return Pe}function Ue(A){return Ft(A)?t.updateFunctionExpression(A,kr(A.modifiers,pt,Ys),A.asteriskToken,A.name,void 0,Sc(A.parameters,H,e),void 0,gf(A.body,H,e)||t.createBlock([])):t.createOmittedExpression()}function rt(A){return t.updateArrowFunction(A,kr(A.modifiers,pt,Ys),void 0,Sc(A.parameters,H,e),void 0,A.equalsGreaterThanToken,gf(A.body,H,e))}function ft(A){if(Ov(A))return;const Pe=t.updateParameterDeclaration(A,kr(A.modifiers,qe=>ql(qe)?H(qe):void 0,Do),A.dotDotDotToken,E.checkDefined(He(A.name,H,nb)),void 0,void 0,He(A.initializer,H,ct));return Pe!==A&&(Ac(Pe,A),tt(Pe,Id(A)),ya(Pe,Id(A)),Vr(Pe.name,64)),Pe}function dt(A){if(Is(A)){const Pe=_E(A.declarationList);return Pe.length===0?void 0:tt(t.createExpressionStatement(t.inlineExpressions(Yt(Pe,fe))),A)}else return sr(A,H,e)}function fe(A){const Pe=A.name;return As(Pe)?jb(A,H,e,0,!1,cl):tt(t.createAssignment(Ro(Pe),E.checkDefined(He(A.initializer,H,ct))),A)}function we(A){const Pe=t.updateVariableDeclaration(A,E.checkDefined(He(A.name,H,nb)),void 0,void 0,He(A.initializer,H,ct));return A.type&&zre(Pe.name,A.type),Pe}function Be(A){const Pe=bc(A.expression,-7);if(sb(Pe)){const qe=He(A.expression,H,ct);return E.assert(qe),t.createPartiallyEmittedExpression(qe,A)}return sr(A,H,e)}function gt(A){const Pe=He(A.expression,H,ct);return E.assert(Pe),t.createPartiallyEmittedExpression(Pe,A)}function G(A){const Pe=He(A.expression,H,m_);return E.assert(Pe),t.createPartiallyEmittedExpression(Pe,A)}function ht(A){const Pe=He(A.expression,H,ct);return E.assert(Pe),t.createPartiallyEmittedExpression(Pe,A)}function Dt(A){return t.updateCallExpression(A,E.checkDefined(He(A.expression,H,ct)),void 0,kr(A.arguments,H,ct))}function Re(A){return t.updateNewExpression(A,E.checkDefined(He(A.expression,H,ct)),void 0,kr(A.arguments,H,ct))}function st(A){return t.updateTaggedTemplateExpression(A,E.checkDefined(He(A.tag,H,ct)),void 0,E.checkDefined(He(A.template,H,bk)))}function Ct(A){return t.updateJsxSelfClosingElement(A,E.checkDefined(He(A.tagName,H,M4)),void 0,E.checkDefined(He(A.attributes,H,Hv)))}function Qt(A){return t.updateJsxOpeningElement(A,E.checkDefined(He(A.tagName,H,M4)),void 0,E.checkDefined(He(A.attributes,H,Hv)))}function er(A){return!Cv(A)||Sb(f)}function or(A){if(!er(A))return t.createNotEmittedStatement(A);const Pe=[];let qe=4;const Tt=Ve(Pe,A);Tt&&(p!==4||z!==w)&&(qe|=1024);const dr=hs(A),En=Ws(A),$r=Is(A)?t.getExternalModuleOrNamespaceExportName(O,A,!1,!0):t.getDeclarationName(A,!1,!0);let yn=t.createLogicalOr($r,t.createAssignment($r,t.createObjectLiteralExpression()));if(Is(A)){const Tn=t.getLocalName(A,!1,!0);yn=t.createAssignment(Tn,yn)}const li=t.createExpressionStatement(t.createCallExpression(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,dr)],void 0,U(A,En)),void 0,[yn]));return rn(li,A),Tt&&(l1(li,void 0),kT(li,void 0)),tt(li,A),Cm(li,qe),Pe.push(li),Pe}function U(A,Pe){const qe=O;O=Pe;const Tt=[];i();const dr=Yt(A.members,j);return vm(Tt,o()),Dn(Tt,dr),O=qe,t.createBlock(tt(t.createNodeArray(Tt),A.members),!0)}function j(A){const Pe=zi(A,!1),qe=ce(A),Tt=t.createAssignment(t.createElementAccessExpression(O,Pe),qe),dr=qe.kind===11?Tt:t.createAssignment(t.createElementAccessExpression(O,Tt),Pe);return tt(t.createExpressionStatement(tt(dr,A)),A)}function ce(A){const Pe=u.getConstantValue(A);return Pe!==void 0?typeof Pe=="string"?t.createStringLiteral(Pe):t.createNumericLiteral(Pe):(el(),A.initializer?E.checkDefined(He(A.initializer,H,ct)):t.createVoidZero())}function ee(A){const Pe=ss(A,vc);return Pe?eV(Pe,Sb(f)):!0}function ue(A){W||(W=new Map);const Pe=De(A);W.has(Pe)||W.set(Pe,A)}function M(A){if(W){const Pe=De(A);return W.get(Pe)===A}return!0}function De(A){return E.assertNode(A.name,Ie),A.name.escapedText}function Ve(A,Pe){const qe=t.createVariableDeclaration(t.getLocalName(Pe,!1,!0)),Tt=z.kind===312?0:1,dr=t.createVariableStatement(kr(Pe.modifiers,pt,Ys),t.createVariableDeclarationList([qe],Tt));return rn(qe,Pe),l1(qe,void 0),kT(qe,void 0),rn(dr,Pe),ue(Pe),M(Pe)?(Pe.kind===266?ya(dr.declarationList,Pe):ya(dr,Pe),Ac(dr,Pe),Cm(dr,2048),A.push(dr),!0):!1}function Fe(A){if(!ee(A))return t.createNotEmittedStatement(A);E.assertNode(A.name,Ie,"A TypeScript namespace should have an Identifier name."),yo();const Pe=[];let qe=4;const Tt=Ve(Pe,A);Tt&&(p!==4||z!==w)&&(qe|=1024);const dr=hs(A),En=Ws(A),$r=Is(A)?t.getExternalModuleOrNamespaceExportName(O,A,!1,!0):t.getDeclarationName(A,!1,!0);let yn=t.createLogicalOr($r,t.createAssignment($r,t.createObjectLiteralExpression()));if(Is(A)){const Tn=t.getLocalName(A,!1,!0);yn=t.createAssignment(Tn,yn)}const li=t.createExpressionStatement(t.createCallExpression(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,dr)],void 0,vt(A,En)),void 0,[yn]));return rn(li,A),Tt&&(l1(li,void 0),kT(li,void 0)),tt(li,A),Cm(li,qe),Pe.push(li),Pe}function vt(A,Pe){const qe=O,Tt=D,dr=W;O=Pe,D=A,W=void 0;const En=[];i();let $r,yn;if(A.body)if(A.body.kind===268)_e(A.body,Tn=>Dn(En,kr(Tn.statements,Z,Ci))),$r=A.body.statements,yn=A.body;else{const Tn=Fe(A.body);Tn&&(es(Tn)?Dn(En,Tn):En.push(Tn));const va=Lt(A).body;$r=i1(va.statements,-1)}vm(En,o()),O=qe,D=Tt,W=dr;const li=t.createBlock(tt(t.createNodeArray(En),$r),!0);return tt(li,yn),(!A.body||A.body.kind!==268)&&Vr(li,da(li)|3072),li}function Lt(A){if(A.body.kind===267)return Lt(A.body)||A.body}function Wt(A){if(!A.importClause)return A;if(A.importClause.isTypeOnly)return;const Pe=He(A.importClause,Lr,Em);return Pe||f.importsNotUsedAsValues===1||f.importsNotUsedAsValues===2?t.updateImportDeclaration(A,void 0,Pe,A.moduleSpecifier,A.attributes):void 0}function Lr(A){E.assert(!A.isTypeOnly);const Pe=xc(A)?A.name:void 0,qe=He(A.namedBindings,Zr,yJ);return Pe||qe?t.updateImportClause(A,!1,Pe,qe):void 0}function Zr(A){if(A.kind===274)return xc(A)?A:void 0;{const Pe=f.verbatimModuleSyntax||f.preserveValueImports&&(f.importsNotUsedAsValues===1||f.importsNotUsedAsValues===2),qe=kr(A.elements,gn,v_);return Pe||ut(qe)?t.updateNamedImports(A,qe):void 0}}function gn(A){return!A.isTypeOnly&&xc(A)?A:void 0}function On(A){return f.verbatimModuleSyntax||u.isValueAliasDeclaration(A)?sr(A,H,e):void 0}function Ln(A){if(A.isTypeOnly)return;if(!A.exportClause||Dm(A.exportClause))return A;const Pe=f.verbatimModuleSyntax||!!A.moduleSpecifier&&(f.importsNotUsedAsValues===1||f.importsNotUsedAsValues===2),qe=He(A.exportClause,Tt=>Ki(Tt,Pe),aJ);return qe?t.updateExportDeclaration(A,void 0,A.isTypeOnly,qe,A.moduleSpecifier,A.attributes):void 0}function Ni(A,Pe){const qe=kr(A.elements,wr,vu);return Pe||ut(qe)?t.updateNamedExports(A,qe):void 0}function Cn(A){return t.updateNamespaceExport(A,E.checkDefined(He(A.name,H,Ie)))}function Ki(A,Pe){return Dm(A)?Cn(A):Ni(A,Pe)}function wr(A){return!A.isTypeOnly&&(f.verbatimModuleSyntax||u.isValueAliasDeclaration(A))?A:void 0}function _i(A){return xc(A)||!Nc(w)&&u.isTopLevelValueImportEqualsWithEntityName(A)}function ia(A){if(A.isTypeOnly)return;if(Ky(A)){const qe=xc(A);return!qe&&f.importsNotUsedAsValues===1?rn(tt(t.createImportDeclaration(void 0,void 0,A.moduleReference.expression,void 0),A),A):qe?sr(A,H,e):void 0}if(!_i(A))return;const Pe=uw(t,A.moduleReference);return Vr(Pe,7168),Tc(A)||!Is(A)?rn(tt(t.createVariableStatement(kr(A.modifiers,pt,Ys),t.createVariableDeclarationList([rn(t.createVariableDeclaration(A.name,void 0,void 0,Pe),A)])),A),A):rn(Vo(A.name,Pe,A),A)}function Is(A){return D!==void 0&&In(A,32)}function Cr(A){return D===void 0&&In(A,32)}function Tc(A){return Cr(A)&&!In(A,2048)}function os(A){return Cr(A)&&In(A,2048)}function Ga(A){const Pe=t.createAssignment(t.getExternalModuleOrNamespaceExportName(O,A,!1,!0),t.getLocalName(A));ya(Pe,Lf(A.name?A.name.pos:A.pos,A.end));const qe=t.createExpressionStatement(Pe);return ya(qe,Lf(-1,A.end)),qe}function rc(A,Pe){A.push(Ga(Pe))}function Vo(A,Pe,qe){return tt(t.createExpressionStatement(t.createAssignment(t.getNamespaceMemberName(O,A,!1,!0),Pe)),qe)}function cl(A,Pe,qe){return tt(t.createAssignment(Ro(A),Pe),qe)}function Ro(A){return t.getNamespaceMemberName(O,A,!1,!0)}function hs(A){const Pe=t.getGeneratedNameForNode(A);return ya(Pe,A.name),Pe}function Ws(A){return t.getGeneratedNameForNode(A)}function el(){J&8||(J|=8,e.enableSubstitution(80))}function yo(){J&2||(J|=2,e.enableSubstitution(80),e.enableSubstitution(304),e.enableEmitNotification(267))}function Us(A){return Zo(A).kind===267}function Ic(A){return Zo(A).kind===266}function Hp(A,Pe,qe){const Tt=ie,dr=w;Ai(Pe)&&(w=Pe),J&2&&Us(Pe)&&(ie|=2),J&8&&Ic(Pe)&&(ie|=8),T(A,Pe,qe),ie=Tt,w=dr}function Fc(A,Pe){return Pe=C(A,Pe),A===1?Ao(Pe):Y_(Pe)?$o(Pe):Pe}function $o(A){if(J&2){const Pe=A.name,qe=qt(Pe);if(qe){if(A.objectAssignmentInitializer){const Tt=t.createAssignment(qe,A.objectAssignmentInitializer);return tt(t.createPropertyAssignment(Pe,Tt),A)}return tt(t.createPropertyAssignment(Pe,qe),A)}}return A}function Ao(A){switch(A.kind){case 80:return rs(A);case 211:return No(A);case 212:return $c(A)}return A}function rs(A){return qt(A)||A}function qt(A){if(J&ie&&!Eo(A)&&!eh(A)){const Pe=u.getReferencedExportContainer(A,!1);if(Pe&&Pe.kind!==312&&(ie&2&&Pe.kind===267||ie&8&&Pe.kind===266))return tt(t.createPropertyAccessExpression(t.getGeneratedNameForNode(Pe),A),A)}}function No(A){return u_(A)}function $c(A){return u_(A)}function ju(A){return A.replace(/\*\//g,"*_/")}function u_(A){const Pe=vo(A);if(Pe!==void 0){Bre(A,Pe);const qe=typeof Pe=="string"?t.createStringLiteral(Pe):Pe<0?t.createPrefixUnaryExpression(41,t.createNumericLiteral(Math.abs(Pe))):t.createNumericLiteral(Pe);if(!f.removeComments){const Tt=Zo(A,co);iF(qe,3,` ${ju(Wc(Tt))} `)}return qe}return A}function vo(A){if(!nd(f))return bn(A)||mo(A)?u.getConstantValue(A):void 0}function xc(A){return f.verbatimModuleSyntax||Hr(A)||(f.preserveValueImports?u.isValueAliasDeclaration(A):u.isReferencedAliasDeclaration(A))}}var R2e,SLe=Nt({"src/compiler/transformers/ts.ts"(){"use strict";Ns(),R2e=!1}});function nse(e){const{factory:t,getEmitHelperFactory:r,hoistVariableDeclaration:i,endLexicalEnvironment:s,startLexicalEnvironment:o,resumeLexicalEnvironment:c,addBlockScopedVariable:u}=e,f=e.getEmitResolver(),g=e.getCompilerOptions(),p=Da(g),y=A8(g),S=!!g.experimentalDecorators,T=!y,C=y&&p<9,w=T||C,D=p<9,O=p<99?-1:y?0:3,z=p<9,W=z&&p>=2,X=w||D||O===-1,J=e.onSubstituteNode;e.onSubstituteNode=$c;const ie=e.onEmitNode;e.onEmitNode=No;let B=!1,Y,ae,_e,$,H;const K=new Map,oe=new Set;let Se,se,Z=!1,ve=!1;return Up(e,Te);function Te(A){if(A.isDeclarationFile||(H=void 0,B=!!(Op(A)&32),!X&&!B))return A;const Pe=sr(A,ke,e);return Yg(Pe,e.readEmitHelpers()),Pe}function Me(A){switch(A.kind){case 129:return Tr()?void 0:A;default:return Jn(A,Ys)}}function ke(A){if(!(A.transformFlags&16777216)&&!(A.transformFlags&134234112))return A;switch(A.kind){case 129:return E.fail("Use `modifierVisitor` instead.");case 263:return er(A);case 231:return U(A);case 175:case 172:return E.fail("Use `classElementVisitor` instead.");case 303:return Je(A);case 243:return ot(A);case 260:return Bt(A);case 169:return Ht(A);case 208:return br(A);case 277:return zr(A);case 81:return it(A);case 211:return Qs(A);case 212:return Ds(A);case 224:case 225:return Ce(A,!1);case 226:return gt(A,!1);case 217:return ht(A,!1);case 213:return dt(A);case 244:return rt(A);case 215:return fe(A);case 248:return Ue(A);case 110:return ee(A);case 262:case 218:return ei(void 0,he,A);case 176:case 174:case 177:case 178:return ei(A,he,A);default:return he(A)}}function he(A){return sr(A,ke,e)}function be(A){switch(A.kind){case 224:case 225:return Ce(A,!0);case 226:return gt(A,!0);case 361:return G(A,!0);case 217:return ht(A,!0);default:return ke(A)}}function lt(A){switch(A.kind){case 298:return sr(A,lt,e);case 233:return Ct(A);default:return ke(A)}}function pt(A){switch(A.kind){case 210:case 209:return qt(A);default:return ke(A)}}function me(A){switch(A.kind){case 176:return ei(A,It,A);case 177:case 178:case 174:return ei(A,Fi,A);case 172:return ei(A,Xr,A);case 175:return ei(A,ce,A);case 167:return Jt(A);case 240:return A;default:return Do(A)?Me(A):ke(A)}}function Oe(A){switch(A.kind){case 167:return Jt(A);default:return ke(A)}}function Xe(A){switch(A.kind){case 172:return yr(A);case 177:case 178:return me(A);default:E.assertMissingNode(A,"Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");break}}function it(A){return!D||Ci(A.parent)?A:rn(t.createIdentifier(""),A)}function mt(A){const Pe=Ws(A.left);if(Pe){const qe=He(A.right,ke,ct);return rn(r().createClassPrivateFieldInHelper(Pe.brandCheckIdentifier,qe),A)}return sr(A,ke,e)}function Je(A){return P_(A,Be)&&(A=I_(e,A)),sr(A,ke,e)}function ot(A){const Pe=$;$=[];const qe=sr(A,ke,e),Tt=ut($)?[qe,...$]:qe;return $=Pe,Tt}function Bt(A){return P_(A,Be)&&(A=I_(e,A)),sr(A,ke,e)}function Ht(A){return P_(A,Be)&&(A=I_(e,A)),sr(A,ke,e)}function br(A){return P_(A,Be)&&(A=I_(e,A)),sr(A,ke,e)}function zr(A){return P_(A,Be)&&(A=I_(e,A,!0,A.isExportEquals?"":"default")),sr(A,ke,e)}function ar(A){return ut(_e)&&(y_(A)?(_e.push(A.expression),A=t.updateParenthesizedExpression(A,t.inlineExpressions(_e))):(_e.push(A),A=t.inlineExpressions(_e)),_e=void 0),A}function Jt(A){const Pe=He(A.expression,ke,ct);return t.updateComputedPropertyName(A,ar(Pe))}function It(A){return Se?De(A,Se):he(A)}function Nn(A){return!!(D||Uc(A)&&Op(A)&32)}function Fi(A){if(E.assert(!Of(A)),!Nu(A)||!Nn(A))return sr(A,me,e);const Pe=Ws(A.name);if(E.assert(Pe,"Undeclared private name for property declaration."),!Pe.isValid)return A;const qe=zi(A);qe&&Is().push(t.createAssignment(qe,t.createFunctionExpression(wn(A.modifiers,Tt=>Ys(Tt)&&!AT(Tt)&&!tne(Tt)),A.asteriskToken,qe,void 0,Sc(A.parameters,ke,e),void 0,gf(A.body,ke,e))))}function ei(A,Pe,qe){if(A!==se){const Tt=se;se=A;const dr=Pe(qe);return se=Tt,dr}return Pe(qe)}function zi(A){E.assert(Ti(A.name));const Pe=Ws(A.name);if(E.assert(Pe,"Undeclared private name for property declaration."),Pe.kind==="m")return Pe.methodName;if(Pe.kind==="a"){if(B0(A))return Pe.getterName;if(Lh(A))return Pe.setterName}}function Qe(){const A=_i(),Pe=A.classThis??A.classConstructor??Se?.name;return E.checkDefined(Pe)}function ur(A){const Pe=Fd(A),qe=c1(A),Tt=A.name;let dr=Tt,En=Tt;if(xa(Tt)&&!jd(Tt.expression)){const tl=nO(Tt);if(tl)dr=t.updateComputedPropertyName(Tt,He(Tt.expression,ke,ct)),En=t.updateComputedPropertyName(Tt,tl.left);else{const no=t.createTempVariable(i);ya(no,Tt.expression);const rl=He(Tt.expression,ke,ct),Xa=t.createAssignment(no,rl);ya(Xa,Tt.expression),dr=t.updateComputedPropertyName(Tt,Xa),En=t.updateComputedPropertyName(Tt,no)}}const $r=kr(A.modifiers,Me,Ys),yn=aU(t,A,$r,A.initializer);rn(yn,A),Vr(yn,3072),ya(yn,qe);const li=Ls(A)?Qe():t.createThis(),Tn=jne(t,A,$r,dr,li);rn(Tn,A),Ac(Tn,Pe),ya(Tn,qe);const va=t.createModifiersFromModifierFlags(Nd($r)),lc=Bne(t,A,va,En,li);return rn(lc,A),Vr(lc,3072),ya(lc,qe),zw([yn,Tn,lc],Xe,Pl)}function Dr(A){if(Nn(A)){const Pe=Ws(A.name);if(E.assert(Pe,"Undeclared private name for property declaration."),!Pe.isValid)return A;if(Pe.isStatic&&!D){const qe=Lt(A,t.createThis());if(qe)return t.createClassStaticBlockDeclaration(t.createBlock([qe],!0))}return}return T&&!Ls(A)&&H?.data&&H.data.facts&16?t.updatePropertyDeclaration(A,kr(A.modifiers,ke,Do),A.name,void 0,void 0,void 0):(P_(A,Be)&&(A=I_(e,A)),t.updatePropertyDeclaration(A,kr(A.modifiers,Me,Ys),He(A.name,Oe,wc),void 0,void 0,He(A.initializer,ke,ct)))}function Ft(A){if(w&&!n_(A)){const Pe=Cn(A.name,!!A.initializer||y);if(Pe&&Is().push(...Jne(Pe)),Ls(A)&&!D){const qe=Lt(A,t.createThis());if(qe){const Tt=t.createClassStaticBlockDeclaration(t.createBlock([qe]));return rn(Tt,A),Ac(Tt,A),Ac(qe,{pos:-1,end:-1}),l1(qe,void 0),kT(qe,void 0),Tt}}return}return t.updatePropertyDeclaration(A,kr(A.modifiers,Me,Ys),He(A.name,Oe,wc),void 0,void 0,He(A.initializer,ke,ct))}function yr(A){return E.assert(!Of(A),"Decorators should already have been transformed and elided."),Nu(A)?Dr(A):Ft(A)}function Tr(){return O===-1||O===3&&!!H?.data&&!!(H.data.facts&16)}function Xr(A){return n_(A)&&(Tr()||Uc(A)&&Op(A)&32)?ur(A):yr(A)}function Pi(){return!!se&&Uc(se)&&R0(se)&&n_(Zo(se))}function ji(A){if(Pi()){const Pe=bc(A);Pe.kind===110&&oe.add(Pe)}}function Di(A,Pe){return Pe=He(Pe,ke,ct),ji(Pe),$i(A,Pe)}function $i(A,Pe){switch(Ac(Pe,i1(Pe,-1)),A.kind){case"a":return r().createClassPrivateFieldGetHelper(Pe,A.brandCheckIdentifier,A.kind,A.getterName);case"m":return r().createClassPrivateFieldGetHelper(Pe,A.brandCheckIdentifier,A.kind,A.methodName);case"f":return r().createClassPrivateFieldGetHelper(Pe,A.brandCheckIdentifier,A.kind,A.isStatic?A.variableName:void 0);case"untransformed":return E.fail("Access helpers should not be created for untransformed private elements");default:E.assertNever(A,"Unknown private element type")}}function Qs(A){if(Ti(A.name)){const Pe=Ws(A.name);if(Pe)return tt(rn(Di(Pe,A.expression),A),A)}if(W&&se&&s_(A)&&Ie(A.name)&&_3(se)&&H?.data){const{classConstructor:Pe,superClassReference:qe,facts:Tt}=H.data;if(Tt&1)return Ni(A);if(Pe&&qe){const dr=t.createReflectGetCall(qe,t.createStringLiteralFromNode(A.name),Pe);return rn(dr,A.expression),tt(dr,A.expression),dr}}return sr(A,ke,e)}function Ds(A){if(W&&se&&s_(A)&&_3(se)&&H?.data){const{classConstructor:Pe,superClassReference:qe,facts:Tt}=H.data;if(Tt&1)return Ni(A);if(Pe&&qe){const dr=t.createReflectGetCall(qe,He(A.argumentExpression,ke,ct),Pe);return rn(dr,A.expression),tt(dr,A.expression),dr}}return sr(A,ke,e)}function Ce(A,Pe){if(A.operator===46||A.operator===47){const qe=Ha(A.operand);if(hk(qe)){let Tt;if(Tt=Ws(qe.name)){const dr=He(qe.expression,ke,ct);ji(dr);const{readExpression:En,initializeExpression:$r}=ft(dr);let yn=Di(Tt,En);const li=f1(A)||Pe?void 0:t.createTempVariable(i);return yn=QF(t,A,yn,i,li),yn=Dt(Tt,$r||En,yn,64),rn(yn,A),tt(yn,A),li&&(yn=t.createComma(yn,li),tt(yn,A)),yn}}else if(W&&se&&s_(qe)&&_3(se)&&H?.data){const{classConstructor:Tt,superClassReference:dr,facts:En}=H.data;if(En&1){const $r=Ni(qe);return f1(A)?t.updatePrefixUnaryExpression(A,$r):t.updatePostfixUnaryExpression(A,$r)}if(Tt&&dr){let $r,yn;if(bn(qe)?Ie(qe.name)&&(yn=$r=t.createStringLiteralFromNode(qe.name)):jd(qe.argumentExpression)?yn=$r=qe.argumentExpression:(yn=t.createTempVariable(i),$r=t.createAssignment(yn,He(qe.argumentExpression,ke,ct))),$r&&yn){let li=t.createReflectGetCall(dr,yn,Tt);tt(li,qe);const Tn=Pe?void 0:t.createTempVariable(i);return li=QF(t,A,li,i,Tn),li=t.createReflectSetCall(dr,$r,li,Tt),rn(li,A),tt(li,A),Tn&&(li=t.createComma(li,Tn),tt(li,A)),li}}}}return sr(A,ke,e)}function Ue(A){return t.updateForStatement(A,He(A.initializer,be,Ff),He(A.condition,ke,ct),He(A.incrementor,be,ct),Hu(A.statement,ke,e))}function rt(A){return t.updateExpressionStatement(A,He(A.expression,be,ct))}function ft(A){const Pe=Po(A)?A:t.cloneNode(A);if(A.kind===110&&oe.has(A)&&oe.add(Pe),jd(A))return{readExpression:Pe,initializeExpression:void 0};const qe=t.createTempVariable(i),Tt=t.createAssignment(qe,Pe);return{readExpression:qe,initializeExpression:Tt}}function dt(A){var Pe;if(hk(A.expression)&&Ws(A.expression.name)){const{thisArg:qe,target:Tt}=t.createCallBinding(A.expression,i,p);return tb(A)?t.updateCallChain(A,t.createPropertyAccessChain(He(Tt,ke,ct),A.questionDotToken,"call"),void 0,void 0,[He(qe,ke,ct),...kr(A.arguments,ke,ct)]):t.updateCallExpression(A,t.createPropertyAccessExpression(He(Tt,ke,ct),"call"),void 0,[He(qe,ke,ct),...kr(A.arguments,ke,ct)])}if(W&&se&&s_(A.expression)&&_3(se)&&((Pe=H?.data)!=null&&Pe.classConstructor)){const qe=t.createFunctionCallCall(He(A.expression,ke,ct),H.data.classConstructor,kr(A.arguments,ke,ct));return rn(qe,A),tt(qe,A),qe}return sr(A,ke,e)}function fe(A){var Pe;if(hk(A.tag)&&Ws(A.tag.name)){const{thisArg:qe,target:Tt}=t.createCallBinding(A.tag,i,p);return t.updateTaggedTemplateExpression(A,t.createCallExpression(t.createPropertyAccessExpression(He(Tt,ke,ct),"bind"),void 0,[He(qe,ke,ct)]),void 0,He(A.template,ke,bk))}if(W&&se&&s_(A.tag)&&_3(se)&&((Pe=H?.data)!=null&&Pe.classConstructor)){const qe=t.createFunctionBindCall(He(A.tag,ke,ct),H.data.classConstructor,[]);return rn(qe,A),tt(qe,A),t.updateTaggedTemplateExpression(A,qe,void 0,He(A.template,ke,bk))}return sr(A,ke,e)}function we(A){if(H&&K.set(Zo(A),H),D){if(l3(A)){const Tt=He(A.body.statements[0].expression,ke,ct);return sl(Tt,!0)&&Tt.left===Tt.right?void 0:Tt}if(QT(A))return He(A.body.statements[0].expression,ke,ct);o();let Pe=ei(A,Tt=>kr(Tt,ke,Ci),A.body.statements);Pe=t.mergeLexicalEnvironment(Pe,s());const qe=t.createImmediatelyInvokedArrowFunction(Pe);return rn(Ha(qe.expression),A),Cm(Ha(qe.expression),4),rn(qe,A),tt(qe,A),qe}}function Be(A){if(Nl(A)&&!A.name){const Pe=JO(A);return ut(Pe,QT)?!1:(D||!!Op(A))&&ut(Pe,Tt=>Go(Tt)||Nu(Tt)||w&&Uw(Tt))}return!1}function gt(A,Pe){if(Jh(A)){const qe=_e;_e=void 0,A=t.updateBinaryExpression(A,He(A.left,pt,ct),A.operatorToken,He(A.right,ke,ct));const Tt=ut(_e)?t.inlineExpressions(UD([..._e,A])):A;return _e=qe,Tt}if(sl(A)){P_(A,Be)&&(A=I_(e,A),E.assertNode(A,sl));const qe=bc(A.left,9);if(hk(qe)){const Tt=Ws(qe.name);if(Tt)return tt(rn(Dt(Tt,qe.expression,A.right,A.operatorToken.kind),A),A)}else if(W&&se&&s_(A.left)&&_3(se)&&H?.data){const{classConstructor:Tt,superClassReference:dr,facts:En}=H.data;if(En&1)return t.updateBinaryExpression(A,Ni(A.left),A.operatorToken,He(A.right,ke,ct));if(Tt&&dr){let $r=mo(A.left)?He(A.left.argumentExpression,ke,ct):Ie(A.left.name)?t.createStringLiteralFromNode(A.left.name):void 0;if($r){let yn=He(A.right,ke,ct);if(a3(A.operatorToken.kind)){let Tn=$r;jd($r)||(Tn=t.createTempVariable(i),$r=t.createAssignment(Tn,$r));const va=t.createReflectGetCall(dr,Tn,Tt);rn(va,A.left),tt(va,A.left),yn=t.createBinaryExpression(va,o3(A.operatorToken.kind),yn),tt(yn,A)}const li=Pe?void 0:t.createTempVariable(i);return li&&(yn=t.createAssignment(li,yn),tt(li,A)),yn=t.createReflectSetCall(dr,$r,yn,Tt),rn(yn,A),tt(yn,A),li&&(yn=t.createComma(yn,li),tt(yn,A)),yn}}}}return ELe(A)?mt(A):sr(A,ke,e)}function G(A,Pe){const qe=Pe?Ww(A.elements,be):Ww(A.elements,ke,be);return t.updateCommaListExpression(A,qe)}function ht(A,Pe){const qe=Pe?be:ke,Tt=He(A.expression,qe,ct);return t.updateParenthesizedExpression(A,Tt)}function Dt(A,Pe,qe,Tt){if(Pe=He(Pe,ke,ct),qe=He(qe,ke,ct),ji(Pe),a3(Tt)){const{readExpression:dr,initializeExpression:En}=ft(Pe);Pe=En||dr,qe=t.createBinaryExpression($i(A,dr),o3(Tt),qe)}switch(Ac(Pe,i1(Pe,-1)),A.kind){case"a":return r().createClassPrivateFieldSetHelper(Pe,A.brandCheckIdentifier,qe,A.kind,A.setterName);case"m":return r().createClassPrivateFieldSetHelper(Pe,A.brandCheckIdentifier,qe,A.kind,void 0);case"f":return r().createClassPrivateFieldSetHelper(Pe,A.brandCheckIdentifier,qe,A.kind,A.isStatic?A.variableName:void 0);case"untransformed":return E.fail("Access helpers should not be created for untransformed private elements");default:E.assertNever(A,"Unknown private element type")}}function Re(A){return wn(A.members,Vie)}function st(A){var Pe;let qe=0;const Tt=Zo(A);Vc(Tt)&&Mh(S,Tt)&&(qe|=1),D&&(gV(A)||WO(A))&&(qe|=2);let dr=!1,En=!1,$r=!1,yn=!1;for(const Tn of A.members)Ls(Tn)?((Tn.name&&(Ti(Tn.name)||n_(Tn))&&D||n_(Tn)&&O===-1&&!A.name&&!((Pe=A.emitNode)!=null&&Pe.classThis))&&(qe|=2),(Es(Tn)||Go(Tn))&&(z&&Tn.transformFlags&16384&&(qe|=8,qe&1||(qe|=2)),W&&Tn.transformFlags&134217728&&(qe&1||(qe|=6)))):Mv(Zo(Tn))||(n_(Tn)?(yn=!0,$r||($r=Nu(Tn))):Nu(Tn)?($r=!0,f.getNodeCheckFlags(Tn)&262144&&(qe|=2)):Es(Tn)&&(dr=!0,En||(En=!!Tn.initializer)));return(C&&dr||T&&En||D&&$r||D&&yn&&O===-1)&&(qe|=16),qe}function Ct(A){var Pe;if((((Pe=H?.data)==null?void 0:Pe.facts)||0)&4){const Tt=t.createTempVariable(i,!0);return _i().superClassReference=Tt,t.updateExpressionWithTypeArguments(A,t.createAssignment(Tt,He(A.expression,ke,ct)),void 0)}return sr(A,ke,e)}function Qt(A,Pe){var qe;const Tt=Se,dr=_e,En=H;Se=A,_e=void 0,Ki();const $r=Op(A)&32;if(D||$r){const Tn=as(A);if(Tn&&Ie(Tn))ia().data.className=Tn;else if((qe=A.emitNode)!=null&&qe.assignedName&&ra(A.emitNode.assignedName)){if(A.emitNode.assignedName.textSourceNode&&Ie(A.emitNode.assignedName.textSourceNode))ia().data.className=A.emitNode.assignedName.textSourceNode;else if(lf(A.emitNode.assignedName.text,p)){const va=t.createIdentifier(A.emitNode.assignedName.text);ia().data.className=va}}}if(D){const Tn=Re(A);ut(Tn)&&(ia().data.weakSetName=Ro("instances",Tn[0].name))}const yn=st(A);yn&&(_i().facts=yn),yn&8&&On();const li=Pe(A,yn);return wr(),E.assert(H===En),Se=Tt,_e=dr,li}function er(A){return Qt(A,or)}function or(A,Pe){var qe,Tt;let dr;if(Pe&2)if(D&&((qe=A.emitNode)!=null&&qe.classThis))_i().classConstructor=A.emitNode.classThis,dr=t.createAssignment(A.emitNode.classThis,t.getInternalName(A));else{const Xa=t.createTempVariable(i,!0);_i().classConstructor=t.cloneNode(Xa),dr=t.createAssignment(Xa,t.getInternalName(A))}(Tt=A.emitNode)!=null&&Tt.classThis&&(_i().classThis=A.emitNode.classThis);const En=f.getNodeCheckFlags(A)&262144,$r=In(A,32),yn=In(A,2048);let li=kr(A.modifiers,Me,Ys);const Tn=kr(A.heritageClauses,lt,Q_),{members:va,prologue:lc}=ue(A),tl=[];if(dr&&Is().unshift(dr),ut(_e)&&tl.push(t.createExpressionStatement(t.inlineExpressions(_e))),T||D||Op(A)&32){const Xa=JO(A);ut(Xa)&&vt(tl,Xa,t.getInternalName(A))}tl.length>0&&$r&&yn&&(li=kr(li,Xa=>mw(Xa)?void 0:Xa,Ys),tl.push(t.createExportAssignment(void 0,!1,t.getLocalName(A,!1,!0))));const no=_i().classConstructor;En&&no&&(gn(),ae[iu(A)]=no);const rl=t.updateClassDeclaration(A,li,A.name,void 0,Tn,va);return tl.unshift(rl),lc&&tl.unshift(t.createExpressionStatement(lc)),tl}function U(A){return Qt(A,j)}function j(A,Pe){var qe,Tt,dr;const En=!!(Pe&1),$r=JO(A),yn=f.getNodeCheckFlags(A),li=yn&262144;let Tn;function va(){var xu;if(D&&((xu=A.emitNode)!=null&&xu.classThis))return _i().classConstructor=A.emitNode.classThis;const Bf=yn&32768,$l=t.createTempVariable(Bf?u:i,!0);return _i().classConstructor=t.cloneNode($l),$l}(qe=A.emitNode)!=null&&qe.classThis&&(_i().classThis=A.emitNode.classThis),Pe&2&&(Tn??(Tn=va()));const lc=kr(A.modifiers,Me,Ys),tl=kr(A.heritageClauses,lt,Q_),{members:no,prologue:rl}=ue(A),Xa=t.updateClassExpression(A,lc,A.name,void 0,tl,no),hl=[];if(rl&&hl.push(rl),(D||Op(A)&32)&&ut($r,xu=>Go(xu)||Nu(xu)||w&&Uw(xu))||ut(_e))if(En)E.assertIsDefined($,"Decorated classes transformed by TypeScript are expected to be within a variable declaration."),ut(_e)&&Dn($,Yt(_e,t.createExpressionStatement)),ut($r)&&vt($,$r,((Tt=A.emitNode)==null?void 0:Tt.classThis)??t.getInternalName(A)),Tn?hl.push(t.createAssignment(Tn,Xa)):D&&((dr=A.emitNode)!=null&&dr.classThis)?hl.push(t.createAssignment(A.emitNode.classThis,Xa)):hl.push(Xa);else{if(Tn??(Tn=va()),li){gn();const xu=t.cloneNode(Tn);xu.emitNode.autoGenerate.flags&=-9,ae[iu(A)]=xu}hl.push(t.createAssignment(Tn,Xa)),Dn(hl,_e),Dn(hl,Wt($r,Tn)),hl.push(t.cloneNode(Tn))}else hl.push(Xa);return hl.length>1&&(Cm(Xa,131072),hl.forEach(Ru)),t.inlineExpressions(hl)}function ce(A){if(!D)return sr(A,ke,e)}function ee(A){if(z&&se&&Go(se)&&H?.data){const{classThis:Pe,classConstructor:qe}=H.data;return Pe??qe??A}return A}function ue(A){const Pe=!!(Op(A)&32);if(D||B){for(const $r of A.members)if(Nu($r))if(Nn($r))cl($r,$r.name,Cr);else{const yn=ia();Rb(yn,$r.name,{kind:"untransformed"})}if(D&&ut(Re(A))&&M(),Tr()){for(const $r of A.members)if(n_($r)){const yn=t.getGeneratedPrivateNameForNode($r.name,void 0,"_accessor_storage");if(D||Pe&&Uc($r))cl($r,yn,Tc);else{const li=ia();Rb(li,yn,{kind:"untransformed"})}}}}let qe=kr(A.members,me,Pl),Tt;ut(qe,gc)||(Tt=De(void 0,A));let dr,En;if(!D&&ut(_e)){let $r=t.createExpressionStatement(t.inlineExpressions(_e));if($r.transformFlags&134234112){const li=t.createTempVariable(i),Tn=t.createArrowFunction(void 0,void 0,[],void 0,void 0,t.createBlock([$r]));dr=t.createAssignment(li,Tn),$r=t.createExpressionStatement(t.createCallExpression(li,void 0,[]))}const yn=t.createBlock([$r]);En=t.createClassStaticBlockDeclaration(yn),_e=void 0}if(Tt||En){let $r;const yn=kn(qe,l3),li=kn(qe,QT);$r=lr($r,yn),$r=lr($r,li),$r=lr($r,Tt),$r=lr($r,En);const Tn=yn||li?wn(qe,va=>va!==yn&&va!==li):qe;$r=Dn($r,Tn),qe=tt(t.createNodeArray($r),A.members)}return{members:qe,prologue:dr}}function M(){const{weakSetName:A}=ia().data;E.assert(A,"weakSetName should be set in private identifier environment"),Is().push(t.createAssignment(A,t.createNewExpression(t.createIdentifier("WeakSet"),void 0,[])))}function De(A,Pe){if(A=He(A,ke,gc),!H?.data||!(H.data.facts&16))return A;const qe=Pd(Pe),Tt=!!(qe&&bc(qe.expression).kind!==106),dr=Sc(A?A.parameters:void 0,ke,e),En=Fe(Pe,A,Tt);return En?A?(E.assert(dr),t.updateConstructorDeclaration(A,void 0,dr,En)):Ru(rn(tt(t.createConstructorDeclaration(void 0,dr??[],En),A||Pe),A)):A}function Ve(A,Pe,qe,Tt,dr,En,$r){const yn=Tt[dr],li=Pe[yn];if(Dn(A,kr(Pe,ke,Ci,qe,yn-qe)),qe=yn+1,Ab(li)){const Tn=[];Ve(Tn,li.tryBlock.statements,0,Tt,dr+1,En,$r);const va=t.createNodeArray(Tn);tt(va,li.tryBlock.statements),A.push(t.updateTryStatement(li,t.updateBlock(li.tryBlock,Tn),He(li.catchClause,ke,Gv),He(li.finallyBlock,ke,Ss)))}else{for(Dn(A,kr(Pe,ke,Ci,yn,1));qe!!no.initializer||Ti(no.name)||Ad(no)));const En=Re(A),$r=ut(dr)||ut(En);if(!Pe&&!$r)return gf(void 0,ke,e);c();const yn=!Pe&&qe;let li=0,Tn=[];const va=[],lc=t.createThis();if(Ln(va,En,lc),Pe){const no=wn(Tt,Xa=>E_(Zo(Xa),Pe)),rl=wn(dr,Xa=>!E_(Zo(Xa),Pe));vt(va,no,lc),vt(va,rl,lc)}else vt(va,dr,lc);if(Pe?.body){li=t.copyPrologue(Pe.body.statements,Tn,!1,ke);const no=BO(Pe.body.statements,li);if(no.length)Ve(Tn,Pe.body.statements,li,no,0,va,Pe);else{for(;li=Tn.length?Pe.body.multiLine??Tn.length>0:Tn.length>0;return tt(t.createBlock(tt(t.createNodeArray(Tn),Pe?Pe.body.statements:A.members),tl),Pe?Pe.body:void 0)}function vt(A,Pe,qe){for(const Tt of Pe){if(Ls(Tt)&&!D)continue;const dr=Lt(Tt,qe);dr&&A.push(dr)}}function Lt(A,Pe){const qe=Go(A)?ei(A,we,A):Lr(A,Pe);if(!qe)return;const Tt=t.createExpressionStatement(qe);rn(Tt,A),Cm(Tt,da(A)&3072),Ac(Tt,A);const dr=Zo(A);return us(dr)?(ya(Tt,dr),G8(Tt)):ya(Tt,Id(A)),l1(qe,void 0),kT(qe,void 0),Ad(dr)&&Cm(Tt,3072),Tt}function Wt(A,Pe){const qe=[];for(const Tt of A){const dr=Go(Tt)?ei(Tt,we,Tt):ei(Tt,()=>Lr(Tt,Pe),void 0);dr&&(Ru(dr),rn(dr,Tt),Cm(dr,da(Tt)&3072),ya(dr,Id(Tt)),Ac(dr,Tt),qe.push(dr))}return qe}function Lr(A,Pe){var qe;const Tt=se,dr=Zr(A,Pe);return dr&&Uc(A)&&((qe=H?.data)!=null&&qe.facts)&&(rn(dr,A),Cm(dr,4),ya(dr,c1(A.name)),K.set(Zo(A),H)),se=Tt,dr}function Zr(A,Pe){const qe=!y;P_(A,Be)&&(A=I_(e,A));const Tt=Ad(A)?t.getGeneratedPrivateNameForNode(A.name):xa(A.name)&&!jd(A.name.expression)?t.updateComputedPropertyName(A.name,t.getGeneratedNameForNode(A.name)):A.name;if(Uc(A)&&(se=A),Ti(Tt)&&Nn(A)){const $r=Ws(Tt);if($r)return $r.kind==="f"?$r.isStatic?TLe(t,$r.variableName,He(A.initializer,ke,ct)):xLe(t,Pe,He(A.initializer,ke,ct),$r.brandCheckIdentifier):void 0;E.fail("Undeclared private name for property declaration.")}if((Ti(Tt)||Uc(A))&&!A.initializer)return;const dr=Zo(A);if(In(dr,64))return;let En=He(A.initializer,ke,ct);if(E_(dr,dr.parent)&&Ie(Tt)){const $r=t.cloneNode(Tt);En?(y_(En)&&_w(En.expression)&&IE(En.expression.left,"___runInitializers")&<(En.expression.right)&&A_(En.expression.right.expression)&&(En=En.expression.left),En=t.inlineExpressions([En,$r])):En=$r,Vr(Tt,3168),ya($r,dr.name),Vr($r,3072)}else En??(En=t.createVoidZero());if(qe||Ti(Tt)){const $r=Ob(t,Pe,Tt,Tt);return Cm($r,1024),t.createAssignment($r,En)}else{const $r=xa(Tt)?Tt.expression:Ie(Tt)?t.createStringLiteral(bi(Tt.escapedText)):Tt,yn=t.createPropertyDescriptor({value:En,configurable:!0,writable:!0,enumerable:!0});return t.createObjectDefinePropertyCall(Pe,$r,yn)}}function gn(){Y&1||(Y|=1,e.enableSubstitution(80),ae=[])}function On(){Y&2||(Y|=2,e.enableSubstitution(110),e.enableEmitNotification(262),e.enableEmitNotification(218),e.enableEmitNotification(176),e.enableEmitNotification(177),e.enableEmitNotification(178),e.enableEmitNotification(174),e.enableEmitNotification(172),e.enableEmitNotification(167))}function Ln(A,Pe,qe){if(!D||!ut(Pe))return;const{weakSetName:Tt}=ia().data;E.assert(Tt,"weakSetName should be set in private identifier environment"),A.push(t.createExpressionStatement(kLe(t,qe,Tt)))}function Ni(A){return bn(A)?t.updatePropertyAccessExpression(A,t.createVoidZero(),A.name):t.updateElementAccessExpression(A,t.createVoidZero(),He(A.argumentExpression,ke,ct))}function Cn(A,Pe){if(xa(A)){const qe=nO(A),Tt=He(A.expression,ke,ct),dr=Fp(Tt),En=jd(dr);if(!(!!qe||sl(dr)&&Eo(dr.left))&&!En&&Pe){const yn=t.getGeneratedNameForNode(A);return f.getNodeCheckFlags(A)&32768?u(yn):i(yn),t.createAssignment(yn,Tt)}return En||Ie(dr)?void 0:Tt}}function Ki(){H={previous:H,data:void 0}}function wr(){H=H?.previous}function _i(){return E.assert(H),H.data??(H.data={facts:0,classConstructor:void 0,classThis:void 0,superClassReference:void 0})}function ia(){return E.assert(H),H.privateEnv??(H.privateEnv=Gie({className:void 0,weakSetName:void 0}))}function Is(){return _e??(_e=[])}function Cr(A,Pe,qe,Tt,dr,En,$r){n_(A)?Vo(A,Pe,qe,Tt,dr,En,$r):Es(A)?Tc(A,Pe,qe,Tt,dr,En,$r):mc(A)?os(A,Pe,qe,Tt,dr,En,$r):pf(A)?Ga(A,Pe,qe,Tt,dr,En,$r):N_(A)&&rc(A,Pe,qe,Tt,dr,En,$r)}function Tc(A,Pe,qe,Tt,dr,En,$r){if(dr){const yn=E.checkDefined(qe.classThis??qe.classConstructor,"classConstructor should be set in private identifier environment"),li=hs(Pe);Rb(Tt,Pe,{kind:"f",isStatic:!0,brandCheckIdentifier:yn,variableName:li,isValid:En})}else{const yn=hs(Pe);Rb(Tt,Pe,{kind:"f",isStatic:!1,brandCheckIdentifier:yn,isValid:En}),Is().push(t.createAssignment(yn,t.createNewExpression(t.createIdentifier("WeakMap"),void 0,[])))}}function os(A,Pe,qe,Tt,dr,En,$r){const yn=hs(Pe),li=dr?E.checkDefined(qe.classThis??qe.classConstructor,"classConstructor should be set in private identifier environment"):E.checkDefined(Tt.data.weakSetName,"weakSetName should be set in private identifier environment");Rb(Tt,Pe,{kind:"m",methodName:yn,brandCheckIdentifier:li,isStatic:dr,isValid:En})}function Ga(A,Pe,qe,Tt,dr,En,$r){const yn=hs(Pe,"_get"),li=dr?E.checkDefined(qe.classThis??qe.classConstructor,"classConstructor should be set in private identifier environment"):E.checkDefined(Tt.data.weakSetName,"weakSetName should be set in private identifier environment");$r?.kind==="a"&&$r.isStatic===dr&&!$r.getterName?$r.getterName=yn:Rb(Tt,Pe,{kind:"a",getterName:yn,setterName:void 0,brandCheckIdentifier:li,isStatic:dr,isValid:En})}function rc(A,Pe,qe,Tt,dr,En,$r){const yn=hs(Pe,"_set"),li=dr?E.checkDefined(qe.classThis??qe.classConstructor,"classConstructor should be set in private identifier environment"):E.checkDefined(Tt.data.weakSetName,"weakSetName should be set in private identifier environment");$r?.kind==="a"&&$r.isStatic===dr&&!$r.setterName?$r.setterName=yn:Rb(Tt,Pe,{kind:"a",getterName:void 0,setterName:yn,brandCheckIdentifier:li,isStatic:dr,isValid:En})}function Vo(A,Pe,qe,Tt,dr,En,$r){const yn=hs(Pe,"_get"),li=hs(Pe,"_set"),Tn=dr?E.checkDefined(qe.classThis??qe.classConstructor,"classConstructor should be set in private identifier environment"):E.checkDefined(Tt.data.weakSetName,"weakSetName should be set in private identifier environment");Rb(Tt,Pe,{kind:"a",getterName:yn,setterName:li,brandCheckIdentifier:Tn,isStatic:dr,isValid:En})}function cl(A,Pe,qe){const Tt=_i(),dr=ia(),En=pV(dr,Pe),$r=Uc(A),yn=!CLe(Pe)&&En===void 0;qe(A,Pe,Tt,dr,$r,yn,En)}function Ro(A,Pe,qe){const{className:Tt}=ia().data,dr=Tt?{prefix:"_",node:Tt,suffix:"_"}:"_",En=typeof A=="object"?t.getGeneratedNameForNode(A,24,dr,qe):typeof A=="string"?t.createUniqueName(A,16,dr,qe):t.createTempVariable(void 0,!0,dr,qe);return f.getNodeCheckFlags(Pe)&32768?u(En):i(En),En}function hs(A,Pe){const qe=J4(A);return Ro(qe?.substring(1)??A,A,Pe)}function Ws(A){const Pe=$ie(H,A);return Pe?.kind==="untransformed"?void 0:Pe}function el(A){const Pe=t.getGeneratedNameForNode(A),qe=Ws(A.name);if(!qe)return sr(A,ke,e);let Tt=A.expression;return(VP(A)||s_(A)||!Kv(A.expression))&&(Tt=t.createTempVariable(i,!0),Is().push(t.createBinaryExpression(Tt,64,He(A.expression,ke,ct)))),t.createAssignmentTargetWrapper(Pe,Dt(qe,Tt,Pe,64))}function yo(A){if(ma(A)||Lu(A))return qt(A);if(hk(A))return el(A);if(W&&se&&s_(A)&&_3(se)&&H?.data){const{classConstructor:Pe,superClassReference:qe,facts:Tt}=H.data;if(Tt&1)return Ni(A);if(Pe&&qe){const dr=mo(A)?He(A.argumentExpression,ke,ct):Ie(A.name)?t.createStringLiteralFromNode(A.name):void 0;if(dr){const En=t.createTempVariable(void 0);return t.createAssignmentTargetWrapper(En,t.createReflectSetCall(qe,dr,En,Pe))}}}return sr(A,ke,e)}function Us(A){if(P_(A,Be)&&(A=I_(e,A)),sl(A,!0)){const Pe=yo(A.left),qe=He(A.right,ke,ct);return t.updateBinaryExpression(A,Pe,A.operatorToken,qe)}return yo(A)}function Ic(A){if(m_(A.expression)){const Pe=yo(A.expression);return t.updateSpreadElement(A,Pe)}return sr(A,ke,e)}function Hp(A){if(EP(A)){if(Od(A))return Ic(A);if(!dl(A))return Us(A)}return sr(A,ke,e)}function Fc(A){const Pe=He(A.name,ke,wc);if(sl(A.initializer,!0)){const qe=Us(A.initializer);return t.updatePropertyAssignment(A,Pe,qe)}if(m_(A.initializer)){const qe=yo(A.initializer);return t.updatePropertyAssignment(A,Pe,qe)}return sr(A,ke,e)}function $o(A){return P_(A,Be)&&(A=I_(e,A)),sr(A,ke,e)}function Ao(A){if(m_(A.expression)){const Pe=yo(A.expression);return t.updateSpreadAssignment(A,Pe)}return sr(A,ke,e)}function rs(A){return E.assertNode(A,CP),Hh(A)?Ao(A):Y_(A)?$o(A):Hc(A)?Fc(A):sr(A,ke,e)}function qt(A){return Lu(A)?t.updateArrayLiteralExpression(A,kr(A.elements,Hp,ct)):t.updateObjectLiteralExpression(A,kr(A.properties,rs,qg))}function No(A,Pe,qe){const Tt=Zo(Pe),dr=K.get(Tt);if(dr){const En=H,$r=ve;H=dr,ve=Z,Z=!Go(Tt)||!(Op(Tt)&32),ie(A,Pe,qe),Z=ve,ve=$r,H=En;return}switch(Pe.kind){case 218:if(go(Tt)||da(Pe)&524288)break;case 262:case 176:case 177:case 178:case 174:case 172:{const En=H,$r=ve;H=void 0,ve=Z,Z=!1,ie(A,Pe,qe),Z=ve,ve=$r,H=En;return}case 167:{const En=H,$r=Z;H=H?.previous,Z=ve,ie(A,Pe,qe),Z=$r,H=En;return}}ie(A,Pe,qe)}function $c(A,Pe){return Pe=J(A,Pe),A===1?ju(Pe):Pe}function ju(A){switch(A.kind){case 80:return vo(A);case 110:return u_(A)}return A}function u_(A){if(Y&2&&H?.data&&!oe.has(A)){const{facts:Pe,classConstructor:qe,classThis:Tt}=H.data,dr=Z?Tt??qe:qe;if(dr)return tt(rn(t.cloneNode(dr),A),A);if(Pe&1&&S)return t.createParenthesizedExpression(t.createVoidZero())}return A}function vo(A){return xc(A)||A}function xc(A){if(Y&1&&f.getNodeCheckFlags(A)&536870912){const Pe=f.getReferencedValueDeclaration(A);if(Pe){const qe=ae[Pe.id];if(qe){const Tt=t.cloneNode(qe);return ya(Tt,A),Ac(Tt,A),Tt}}}}}function TLe(e,t,r){return e.createAssignment(t,e.createObjectLiteralExpression([e.createPropertyAssignment("value",r||e.createVoidZero())]))}function xLe(e,t,r,i){return e.createCallExpression(e.createPropertyAccessExpression(i,"set"),void 0,[t,r||e.createVoidZero()])}function kLe(e,t,r){return e.createCallExpression(e.createPropertyAccessExpression(r,"add"),void 0,[t])}function CLe(e){return!rb(e)&&e.escapedText==="#constructor"}function ELe(e){return Ti(e.left)&&e.operatorToken.kind===103}function DLe(e){return Es(e)&&Uc(e)}function _3(e){return Go(e)||DLe(e)}var PLe=Nt({"src/compiler/transformers/classFields.ts"(){"use strict";Ns()}});function ise(e){const{factory:t,hoistVariableDeclaration:r}=e,i=e.getEmitResolver(),s=e.getCompilerOptions(),o=Da(s),c=fp(s,"strictNullChecks");let u,f;return{serializeTypeNode:(_e,$)=>g(_e,w,$),serializeTypeOfNode:(_e,$)=>g(_e,y,$),serializeParameterTypesOfNode:(_e,$,H)=>g(_e,S,$,H),serializeReturnTypeOfNode:(_e,$)=>g(_e,C,$)};function g(_e,$,H,K){const oe=u,Se=f;u=_e.currentLexicalScope,f=_e.currentNameScope;const se=K===void 0?$(H):$(H,K);return u=oe,f=Se,se}function p(_e){const $=i.getAllAccessorDeclarations(_e);return $.setAccessor&&vte($.setAccessor)||$.getAccessor&&up($.getAccessor)}function y(_e){switch(_e.kind){case 172:case 169:return w(_e.type);case 178:case 177:return w(p(_e));case 263:case 231:case 174:return t.createIdentifier("Function");default:return t.createVoidZero()}}function S(_e,$){const H=Qn(_e)?cg(_e):ks(_e)&&ip(_e.body)?_e:void 0,K=[];if(H){const oe=T(H,$),Se=oe.length;for(let se=0;seoe.parent&&fC(oe.parent)&&(oe.parent.trueType===oe||oe.parent.falseType===oe)))return t.createIdentifier("Object");const H=J(_e.typeName),K=t.createTempVariable(r);return t.createConditionalExpression(t.createTypeCheck(t.createAssignment(K,H),"function"),void 0,K,void 0,t.createIdentifier("Object"));case 1:return ie(_e.typeName);case 2:return t.createVoidZero();case 4:return ae("BigInt",7);case 6:return t.createIdentifier("Boolean");case 3:return t.createIdentifier("Number");case 5:return t.createIdentifier("String");case 7:return t.createIdentifier("Array");case 8:return ae("Symbol",2);case 10:return t.createIdentifier("Function");case 9:return t.createIdentifier("Promise");case 11:return t.createIdentifier("Object");default:return E.assertNever($)}}function X(_e,$){return t.createLogicalAnd(t.createStrictInequality(t.createTypeOfExpression(_e),t.createStringLiteral("undefined")),$)}function J(_e){if(_e.kind===80){const K=ie(_e);return X(K,K)}if(_e.left.kind===80)return X(ie(_e.left),ie(_e));const $=J(_e.left),H=t.createTempVariable(r);return t.createLogicalAnd(t.createLogicalAnd($.left,t.createStrictInequality(t.createAssignment(H,$.right),t.createVoidZero())),t.createPropertyAccessExpression(H,_e.right))}function ie(_e){switch(_e.kind){case 80:const $=ga(tt(wm.cloneNode(_e),_e),_e.parent);return $.original=void 0,ga($,ss(u)),$;case 166:return B(_e)}}function B(_e){return t.createPropertyAccessExpression(ie(_e.left),_e.right)}function Y(_e){return t.createConditionalExpression(t.createTypeCheck(t.createIdentifier(_e),"function"),void 0,t.createIdentifier(_e),void 0,t.createIdentifier("Object"))}function ae(_e,$){return o<$?Y(_e):t.createIdentifier(_e)}}var wLe=Nt({"src/compiler/transformers/typeSerializer.ts"(){"use strict";Ns()}});function sse(e){const{factory:t,getEmitHelperFactory:r,hoistVariableDeclaration:i}=e,s=e.getEmitResolver(),o=e.getCompilerOptions(),c=Da(o),u=e.onSubstituteNode;e.onSubstituteNode=Oe;let f;return Up(e,g);function g(Je){const ot=sr(Je,y,e);return Yg(ot,e.readEmitHelpers()),ot}function p(Je){return ql(Je)?void 0:Je}function y(Je){if(!(Je.transformFlags&33554432))return Je;switch(Je.kind){case 170:return;case 263:return S(Je);case 231:return W(Je);case 176:return X(Je);case 174:return ie(Je);case 178:return Y(Je);case 177:return B(Je);case 172:return ae(Je);case 169:return _e(Je);default:return sr(Je,y,e)}}function S(Je){if(!(Mh(!0,Je)||V4(!0,Je)))return sr(Je,y,e);const ot=Mh(!0,Je)?z(Je,Je.name):O(Je,Je.name);return um(ot)}function T(Je){return!!(Je.transformFlags&536870912)}function C(Je){return ut(Je,T)}function w(Je){for(const ot of Je.members){if(!Lb(ot))continue;const Bt=zO(ot,Je,!0);if(ut(Bt?.decorators,T)||ut(Bt?.parameters,C))return!0}return!1}function D(Je,ot){let Bt=[];return K(Bt,Je,!1),K(Bt,Je,!0),w(Je)&&(ot=tt(t.createNodeArray([...ot,t.createClassStaticBlockDeclaration(t.createBlock(Bt,!0))]),ot),Bt=void 0),{decorationStatements:Bt,members:ot}}function O(Je,ot){const Bt=kr(Je.modifiers,p,Ys),Ht=kr(Je.heritageClauses,y,Q_);let br=kr(Je.members,y,Pl),zr=[];({members:br,decorationStatements:zr}=D(Je,br));const ar=t.updateClassDeclaration(Je,Bt,ot,void 0,Ht,br);return Dn([ar],zr)}function z(Je,ot){const Bt=In(Je,32),Ht=In(Je,2048),br=kr(Je.modifiers,Tr=>mw(Tr)||ql(Tr)?void 0:Tr,Do),zr=Id(Je),ar=lt(Je),Jt=c<2?t.getInternalName(Je,!1,!0):t.getLocalName(Je,!1,!0),It=kr(Je.heritageClauses,y,Q_);let Nn=kr(Je.members,y,Pl),Fi=[];({members:Nn,decorationStatements:Fi}=D(Je,Nn));const ei=c>=9&&!!ar&&ut(Nn,Tr=>Es(Tr)&&In(Tr,256)||Go(Tr));ei&&(Nn=tt(t.createNodeArray([t.createClassStaticBlockDeclaration(t.createBlock([t.createExpressionStatement(t.createAssignment(ar,t.createThis()))])),...Nn]),Nn));const zi=t.createClassExpression(br,ot&&Eo(ot)?void 0:ot,void 0,It,Nn);rn(zi,Je),tt(zi,zr);const Qe=ar&&!ei?t.createAssignment(ar,zi):zi,ur=t.createVariableDeclaration(Jt,void 0,void 0,Qe);rn(ur,Je);const Dr=t.createVariableDeclarationList([ur],1),Ft=t.createVariableStatement(void 0,Dr);rn(Ft,Je),tt(Ft,zr),Ac(Ft,Je);const yr=[Ft];if(Dn(yr,Fi),ve(yr,Je),Bt)if(Ht){const Tr=t.createExportDefault(Jt);yr.push(Tr)}else{const Tr=t.createExternalModuleExport(t.getDeclarationName(Je));yr.push(Tr)}return yr}function W(Je){return t.updateClassExpression(Je,kr(Je.modifiers,p,Ys),Je.name,void 0,kr(Je.heritageClauses,y,Q_),kr(Je.members,y,Pl))}function X(Je){return t.updateConstructorDeclaration(Je,kr(Je.modifiers,p,Ys),kr(Je.parameters,y,us),He(Je.body,y,Ss))}function J(Je,ot){return Je!==ot&&(Ac(Je,ot),ya(Je,Id(ot))),Je}function ie(Je){return J(t.updateMethodDeclaration(Je,kr(Je.modifiers,p,Ys),Je.asteriskToken,E.checkDefined(He(Je.name,y,wc)),void 0,void 0,kr(Je.parameters,y,us),void 0,He(Je.body,y,Ss)),Je)}function B(Je){return J(t.updateGetAccessorDeclaration(Je,kr(Je.modifiers,p,Ys),E.checkDefined(He(Je.name,y,wc)),kr(Je.parameters,y,us),void 0,He(Je.body,y,Ss)),Je)}function Y(Je){return J(t.updateSetAccessorDeclaration(Je,kr(Je.modifiers,p,Ys),E.checkDefined(He(Je.name,y,wc)),kr(Je.parameters,y,us),He(Je.body,y,Ss)),Je)}function ae(Je){if(!(Je.flags&33554432||In(Je,128)))return J(t.updatePropertyDeclaration(Je,kr(Je.modifiers,p,Ys),E.checkDefined(He(Je.name,y,wc)),void 0,void 0,He(Je.initializer,y,ct)),Je)}function _e(Je){const ot=t.updateParameterDeclaration(Je,Rne(t,Je.modifiers),Je.dotDotDotToken,E.checkDefined(He(Je.name,y,nb)),void 0,void 0,He(Je.initializer,y,ct));return ot!==Je&&(Ac(ot,Je),tt(ot,Id(Je)),ya(ot,Id(Je)),Vr(ot.name,64)),ot}function $(Je){return IE(Je.expression,"___metadata")}function H(Je){if(!Je)return;const{false:ot,true:Bt}=VZ(Je.decorators,$),Ht=[];return Dn(Ht,Yt(ot,Me)),Dn(Ht,ta(Je.parameters,ke)),Dn(Ht,Yt(Bt,Me)),Ht}function K(Je,ot,Bt){Dn(Je,Yt(se(ot,Bt),Ht=>t.createExpressionStatement(Ht)))}function oe(Je,ot,Bt){return HP(!0,Je,Bt)&&ot===Ls(Je)}function Se(Je,ot){return wn(Je.members,Bt=>oe(Bt,ot,Je))}function se(Je,ot){const Bt=Se(Je,ot);let Ht;for(const br of Bt)Ht=lr(Ht,Z(Je,br));return Ht}function Z(Je,ot){const Bt=zO(ot,Je,!0),Ht=H(Bt);if(!Ht)return;const br=me(Je,ot),zr=he(ot,!In(ot,128)),ar=c>0?Es(ot)&&!Ad(ot)?t.createVoidZero():t.createNull():void 0,Jt=r().createDecorateHelper(Ht,br,zr,ar);return Vr(Jt,3072),ya(Jt,Id(ot)),Jt}function ve(Je,ot){const Bt=Te(ot);Bt&&Je.push(rn(t.createExpressionStatement(Bt),ot))}function Te(Je){const ot=fV(Je),Bt=H(ot);if(!Bt)return;const Ht=f&&f[iu(Je)],br=c<2?t.getInternalName(Je,!1,!0):t.getDeclarationName(Je,!1,!0),zr=r().createDecorateHelper(Bt,br),ar=t.createAssignment(br,Ht?t.createAssignment(Ht,zr):zr);return Vr(ar,3072),ya(ar,Id(Je)),ar}function Me(Je){return E.checkDefined(He(Je.expression,y,ct))}function ke(Je,ot){let Bt;if(Je){Bt=[];for(const Ht of Je){const br=r().createParamHelper(Me(Ht),ot);tt(br,Ht.expression),Vr(br,3072),Bt.push(br)}}return Bt}function he(Je,ot){const Bt=Je.name;return Ti(Bt)?t.createIdentifier(""):xa(Bt)?ot&&!jd(Bt.expression)?t.getGeneratedNameForNode(Bt):Bt.expression:Ie(Bt)?t.createStringLiteral(an(Bt)):t.cloneNode(Bt)}function be(){f||(e.enableSubstitution(80),f=[])}function lt(Je){if(s.getNodeCheckFlags(Je)&262144){be();const ot=t.createUniqueName(Je.name&&!Eo(Je.name)?an(Je.name):"default");return f[iu(Je)]=ot,i(ot),ot}}function pt(Je){return t.createPropertyAccessExpression(t.getDeclarationName(Je),"prototype")}function me(Je,ot){return Ls(ot)?t.getDeclarationName(Je):pt(Je)}function Oe(Je,ot){return ot=u(Je,ot),Je===1?Xe(ot):ot}function Xe(Je){switch(Je.kind){case 80:return it(Je)}return Je}function it(Je){return mt(Je)??Je}function mt(Je){if(f&&s.getNodeCheckFlags(Je)&536870912){const ot=s.getReferencedValueDeclaration(Je);if(ot){const Bt=f[ot.id];if(Bt){const Ht=t.cloneNode(Bt);return ya(Ht,Je),Ac(Ht,Je),Ht}}}}}var ALe=Nt({"src/compiler/transformers/legacyDecorators.ts"(){"use strict";Ns()}});function ase(e){const{factory:t,getEmitHelperFactory:r,startLexicalEnvironment:i,endLexicalEnvironment:s,hoistVariableDeclaration:o}=e,c=Da(e.getCompilerOptions());let u,f,g,p,y,S;return Up(e,T);function T(j){u=void 0,S=!1;const ce=sr(j,Y,e);return Yg(ce,e.readEmitHelpers()),S&&(xT(ce,32),S=!1),ce}function C(){switch(f=void 0,g=void 0,p=void 0,u?.kind){case"class":f=u.classInfo;break;case"class-element":f=u.next.classInfo,g=u.classThis,p=u.classSuper;break;case"name":const j=u.next.next.next;j?.kind==="class-element"&&(f=j.next.classInfo,g=j.classThis,p=j.classSuper);break}}function w(j){u={kind:"class",next:u,classInfo:j,savedPendingExpressions:y},y=void 0,C()}function D(){E.assert(u?.kind==="class","Incorrect value for top.kind.",()=>`Expected top.kind to be 'class' but got '${u?.kind}' instead.`),y=u.savedPendingExpressions,u=u.next,C()}function O(j){var ce,ee;E.assert(u?.kind==="class","Incorrect value for top.kind.",()=>`Expected top.kind to be 'class' but got '${u?.kind}' instead.`),u={kind:"class-element",next:u},(Go(j)||Es(j)&&Uc(j))&&(u.classThis=(ce=u.next.classInfo)==null?void 0:ce.classThis,u.classSuper=(ee=u.next.classInfo)==null?void 0:ee.classSuper),C()}function z(){var j;E.assert(u?.kind==="class-element","Incorrect value for top.kind.",()=>`Expected top.kind to be 'class-element' but got '${u?.kind}' instead.`),E.assert(((j=u.next)==null?void 0:j.kind)==="class","Incorrect value for top.next.kind.",()=>{var ce;return`Expected top.next.kind to be 'class' but got '${(ce=u.next)==null?void 0:ce.kind}' instead.`}),u=u.next,C()}function W(){E.assert(u?.kind==="class-element","Incorrect value for top.kind.",()=>`Expected top.kind to be 'class-element' but got '${u?.kind}' instead.`),u={kind:"name",next:u},C()}function X(){E.assert(u?.kind==="name","Incorrect value for top.kind.",()=>`Expected top.kind to be 'name' but got '${u?.kind}' instead.`),u=u.next,C()}function J(){u?.kind==="other"?(E.assert(!y),u.depth++):(u={kind:"other",next:u,depth:0,savedPendingExpressions:y},y=void 0,C())}function ie(){E.assert(u?.kind==="other","Incorrect value for top.kind.",()=>`Expected top.kind to be 'other' but got '${u?.kind}' instead.`),u.depth>0?(E.assert(!y),u.depth--):(y=u.savedPendingExpressions,u=u.next,C())}function B(j){return!!(j.transformFlags&33554432)||!!g&&!!(j.transformFlags&16384)||!!g&&!!p&&!!(j.transformFlags&134217728)}function Y(j){if(!B(j))return j;switch(j.kind){case 170:return E.fail("Use `modifierVisitor` instead.");case 263:return Te(j);case 231:return Me(j);case 176:case 172:case 175:return E.fail("Not supported outside of a class. Use 'classElementVisitor' instead.");case 169:return zr(j);case 226:return Fi(j,!1);case 303:return Ft(j);case 260:return yr(j);case 208:return Tr(j);case 277:return rt(j);case 110:return Je(j);case 248:return It(j);case 244:return Nn(j);case 361:return zi(j,!1);case 217:return ft(j,!1);case 360:return dt(j,!1);case 213:return ot(j);case 215:return Bt(j);case 224:case 225:return ei(j,!1);case 211:return Ht(j);case 212:return br(j);case 167:return Dr(j);case 174:case 178:case 177:case 218:case 262:{J();const ce=sr(j,ae,e);return ie(),ce}default:return sr(j,ae,e)}}function ae(j){switch(j.kind){case 170:return;default:return Y(j)}}function _e(j){switch(j.kind){case 170:return;default:return j}}function $(j){switch(j.kind){case 176:return be(j);case 174:return me(j);case 177:return Oe(j);case 178:return Xe(j);case 172:return mt(j);case 175:return it(j);default:return Y(j)}}function H(j){switch(j.kind){case 224:case 225:return ei(j,!0);case 226:return Fi(j,!0);case 361:return zi(j,!0);case 217:return ft(j,!0);default:return Y(j)}}function K(j){let ce=j.name&&Ie(j.name)&&!Eo(j.name)?an(j.name):j.name&&Ti(j.name)&&!Eo(j.name)?an(j.name).slice(1):j.name&&ra(j.name)&&lf(j.name.text,99)?j.name.text:Qn(j)?"class":"member";return B0(j)&&(ce=`get_${ce}`),Lh(j)&&(ce=`set_${ce}`),j.name&&Ti(j.name)&&(ce=`private_${ce}`),Ls(j)&&(ce=`static_${ce}`),"_"+ce}function oe(j,ce){return t.createUniqueName(`${K(j)}_${ce}`,24)}function Se(j,ce){return t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(j,void 0,void 0,ce)],1))}function se(j){const ce=t.createUniqueName("_metadata",48);let ee,ue,M=!1,De=!1,Ve=!1;for(const Fe of j.members)if(tee(Fe)&&HP(!1,Fe,j)&&(Uc(Fe)?ue??(ue=t.createUniqueName("_staticExtraInitializers",48)):ee??(ee=t.createUniqueName("_instanceExtraInitializers",48))),Go(Fe)?QT(Fe)||(M=!0):Es(Fe)&&(Uc(Fe)?M||(M=!!Fe.initializer||Of(Fe)):De||(De=!OJ(Fe))),(Nu(Fe)||n_(Fe))&&Uc(Fe)&&(Ve=!0),ue&&ee&&M&&De&&Ve)break;return{class:j,metadataReference:ce,instanceExtraInitializersName:ee,staticExtraInitializersName:ue,hasStaticInitializers:M,hasNonAmbientInstanceFields:De,hasStaticPrivateClassElements:Ve}}function Z(j){i(),!hV(j)&&Mh(!1,j)&&(j=UO(e,j,t.createStringLiteral("")));const ce=t.getLocalName(j,!1,!1,!0),ee=se(j),ue=[];let M,De,Ve,Fe,vt=!1;const Lt=we(fV(j));if(Lt){ee.classDecoratorsName=t.createUniqueName("_classDecorators",48),ee.classDescriptorName=t.createUniqueName("_classDescriptor",48),ee.classExtraInitializersName=t.createUniqueName("_classExtraInitializers",48);const wr=ut(j.members,_i=>(Nu(_i)||n_(_i))&&Uc(_i));ee.classThis=t.createUniqueName("_classThis",wr?24:48),ue.push(Se(ee.classDecoratorsName,t.createArrayLiteralExpression(Lt)),Se(ee.classDescriptorName),Se(ee.classExtraInitializersName,t.createArrayLiteralExpression()),Se(ee.classThis)),ee.hasStaticPrivateClassElements&&(vt=!0,S=!0)}const Wt=_8(j.heritageClauses,96),Lr=Wt&&bl(Wt.types),Zr=Lr&&He(Lr.expression,Y,ct);if(Zr){ee.classSuper=t.createUniqueName("_classSuper",48);const wr=bc(Zr),_i=Nl(wr)&&!wr.name||ro(wr)&&!wr.name||go(wr)?t.createComma(t.createNumericLiteral(0),Zr):Zr;ue.push(Se(ee.classSuper,_i));const ia=t.updateExpressionWithTypeArguments(Lr,ee.classSuper,void 0),Is=t.updateHeritageClause(Wt,[ia]);Fe=t.createNodeArray([Is])}const gn=ee.classThis??t.createThis();w(ee),M=lr(M,er(ee.metadataReference,ee.classSuper));let On=kr(j.members,$,Pl);if(y){let wr;for(let _i of y){_i=He(_i,function Is(Cr){if(!(Cr.transformFlags&16384))return Cr;switch(Cr.kind){case 110:return wr||(wr=t.createUniqueName("_outerThis",16),ue.unshift(Se(wr,t.createThis()))),wr;default:return sr(Cr,Is,e)}},ct);const ia=t.createExpressionStatement(_i);M=lr(M,ia)}y=void 0}if(D(),ee.instanceExtraInitializersName&&!cg(j)){const wr=ke(j,ee);if(wr){const _i=Pd(j),ia=!!(_i&&bc(_i.expression).kind!==106),Is=[];if(ia){const Tc=t.createSpreadElement(t.createIdentifier("arguments")),os=t.createCallExpression(t.createSuper(),void 0,[Tc]);Is.push(t.createExpressionStatement(os))}Dn(Is,wr);const Cr=t.createBlock(Is,!0);Ve=t.createConstructorDeclaration(void 0,[],Cr)}}if(ee.staticExtraInitializersName&&ue.push(Se(ee.staticExtraInitializersName,t.createArrayLiteralExpression())),ee.instanceExtraInitializersName&&ue.push(Se(ee.instanceExtraInitializersName,t.createArrayLiteralExpression())),ee.memberInfos&&zl(ee.memberInfos,(wr,_i)=>{Ls(_i)&&(ue.push(Se(wr.memberDecoratorsName)),wr.memberInitializersName&&ue.push(Se(wr.memberInitializersName,t.createArrayLiteralExpression())),wr.memberDescriptorName&&ue.push(Se(wr.memberDescriptorName)))}),ee.memberInfos&&zl(ee.memberInfos,(wr,_i)=>{Ls(_i)||(ue.push(Se(wr.memberDecoratorsName)),wr.memberInitializersName&&ue.push(Se(wr.memberInitializersName,t.createArrayLiteralExpression())),wr.memberDescriptorName&&ue.push(Se(wr.memberDescriptorName)))}),M=Dn(M,ee.staticNonFieldDecorationStatements),M=Dn(M,ee.nonStaticNonFieldDecorationStatements),M=Dn(M,ee.staticFieldDecorationStatements),M=Dn(M,ee.nonStaticFieldDecorationStatements),ee.classDescriptorName&&ee.classDecoratorsName&&ee.classExtraInitializersName&&ee.classThis){M??(M=[]);const wr=t.createPropertyAssignment("value",gn),_i=t.createObjectLiteralExpression([wr]),ia=t.createAssignment(ee.classDescriptorName,_i),Is=t.createPropertyAccessExpression(gn,"name"),Cr=r().createESDecorateHelper(t.createNull(),ia,ee.classDecoratorsName,{kind:"class",name:Is,metadata:ee.metadataReference},t.createNull(),ee.classExtraInitializersName),Tc=t.createExpressionStatement(Cr);ya(Tc,Wh(j)),M.push(Tc);const os=t.createPropertyAccessExpression(ee.classDescriptorName,"value"),Ga=t.createAssignment(ee.classThis,os),rc=t.createAssignment(ce,Ga);M.push(t.createExpressionStatement(rc))}if(M.push(or(gn,ee.metadataReference)),ee.staticExtraInitializersName){const wr=r().createRunInitializersHelper(gn,ee.staticExtraInitializersName),_i=t.createExpressionStatement(wr);ya(_i,j.name??Wh(j)),M=lr(M,_i)}if(ee.classExtraInitializersName){const wr=r().createRunInitializersHelper(gn,ee.classExtraInitializersName),_i=t.createExpressionStatement(wr);ya(_i,j.name??Wh(j)),De=lr(De,_i)}M&&De&&!ee.hasStaticInitializers&&(Dn(M,De),De=void 0);const Ln=M&&t.createClassStaticBlockDeclaration(t.createBlock(M,!0));Ln&&vt&&$8(Ln,32);const Ni=De&&t.createClassStaticBlockDeclaration(t.createBlock(De,!0));if(Ln||Ve||Ni){const wr=[],_i=On.findIndex(QT);Ln?(Dn(wr,On,0,_i+1),wr.push(Ln),Dn(wr,On,_i+1)):Dn(wr,On),Ve&&wr.push(Ve),Ni&&wr.push(Ni),On=tt(t.createNodeArray(wr),On)}const Cn=s();let Ki;if(Lt){Ki=t.createClassExpression(void 0,void 0,void 0,Fe,On),ee.classThis&&(Ki=Zie(t,Ki,ee.classThis));const wr=t.createVariableDeclaration(ce,void 0,void 0,Ki),_i=t.createVariableDeclarationList([wr]),ia=ee.classThis?t.createAssignment(ce,ee.classThis):ce;ue.push(t.createVariableStatement(void 0,_i),t.createReturnStatement(ia))}else Ki=t.createClassExpression(void 0,j.name,void 0,Fe,On),ue.push(t.createReturnStatement(Ki));if(vt){xT(Ki,32);for(const wr of Ki.members)(Nu(wr)||n_(wr))&&Uc(wr)&&xT(wr,32)}return rn(Ki,j),t.createImmediatelyInvokedArrowFunction(t.mergeLexicalEnvironment(ue,Cn))}function ve(j){return Mh(!1,j)||V4(!1,j)}function Te(j){if(ve(j)){const ce=[],ee=Zo(j,Qn)??j,ue=ee.name?t.createStringLiteralFromNode(ee.name):t.createStringLiteral("default"),M=In(j,32),De=In(j,2048);if(j.name||(j=UO(e,j,ue)),M&&De){const Ve=Z(j);if(j.name){const Fe=t.createVariableDeclaration(t.getLocalName(j),void 0,void 0,Ve);rn(Fe,j);const vt=t.createVariableDeclarationList([Fe],1),Lt=t.createVariableStatement(void 0,vt);ce.push(Lt);const Wt=t.createExportDefault(t.getDeclarationName(j));rn(Wt,j),Ac(Wt,Fd(j)),ya(Wt,Wh(j)),ce.push(Wt)}else{const Fe=t.createExportDefault(Ve);rn(Fe,j),Ac(Fe,Fd(j)),ya(Fe,Wh(j)),ce.push(Fe)}}else{E.assertIsDefined(j.name,"A class declaration that is not a default export must have a name.");const Ve=Z(j),Fe=M?gn=>wT(gn)?void 0:_e(gn):_e,vt=kr(j.modifiers,Fe,Ys),Lt=t.getLocalName(j,!1,!0),Wt=t.createVariableDeclaration(Lt,void 0,void 0,Ve);rn(Wt,j);const Lr=t.createVariableDeclarationList([Wt],1),Zr=t.createVariableStatement(vt,Lr);if(rn(Zr,j),Ac(Zr,Fd(j)),ce.push(Zr),M){const gn=t.createExternalModuleExport(Lt);rn(gn,j),ce.push(gn)}}return um(ce)}else{const ce=kr(j.modifiers,_e,Ys),ee=kr(j.heritageClauses,Y,Q_);w(void 0);const ue=kr(j.members,$,Pl);return D(),t.updateClassDeclaration(j,ce,j.name,void 0,ee,ue)}}function Me(j){if(ve(j)){const ce=Z(j);return rn(ce,j),ce}else{const ce=kr(j.modifiers,_e,Ys),ee=kr(j.heritageClauses,Y,Q_);w(void 0);const ue=kr(j.members,$,Pl);return D(),t.updateClassExpression(j,ce,j.name,void 0,ee,ue)}}function ke(j,ce){if(ce.instanceExtraInitializersName&&!ce.hasNonAmbientInstanceFields){const ee=[];return ee.push(t.createExpressionStatement(r().createRunInitializersHelper(t.createThis(),ce.instanceExtraInitializersName))),ee}}function he(j,ce,ee,ue,M,De){const Ve=ue[M],Fe=ce[Ve];if(Dn(j,kr(ce,Y,Ci,ee,Ve-ee)),Ab(Fe)){const vt=[];he(vt,Fe.tryBlock.statements,0,ue,M+1,De);const Lt=t.createNodeArray(vt);tt(Lt,Fe.tryBlock.statements),j.push(t.updateTryStatement(Fe,t.updateBlock(Fe.tryBlock,vt),He(Fe.catchClause,Y,Gv),He(Fe.finallyBlock,Y,Ss)))}else Dn(j,kr(ce,Y,Ci,Ve,1)),Dn(j,De);Dn(j,kr(ce,Y,Ci,Ve+1))}function be(j){O(j);const ce=kr(j.modifiers,_e,Ys),ee=kr(j.parameters,Y,us);let ue;if(j.body&&f){const M=ke(f.class,f);if(M){const De=[],Ve=t.copyPrologue(j.body.statements,De,!1,Y),Fe=BO(j.body.statements,Ve);Fe.length>0?he(De,j.body.statements,Ve,Fe,0,M):(Dn(De,M),Dn(De,kr(j.body.statements,Y,Ci))),ue=t.createBlock(De,!0),rn(ue,j.body),tt(ue,j.body)}}return ue??(ue=He(j.body,Y,Ss)),z(),t.updateConstructorDeclaration(j,ce,ee,ue)}function lt(j,ce){return j!==ce&&(Ac(j,ce),ya(j,Wh(ce))),j}function pt(j,ce,ee){let ue,M,De,Ve,Fe;if(!ce){const Wt=kr(j.modifiers,_e,Ys);return W(),M=ur(j.name),X(),{modifiers:Wt,referencedName:ue,name:M,initializersName:De,descriptorName:Fe,thisArg:Ve}}const vt=we(zO(j,ce.class,!1)),Lt=kr(j.modifiers,_e,Ys);if(vt){const Wt=oe(j,"decorators"),Lr=t.createArrayLiteralExpression(vt),Zr=t.createAssignment(Wt,Lr),gn={memberDecoratorsName:Wt};ce.memberInfos??(ce.memberInfos=new Map),ce.memberInfos.set(j,gn),y??(y=[]),y.push(Zr);const On=vk(j)||n_(j)?Ls(j)?ce.staticNonFieldDecorationStatements??(ce.staticNonFieldDecorationStatements=[]):ce.nonStaticNonFieldDecorationStatements??(ce.nonStaticNonFieldDecorationStatements=[]):Es(j)&&!n_(j)?Ls(j)?ce.staticFieldDecorationStatements??(ce.staticFieldDecorationStatements=[]):ce.nonStaticFieldDecorationStatements??(ce.nonStaticFieldDecorationStatements=[]):E.fail(),Ln=pf(j)?"getter":N_(j)?"setter":mc(j)?"method":n_(j)?"accessor":Es(j)?"field":E.fail();let Ni;if(Ie(j.name)||Ti(j.name))Ni={computed:!1,name:j.name};else if(wd(j.name))Ni={computed:!0,name:t.createStringLiteralFromNode(j.name)};else{const wr=j.name.expression;wd(wr)&&!Ie(wr)?Ni={computed:!0,name:t.createStringLiteralFromNode(wr)}:(W(),{referencedName:ue,name:M}=Qe(j.name),Ni={computed:!0,name:ue},X())}const Cn={kind:Ln,name:Ni,static:Ls(j),private:Ti(j.name),access:{get:Es(j)||pf(j)||mc(j),set:Es(j)||N_(j)},metadata:ce.metadataReference},Ki=Ls(j)?ce.staticExtraInitializersName??(ce.staticExtraInitializersName=t.createUniqueName("_staticExtraInitializers",48)):ce.instanceExtraInitializersName??(ce.instanceExtraInitializersName=t.createUniqueName("_instanceExtraInitializers",48));if(vk(j)){let wr;Nu(j)&&ee&&(wr=ee(j,kr(Lt,Is=>Jn(Is,FE),Ys)),gn.memberDescriptorName=Fe=oe(j,"descriptor"),wr=t.createAssignment(Fe,wr));const _i=r().createESDecorateHelper(t.createThis(),wr??t.createNull(),Wt,Cn,t.createNull(),Ki),ia=t.createExpressionStatement(_i);ya(ia,Wh(j)),On.push(ia)}else if(Es(j)){De=gn.memberInitializersName??(gn.memberInitializersName=oe(j,"initializers")),Ls(j)&&(Ve=ce.classThis);let wr;Nu(j)&&Ad(j)&&ee&&(wr=ee(j,void 0),gn.memberDescriptorName=Fe=oe(j,"descriptor"),wr=t.createAssignment(Fe,wr));const _i=r().createESDecorateHelper(n_(j)?t.createThis():t.createNull(),wr??t.createNull(),Wt,Cn,De,Ki),ia=t.createExpressionStatement(_i);ya(ia,Wh(j)),On.push(ia)}}return M===void 0&&(W(),M=ur(j.name),X()),!ut(Lt)&&(mc(j)||Es(j))&&Vr(M,1024),{modifiers:Lt,referencedName:ue,name:M,initializersName:De,descriptorName:Fe,thisArg:Ve}}function me(j){O(j);const{modifiers:ce,name:ee,descriptorName:ue}=pt(j,f,G);if(ue)return z(),lt(st(ce,ee,ue),j);{const M=kr(j.parameters,Y,us),De=He(j.body,Y,Ss);return z(),lt(t.updateMethodDeclaration(j,ce,j.asteriskToken,ee,void 0,void 0,M,void 0,De),j)}}function Oe(j){O(j);const{modifiers:ce,name:ee,descriptorName:ue}=pt(j,f,ht);if(ue)return z(),lt(Ct(ce,ee,ue),j);{const M=kr(j.parameters,Y,us),De=He(j.body,Y,Ss);return z(),lt(t.updateGetAccessorDeclaration(j,ce,ee,M,void 0,De),j)}}function Xe(j){O(j);const{modifiers:ce,name:ee,descriptorName:ue}=pt(j,f,Dt);if(ue)return z(),lt(Qt(ce,ee,ue),j);{const M=kr(j.parameters,Y,us),De=He(j.body,Y,Ss);return z(),lt(t.updateSetAccessorDeclaration(j,ce,ee,M,De),j)}}function it(j){O(j);let ce;if(QT(j))ce=sr(j,Y,e);else if(l3(j)){const ee=g;g=void 0,ce=sr(j,Y,e),g=ee}else f&&(f.hasStaticInitializers=!0),ce=sr(j,Y,e);return z(),ce}function mt(j){P_(j,ar)&&(j=I_(e,j,Jt(j.initializer))),O(j),E.assert(!OJ(j),"Not yet implemented.");const{modifiers:ce,name:ee,initializersName:ue,descriptorName:M,thisArg:De}=pt(j,f,Ad(j)?Re:void 0);i();let Ve=He(j.initializer,Y,ct);ue&&(Ve=r().createRunInitializersHelper(De??t.createThis(),ue,Ve??t.createVoidZero())),!Ls(j)&&f?.instanceExtraInitializersName&&!f?.hasInjectedInstanceInitializers&&(f.hasInjectedInstanceInitializers=!0,Ve??(Ve=t.createVoidZero()),Ve=t.createParenthesizedExpression(t.createComma(r().createRunInitializersHelper(t.createThis(),f.instanceExtraInitializersName),Ve))),Ls(j)&&f&&Ve&&(f.hasStaticInitializers=!0);const Fe=s();if(ut(Fe)&&(Ve=t.createImmediatelyInvokedArrowFunction([...Fe,t.createReturnStatement(Ve)])),z(),Ad(j)&&M){const vt=Fd(j),Lt=c1(j),Wt=j.name;let Lr=Wt,Zr=Wt;if(xa(Wt)&&!jd(Wt.expression)){const Cn=nO(Wt);if(Cn)Lr=t.updateComputedPropertyName(Wt,He(Wt.expression,Y,ct)),Zr=t.updateComputedPropertyName(Wt,Cn.left);else{const Ki=t.createTempVariable(o);ya(Ki,Wt.expression);const wr=He(Wt.expression,Y,ct),_i=t.createAssignment(Ki,wr);ya(_i,Wt.expression),Lr=t.updateComputedPropertyName(Wt,_i),Zr=t.updateComputedPropertyName(Wt,Ki)}}const gn=kr(ce,Cn=>Cn.kind!==129?Cn:void 0,Ys),On=aU(t,j,gn,Ve);rn(On,j),Vr(On,3072),ya(On,Lt),ya(On.name,j.name);const Ln=Ct(gn,Lr,M);rn(Ln,j),Ac(Ln,vt),ya(Ln,Lt);const Ni=Qt(gn,Zr,M);return rn(Ni,j),Vr(Ni,3072),ya(Ni,Lt),[On,Ln,Ni]}return lt(t.updatePropertyDeclaration(j,ce,ee,void 0,void 0,Ve),j)}function Je(j){return g??j}function ot(j){if(s_(j.expression)&&g){const ce=He(j.expression,Y,ct),ee=kr(j.arguments,Y,ct),ue=t.createFunctionCallCall(ce,g,ee);return rn(ue,j),tt(ue,j),ue}return sr(j,Y,e)}function Bt(j){if(s_(j.tag)&&g){const ce=He(j.tag,Y,ct),ee=t.createFunctionBindCall(ce,g,[]);rn(ee,j),tt(ee,j);const ue=He(j.template,Y,bk);return t.updateTaggedTemplateExpression(j,ee,void 0,ue)}return sr(j,Y,e)}function Ht(j){if(s_(j)&&Ie(j.name)&&g&&p){const ce=t.createStringLiteralFromNode(j.name),ee=t.createReflectGetCall(p,ce,g);return rn(ee,j.expression),tt(ee,j.expression),ee}return sr(j,Y,e)}function br(j){if(s_(j)&&g&&p){const ce=He(j.argumentExpression,Y,ct),ee=t.createReflectGetCall(p,ce,g);return rn(ee,j.expression),tt(ee,j.expression),ee}return sr(j,Y,e)}function zr(j){P_(j,ar)&&(j=I_(e,j,Jt(j.initializer)));const ce=t.updateParameterDeclaration(j,void 0,j.dotDotDotToken,He(j.name,Y,nb),void 0,void 0,He(j.initializer,Y,ct));return ce!==j&&(Ac(ce,j),tt(ce,Id(j)),ya(ce,Id(j)),Vr(ce.name,64)),ce}function ar(j){return Nl(j)&&!j.name&&ve(j)}function Jt(j){const ce=bc(j);return Nl(ce)&&!ce.name&&!Mh(!1,ce)}function It(j){return t.updateForStatement(j,He(j.initializer,H,Ff),He(j.condition,Y,ct),He(j.incrementor,H,ct),Hu(j.statement,Y,e))}function Nn(j){return sr(j,H,e)}function Fi(j,ce){if(Jh(j)){const ee=Ue(j.left),ue=He(j.right,Y,ct);return t.updateBinaryExpression(j,ee,j.operatorToken,ue)}if(sl(j)){if(P_(j,ar))return j=I_(e,j,Jt(j.right)),sr(j,Y,e);if(s_(j.left)&&g&&p){let ee=mo(j.left)?He(j.left.argumentExpression,Y,ct):Ie(j.left.name)?t.createStringLiteralFromNode(j.left.name):void 0;if(ee){let ue=He(j.right,Y,ct);if(a3(j.operatorToken.kind)){let De=ee;jd(ee)||(De=t.createTempVariable(o),ee=t.createAssignment(De,ee));const Ve=t.createReflectGetCall(p,De,g);rn(Ve,j.left),tt(Ve,j.left),ue=t.createBinaryExpression(Ve,o3(j.operatorToken.kind),ue),tt(ue,j)}const M=ce?void 0:t.createTempVariable(o);return M&&(ue=t.createAssignment(M,ue),tt(M,j)),ue=t.createReflectSetCall(p,ee,ue,g),rn(ue,j),tt(ue,j),M&&(ue=t.createComma(ue,M),tt(ue,j)),ue}}}if(j.operatorToken.kind===28){const ee=He(j.left,H,ct),ue=He(j.right,ce?H:Y,ct);return t.updateBinaryExpression(j,ee,j.operatorToken,ue)}return sr(j,Y,e)}function ei(j,ce){if(j.operator===46||j.operator===47){const ee=Ha(j.operand);if(s_(ee)&&g&&p){let ue=mo(ee)?He(ee.argumentExpression,Y,ct):Ie(ee.name)?t.createStringLiteralFromNode(ee.name):void 0;if(ue){let M=ue;jd(ue)||(M=t.createTempVariable(o),ue=t.createAssignment(M,ue));let De=t.createReflectGetCall(p,M,g);rn(De,j),tt(De,j);const Ve=ce?void 0:t.createTempVariable(o);return De=QF(t,j,De,o,Ve),De=t.createReflectSetCall(p,ue,De,g),rn(De,j),tt(De,j),Ve&&(De=t.createComma(De,Ve),tt(De,j)),De}}}return sr(j,Y,e)}function zi(j,ce){const ee=ce?Ww(j.elements,H):Ww(j.elements,Y,H);return t.updateCommaListExpression(j,ee)}function Qe(j){if(wd(j)||Ti(j)){const De=t.createStringLiteralFromNode(j),Ve=He(j,Y,wc);return{referencedName:De,name:Ve}}if(wd(j.expression)&&!Ie(j.expression)){const De=t.createStringLiteralFromNode(j.expression),Ve=He(j,Y,wc);return{referencedName:De,name:Ve}}const ce=t.getGeneratedNameForNode(j);o(ce);const ee=r().createPropKeyHelper(He(j.expression,Y,ct)),ue=t.createAssignment(ce,ee),M=t.updateComputedPropertyName(j,fe(ue));return{referencedName:ce,name:M}}function ur(j){return xa(j)?Dr(j):He(j,Y,wc)}function Dr(j){let ce=He(j.expression,Y,ct);return jd(ce)||(ce=fe(ce)),t.updateComputedPropertyName(j,ce)}function Ft(j){return P_(j,ar)&&(j=I_(e,j,Jt(j.initializer))),sr(j,Y,e)}function yr(j){return P_(j,ar)&&(j=I_(e,j,Jt(j.initializer))),sr(j,Y,e)}function Tr(j){return P_(j,ar)&&(j=I_(e,j,Jt(j.initializer))),sr(j,Y,e)}function Xr(j){if(ma(j)||Lu(j))return Ue(j);if(s_(j)&&g&&p){const ce=mo(j)?He(j.argumentExpression,Y,ct):Ie(j.name)?t.createStringLiteralFromNode(j.name):void 0;if(ce){const ee=t.createTempVariable(void 0),ue=t.createAssignmentTargetWrapper(ee,t.createReflectSetCall(p,ce,ee,g));return rn(ue,j),tt(ue,j),ue}}return sr(j,Y,e)}function Pi(j){if(sl(j,!0)){P_(j,ar)&&(j=I_(e,j,Jt(j.right)));const ce=Xr(j.left),ee=He(j.right,Y,ct);return t.updateBinaryExpression(j,ce,j.operatorToken,ee)}else return Xr(j)}function ji(j){if(m_(j.expression)){const ce=Xr(j.expression);return t.updateSpreadElement(j,ce)}return sr(j,Y,e)}function Di(j){return E.assertNode(j,EP),Od(j)?ji(j):dl(j)?sr(j,Y,e):Pi(j)}function $i(j){const ce=He(j.name,Y,wc);if(sl(j.initializer,!0)){const ee=Pi(j.initializer);return t.updatePropertyAssignment(j,ce,ee)}if(m_(j.initializer)){const ee=Xr(j.initializer);return t.updatePropertyAssignment(j,ce,ee)}return sr(j,Y,e)}function Qs(j){return P_(j,ar)&&(j=I_(e,j,Jt(j.objectAssignmentInitializer))),sr(j,Y,e)}function Ds(j){if(m_(j.expression)){const ce=Xr(j.expression);return t.updateSpreadAssignment(j,ce)}return sr(j,Y,e)}function Ce(j){return E.assertNode(j,CP),Hh(j)?Ds(j):Y_(j)?Qs(j):Hc(j)?$i(j):sr(j,Y,e)}function Ue(j){if(Lu(j)){const ce=kr(j.elements,Di,ct);return t.updateArrayLiteralExpression(j,ce)}else{const ce=kr(j.properties,Ce,qg);return t.updateObjectLiteralExpression(j,ce)}}function rt(j){return P_(j,ar)&&(j=I_(e,j,Jt(j.expression))),sr(j,Y,e)}function ft(j,ce){const ee=ce?H:Y,ue=He(j.expression,ee,ct);return t.updateParenthesizedExpression(j,ue)}function dt(j,ce){const ee=ce?H:Y,ue=He(j.expression,ee,ct);return t.updatePartiallyEmittedExpression(j,ue)}function fe(j){return ut(y)&&(y_(j)?(y.push(j.expression),j=t.updateParenthesizedExpression(j,t.inlineExpressions(y))):(y.push(j),j=t.inlineExpressions(y)),y=void 0),j}function we(j){if(!j)return;const ce=[];return Dn(ce,Yt(j.decorators,Be)),ce}function Be(j){const ce=He(j.expression,Y,ct);Vr(ce,3072);const ee=bc(ce);if(co(ee)){const{target:ue,thisArg:M}=t.createCallBinding(ce,o,c,!0);return t.restoreOuterExpressions(ce,t.createFunctionBindCall(ue,M,[]))}return ce}function gt(j,ce,ee,ue,M,De,Ve){const Fe=t.createFunctionExpression(ee,ue,void 0,void 0,De,void 0,Ve??t.createBlock([]));rn(Fe,j),ya(Fe,Wh(j)),Vr(Fe,3072);const vt=M==="get"||M==="set"?M:void 0,Lt=t.createStringLiteralFromNode(ce,void 0),Wt=r().createSetFunctionNameHelper(Fe,Lt,vt),Lr=t.createPropertyAssignment(t.createIdentifier(M),Wt);return rn(Lr,j),ya(Lr,Wh(j)),Vr(Lr,3072),Lr}function G(j,ce){return t.createObjectLiteralExpression([gt(j,j.name,ce,j.asteriskToken,"value",kr(j.parameters,Y,us),He(j.body,Y,Ss))])}function ht(j,ce){return t.createObjectLiteralExpression([gt(j,j.name,ce,void 0,"get",[],He(j.body,Y,Ss))])}function Dt(j,ce){return t.createObjectLiteralExpression([gt(j,j.name,ce,void 0,"set",kr(j.parameters,Y,us),He(j.body,Y,Ss))])}function Re(j,ce){return t.createObjectLiteralExpression([gt(j,j.name,ce,void 0,"get",[],t.createBlock([t.createReturnStatement(t.createPropertyAccessExpression(t.createThis(),t.getGeneratedPrivateNameForNode(j.name)))])),gt(j,j.name,ce,void 0,"set",[t.createParameterDeclaration(void 0,void 0,"value")],t.createBlock([t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createThis(),t.getGeneratedPrivateNameForNode(j.name)),t.createIdentifier("value")))]))])}function st(j,ce,ee){return j=kr(j,ue=>AT(ue)?ue:void 0,Ys),t.createGetAccessorDeclaration(j,ce,[],void 0,t.createBlock([t.createReturnStatement(t.createPropertyAccessExpression(ee,t.createIdentifier("value")))]))}function Ct(j,ce,ee){return j=kr(j,ue=>AT(ue)?ue:void 0,Ys),t.createGetAccessorDeclaration(j,ce,[],void 0,t.createBlock([t.createReturnStatement(t.createFunctionCallCall(t.createPropertyAccessExpression(ee,t.createIdentifier("get")),t.createThis(),[]))]))}function Qt(j,ce,ee){return j=kr(j,ue=>AT(ue)?ue:void 0,Ys),t.createSetAccessorDeclaration(j,ce,[t.createParameterDeclaration(void 0,void 0,"value")],t.createBlock([t.createReturnStatement(t.createFunctionCallCall(t.createPropertyAccessExpression(ee,t.createIdentifier("set")),t.createThis(),[t.createIdentifier("value")]))]))}function er(j,ce){const ee=t.createVariableDeclaration(j,void 0,void 0,t.createConditionalExpression(t.createLogicalAnd(t.createTypeCheck(t.createIdentifier("Symbol"),"function"),t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata")),t.createToken(58),t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[ce?U(ce):t.createNull()]),t.createToken(59),t.createVoidZero()));return t.createVariableStatement(void 0,t.createVariableDeclarationList([ee],2))}function or(j,ce){const ee=t.createObjectDefinePropertyCall(j,t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata"),t.createPropertyDescriptor({configurable:!0,writable:!0,enumerable:!0,value:ce},!0));return Vr(t.createIfStatement(ce,t.createExpressionStatement(ee)),1)}function U(j){return t.createBinaryExpression(t.createElementAccessExpression(j,t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata")),61,t.createNull())}}var NLe=Nt({"src/compiler/transformers/esDecorators.ts"(){"use strict";Ns()}});function ose(e){const{factory:t,getEmitHelperFactory:r,resumeLexicalEnvironment:i,endLexicalEnvironment:s,hoistVariableDeclaration:o}=e,c=e.getEmitResolver(),u=e.getCompilerOptions(),f=Da(u);let g,p=0,y,S,T;const C=[];let w=0;const D=e.onEmitNode,O=e.onSubstituteNode;return e.onEmitNode=zr,e.onSubstituteNode=ar,Up(e,z);function z(Qe){if(Qe.isDeclarationFile)return Qe;W(1,!1),W(2,!FJ(Qe,u));const ur=sr(Qe,ae,e);return Yg(ur,e.readEmitHelpers()),ur}function W(Qe,ur){w=ur?w|Qe:w&~Qe}function X(Qe){return(w&Qe)!==0}function J(){return!X(1)}function ie(){return X(2)}function B(Qe,ur,Dr){const Ft=Qe&~w;if(Ft){W(Ft,!0);const yr=ur(Dr);return W(Ft,!1),yr}return ur(Dr)}function Y(Qe){return sr(Qe,ae,e)}function ae(Qe){if(!(Qe.transformFlags&256))return Qe;switch(Qe.kind){case 134:return;case 223:return se(Qe);case 174:return B(3,ve,Qe);case 262:return B(3,ke,Qe);case 218:return B(3,he,Qe);case 219:return B(1,be,Qe);case 211:return S&&bn(Qe)&&Qe.expression.kind===108&&S.add(Qe.name.escapedText),sr(Qe,ae,e);case 212:return S&&Qe.expression.kind===108&&(T=!0),sr(Qe,ae,e);case 177:return B(3,Te,Qe);case 178:return B(3,Me,Qe);case 176:return B(3,Z,Qe);case 263:case 231:return B(3,Y,Qe);default:return sr(Qe,ae,e)}}function _e(Qe){if(ote(Qe))switch(Qe.kind){case 243:return H(Qe);case 248:return Se(Qe);case 249:return K(Qe);case 250:return oe(Qe);case 299:return $(Qe);case 241:case 255:case 269:case 296:case 297:case 258:case 246:case 247:case 245:case 254:case 256:return sr(Qe,_e,e);default:return E.assertNever(Qe,"Unhandled node.")}return ae(Qe)}function $(Qe){const ur=new Set;lt(Qe.variableDeclaration,ur);let Dr;if(ur.forEach((Ft,yr)=>{y.has(yr)&&(Dr||(Dr=new Set(y)),Dr.delete(yr))}),Dr){const Ft=y;y=Dr;const yr=sr(Qe,_e,e);return y=Ft,yr}else return sr(Qe,_e,e)}function H(Qe){if(pt(Qe.declarationList)){const ur=me(Qe.declarationList,!1);return ur?t.createExpressionStatement(ur):void 0}return sr(Qe,ae,e)}function K(Qe){return t.updateForInStatement(Qe,pt(Qe.initializer)?me(Qe.initializer,!0):E.checkDefined(He(Qe.initializer,ae,Ff)),E.checkDefined(He(Qe.expression,ae,ct)),Hu(Qe.statement,_e,e))}function oe(Qe){return t.updateForOfStatement(Qe,He(Qe.awaitModifier,ae,OW),pt(Qe.initializer)?me(Qe.initializer,!0):E.checkDefined(He(Qe.initializer,ae,Ff)),E.checkDefined(He(Qe.expression,ae,ct)),Hu(Qe.statement,_e,e))}function Se(Qe){const ur=Qe.initializer;return t.updateForStatement(Qe,pt(ur)?me(ur,!1):He(Qe.initializer,ae,Ff),He(Qe.condition,ae,ct),He(Qe.incrementor,ae,ct),Hu(Qe.statement,_e,e))}function se(Qe){return J()?sr(Qe,ae,e):rn(tt(t.createYieldExpression(void 0,He(Qe.expression,ae,ct)),Qe),Qe)}function Z(Qe){return t.updateConstructorDeclaration(Qe,kr(Qe.modifiers,ae,Ys),Sc(Qe.parameters,ae,e),Je(Qe))}function ve(Qe){return t.updateMethodDeclaration(Qe,kr(Qe.modifiers,ae,Do),Qe.asteriskToken,Qe.name,void 0,void 0,Sc(Qe.parameters,ae,e),void 0,pl(Qe)&2?ot(Qe):Je(Qe))}function Te(Qe){return t.updateGetAccessorDeclaration(Qe,kr(Qe.modifiers,ae,Do),Qe.name,Sc(Qe.parameters,ae,e),void 0,Je(Qe))}function Me(Qe){return t.updateSetAccessorDeclaration(Qe,kr(Qe.modifiers,ae,Do),Qe.name,Sc(Qe.parameters,ae,e),Je(Qe))}function ke(Qe){return t.updateFunctionDeclaration(Qe,kr(Qe.modifiers,ae,Do),Qe.asteriskToken,Qe.name,void 0,Sc(Qe.parameters,ae,e),void 0,pl(Qe)&2?ot(Qe):gf(Qe.body,ae,e))}function he(Qe){return t.updateFunctionExpression(Qe,kr(Qe.modifiers,ae,Ys),Qe.asteriskToken,Qe.name,void 0,Sc(Qe.parameters,ae,e),void 0,pl(Qe)&2?ot(Qe):gf(Qe.body,ae,e))}function be(Qe){return t.updateArrowFunction(Qe,kr(Qe.modifiers,ae,Ys),void 0,Sc(Qe.parameters,ae,e),void 0,Qe.equalsGreaterThanToken,pl(Qe)&2?ot(Qe):gf(Qe.body,ae,e))}function lt({name:Qe},ur){if(Ie(Qe))ur.add(Qe.escapedText);else for(const Dr of Qe.elements)dl(Dr)||lt(Dr,ur)}function pt(Qe){return!!Qe&&ml(Qe)&&!(Qe.flags&7)&&Qe.declarations.some(mt)}function me(Qe,ur){Oe(Qe);const Dr=_E(Qe);return Dr.length===0?ur?He(t.converters.convertToAssignmentElementTarget(Qe.declarations[0].name),ae,ct):void 0:t.inlineExpressions(Yt(Dr,it))}function Oe(Qe){Zt(Qe.declarations,Xe)}function Xe({name:Qe}){if(Ie(Qe))o(Qe);else for(const ur of Qe.elements)dl(ur)||Xe(ur)}function it(Qe){const ur=ya(t.createAssignment(t.converters.convertToAssignmentElementTarget(Qe.name),Qe.initializer),Qe);return E.checkDefined(He(ur,ae,ct))}function mt({name:Qe}){if(Ie(Qe))return y.has(Qe.escapedText);for(const ur of Qe.elements)if(!dl(ur)&&mt(ur))return!0;return!1}function Je(Qe){E.assertIsDefined(Qe.body);const ur=S,Dr=T;S=new Set,T=!1;let Ft=gf(Qe.body,ae,e);const yr=Zo(Qe,po);if(f>=2&&c.getNodeCheckFlags(Qe)&384&&(pl(yr)&3)!==3){if(br(),S.size){const Xr=VO(t,c,Qe,S);C[Oa(Xr)]=!0;const Pi=Ft.statements.slice();vm(Pi,[Xr]),Ft=t.updateBlock(Ft,Pi)}T&&(c.getNodeCheckFlags(Qe)&256?CT(Ft,K8):c.getNodeCheckFlags(Qe)&128&&CT(Ft,Z8))}return S=ur,T=Dr,Ft}function ot(Qe){i();const Dr=Zo(Qe,ks).type,Ft=f<2?Ht(Dr):void 0,yr=Qe.kind===219,Tr=(c.getNodeCheckFlags(Qe)&512)!==0,Xr=y;y=new Set;for(const $i of Qe.parameters)lt($i,y);const Pi=S,ji=T;yr||(S=new Set,T=!1);let Di;if(yr){const $i=r().createAwaiterHelper(ie(),Tr,Ft,Bt(Qe.body)),Qs=s();if(ut(Qs)){const Ds=t.converters.convertToFunctionBlock($i);Di=t.updateBlock(Ds,tt(t.createNodeArray(Xi(Qs,Ds.statements)),Ds.statements))}else Di=$i}else{const $i=[],Qs=t.copyPrologue(Qe.body.statements,$i,!1,ae);$i.push(t.createReturnStatement(r().createAwaiterHelper(ie(),Tr,Ft,Bt(Qe.body,Qs)))),vm($i,s());const Ds=f>=2&&c.getNodeCheckFlags(Qe)&384;if(Ds&&(br(),S.size)){const Ue=VO(t,c,Qe,S);C[Oa(Ue)]=!0,vm($i,[Ue])}const Ce=t.createBlock($i,!0);tt(Ce,Qe.body),Ds&&T&&(c.getNodeCheckFlags(Qe)&256?CT(Ce,K8):c.getNodeCheckFlags(Qe)&128&&CT(Ce,Z8)),Di=Ce}return y=Xr,yr||(S=Pi,T=ji),Di}function Bt(Qe,ur){return Ss(Qe)?t.updateBlock(Qe,kr(Qe.statements,_e,Ci,ur)):t.converters.convertToFunctionBlock(E.checkDefined(He(Qe,_e,vI)))}function Ht(Qe){const ur=Qe&&qP(Qe);if(ur&&V_(ur)){const Dr=c.getTypeReferenceSerializationKind(ur);if(Dr===1||Dr===0)return ur}}function br(){g&1||(g|=1,e.enableSubstitution(213),e.enableSubstitution(211),e.enableSubstitution(212),e.enableEmitNotification(263),e.enableEmitNotification(174),e.enableEmitNotification(177),e.enableEmitNotification(178),e.enableEmitNotification(176),e.enableEmitNotification(243))}function zr(Qe,ur,Dr){if(g&1&&ei(ur)){const Ft=c.getNodeCheckFlags(ur)&384;if(Ft!==p){const yr=p;p=Ft,D(Qe,ur,Dr),p=yr;return}}else if(g&&C[Oa(ur)]){const Ft=p;p=0,D(Qe,ur,Dr),p=Ft;return}D(Qe,ur,Dr)}function ar(Qe,ur){return ur=O(Qe,ur),Qe===1&&p?Jt(ur):ur}function Jt(Qe){switch(Qe.kind){case 211:return It(Qe);case 212:return Nn(Qe);case 213:return Fi(Qe)}return Qe}function It(Qe){return Qe.expression.kind===108?tt(t.createPropertyAccessExpression(t.createUniqueName("_super",48),Qe.name),Qe):Qe}function Nn(Qe){return Qe.expression.kind===108?zi(Qe.argumentExpression,Qe):Qe}function Fi(Qe){const ur=Qe.expression;if(s_(ur)){const Dr=bn(ur)?It(ur):Nn(ur);return t.createCallExpression(t.createPropertyAccessExpression(Dr,"call"),void 0,[t.createThis(),...Qe.arguments])}return Qe}function ei(Qe){const ur=Qe.kind;return ur===263||ur===176||ur===174||ur===177||ur===178}function zi(Qe,ur){return p&256?tt(t.createPropertyAccessExpression(t.createCallExpression(t.createUniqueName("_superIndex",48),void 0,[Qe]),"value"),ur):tt(t.createCallExpression(t.createUniqueName("_superIndex",48),void 0,[Qe]),ur)}}function VO(e,t,r,i){const s=(t.getNodeCheckFlags(r)&256)!==0,o=[];return i.forEach((c,u)=>{const f=bi(u),g=[];g.push(e.createPropertyAssignment("get",e.createArrowFunction(void 0,void 0,[],void 0,void 0,Vr(e.createPropertyAccessExpression(Vr(e.createSuper(),8),f),8)))),s&&g.push(e.createPropertyAssignment("set",e.createArrowFunction(void 0,void 0,[e.createParameterDeclaration(void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,e.createAssignment(Vr(e.createPropertyAccessExpression(Vr(e.createSuper(),8),f),8),e.createIdentifier("v"))))),o.push(e.createPropertyAssignment(f,e.createObjectLiteralExpression(g)))}),e.createVariableStatement(void 0,e.createVariableDeclarationList([e.createVariableDeclaration(e.createUniqueName("_super",48),void 0,void 0,e.createCallExpression(e.createPropertyAccessExpression(e.createIdentifier("Object"),"create"),void 0,[e.createNull(),e.createObjectLiteralExpression(o,!0)]))],2))}var ILe=Nt({"src/compiler/transformers/es2017.ts"(){"use strict";Ns()}});function cse(e){const{factory:t,getEmitHelperFactory:r,resumeLexicalEnvironment:i,endLexicalEnvironment:s,hoistVariableDeclaration:o}=e,c=e.getEmitResolver(),u=e.getCompilerOptions(),f=Da(u),g=e.onEmitNode;e.onEmitNode=$i;const p=e.onSubstituteNode;e.onSubstituteNode=Qs;let y=!1,S,T,C,w=0,D=0,O,z,W,X;const J=[];return Up(e,_e);function ie(fe,we){return D!==(D&~fe|we)}function B(fe,we){const Be=D;return D=(D&~fe|we)&3,Be}function Y(fe){D=fe}function ae(fe){z=lr(z,t.createVariableDeclaration(fe))}function _e(fe){if(fe.isDeclarationFile)return fe;O=fe;const we=pt(fe);return Yg(we,e.readEmitHelpers()),O=void 0,z=void 0,we}function $(fe){return se(fe,!1)}function H(fe){return se(fe,!0)}function K(fe){if(fe.kind!==134)return fe}function oe(fe,we,Be,gt){if(ie(Be,gt)){const G=B(Be,gt),ht=fe(we);return Y(G),ht}return fe(we)}function Se(fe){return sr(fe,$,e)}function se(fe,we){if(!(fe.transformFlags&128))return fe;switch(fe.kind){case 223:return Z(fe);case 229:return ve(fe);case 253:return Te(fe);case 256:return Me(fe);case 210:return he(fe);case 226:return Oe(fe,we);case 361:return Xe(fe,we);case 299:return it(fe);case 243:return mt(fe);case 260:return Je(fe);case 246:case 247:case 249:return oe(Se,fe,0,2);case 250:return br(fe,void 0);case 248:return oe(Bt,fe,0,2);case 222:return Ht(fe);case 176:return oe(zi,fe,2,1);case 174:return oe(Dr,fe,2,1);case 177:return oe(Qe,fe,2,1);case 178:return oe(ur,fe,2,1);case 262:return oe(Ft,fe,2,1);case 218:return oe(Tr,fe,2,1);case 219:return oe(yr,fe,2,0);case 169:return Fi(fe);case 244:return be(fe);case 217:return lt(fe,we);case 215:return me(fe);case 211:return W&&bn(fe)&&fe.expression.kind===108&&W.add(fe.name.escapedText),sr(fe,$,e);case 212:return W&&fe.expression.kind===108&&(X=!0),sr(fe,$,e);case 263:case 231:return oe(Se,fe,2,1);default:return sr(fe,$,e)}}function Z(fe){return T&2&&T&1?rn(tt(t.createYieldExpression(void 0,r().createAwaitHelper(He(fe.expression,$,ct))),fe),fe):sr(fe,$,e)}function ve(fe){if(T&2&&T&1){if(fe.asteriskToken){const we=He(E.checkDefined(fe.expression),$,ct);return rn(tt(t.createYieldExpression(void 0,r().createAwaitHelper(t.updateYieldExpression(fe,fe.asteriskToken,tt(r().createAsyncDelegatorHelper(tt(r().createAsyncValuesHelper(we),we)),we)))),fe),fe)}return rn(tt(t.createYieldExpression(void 0,Jt(fe.expression?He(fe.expression,$,ct):t.createVoidZero())),fe),fe)}return sr(fe,$,e)}function Te(fe){return T&2&&T&1?t.updateReturnStatement(fe,Jt(fe.expression?He(fe.expression,$,ct):t.createVoidZero())):sr(fe,$,e)}function Me(fe){if(T&2){const we=UJ(fe);return we.kind===250&&we.awaitModifier?br(we,fe):t.restoreEnclosingLabel(He(we,$,Ci,t.liftToBlock),fe)}return sr(fe,$,e)}function ke(fe){let we;const Be=[];for(const gt of fe)if(gt.kind===305){we&&(Be.push(t.createObjectLiteralExpression(we)),we=void 0);const G=gt.expression;Be.push(He(G,$,ct))}else we=lr(we,gt.kind===303?t.createPropertyAssignment(gt.name,He(gt.initializer,$,ct)):He(gt,$,qg));return we&&Be.push(t.createObjectLiteralExpression(we)),Be}function he(fe){if(fe.transformFlags&65536){const we=ke(fe.properties);we.length&&we[0].kind!==210&&we.unshift(t.createObjectLiteralExpression());let Be=we[0];if(we.length>1){for(let gt=1;gt=2&&c.getNodeCheckFlags(fe)&384;if(Dt){Di();const st=VO(t,c,fe,W);J[Oa(st)]=!0,vm(we,[st])}we.push(ht),vm(we,s());const Re=t.updateBlock(fe.body,we);return Dt&&X&&(c.getNodeCheckFlags(fe)&256?CT(Re,K8):c.getNodeCheckFlags(fe)&128&&CT(Re,Z8)),W=gt,X=G,Re}function Pi(fe){i();let we=0;const Be=[],gt=He(fe.body,$,vI)??t.createBlock([]);Ss(gt)&&(we=t.copyPrologue(gt.statements,Be,!1,$)),Dn(Be,ji(void 0,fe));const G=s();if(we>0||ut(Be)||ut(G)){const ht=t.converters.convertToFunctionBlock(gt,!0);return vm(Be,G),Dn(Be,ht.statements.slice(we)),t.updateBlock(ht,tt(t.createNodeArray(Be),ht.statements))}return gt}function ji(fe,we){let Be=!1;for(const gt of we.parameters)if(Be){if(As(gt.name)){if(gt.name.elements.length>0){const G=e2(gt,$,e,0,t.getGeneratedNameForNode(gt));if(ut(G)){const ht=t.createVariableDeclarationList(G),Dt=t.createVariableStatement(void 0,ht);Vr(Dt,2097152),fe=lr(fe,Dt)}}else if(gt.initializer){const G=t.getGeneratedNameForNode(gt),ht=He(gt.initializer,$,ct),Dt=t.createAssignment(G,ht),Re=t.createExpressionStatement(Dt);Vr(Re,2097152),fe=lr(fe,Re)}}else if(gt.initializer){const G=t.cloneNode(gt.name);tt(G,gt.name),Vr(G,96);const ht=He(gt.initializer,$,ct);Cm(ht,3168);const Dt=t.createAssignment(G,ht);tt(Dt,gt),Vr(Dt,3072);const Re=t.createBlock([t.createExpressionStatement(Dt)]);tt(Re,gt),Vr(Re,3905);const st=t.createTypeCheck(t.cloneNode(gt.name),"undefined"),Ct=t.createIfStatement(st,Re);Ru(Ct),tt(Ct,gt),Vr(Ct,2101056),fe=lr(fe,Ct)}}else if(gt.transformFlags&65536){Be=!0;const G=e2(gt,$,e,1,t.getGeneratedNameForNode(gt),!1,!0);if(ut(G)){const ht=t.createVariableDeclarationList(G),Dt=t.createVariableStatement(void 0,ht);Vr(Dt,2097152),fe=lr(fe,Dt)}}return fe}function Di(){S&1||(S|=1,e.enableSubstitution(213),e.enableSubstitution(211),e.enableSubstitution(212),e.enableEmitNotification(263),e.enableEmitNotification(174),e.enableEmitNotification(177),e.enableEmitNotification(178),e.enableEmitNotification(176),e.enableEmitNotification(243))}function $i(fe,we,Be){if(S&1&&ft(we)){const gt=c.getNodeCheckFlags(we)&384;if(gt!==w){const G=w;w=gt,g(fe,we,Be),w=G;return}}else if(S&&J[Oa(we)]){const gt=w;w=0,g(fe,we,Be),w=gt;return}g(fe,we,Be)}function Qs(fe,we){return we=p(fe,we),fe===1&&w?Ds(we):we}function Ds(fe){switch(fe.kind){case 211:return Ce(fe);case 212:return Ue(fe);case 213:return rt(fe)}return fe}function Ce(fe){return fe.expression.kind===108?tt(t.createPropertyAccessExpression(t.createUniqueName("_super",48),fe.name),fe):fe}function Ue(fe){return fe.expression.kind===108?dt(fe.argumentExpression,fe):fe}function rt(fe){const we=fe.expression;if(s_(we)){const Be=bn(we)?Ce(we):Ue(we);return t.createCallExpression(t.createPropertyAccessExpression(Be,"call"),void 0,[t.createThis(),...fe.arguments])}return fe}function ft(fe){const we=fe.kind;return we===263||we===176||we===174||we===177||we===178}function dt(fe,we){return w&256?tt(t.createPropertyAccessExpression(t.createCallExpression(t.createIdentifier("_superIndex"),void 0,[fe]),"value"),we):tt(t.createCallExpression(t.createIdentifier("_superIndex"),void 0,[fe]),we)}}var FLe=Nt({"src/compiler/transformers/es2018.ts"(){"use strict";Ns()}});function lse(e){const t=e.factory;return Up(e,r);function r(o){return o.isDeclarationFile?o:sr(o,i,e)}function i(o){if(!(o.transformFlags&64))return o;switch(o.kind){case 299:return s(o);default:return sr(o,i,e)}}function s(o){return o.variableDeclaration?sr(o,i,e):t.updateCatchClause(o,t.createVariableDeclaration(t.createTempVariable(void 0)),He(o.block,i,Ss))}}var OLe=Nt({"src/compiler/transformers/es2019.ts"(){"use strict";Ns()}});function use(e){const{factory:t,hoistVariableDeclaration:r}=e;return Up(e,i);function i(C){return C.isDeclarationFile?C:sr(C,s,e)}function s(C){if(!(C.transformFlags&32))return C;switch(C.kind){case 213:{const w=f(C,!1);return E.assertNotNode(w,RT),w}case 211:case 212:if(gu(C)){const w=p(C,!1,!1);return E.assertNotNode(w,RT),w}return sr(C,s,e);case 226:return C.operatorToken.kind===61?S(C):sr(C,s,e);case 220:return T(C);default:return sr(C,s,e)}}function o(C){E.assertNotNode(C,pI);const w=[C];for(;!C.questionDotToken&&!Db(C);)C=Ms(Fp(C.expression),gu),E.assertNotNode(C,pI),w.unshift(C);return{expression:C.expression,chain:w}}function c(C,w,D){const O=g(C.expression,w,D);return RT(O)?t.createSyntheticReferenceExpression(t.updateParenthesizedExpression(C,O.expression),O.thisArg):t.updateParenthesizedExpression(C,O)}function u(C,w,D){if(gu(C))return p(C,w,D);let O=He(C.expression,s,ct);E.assertNotNode(O,RT);let z;return w&&(Kv(O)?z=O:(z=t.createTempVariable(r),O=t.createAssignment(z,O))),O=C.kind===211?t.updatePropertyAccessExpression(C,O,He(C.name,s,Ie)):t.updateElementAccessExpression(C,O,He(C.argumentExpression,s,ct)),z?t.createSyntheticReferenceExpression(O,z):O}function f(C,w){if(gu(C))return p(C,w,!1);if(y_(C.expression)&&gu(Ha(C.expression))){const D=c(C.expression,!0,!1),O=kr(C.arguments,s,ct);return RT(D)?tt(t.createFunctionCallCall(D.expression,D.thisArg,O),C):t.updateCallExpression(C,D,void 0,O)}return sr(C,s,e)}function g(C,w,D){switch(C.kind){case 217:return c(C,w,D);case 211:case 212:return u(C,w,D);case 213:return f(C,w);default:return He(C,s,ct)}}function p(C,w,D){const{expression:O,chain:z}=o(C),W=g(Fp(O),tb(z[0]),!1);let X=RT(W)?W.thisArg:void 0,J=RT(W)?W.expression:W,ie=t.restoreOuterExpressions(O,J,8);Kv(J)||(J=t.createTempVariable(r),ie=t.createAssignment(J,ie));let B=J,Y;for(let _e=0;_ese&&Dn(Z,kr(oe.statements,y,Ci,se,ve-se));break}ve++}E.assert(veD(Z,se))))],se,Se===2)}return sr(oe,y,e)}function z(oe,Se,se,Z,ve){const Te=[];for(let he=Se;het&&(t=i)}return t}function jLe(e){let t=0;for(const r of e){const i=bV(r.statements);if(i===2)return 2;i>t&&(t=i)}return t}var BLe=Nt({"src/compiler/transformers/esnext.ts"(){"use strict";Ns()}});function gse(e){const{factory:t,getEmitHelperFactory:r}=e,i=e.getCompilerOptions();let s,o;return Up(e,y);function c(){if(o.filenameDeclaration)return o.filenameDeclaration.name;const me=t.createVariableDeclaration(t.createUniqueName("_jsxFileName",48),void 0,void 0,t.createStringLiteral(s.fileName));return o.filenameDeclaration=me,o.filenameDeclaration.name}function u(me){return i.jsx===5?"jsxDEV":me?"jsxs":"jsx"}function f(me){const Oe=u(me);return p(Oe)}function g(){return p("Fragment")}function p(me){var Oe,Xe;const it=me==="createElement"?o.importSpecifier:L5(o.importSpecifier,i),mt=(Xe=(Oe=o.utilizedImplicitRuntimeImports)==null?void 0:Oe.get(it))==null?void 0:Xe.get(me);if(mt)return mt.name;o.utilizedImplicitRuntimeImports||(o.utilizedImplicitRuntimeImports=new Map);let Je=o.utilizedImplicitRuntimeImports.get(it);Je||(Je=new Map,o.utilizedImplicitRuntimeImports.set(it,Je));const ot=t.createUniqueName(`_${me}`,112),Bt=t.createImportSpecifier(!1,t.createIdentifier(me),ot);return Ure(ot,Bt),Je.set(me,Bt),ot}function y(me){if(me.isDeclarationFile)return me;s=me,o={},o.importSpecifier=O5(i,me);let Oe=sr(me,S,e);Yg(Oe,e.readEmitHelpers());let Xe=Oe.statements;if(o.filenameDeclaration&&(Xe=ob(Xe.slice(),t.createVariableStatement(void 0,t.createVariableDeclarationList([o.filenameDeclaration],2)))),o.utilizedImplicitRuntimeImports){for(const[it,mt]of fs(o.utilizedImplicitRuntimeImports.entries()))if(Nc(me)){const Je=t.createImportDeclaration(void 0,t.createImportClause(!1,void 0,t.createNamedImports(fs(mt.values()))),t.createStringLiteral(it),void 0);$0(Je,!1),Xe=ob(Xe.slice(),Je)}else if(H_(me)){const Je=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createObjectBindingPattern(fs(mt.values(),ot=>t.createBindingElement(void 0,ot.propertyName,ot.name))),void 0,void 0,t.createCallExpression(t.createIdentifier("require"),void 0,[t.createStringLiteral(it)]))],2));$0(Je,!1),Xe=ob(Xe.slice(),Je)}}return Xe!==Oe.statements&&(Oe=t.updateSourceFile(Oe,Xe)),o=void 0,Oe}function S(me){return me.transformFlags&2?T(me):me}function T(me){switch(me.kind){case 284:return z(me,!1);case 285:return W(me,!1);case 288:return X(me,!1);case 294:return pt(me);default:return sr(me,S,e)}}function C(me){switch(me.kind){case 12:return ve(me);case 294:return pt(me);case 284:return z(me,!0);case 285:return W(me,!0);case 288:return X(me,!0);default:return E.failBadSyntaxKind(me)}}function w(me){return me.properties.some(Oe=>Hc(Oe)&&(Ie(Oe.name)&&an(Oe.name)==="__proto__"||ra(Oe.name)&&Oe.name.text==="__proto__"))}function D(me){let Oe=!1;for(const Xe of me.attributes.properties)if(BT(Xe)&&(!ma(Xe.expression)||Xe.expression.properties.some(Hh)))Oe=!0;else if(Oe&&Rd(Xe)&&Ie(Xe.name)&&Xe.name.escapedText==="key")return!0;return!1}function O(me){return o.importSpecifier===void 0||D(me)}function z(me,Oe){return(O(me.openingElement)?ae:B)(me.openingElement,me.children,Oe,me)}function W(me,Oe){return(O(me)?ae:B)(me,void 0,Oe,me)}function X(me,Oe){return(o.importSpecifier===void 0?$:_e)(me.openingFragment,me.children,Oe,me)}function J(me){const Oe=ie(me);return Oe&&t.createObjectLiteralExpression([Oe])}function ie(me){const Oe=Vk(me);if(Ir(Oe)===1&&!Oe[0].dotDotDotToken){const it=C(Oe[0]);return it&&t.createPropertyAssignment("children",it)}const Xe=Ii(me,C);return Ir(Xe)?t.createPropertyAssignment("children",t.createArrayLiteralExpression(Xe)):void 0}function B(me,Oe,Xe,it){const mt=be(me),Je=Oe&&Oe.length?ie(Oe):void 0,ot=kn(me.attributes.properties,br=>!!br.name&&Ie(br.name)&&br.name.escapedText==="key"),Bt=ot?wn(me.attributes.properties,br=>br!==ot):me.attributes.properties,Ht=Ir(Bt)?K(Bt,Je):t.createObjectLiteralExpression(Je?[Je]:ze);return Y(mt,Ht,ot,Oe||ze,Xe,it)}function Y(me,Oe,Xe,it,mt,Je){var ot;const Bt=Vk(it),Ht=Ir(Bt)>1||!!((ot=Bt[0])!=null&&ot.dotDotDotToken),br=[me,Oe];if(Xe&&br.push(Z(Xe.initializer)),i.jsx===5){const ar=Zo(s);if(ar&&Ai(ar)){Xe===void 0&&br.push(t.createVoidZero()),br.push(Ht?t.createTrue():t.createFalse());const Jt=qa(ar,Je.pos);br.push(t.createObjectLiteralExpression([t.createPropertyAssignment("fileName",c()),t.createPropertyAssignment("lineNumber",t.createNumericLiteral(Jt.line+1)),t.createPropertyAssignment("columnNumber",t.createNumericLiteral(Jt.character+1))])),br.push(t.createThis())}}const zr=tt(t.createCallExpression(f(Ht),void 0,br),Je);return mt&&Ru(zr),zr}function ae(me,Oe,Xe,it){const mt=be(me),Je=me.attributes.properties,ot=Ir(Je)?K(Je):t.createNull(),Bt=o.importSpecifier===void 0?QW(t,e.getEmitResolver().getJsxFactoryEntity(s),i.reactNamespace,me):p("createElement"),Ht=Tne(t,Bt,mt,ot,Ii(Oe,C),it);return Xe&&Ru(Ht),Ht}function _e(me,Oe,Xe,it){let mt;if(Oe&&Oe.length){const Je=J(Oe);Je&&(mt=Je)}return Y(g(),mt||t.createObjectLiteralExpression([]),void 0,Oe,Xe,it)}function $(me,Oe,Xe,it){const mt=xne(t,e.getEmitResolver().getJsxFactoryEntity(s),e.getEmitResolver().getJsxFragmentFactoryEntity(s),i.reactNamespace,Ii(Oe,C),me,it);return Xe&&Ru(mt),mt}function H(me){return ma(me.expression)&&!w(me.expression)?Yc(me.expression.properties,Oe=>E.checkDefined(He(Oe,S,qg))):t.createSpreadAssignment(E.checkDefined(He(me.expression,S,ct)))}function K(me,Oe){const Xe=Da(i);return Xe&&Xe>=5?t.createObjectLiteralExpression(oe(me,Oe)):Se(me,Oe)}function oe(me,Oe){const Xe=Np(fj(me,BT,(it,mt)=>Np(Yt(it,Je=>mt?H(Je):se(Je)))));return Oe&&Xe.push(Oe),Xe}function Se(me,Oe){const Xe=[];let it=[];for(const Je of me){if(BT(Je)){if(ma(Je.expression)&&!w(Je.expression)){for(const ot of Je.expression.properties){if(Hh(ot)){mt(),Xe.push(E.checkDefined(He(ot.expression,S,ct)));continue}it.push(E.checkDefined(He(ot,S)))}continue}mt(),Xe.push(E.checkDefined(He(Je.expression,S,ct)));continue}it.push(se(Je))}return Oe&&it.push(Oe),mt(),Xe.length&&!ma(Xe[0])&&Xe.unshift(t.createObjectLiteralExpression()),lm(Xe)||r().createAssignHelper(Xe);function mt(){it.length&&(Xe.push(t.createObjectLiteralExpression(it)),it=[])}}function se(me){const Oe=lt(me),Xe=Z(me.initializer);return t.createPropertyAssignment(Oe,Xe)}function Z(me){if(me===void 0)return t.createTrue();if(me.kind===11){const Oe=me.singleQuote!==void 0?me.singleQuote:!KI(me,s),Xe=t.createStringLiteral(he(me.text)||me.text,Oe);return tt(Xe,me)}return me.kind===294?me.expression===void 0?t.createTrue():E.checkDefined(He(me.expression,S,ct)):dg(me)?z(me,!1):Nb(me)?W(me,!1):qv(me)?X(me,!1):E.failBadSyntaxKind(me)}function ve(me){const Oe=Te(me.text);return Oe===void 0?void 0:t.createStringLiteral(Oe)}function Te(me){let Oe,Xe=0,it=-1;for(let mt=0;mt{if(Je)return fk(parseInt(Je,10));if(ot)return fk(parseInt(ot,16));{const Ht=B2e.get(Bt);return Ht?fk(Ht):Oe}})}function he(me){const Oe=ke(me);return Oe===me?void 0:Oe}function be(me){if(me.kind===284)return be(me.openingElement);{const Oe=me.tagName;return Ie(Oe)&&Hk(Oe.escapedText)?t.createStringLiteral(an(Oe)):sd(Oe)?t.createStringLiteral(an(Oe.namespace)+":"+an(Oe.name)):uw(t,Oe)}}function lt(me){const Oe=me.name;if(Ie(Oe)){const Xe=an(Oe);return/^[A-Za-z_]\w*$/.test(Xe)?Oe:t.createStringLiteral(Xe)}return t.createStringLiteral(an(Oe.namespace)+":"+an(Oe.name))}function pt(me){const Oe=He(me.expression,S,ct);return me.dotDotDotToken?t.createSpreadElement(Oe):Oe}}var B2e,JLe=Nt({"src/compiler/transformers/jsx.ts"(){"use strict";Ns(),B2e=new Map(Object.entries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}))}});function hse(e){const{factory:t,hoistVariableDeclaration:r}=e;return Up(e,i);function i(f){return f.isDeclarationFile?f:sr(f,s,e)}function s(f){if(!(f.transformFlags&512))return f;switch(f.kind){case 226:return o(f);default:return sr(f,s,e)}}function o(f){switch(f.operatorToken.kind){case 68:return c(f);case 43:return u(f);default:return sr(f,s,e)}}function c(f){let g,p;const y=He(f.left,s,ct),S=He(f.right,s,ct);if(mo(y)){const T=t.createTempVariable(r),C=t.createTempVariable(r);g=tt(t.createElementAccessExpression(tt(t.createAssignment(T,y.expression),y.expression),tt(t.createAssignment(C,y.argumentExpression),y.argumentExpression)),y),p=tt(t.createElementAccessExpression(T,C),y)}else if(bn(y)){const T=t.createTempVariable(r);g=tt(t.createPropertyAccessExpression(tt(t.createAssignment(T,y.expression),y.expression),y.name),y),p=tt(t.createPropertyAccessExpression(T,y.name),y)}else g=y,p=y;return tt(t.createAssignment(g,tt(t.createGlobalMethodCall("Math","pow",[p,S]),f)),f)}function u(f){const g=He(f.left,s,ct),p=He(f.right,s,ct);return tt(t.createGlobalMethodCall("Math","pow",[g,p]),f)}}var zLe=Nt({"src/compiler/transformers/es2016.ts"(){"use strict";Ns()}});function J2e(e,t){return{kind:e,expression:t}}function yse(e){const{factory:t,getEmitHelperFactory:r,startLexicalEnvironment:i,resumeLexicalEnvironment:s,endLexicalEnvironment:o,hoistVariableDeclaration:c}=e,u=e.getCompilerOptions(),f=e.getEmitResolver(),g=e.onSubstituteNode,p=e.onEmitNode;e.onEmitNode=yp,e.onSubstituteNode=Jf;let y,S,T,C;function w(Q){C=lr(C,t.createVariableDeclaration(Q))}let D,O;return Up(e,z);function z(Q){if(Q.isDeclarationFile)return Q;y=Q,S=Q.text;const Ye=K(Q);return Yg(Ye,e.readEmitHelpers()),y=void 0,S=void 0,C=void 0,T=0,Ye}function W(Q,Ye){const Et=T;return T=(T&~Q|Ye)&32767,Et}function X(Q,Ye,Et){T=(T&~Ye|Et)&-32768|Q}function J(Q){return(T&8192)!==0&&Q.kind===253&&!Q.expression}function ie(Q){return Q.transformFlags&4194304&&(Bp(Q)||Pb(Q)||cne(Q)||sw(Q)||WE(Q)||mC(Q)||ow(Q)||Ab(Q)||Gv(Q)||Uv(Q)||j0(Q,!1)||Ss(Q))}function B(Q){return(Q.transformFlags&1024)!==0||D!==void 0||T&8192&&ie(Q)||j0(Q,!1)&&hs(Q)||(Op(Q)&1)!==0}function Y(Q){return B(Q)?H(Q,!1):Q}function ae(Q){return B(Q)?H(Q,!0):Q}function _e(Q){if(B(Q)){const Ye=Zo(Q);if(Es(Ye)&&Uc(Ye)){const Et=W(32670,16449),Pt=H(Q,!1);return X(Et,229376,0),Pt}return H(Q,!1)}return Q}function $(Q){return Q.kind===108?nc(Q,!0):Y(Q)}function H(Q,Ye){switch(Q.kind){case 126:return;case 263:return be(Q);case 231:return lt(Q);case 169:return Ds(Q);case 262:return er(Q);case 219:return Ct(Q);case 218:return Qt(Q);case 260:return Lr(Q);case 80:return ke(Q);case 261:return Fe(Q);case 255:return oe(Q);case 269:return Se(Q);case 241:return j(Q,!1);case 252:case 251:return he(Q);case 256:return On(Q);case 246:case 247:return Cn(Q,void 0);case 248:return Ki(Q,void 0);case 249:return _i(Q,void 0);case 250:return ia(Q,void 0);case 244:return ce(Q);case 210:return Ga(Q);case 299:return li(Q);case 304:return tl(Q);case 167:return no(Q);case 209:return Xa(Q);case 213:return hl(Q);case 214:return Bf(Q);case 217:return ee(Q,Ye);case 226:return ue(Q,Ye);case 361:return M(Q,Ye);case 15:case 16:case 17:case 18:return Fs(Q);case 11:return uc(Q);case 9:return hc(Q);case 215:return jo(Q);case 228:return qo(Q);case 229:return rl(Q);case 230:return Ps(Q);case 108:return nc(Q,!1);case 110:return Te(Q);case 236:return Oc(Q);case 174:return va(Q);case 177:case 178:return lc(Q);case 243:return Ve(Q);case 253:return ve(Q);case 222:return Me(Q);default:return sr(Q,Y,e)}}function K(Q){const Ye=W(8064,64),Et=[],Pt=[];i();const L=t.copyPrologue(Q.statements,Et,!1,Y);return Dn(Pt,kr(Q.statements,Y,Ci,L)),C&&Pt.push(t.createVariableStatement(void 0,t.createVariableDeclarationList(C))),t.mergeLexicalEnvironment(Et,o()),we(Et,Q),X(Ye,0,0),t.updateSourceFile(Q,tt(t.createNodeArray(Xi(Et,Pt)),Q.statements))}function oe(Q){if(D!==void 0){const Ye=D.allowedNonLabeledJumps;D.allowedNonLabeledJumps|=2;const Et=sr(Q,Y,e);return D.allowedNonLabeledJumps=Ye,Et}return sr(Q,Y,e)}function Se(Q){const Ye=W(7104,0),Et=sr(Q,Y,e);return X(Ye,0,0),Et}function se(Q){return rn(t.createReturnStatement(Z()),Q)}function Z(){return t.createUniqueName("_this",48)}function ve(Q){return D?(D.nonLocalJumps|=8,J(Q)&&(Q=se(Q)),t.createReturnStatement(t.createObjectLiteralExpression([t.createPropertyAssignment(t.createIdentifier("value"),Q.expression?E.checkDefined(He(Q.expression,Y,ct)):t.createVoidZero())]))):J(Q)?se(Q):sr(Q,Y,e)}function Te(Q){return T|=65536,T&2&&!(T&16384)&&(T|=131072),D?T&2?(D.containsLexicalThis=!0,Q):D.thisName||(D.thisName=t.createUniqueName("this")):Q}function Me(Q){return sr(Q,ae,e)}function ke(Q){return D&&f.isArgumentsLocalBinding(Q)?D.argumentsName||(D.argumentsName=t.createUniqueName("arguments")):Q.flags&256?rn(tt(t.createIdentifier(bi(Q.escapedText)),Q),Q):Q}function he(Q){if(D){const Ye=Q.kind===252?2:4;if(!(Q.label&&D.labels&&D.labels.get(an(Q.label))||!Q.label&&D.allowedNonLabeledJumps&Ye)){let Pt;const L=Q.label;L?Q.kind===252?(Pt=`break-${L.escapedText}`,Pe(D,!0,an(L),Pt)):(Pt=`continue-${L.escapedText}`,Pe(D,!1,an(L),Pt)):Q.kind===252?(D.nonLocalJumps|=2,Pt="break"):(D.nonLocalJumps|=4,Pt="continue");let pe=t.createStringLiteral(Pt);if(D.loopOutParameters.length){const Ze=D.loopOutParameters;let At;for(let Mr=0;MrIe(Ye.name)&&!Ye.initializer)}function ot(Q){if(ub(Q))return!0;if(!(Q.transformFlags&134217728))return!1;switch(Q.kind){case 219:case 218:case 262:case 176:case 175:return!1;case 177:case 178:case 174:case 172:{const Ye=Q;return xa(Ye.name)?!!ds(Ye.name,ot):!1}}return!!ds(Q,ot)}function Bt(Q,Ye,Et,Pt){const L=!!Et&&bc(Et.expression).kind!==106;if(!Q)return mt(Ye,L);const pe=[],Ze=[];s();const At=t.copyStandardPrologue(Q.body.statements,pe,0);(Pt||ot(Q.body))&&(T|=8192),Dn(Ze,kr(Q.body.statements,Y,Ci,At));const Mr=L||T&8192;Ue(pe,Q),fe(pe,Q,Pt),gt(pe,Q),Mr?Be(pe,Q,$i()):we(pe,Q),t.mergeLexicalEnvironment(pe,o()),Mr&&!Di(Q.body)&&Ze.push(t.createReturnStatement(Z()));const Rn=t.createBlock(tt(t.createNodeArray([...pe,...Ze]),Q.body.statements),!0);return tt(Rn,Q.body),ji(Rn,Q.body,Pt)}function Ht(Q){return Eo(Q)&&an(Q)==="_this"}function br(Q){return Eo(Q)&&an(Q)==="_super"}function zr(Q){return ec(Q)&&Q.declarationList.declarations.length===1&&ar(Q.declarationList.declarations[0])}function ar(Q){return Ei(Q)&&Ht(Q.name)&&!!Q.initializer}function Jt(Q){return sl(Q,!0)&&Ht(Q.left)}function It(Q){return Rs(Q)&&bn(Q.expression)&&br(Q.expression.expression)&&Ie(Q.expression.name)&&(an(Q.expression.name)==="call"||an(Q.expression.name)==="apply")&&Q.arguments.length>=1&&Q.arguments[0].kind===110}function Nn(Q){return Gr(Q)&&Q.operatorToken.kind===57&&Q.right.kind===110&&It(Q.left)}function Fi(Q){return Gr(Q)&&Q.operatorToken.kind===56&&Gr(Q.left)&&Q.left.operatorToken.kind===38&&br(Q.left.left)&&Q.left.right.kind===106&&It(Q.right)&&an(Q.right.expression.name)==="apply"}function ei(Q){return Gr(Q)&&Q.operatorToken.kind===57&&Q.right.kind===110&&Fi(Q.left)}function zi(Q){return Jt(Q)&&Nn(Q.right)}function Qe(Q){return Jt(Q)&&ei(Q.right)}function ur(Q){return It(Q)||Nn(Q)||zi(Q)||Fi(Q)||ei(Q)||Qe(Q)}function Dr(Q){for(let Ye=0;Ye0;Pt--){const L=Q.statements[Pt];if(Bp(L)&&L.expression&&Ht(L.expression)){const pe=Q.statements[Pt-1];let Ze;if(kl(pe)&&zi(bc(pe.expression)))Ze=pe.expression;else if(Et&&zr(pe)){const Rn=pe.declarationList.declarations[0];ur(bc(Rn.initializer))&&(Ze=t.createAssignment(Z(),Rn.initializer))}if(!Ze)break;const At=t.createReturnStatement(Ze);rn(At,pe),tt(At,pe);const Mr=t.createNodeArray([...Q.statements.slice(0,Pt-1),At,...Q.statements.slice(Pt+1)]);return tt(Mr,Q.statements),t.updateBlock(Q,Mr)}}return Q}function yr(Q){if(zr(Q)){if(Q.declarationList.declarations[0].initializer.kind===110)return}else if(Jt(Q))return t.createPartiallyEmittedExpression(Q.right,Q);switch(Q.kind){case 219:case 218:case 262:case 176:case 175:return Q;case 177:case 178:case 174:case 172:{const Ye=Q;return xa(Ye.name)?t.replacePropertyName(Ye,sr(Ye.name,yr,cd)):Q}}return sr(Q,yr,cd)}function Tr(Q,Ye){if(Ye.transformFlags&16384||T&65536||T&131072)return Q;for(const Et of Ye.statements)if(Et.transformFlags&134217728&&!jO(Et))return Q;return t.updateBlock(Q,kr(Q.statements,yr,Ci))}function Xr(Q){if(It(Q)&&Q.arguments.length===2&&Ie(Q.arguments[1])&&an(Q.arguments[1])==="arguments")return t.createLogicalAnd(t.createStrictInequality(kc(),t.createNull()),Q);switch(Q.kind){case 219:case 218:case 262:case 176:case 175:return Q;case 177:case 178:case 174:case 172:{const Ye=Q;return xa(Ye.name)?t.replacePropertyName(Ye,sr(Ye.name,Xr,cd)):Q}}return sr(Q,Xr,cd)}function Pi(Q){return t.updateBlock(Q,kr(Q.statements,Xr,Ci))}function ji(Q,Ye,Et){const Pt=Q;return Q=Dr(Q),Q=Ft(Q,Ye),Q!==Pt&&(Q=Tr(Q,Ye)),Et&&(Q=Pi(Q)),Q}function Di(Q){if(Q.kind===253)return!0;if(Q.kind===245){const Ye=Q;if(Ye.elseStatement)return Di(Ye.thenStatement)&&Di(Ye.elseStatement)}else if(Q.kind===241){const Ye=Mo(Q.statements);if(Ye&&Di(Ye))return!0}return!1}function $i(){return Vr(t.createThis(),8)}function Qs(){return t.createLogicalOr(t.createLogicalAnd(t.createStrictInequality(kc(),t.createNull()),t.createFunctionApplyCall(kc(),$i(),t.createIdentifier("arguments"))),$i())}function Ds(Q){if(!Q.dotDotDotToken)return As(Q.name)?rn(tt(t.createParameterDeclaration(void 0,void 0,t.getGeneratedNameForNode(Q),void 0,void 0,void 0),Q),Q):Q.initializer?rn(tt(t.createParameterDeclaration(void 0,void 0,Q.name,void 0,void 0,void 0),Q),Q):Q}function Ce(Q){return Q.initializer!==void 0||As(Q.name)}function Ue(Q,Ye){if(!ut(Ye.parameters,Ce))return!1;let Et=!1;for(const Pt of Ye.parameters){const{name:L,initializer:pe,dotDotDotToken:Ze}=Pt;Ze||(As(L)?Et=rt(Q,Pt,L,pe)||Et:pe&&(ft(Q,Pt,L,pe),Et=!0))}return Et}function rt(Q,Ye,Et,Pt){return Et.elements.length>0?(ob(Q,Vr(t.createVariableStatement(void 0,t.createVariableDeclarationList(e2(Ye,Y,e,0,t.getGeneratedNameForNode(Ye)))),2097152)),!0):Pt?(ob(Q,Vr(t.createExpressionStatement(t.createAssignment(t.getGeneratedNameForNode(Ye),E.checkDefined(He(Pt,Y,ct)))),2097152)),!0):!1}function ft(Q,Ye,Et,Pt){Pt=E.checkDefined(He(Pt,Y,ct));const L=t.createIfStatement(t.createTypeCheck(t.cloneNode(Et),"undefined"),Vr(tt(t.createBlock([t.createExpressionStatement(Vr(tt(t.createAssignment(Vr(ga(tt(t.cloneNode(Et),Et),Et.parent),96),Vr(Pt,96|da(Pt)|3072)),Ye),3072))]),Ye),3905));Ru(L),tt(L,Ye),Vr(L,2101056),ob(Q,L)}function dt(Q,Ye){return!!(Q&&Q.dotDotDotToken&&!Ye)}function fe(Q,Ye,Et){const Pt=[],L=Mo(Ye.parameters);if(!dt(L,Et))return!1;const pe=L.name.kind===80?ga(tt(t.cloneNode(L.name),L.name),L.name.parent):t.createTempVariable(void 0);Vr(pe,96);const Ze=L.name.kind===80?t.cloneNode(L.name):pe,At=Ye.parameters.length-1,Mr=t.createLoopVariable();Pt.push(Vr(tt(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(pe,void 0,void 0,t.createArrayLiteralExpression([]))])),L),2097152));const Rn=t.createForStatement(tt(t.createVariableDeclarationList([t.createVariableDeclaration(Mr,void 0,void 0,t.createNumericLiteral(At))]),L),tt(t.createLessThan(Mr,t.createPropertyAccessExpression(t.createIdentifier("arguments"),"length")),L),tt(t.createPostfixIncrement(Mr),L),t.createBlock([Ru(tt(t.createExpressionStatement(t.createAssignment(t.createElementAccessExpression(Ze,At===0?Mr:t.createSubtract(Mr,t.createNumericLiteral(At))),t.createElementAccessExpression(t.createIdentifier("arguments"),Mr))),L))]));return Vr(Rn,2097152),Ru(Rn),Pt.push(Rn),L.name.kind!==80&&Pt.push(Vr(tt(t.createVariableStatement(void 0,t.createVariableDeclarationList(e2(L,Y,e,0,Ze))),L),2097152)),CJ(Q,Pt),!0}function we(Q,Ye){return T&131072&&Ye.kind!==219?(Be(Q,Ye,t.createThis()),!0):!1}function Be(Q,Ye,Et){Xu();const Pt=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(Z(),void 0,void 0,Et)]));Vr(Pt,2100224),ya(Pt,Ye),ob(Q,Pt)}function gt(Q,Ye){if(T&32768){let Et;switch(Ye.kind){case 219:return Q;case 174:case 177:case 178:Et=t.createVoidZero();break;case 176:Et=t.createPropertyAccessExpression(Vr(t.createThis(),8),"constructor");break;case 262:case 218:Et=t.createConditionalExpression(t.createLogicalAnd(Vr(t.createThis(),8),t.createBinaryExpression(Vr(t.createThis(),8),104,t.getLocalName(Ye))),void 0,t.createPropertyAccessExpression(Vr(t.createThis(),8),"constructor"),void 0,t.createVoidZero());break;default:return E.failBadSyntaxKind(Ye)}const Pt=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_newTarget",48),void 0,void 0,Et)]));Vr(Pt,2100224),ob(Q,Pt)}return Q}function G(Q,Ye){for(const Et of Ye.members)switch(Et.kind){case 240:Q.push(ht(Et));break;case 174:Q.push(Dt(zf(Ye,Et),Et,Ye));break;case 177:case 178:const Pt=vb(Ye.members,Et);Et===Pt.firstAccessor&&Q.push(Re(zf(Ye,Et),Pt,Ye));break;case 176:case 175:break;default:E.failBadSyntaxKind(Et,y&&y.fileName);break}}function ht(Q){return tt(t.createEmptyStatement(),Q)}function Dt(Q,Ye,Et){const Pt=Fd(Ye),L=c1(Ye),pe=or(Ye,Ye,void 0,Et),Ze=He(Ye.name,Y,wc);E.assert(Ze);let At;if(!Ti(Ze)&&A8(e.getCompilerOptions())){const Rn=xa(Ze)?Ze.expression:Ie(Ze)?t.createStringLiteral(bi(Ze.escapedText)):Ze;At=t.createObjectDefinePropertyCall(Q,Rn,t.createPropertyDescriptor({value:pe,enumerable:!1,writable:!0,configurable:!0}))}else{const Rn=Ob(t,Q,Ze,Ye.name);At=t.createAssignment(Rn,pe)}Vr(pe,3072),ya(pe,L);const Mr=tt(t.createExpressionStatement(At),Ye);return rn(Mr,Ye),Ac(Mr,Pt),Vr(Mr,96),Mr}function Re(Q,Ye,Et){const Pt=t.createExpressionStatement(st(Q,Ye,Et,!1));return Vr(Pt,3072),ya(Pt,c1(Ye.firstAccessor)),Pt}function st(Q,{firstAccessor:Ye,getAccessor:Et,setAccessor:Pt},L,pe){const Ze=ga(tt(t.cloneNode(Q),Q),Q.parent);Vr(Ze,3136),ya(Ze,Ye.name);const At=He(Ye.name,Y,wc);if(E.assert(At),Ti(At))return E.failBadSyntaxKind(At,"Encountered unhandled private identifier while transforming ES2015.");const Mr=ZW(t,At);Vr(Mr,3104),ya(Mr,Ye.name);const Rn=[];if(Et){const Oi=or(Et,void 0,void 0,L);ya(Oi,c1(Et)),Vr(Oi,1024);const sa=t.createPropertyAssignment("get",Oi);Ac(sa,Fd(Et)),Rn.push(sa)}if(Pt){const Oi=or(Pt,void 0,void 0,L);ya(Oi,c1(Pt)),Vr(Oi,1024);const sa=t.createPropertyAssignment("set",Oi);Ac(sa,Fd(Pt)),Rn.push(sa)}Rn.push(t.createPropertyAssignment("enumerable",Et||Pt?t.createFalse():t.createTrue()),t.createPropertyAssignment("configurable",t.createTrue()));const jn=t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"defineProperty"),void 0,[Ze,Mr,t.createObjectLiteralExpression(Rn,!0)]);return pe&&Ru(jn),jn}function Ct(Q){Q.transformFlags&16384&&!(T&16384)&&(T|=131072);const Ye=D;D=void 0;const Et=W(15232,66),Pt=t.createFunctionExpression(void 0,void 0,void 0,void 0,Sc(Q.parameters,Y,e),void 0,U(Q));return tt(Pt,Q),rn(Pt,Q),Vr(Pt,16),X(Et,0,0),D=Ye,Pt}function Qt(Q){const Ye=da(Q)&524288?W(32662,69):W(32670,65),Et=D;D=void 0;const Pt=Sc(Q.parameters,Y,e),L=U(Q),pe=T&32768?t.getLocalName(Q):Q.name;return X(Ye,229376,0),D=Et,t.updateFunctionExpression(Q,void 0,Q.asteriskToken,pe,void 0,Pt,void 0,L)}function er(Q){const Ye=D;D=void 0;const Et=W(32670,65),Pt=Sc(Q.parameters,Y,e),L=U(Q),pe=T&32768?t.getLocalName(Q):Q.name;return X(Et,229376,0),D=Ye,t.updateFunctionDeclaration(Q,kr(Q.modifiers,Y,Ys),Q.asteriskToken,pe,void 0,Pt,void 0,L)}function or(Q,Ye,Et,Pt){const L=D;D=void 0;const pe=Pt&&Qn(Pt)&&!Ls(Q)?W(32670,73):W(32670,65),Ze=Sc(Q.parameters,Y,e),At=U(Q);return T&32768&&!Et&&(Q.kind===262||Q.kind===218)&&(Et=t.getGeneratedNameForNode(Q)),X(pe,229376,0),D=L,rn(tt(t.createFunctionExpression(void 0,Q.asteriskToken,Et,void 0,Ze,void 0,At),Ye),Q)}function U(Q){let Ye=!1,Et=!1,Pt,L;const pe=[],Ze=[],At=Q.body;let Mr;if(s(),Ss(At)&&(Mr=t.copyStandardPrologue(At.statements,pe,0,!1),Mr=t.copyCustomPrologue(At.statements,Ze,Mr,Y,RI),Mr=t.copyCustomPrologue(At.statements,Ze,Mr,Y,jI)),Ye=Ue(Ze,Q)||Ye,Ye=fe(Ze,Q,!1)||Ye,Ss(At))Mr=t.copyCustomPrologue(At.statements,Ze,Mr,Y),Pt=At.statements,Dn(Ze,kr(At.statements,Y,Ci,Mr)),!Ye&&At.multiLine&&(Ye=!0);else{E.assert(Q.kind===219),Pt=S5(At,-1);const jn=Q.equalsGreaterThanToken;!Po(jn)&&!Po(At)&&(C8(jn,At,y)?Et=!0:Ye=!0);const Oi=He(At,Y,ct),sa=t.createReturnStatement(Oi);tt(sa,At),Rre(sa,At),Vr(sa,2880),Ze.push(sa),L=At}if(t.mergeLexicalEnvironment(pe,o()),gt(pe,Q),we(pe,Q),ut(pe)&&(Ye=!0),Ze.unshift(...pe),Ss(At)&&Zp(Ze,At.statements))return At;const Rn=t.createBlock(tt(t.createNodeArray(Ze),Pt),Ye);return tt(Rn,Q.body),!Ye&&Et&&Vr(Rn,1),L&&Mre(Rn,20,L),rn(Rn,Q.body),Rn}function j(Q,Ye){if(Ye)return sr(Q,Y,e);const Et=T&256?W(7104,512):W(6976,128),Pt=sr(Q,Y,e);return X(Et,0,0),Pt}function ce(Q){return sr(Q,ae,e)}function ee(Q,Ye){return sr(Q,Ye?ae:Y,e)}function ue(Q,Ye){return Jh(Q)?jb(Q,Y,e,0,!Ye):Q.operatorToken.kind===28?t.updateBinaryExpression(Q,E.checkDefined(He(Q.left,ae,ct)),Q.operatorToken,E.checkDefined(He(Q.right,Ye?ae:Y,ct))):sr(Q,Y,e)}function M(Q,Ye){if(Ye)return sr(Q,ae,e);let Et;for(let L=0;LMr.name)),At=Pt?t.createYieldExpression(t.createToken(42),Vr(Ze,8388608)):Ze;if(pe)L.push(t.createExpressionStatement(At)),vo(Ye.loopOutParameters,1,0,L);else{const Mr=t.createUniqueName("state"),Rn=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(Mr,void 0,void 0,At)]));if(L.push(Rn),vo(Ye.loopOutParameters,1,0,L),Ye.nonLocalJumps&8){let jn;Et?(Et.nonLocalJumps|=8,jn=t.createReturnStatement(Mr)):jn=t.createReturnStatement(t.createPropertyAccessExpression(Mr,"value")),L.push(t.createIfStatement(t.createTypeCheck(Mr,"object"),jn))}if(Ye.nonLocalJumps&2&&L.push(t.createIfStatement(t.createStrictEquality(Mr,t.createStringLiteral("break")),t.createBreakStatement())),Ye.labeledNonLocalBreaks||Ye.labeledNonLocalContinues){const jn=[];qe(Ye.labeledNonLocalBreaks,!0,Mr,Et,jn),qe(Ye.labeledNonLocalContinues,!1,Mr,Et,jn),L.push(t.createSwitchStatement(Mr,t.createCaseBlock(jn)))}}return L}function Pe(Q,Ye,Et,Pt){Ye?(Q.labeledNonLocalBreaks||(Q.labeledNonLocalBreaks=new Map),Q.labeledNonLocalBreaks.set(Et,Pt)):(Q.labeledNonLocalContinues||(Q.labeledNonLocalContinues=new Map),Q.labeledNonLocalContinues.set(Et,Pt))}function qe(Q,Ye,Et,Pt,L){Q&&Q.forEach((pe,Ze)=>{const At=[];if(!Pt||Pt.labels&&Pt.labels.get(Ze)){const Mr=t.createIdentifier(Ze);At.push(Ye?t.createBreakStatement(Mr):t.createContinueStatement(Mr))}else Pe(Pt,Ye,Ze,pe),At.push(t.createReturnStatement(Et));L.push(t.createCaseClause(t.createStringLiteral(pe),At))})}function Tt(Q,Ye,Et,Pt,L){const pe=Ye.name;if(As(pe))for(const Ze of pe.elements)dl(Ze)||Tt(Q,Ze,Et,Pt,L);else{Et.push(t.createParameterDeclaration(void 0,void 0,pe));const Ze=f.getNodeCheckFlags(Ye);if(Ze&65536||L){const At=t.createUniqueName("out_"+an(pe));let Mr=0;Ze&65536&&(Mr|=1),wb(Q)&&(Q.initializer&&f.isBindingCapturedByNode(Q.initializer,Ye)&&(Mr|=2),(Q.condition&&f.isBindingCapturedByNode(Q.condition,Ye)||Q.incrementor&&f.isBindingCapturedByNode(Q.incrementor,Ye))&&(Mr|=1)),Pt.push({flags:Mr,originalName:pe,outParamName:At})}}}function dr(Q,Ye,Et,Pt){const L=Ye.properties,pe=L.length;for(let Ze=Pt;Zeec(_a)&&!!ba(_a.declarationList.declarations).initializer,Pt=D;D=void 0;const L=kr(Ye.statements,_e,Ci);D=Pt;const pe=wn(L,Et),Ze=wn(L,_a=>!Et(_a)),Mr=Ms(ba(pe),ec).declarationList.declarations[0],Rn=bc(Mr.initializer);let jn=Jn(Rn,sl);!jn&&Gr(Rn)&&Rn.operatorToken.kind===28&&(jn=Jn(Rn.left,sl));const Oi=Ms(jn?bc(jn.right):Rn,Rs),sa=Ms(bc(Oi.expression),ro),aa=sa.body.statements;let Xo=0,Xl=-1;const ll=[];if(jn){const _a=Jn(aa[Xo],kl);_a&&(ll.push(_a),Xo++),ll.push(aa[Xo]),Xo++,ll.push(t.createExpressionStatement(t.createAssignment(jn.left,Ms(Mr.name,Ie))))}for(;!Bp(Ah(aa,Xl));)Xl--;Dn(ll,aa,Xo,Xl),Xl<-1&&Dn(ll,aa,Xl+1);const kf=Jn(Ah(aa,Xl),Bp);for(const _a of Ze)Bp(_a)&&kf?.expression&&!Ie(kf.expression)?ll.push(kf):ll.push(_a);return Dn(ll,pe,1),t.restoreOuterExpressions(Q.expression,t.restoreOuterExpressions(Mr.initializer,t.restoreOuterExpressions(jn&&jn.right,t.updateCallExpression(Oi,t.restoreOuterExpressions(Oi.expression,t.updateFunctionExpression(sa,void 0,void 0,void 0,void 0,sa.parameters,void 0,t.updateBlock(sa.body,ll))),void 0,Oi.arguments))))}function xu(Q,Ye){if(Q.transformFlags&32768||Q.expression.kind===108||s_(bc(Q.expression))){const{target:Et,thisArg:Pt}=t.createCallBinding(Q.expression,c);Q.expression.kind===108&&Vr(Pt,8);let L;if(Q.transformFlags&32768?L=t.createFunctionApplyCall(E.checkDefined(He(Et,$,ct)),Q.expression.kind===108?Pt:E.checkDefined(He(Pt,Y,ct)),$l(Q.arguments,!0,!1,!1)):L=tt(t.createFunctionCallCall(E.checkDefined(He(Et,$,ct)),Q.expression.kind===108?Pt:E.checkDefined(He(Pt,Y,ct)),kr(Q.arguments,Y,ct)),Q),Q.expression.kind===108){const pe=t.createLogicalOr(L,$i());L=Ye?t.createAssignment(Z(),pe):pe}return rn(L,Q)}return ub(Q)&&(T|=131072),sr(Q,Y,e)}function Bf(Q){if(ut(Q.arguments,Od)){const{target:Ye,thisArg:Et}=t.createCallBinding(t.createPropertyAccessExpression(Q.expression,"bind"),c);return t.createNewExpression(t.createFunctionApplyCall(E.checkDefined(He(Ye,Y,ct)),Et,$l(t.createNodeArray([t.createVoidZero(),...Q.arguments]),!0,!1,!1)),void 0,[])}return sr(Q,Y,e)}function $l(Q,Ye,Et,Pt){const L=Q.length,pe=Np(fj(Q,ye,(Rn,jn,Oi,sa)=>jn(Rn,Et,Pt&&sa===L)));if(pe.length===1){const Rn=pe[0];if(Ye&&!u.downlevelIteration||Qz(Rn.expression)||IE(Rn.expression,"___spreadArray"))return Rn.expression}const Ze=r(),At=pe[0].kind!==0;let Mr=At?t.createArrayLiteralExpression():pe[0].expression;for(let Rn=At?0:1;Rn0&&Pt.push(t.createStringLiteral(Et.literal.text)),Ye=t.createCallExpression(t.createPropertyAccessExpression(Ye,"concat"),void 0,Pt)}return tt(Ye,Q)}function kc(){return t.createUniqueName("_super",48)}function nc(Q,Ye){const Et=T&8&&!Ye?t.createPropertyAccessExpression(rn(kc(),Q),"prototype"):kc();return rn(Et,Q),Ac(Et,Q),ya(Et,Q),Et}function Oc(Q){return Q.keywordToken===105&&Q.name.escapedText==="target"?(T|=32768,t.createUniqueName("_newTarget",48)):Q}function yp(Q,Ye,Et){if(O&1&&ks(Ye)){const Pt=W(32670,da(Ye)&16?81:65);p(Q,Ye,Et),X(Pt,0,0);return}p(Q,Ye,Et)}function xf(){O&2||(O|=2,e.enableSubstitution(80))}function Xu(){O&1||(O|=1,e.enableSubstitution(110),e.enableEmitNotification(176),e.enableEmitNotification(174),e.enableEmitNotification(177),e.enableEmitNotification(178),e.enableEmitNotification(219),e.enableEmitNotification(218),e.enableEmitNotification(262))}function Jf(Q,Ye){return Ye=g(Q,Ye),Q===1?n0(Ye):Ie(Ye)?vg(Ye):Ye}function vg(Q){if(O&2&&!KW(Q)){const Ye=ss(Q,Ie);if(Ye&&Fm(Ye))return tt(t.getGeneratedNameForNode(Ye),Q)}return Q}function Fm(Q){switch(Q.parent.kind){case 208:case 263:case 266:case 260:return Q.parent.name===Q&&f.isDeclarationWithCollidingName(Q.parent)}return!1}function n0(Q){switch(Q.kind){case 80:return ou(Q);case 110:return L_(Q)}return Q}function ou(Q){if(O&2&&!KW(Q)){const Ye=f.getReferencedDeclarationWithCollidingName(Q);if(Ye&&!(Qn(Ye)&&bg(Ye,Q)))return tt(t.getGeneratedNameForNode(as(Ye)),Q)}return Q}function bg(Q,Ye){let Et=ss(Ye);if(!Et||Et===Q||Et.end<=Q.pos||Et.pos>=Q.end)return!1;const Pt=bm(Q);for(;Et;){if(Et===Pt||Et===Q)return!1;if(Pl(Et)&&Et.parent===Q)return!0;Et=Et.parent}return!1}function L_(Q){return O&1&&T&16?tt(Z(),Q):Q}function zf(Q,Ye){return Ls(Ye)?t.getInternalName(Q):t.createPropertyAccessExpression(t.getInternalName(Q),"prototype")}function Qu(Q,Ye){if(!Q||!Ye||ut(Q.parameters))return!1;const Et=bl(Q.body.statements);if(!Et||!Po(Et)||Et.kind!==244)return!1;const Pt=Et.expression;if(!Po(Pt)||Pt.kind!==213)return!1;const L=Pt.expression;if(!Po(L)||L.kind!==108)return!1;const pe=lm(Pt.arguments);if(!pe||!Po(pe)||pe.kind!==230)return!1;const Ze=pe.expression;return Ie(Ze)&&Ze.escapedText==="arguments"}}var WLe=Nt({"src/compiler/transformers/es2015.ts"(){"use strict";Ns()}});function vse(e){const{factory:t}=e,r=e.getCompilerOptions();let i,s;(r.jsx===1||r.jsx===3)&&(i=e.onEmitNode,e.onEmitNode=u,e.enableEmitNotification(286),e.enableEmitNotification(287),e.enableEmitNotification(285),s=[]);const o=e.onSubstituteNode;return e.onSubstituteNode=f,e.enableSubstitution(211),e.enableSubstitution(303),Up(e,c);function c(S){return S}function u(S,T,C){switch(T.kind){case 286:case 287:case 285:const w=T.tagName;s[iu(w)]=!0;break}i(S,T,C)}function f(S,T){return T.id&&s&&s[T.id]?o(S,T):(T=o(S,T),bn(T)?g(T):Hc(T)?p(T):T)}function g(S){if(Ti(S.name))return S;const T=y(S.name);return T?tt(t.createElementAccessExpression(S.expression,T),S):S}function p(S){const T=Ie(S.name)&&y(S.name);return T?t.updatePropertyAssignment(S,T,S.initializer):S}function y(S){const T=Xy(S);if(T!==void 0&&T>=83&&T<=118)return tt(t.createStringLiteralFromNode(S),S)}}var ULe=Nt({"src/compiler/transformers/es5.ts"(){"use strict";Ns()}});function VLe(e){switch(e){case 2:return"return";case 3:return"break";case 4:return"yield";case 5:return"yield*";case 7:return"endfinally";default:return}}function bse(e){const{factory:t,getEmitHelperFactory:r,resumeLexicalEnvironment:i,endLexicalEnvironment:s,hoistFunctionDeclaration:o,hoistVariableDeclaration:c}=e,u=e.getCompilerOptions(),f=Da(u),g=e.getEmitResolver(),p=e.onSubstituteNode;e.onSubstituteNode=ce;let y,S,T,C,w,D,O,z,W,X,J=1,ie,B,Y,ae,_e=0,$=0,H,K,oe,Se,se,Z,ve,Te;return Up(e,Me);function Me(ye){if(ye.isDeclarationFile||!(ye.transformFlags&2048))return ye;const St=sr(ye,ke,e);return Yg(St,e.readEmitHelpers()),St}function ke(ye){const St=ye.transformFlags;return C?he(ye):T?be(ye):po(ye)&&ye.asteriskToken?pt(ye):St&2048?sr(ye,ke,e):ye}function he(ye){switch(ye.kind){case 246:return Qs(ye);case 247:return Ce(ye);case 255:return st(ye);case 256:return Qt(ye);default:return be(ye)}}function be(ye){switch(ye.kind){case 262:return me(ye);case 218:return Oe(ye);case 177:case 178:return Xe(ye);case 243:return mt(ye);case 248:return rt(ye);case 249:return dt(ye);case 252:return gt(ye);case 251:return we(ye);case 253:return ht(ye);default:return ye.transformFlags&1048576?lt(ye):ye.transformFlags&4196352?sr(ye,ke,e):ye}}function lt(ye){switch(ye.kind){case 226:return Je(ye);case 361:return br(ye);case 227:return ar(ye);case 229:return Jt(ye);case 209:return It(ye);case 210:return Fi(ye);case 212:return ei(ye);case 213:return zi(ye);case 214:return Qe(ye);default:return sr(ye,ke,e)}}function pt(ye){switch(ye.kind){case 262:return me(ye);case 218:return Oe(ye);default:return E.failBadSyntaxKind(ye)}}function me(ye){if(ye.asteriskToken)ye=rn(tt(t.createFunctionDeclaration(ye.modifiers,void 0,ye.name,void 0,Sc(ye.parameters,ke,e),void 0,it(ye.body)),ye),ye);else{const St=T,Fr=C;T=!1,C=!1,ye=sr(ye,ke,e),T=St,C=Fr}if(T){o(ye);return}else return ye}function Oe(ye){if(ye.asteriskToken)ye=rn(tt(t.createFunctionExpression(void 0,void 0,ye.name,void 0,Sc(ye.parameters,ke,e),void 0,it(ye.body)),ye),ye);else{const St=T,Fr=C;T=!1,C=!1,ye=sr(ye,ke,e),T=St,C=Fr}return ye}function Xe(ye){const St=T,Fr=C;return T=!1,C=!1,ye=sr(ye,ke,e),T=St,C=Fr,ye}function it(ye){const St=[],Fr=T,Wi=C,Ps=w,Fs=D,uc=O,hc=z,jo=W,qo=X,kc=J,nc=ie,Oc=B,yp=Y,xf=ae;T=!0,C=!1,w=void 0,D=void 0,O=void 0,z=void 0,W=void 0,X=void 0,J=1,ie=void 0,B=void 0,Y=void 0,ae=t.createTempVariable(void 0),i();const Xu=t.copyPrologue(ye.statements,St,!1,ke);ur(ye.statements,Xu);const Jf=Pe();return vm(St,s()),St.push(t.createReturnStatement(Jf)),T=Fr,C=Wi,w=Ps,D=Fs,O=uc,z=hc,W=jo,X=qo,J=kc,ie=nc,B=Oc,Y=yp,ae=xf,tt(t.createBlock(St,ye.multiLine),ye)}function mt(ye){if(ye.transformFlags&1048576){Pi(ye.declarationList);return}else{if(da(ye)&2097152)return ye;for(const Fr of ye.declarationList.declarations)c(Fr.name);const St=_E(ye.declarationList);return St.length===0?void 0:ya(t.createExpressionStatement(t.inlineExpressions(Yt(St,ji))),ye)}}function Je(ye){const St=_z(ye);switch(St){case 0:return Bt(ye);case 1:return ot(ye);default:return E.assertNever(St)}}function ot(ye){const{left:St,right:Fr}=ye;if(U(Fr)){let Wi;switch(St.kind){case 211:Wi=t.updatePropertyAccessExpression(St,M(E.checkDefined(He(St.expression,ke,m_))),St.name);break;case 212:Wi=t.updateElementAccessExpression(St,M(E.checkDefined(He(St.expression,ke,m_))),M(E.checkDefined(He(St.argumentExpression,ke,ct))));break;default:Wi=E.checkDefined(He(St,ke,ct));break}const Ps=ye.operatorToken.kind;return a3(Ps)?tt(t.createAssignment(Wi,tt(t.createBinaryExpression(M(Wi),o3(Ps),E.checkDefined(He(Fr,ke,ct))),ye)),ye):t.updateBinaryExpression(ye,Wi,ye.operatorToken,E.checkDefined(He(Fr,ke,ct)))}return sr(ye,ke,e)}function Bt(ye){return U(ye.right)?Ite(ye.operatorToken.kind)?zr(ye):ye.operatorToken.kind===28?Ht(ye):t.updateBinaryExpression(ye,M(E.checkDefined(He(ye.left,ke,ct))),ye.operatorToken,E.checkDefined(He(ye.right,ke,ct))):sr(ye,ke,e)}function Ht(ye){let St=[];return Fr(ye.left),Fr(ye.right),t.inlineExpressions(St);function Fr(Wi){Gr(Wi)&&Wi.operatorToken.kind===28?(Fr(Wi.left),Fr(Wi.right)):(U(Wi)&&St.length>0&&(A(1,[t.createExpressionStatement(t.inlineExpressions(St))]),St=[]),St.push(E.checkDefined(He(Wi,ke,ct))))}}function br(ye){let St=[];for(const Fr of ye.elements)Gr(Fr)&&Fr.operatorToken.kind===28?St.push(Ht(Fr)):(U(Fr)&&St.length>0&&(A(1,[t.createExpressionStatement(t.inlineExpressions(St))]),St=[]),St.push(E.checkDefined(He(Fr,ke,ct))));return t.inlineExpressions(St)}function zr(ye){const St=Ve(),Fr=De();return Ao(Fr,E.checkDefined(He(ye.left,ke,ct)),ye.left),ye.operatorToken.kind===56?No(St,Fr,ye.left):qt(St,Fr,ye.left),Ao(Fr,E.checkDefined(He(ye.right,ke,ct)),ye.right),Fe(St),Fr}function ar(ye){if(U(ye.whenTrue)||U(ye.whenFalse)){const St=Ve(),Fr=Ve(),Wi=De();return No(St,E.checkDefined(He(ye.condition,ke,ct)),ye.condition),Ao(Wi,E.checkDefined(He(ye.whenTrue,ke,ct)),ye.whenTrue),rs(Fr),Fe(St),Ao(Wi,E.checkDefined(He(ye.whenFalse,ke,ct)),ye.whenFalse),Fe(Fr),Wi}return sr(ye,ke,e)}function Jt(ye){const St=Ve(),Fr=He(ye.expression,ke,ct);if(ye.asteriskToken){const Wi=da(ye.expression)&8388608?Fr:tt(r().createValuesHelper(Fr),ye);$c(Wi,ye)}else ju(Fr,ye);return Fe(St),Hp(ye)}function It(ye){return Nn(ye.elements,void 0,void 0,ye.multiLine)}function Nn(ye,St,Fr,Wi){const Ps=j(ye);let Fs;if(Ps>0){Fs=De();const jo=kr(ye,ke,ct,0,Ps);Ao(Fs,t.createArrayLiteralExpression(St?[St,...jo]:jo)),St=void 0}const uc=Eu(ye,hc,[],Ps);return Fs?t.createArrayConcatCall(Fs,[t.createArrayLiteralExpression(uc,Wi)]):tt(t.createArrayLiteralExpression(St?[St,...uc]:uc,Wi),Fr);function hc(jo,qo){if(U(qo)&&jo.length>0){const kc=Fs!==void 0;Fs||(Fs=De()),Ao(Fs,kc?t.createArrayConcatCall(Fs,[t.createArrayLiteralExpression(jo,Wi)]):t.createArrayLiteralExpression(St?[St,...jo]:jo,Wi)),St=void 0,jo=[]}return jo.push(E.checkDefined(He(qo,ke,ct))),jo}}function Fi(ye){const St=ye.properties,Fr=ye.multiLine,Wi=j(St),Ps=De();Ao(Ps,t.createObjectLiteralExpression(kr(St,ke,qg,0,Wi),Fr));const Fs=Eu(St,uc,[],Wi);return Fs.push(Fr?Ru(ga(tt(t.cloneNode(Ps),Ps),Ps.parent)):Ps),t.inlineExpressions(Fs);function uc(hc,jo){U(jo)&&hc.length>0&&($o(t.createExpressionStatement(t.inlineExpressions(hc))),hc=[]);const qo=kne(t,ye,jo,Ps),kc=He(qo,ke,ct);return kc&&(Fr&&Ru(kc),hc.push(kc)),hc}}function ei(ye){return U(ye.argumentExpression)?t.updateElementAccessExpression(ye,M(E.checkDefined(He(ye.expression,ke,m_))),E.checkDefined(He(ye.argumentExpression,ke,ct))):sr(ye,ke,e)}function zi(ye){if(!G_(ye)&&Zt(ye.arguments,U)){const{target:St,thisArg:Fr}=t.createCallBinding(ye.expression,c,f,!0);return rn(tt(t.createFunctionApplyCall(M(E.checkDefined(He(St,ke,m_))),Fr,Nn(ye.arguments)),ye),ye)}return sr(ye,ke,e)}function Qe(ye){if(Zt(ye.arguments,U)){const{target:St,thisArg:Fr}=t.createCallBinding(t.createPropertyAccessExpression(ye.expression,"bind"),c);return rn(tt(t.createNewExpression(t.createFunctionApplyCall(M(E.checkDefined(He(St,ke,ct))),Fr,Nn(ye.arguments,t.createVoidZero())),void 0,[]),ye),ye)}return sr(ye,ke,e)}function ur(ye,St=0){const Fr=ye.length;for(let Wi=St;Wi0)break;Ps.push(ji(uc))}Ps.length&&($o(t.createExpressionStatement(t.inlineExpressions(Ps))),Wi+=Ps.length,Ps=[])}}function ji(ye){return ya(t.createAssignment(ya(t.cloneNode(ye.name),ye.name),E.checkDefined(He(ye.initializer,ke,ct))),ye)}function Di(ye){if(U(ye))if(U(ye.thenStatement)||U(ye.elseStatement)){const St=Ve(),Fr=ye.elseStatement?Ve():void 0;No(ye.elseStatement?Fr:St,E.checkDefined(He(ye.expression,ke,ct)),ye.expression),Dr(ye.thenStatement),ye.elseStatement&&(rs(St),Fe(Fr),Dr(ye.elseStatement)),Fe(St)}else $o(He(ye,ke,Ci));else $o(He(ye,ke,Ci))}function $i(ye){if(U(ye)){const St=Ve(),Fr=Ve();wr(St),Fe(Fr),Dr(ye.statement),Fe(St),qt(Fr,E.checkDefined(He(ye.expression,ke,ct))),_i()}else $o(He(ye,ke,Ci))}function Qs(ye){return C?(Ki(),ye=sr(ye,ke,e),_i(),ye):sr(ye,ke,e)}function Ds(ye){if(U(ye)){const St=Ve(),Fr=wr(St);Fe(St),No(Fr,E.checkDefined(He(ye.expression,ke,ct))),Dr(ye.statement),rs(St),_i()}else $o(He(ye,ke,Ci))}function Ce(ye){return C?(Ki(),ye=sr(ye,ke,e),_i(),ye):sr(ye,ke,e)}function Ue(ye){if(U(ye)){const St=Ve(),Fr=Ve(),Wi=wr(Fr);if(ye.initializer){const Ps=ye.initializer;ml(Ps)?Pi(Ps):$o(tt(t.createExpressionStatement(E.checkDefined(He(Ps,ke,ct))),Ps))}Fe(St),ye.condition&&No(Wi,E.checkDefined(He(ye.condition,ke,ct))),Dr(ye.statement),Fe(Fr),ye.incrementor&&$o(tt(t.createExpressionStatement(E.checkDefined(He(ye.incrementor,ke,ct))),ye.incrementor)),rs(St),_i()}else $o(He(ye,ke,Ci))}function rt(ye){C&&Ki();const St=ye.initializer;if(St&&ml(St)){for(const Wi of St.declarations)c(Wi.name);const Fr=_E(St);ye=t.updateForStatement(ye,Fr.length>0?t.inlineExpressions(Yt(Fr,ji)):void 0,He(ye.condition,ke,ct),He(ye.incrementor,ke,ct),Hu(ye.statement,ke,e))}else ye=sr(ye,ke,e);return C&&_i(),ye}function ft(ye){if(U(ye)){const St=De(),Fr=De(),Wi=De(),Ps=t.createLoopVariable(),Fs=ye.initializer;c(Ps),Ao(St,E.checkDefined(He(ye.expression,ke,ct))),Ao(Fr,t.createArrayLiteralExpression()),$o(t.createForInStatement(Wi,St,t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(Fr,"push"),void 0,[Wi])))),Ao(Ps,t.createNumericLiteral(0));const uc=Ve(),hc=Ve(),jo=wr(hc);Fe(uc),No(jo,t.createLessThan(Ps,t.createPropertyAccessExpression(Fr,"length"))),Ao(Wi,t.createElementAccessExpression(Fr,Ps)),No(hc,t.createBinaryExpression(Wi,103,St));let qo;if(ml(Fs)){for(const kc of Fs.declarations)c(kc.name);qo=t.cloneNode(Fs.declarations[0].name)}else qo=E.checkDefined(He(Fs,ke,ct)),E.assert(m_(qo));Ao(qo,Wi),Dr(ye.statement),Fe(hc),$o(t.createExpressionStatement(t.createPostfixIncrement(Ps))),rs(uc),_i()}else $o(He(ye,ke,Ci))}function dt(ye){C&&Ki();const St=ye.initializer;if(ml(St)){for(const Fr of St.declarations)c(Fr.name);ye=t.updateForInStatement(ye,St.declarations[0].name,E.checkDefined(He(ye.expression,ke,ct)),E.checkDefined(He(ye.statement,ke,Ci,t.liftToBlock)))}else ye=sr(ye,ke,e);return C&&_i(),ye}function fe(ye){const St=Ws(ye.label?an(ye.label):void 0);St>0?rs(St,ye):$o(ye)}function we(ye){if(C){const St=Ws(ye.label&&an(ye.label));if(St>0)return Us(St,ye)}return sr(ye,ke,e)}function Be(ye){const St=hs(ye.label?an(ye.label):void 0);St>0?rs(St,ye):$o(ye)}function gt(ye){if(C){const St=hs(ye.label&&an(ye.label));if(St>0)return Us(St,ye)}return sr(ye,ke,e)}function G(ye){u_(He(ye.expression,ke,ct),ye)}function ht(ye){return Ic(He(ye.expression,ke,ct),ye)}function Dt(ye){U(ye)?(Zr(M(E.checkDefined(He(ye.expression,ke,ct)))),Dr(ye.statement),gn()):$o(He(ye,ke,Ci))}function Re(ye){if(U(ye.caseBlock)){const St=ye.caseBlock,Fr=St.clauses.length,Wi=Is(),Ps=M(E.checkDefined(He(ye.expression,ke,ct))),Fs=[];let uc=-1;for(let qo=0;qo0)break;jo.push(t.createCaseClause(E.checkDefined(He(nc.expression,ke,ct)),[Us(Fs[kc],nc.expression)]))}else qo++}jo.length&&($o(t.createSwitchStatement(Ps,t.createCaseBlock(jo))),hc+=jo.length,jo=[]),qo>0&&(hc+=qo,qo=0)}uc>=0?rs(Fs[uc]):rs(Wi);for(let qo=0;qo=0;Fr--){const Wi=z[Fr];if(Vo(Wi)){if(Wi.labelText===ye)return!0}else break}return!1}function hs(ye){if(z)if(ye)for(let St=z.length-1;St>=0;St--){const Fr=z[St];if(Vo(Fr)&&Fr.labelText===ye)return Fr.breakLabel;if(rc(Fr)&&Ro(ye,St-1))return Fr.breakLabel}else for(let St=z.length-1;St>=0;St--){const Fr=z[St];if(rc(Fr))return Fr.breakLabel}return 0}function Ws(ye){if(z)if(ye)for(let St=z.length-1;St>=0;St--){const Fr=z[St];if(cl(Fr)&&Ro(ye,St-1))return Fr.continueLabel}else for(let St=z.length-1;St>=0;St--){const Fr=z[St];if(cl(Fr))return Fr.continueLabel}return 0}function el(ye){if(ye!==void 0&&ye>0){X===void 0&&(X=[]);const St=t.createNumericLiteral(-1);return X[ye]===void 0?X[ye]=[St]:X[ye].push(St),St}return t.createOmittedExpression()}function yo(ye){const St=t.createNumericLiteral(ye);return iF(St,3,VLe(ye)),St}function Us(ye,St){return E.assertLessThan(0,ye,"Invalid label"),tt(t.createReturnStatement(t.createArrayLiteralExpression([yo(3),el(ye)])),St)}function Ic(ye,St){return tt(t.createReturnStatement(t.createArrayLiteralExpression(ye?[yo(2),ye]:[yo(2)])),St)}function Hp(ye){return tt(t.createCallExpression(t.createPropertyAccessExpression(ae,"sent"),void 0,[]),ye)}function Fc(){A(0)}function $o(ye){ye?A(1,[ye]):Fc()}function Ao(ye,St,Fr){A(2,[ye,St],Fr)}function rs(ye,St){A(3,[ye],St)}function qt(ye,St,Fr){A(4,[ye,St],Fr)}function No(ye,St,Fr){A(5,[ye,St],Fr)}function $c(ye,St){A(7,[ye],St)}function ju(ye,St){A(6,[ye],St)}function u_(ye,St){A(8,[ye],St)}function vo(ye,St){A(9,[ye],St)}function xc(){A(10)}function A(ye,St,Fr){ie===void 0&&(ie=[],B=[],Y=[]),W===void 0&&Fe(Ve());const Wi=ie.length;ie[Wi]=ye,B[Wi]=St,Y[Wi]=Fr}function Pe(){_e=0,$=0,H=void 0,K=!1,oe=!1,Se=void 0,se=void 0,Z=void 0,ve=void 0,Te=void 0;const ye=qe();return r().createGeneratorHelper(Vr(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,ae)],void 0,t.createBlock(ye,ye.length>0)),1048576))}function qe(){if(ie){for(let ye=0;ye=0;St--){const Fr=Te[St];se=[t.createWithStatement(Fr.expression,t.createBlock(se))]}if(ve){const{startLabel:St,catchLabel:Fr,finallyLabel:Wi,endLabel:Ps}=ve;se.unshift(t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createPropertyAccessExpression(ae,"trys"),"push"),void 0,[t.createArrayLiteralExpression([el(St),el(Fr),el(Wi),el(Ps)])]))),ve=void 0}ye&&se.push(t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(ae,"label"),t.createNumericLiteral($+1))))}Se.push(t.createCaseClause(t.createNumericLiteral($),se||[])),se=void 0}function yn(ye){if(W)for(let St=0;Str.createAssignment(r.createPropertyAccessExpression(r.createIdentifier("exports"),r.createIdentifier(an(Fe))),Ve),r.createVoidZero())));lr(j,He(D.externalHelpersImportDeclaration,H,Ci)),Dn(j,kr(U.statements,H,Ci,ee)),$(j,!1),vm(j,o());const ue=r.updateSourceFile(U,tt(r.createNodeArray(j),U.statements));return Yg(ue,e.readEmitHelpers()),ue}function ie(U){const j=r.createIdentifier("define"),ce=pw(r,U,g,u),ee=ap(U)&&U,{aliasedModuleNames:ue,unaliasedModuleNames:M,importAliasNames:De}=Y(U,!0),Ve=r.updateSourceFile(U,tt(r.createNodeArray([r.createExpressionStatement(r.createCallExpression(j,void 0,[...ce?[ce]:[],r.createArrayLiteralExpression(ee?ze:[r.createStringLiteral("require"),r.createStringLiteral("exports"),...ue,...M]),ee?ee.statements.length?ee.statements[0].expression:r.createObjectLiteralExpression():r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,"require"),r.createParameterDeclaration(void 0,void 0,"exports"),...De],void 0,_e(U))]))]),U.statements));return Yg(Ve,e.readEmitHelpers()),Ve}function B(U){const{aliasedModuleNames:j,unaliasedModuleNames:ce,importAliasNames:ee}=Y(U,!1),ue=pw(r,U,g,u),M=r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,"factory")],void 0,tt(r.createBlock([r.createIfStatement(r.createLogicalAnd(r.createTypeCheck(r.createIdentifier("module"),"object"),r.createTypeCheck(r.createPropertyAccessExpression(r.createIdentifier("module"),"exports"),"object")),r.createBlock([r.createVariableStatement(void 0,[r.createVariableDeclaration("v",void 0,void 0,r.createCallExpression(r.createIdentifier("factory"),void 0,[r.createIdentifier("require"),r.createIdentifier("exports")]))]),Vr(r.createIfStatement(r.createStrictInequality(r.createIdentifier("v"),r.createIdentifier("undefined")),r.createExpressionStatement(r.createAssignment(r.createPropertyAccessExpression(r.createIdentifier("module"),"exports"),r.createIdentifier("v")))),1)]),r.createIfStatement(r.createLogicalAnd(r.createTypeCheck(r.createIdentifier("define"),"function"),r.createPropertyAccessExpression(r.createIdentifier("define"),"amd")),r.createBlock([r.createExpressionStatement(r.createCallExpression(r.createIdentifier("define"),void 0,[...ue?[ue]:[],r.createArrayLiteralExpression([r.createStringLiteral("require"),r.createStringLiteral("exports"),...j,...ce]),r.createIdentifier("factory")]))])))],!0),void 0)),De=r.updateSourceFile(U,tt(r.createNodeArray([r.createExpressionStatement(r.createCallExpression(M,void 0,[r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,"require"),r.createParameterDeclaration(void 0,void 0,"exports"),...ee],void 0,_e(U))]))]),U.statements));return Yg(De,e.readEmitHelpers()),De}function Y(U,j){const ce=[],ee=[],ue=[];for(const M of U.amdDependencies)M.name?(ce.push(r.createStringLiteral(M.path)),ue.push(r.createParameterDeclaration(void 0,void 0,M.name))):ee.push(r.createStringLiteral(M.path));for(const M of D.externalImports){const De=zT(r,M,w,g,f,u),Ve=TC(r,M,w);De&&(j&&Ve?(Vr(Ve,8),ce.push(De),ue.push(r.createParameterDeclaration(void 0,void 0,Ve))):ee.push(De))}return{aliasedModuleNames:ce,unaliasedModuleNames:ee,importAliasNames:ue}}function ae(U){if(Hl(U)||qc(U)||!zT(r,U,w,g,f,u))return;const j=TC(r,U,w),ce=zi(U,j);if(ce!==j)return r.createExpressionStatement(r.createAssignment(j,ce))}function _e(U){s();const j=[],ce=r.copyPrologue(U.statements,j,!u.noImplicitUseStrict,H);X()&&lr(j,fe()),Ir(D.exportedNames)&&lr(j,r.createExpressionStatement(Eu(D.exportedNames,(ue,M)=>r.createAssignment(r.createPropertyAccessExpression(r.createIdentifier("exports"),r.createIdentifier(an(M))),ue),r.createVoidZero()))),lr(j,He(D.externalHelpersImportDeclaration,H,Ci)),y===2&&Dn(j,Ii(D.externalImports,ae)),Dn(j,kr(U.statements,H,Ci,ce)),$(j,!0),vm(j,o());const ee=r.createBlock(j,!0);return z&&CT(ee,z2e),ee}function $(U,j){if(D.exportEquals){const ce=He(D.exportEquals.expression,Se,ct);if(ce)if(j){const ee=r.createReturnStatement(ce);tt(ee,D.exportEquals),Vr(ee,3840),U.push(ee)}else{const ee=r.createExpressionStatement(r.createAssignment(r.createPropertyAccessExpression(r.createIdentifier("module"),"exports"),ce));tt(ee,D.exportEquals),Vr(ee,3072),U.push(ee)}}}function H(U){switch(U.kind){case 272:return Qe(U);case 271:return Dr(U);case 278:return Ft(U);case 277:return yr(U);default:return K(U)}}function K(U){switch(U.kind){case 243:return Pi(U);case 262:return Tr(U);case 263:return Xr(U);case 248:return Te(U,!0);case 249:return Me(U);case 250:return ke(U);case 246:return he(U);case 247:return be(U);case 256:return lt(U);case 254:return pt(U);case 245:return me(U);case 255:return Oe(U);case 269:return Xe(U);case 296:return it(U);case 297:return mt(U);case 258:return Je(U);case 299:return ot(U);case 241:return Bt(U);default:return Se(U)}}function oe(U,j){if(!(U.transformFlags&276828160))return U;switch(U.kind){case 248:return Te(U,!1);case 244:return Ht(U);case 217:return br(U,j);case 360:return zr(U,j);case 213:if(G_(U)&&w.impliedNodeFormat===void 0)return Jt(U);break;case 226:if(Jh(U))return ve(U,j);break;case 224:case 225:return ar(U,j)}return sr(U,Se,e)}function Se(U){return oe(U,!1)}function se(U){return oe(U,!0)}function Z(U){if(ma(U))for(const j of U.properties)switch(j.kind){case 303:if(Z(j.initializer))return!0;break;case 304:if(Z(j.name))return!0;break;case 305:if(Z(j.expression))return!0;break;case 174:case 177:case 178:return!1;default:E.assertNever(j,"Unhandled object member kind")}else if(Lu(U)){for(const j of U.elements)if(Od(j)){if(Z(j.expression))return!0}else if(Z(j))return!0}else if(Ie(U))return Ir(or(U))>(YF(U)?1:0);return!1}function ve(U,j){return Z(U.left)?jb(U,Se,e,0,!j,ji):sr(U,Se,e)}function Te(U,j){if(j&&U.initializer&&ml(U.initializer)&&!(U.initializer.flags&7)){const ce=Ce(void 0,U.initializer,!1);if(ce){const ee=[],ue=He(U.initializer,se,ml),M=r.createVariableStatement(void 0,ue);ee.push(M),Dn(ee,ce);const De=He(U.condition,Se,ct),Ve=He(U.incrementor,se,ct),Fe=Hu(U.statement,j?K:Se,e);return ee.push(r.updateForStatement(U,void 0,De,Ve,Fe)),ee}}return r.updateForStatement(U,He(U.initializer,se,Ff),He(U.condition,Se,ct),He(U.incrementor,se,ct),Hu(U.statement,j?K:Se,e))}function Me(U){if(ml(U.initializer)&&!(U.initializer.flags&7)){const j=Ce(void 0,U.initializer,!0);if(ut(j)){const ce=He(U.initializer,se,Ff),ee=He(U.expression,Se,ct),ue=Hu(U.statement,K,e),M=Ss(ue)?r.updateBlock(ue,[...j,...ue.statements]):r.createBlock([...j,ue],!0);return r.updateForInStatement(U,ce,ee,M)}}return r.updateForInStatement(U,He(U.initializer,se,Ff),He(U.expression,Se,ct),Hu(U.statement,K,e))}function ke(U){if(ml(U.initializer)&&!(U.initializer.flags&7)){const j=Ce(void 0,U.initializer,!0),ce=He(U.initializer,se,Ff),ee=He(U.expression,Se,ct);let ue=Hu(U.statement,K,e);return ut(j)&&(ue=Ss(ue)?r.updateBlock(ue,[...j,...ue.statements]):r.createBlock([...j,ue],!0)),r.updateForOfStatement(U,U.awaitModifier,ce,ee,ue)}return r.updateForOfStatement(U,U.awaitModifier,He(U.initializer,se,Ff),He(U.expression,Se,ct),Hu(U.statement,K,e))}function he(U){return r.updateDoStatement(U,Hu(U.statement,K,e),He(U.expression,Se,ct))}function be(U){return r.updateWhileStatement(U,He(U.expression,Se,ct),Hu(U.statement,K,e))}function lt(U){return r.updateLabeledStatement(U,U.label,E.checkDefined(He(U.statement,K,Ci,r.liftToBlock)))}function pt(U){return r.updateWithStatement(U,He(U.expression,Se,ct),E.checkDefined(He(U.statement,K,Ci,r.liftToBlock)))}function me(U){return r.updateIfStatement(U,He(U.expression,Se,ct),E.checkDefined(He(U.thenStatement,K,Ci,r.liftToBlock)),He(U.elseStatement,K,Ci,r.liftToBlock))}function Oe(U){return r.updateSwitchStatement(U,He(U.expression,Se,ct),E.checkDefined(He(U.caseBlock,K,WE)))}function Xe(U){return r.updateCaseBlock(U,kr(U.clauses,K,SI))}function it(U){return r.updateCaseClause(U,He(U.expression,Se,ct),kr(U.statements,K,Ci))}function mt(U){return sr(U,K,e)}function Je(U){return sr(U,K,e)}function ot(U){return r.updateCatchClause(U,U.variableDeclaration,E.checkDefined(He(U.block,K,Ss)))}function Bt(U){return U=sr(U,K,e),U}function Ht(U){return r.updateExpressionStatement(U,He(U.expression,se,ct))}function br(U,j){return r.updateParenthesizedExpression(U,He(U.expression,j?se:Se,ct))}function zr(U,j){return r.updatePartiallyEmittedExpression(U,He(U.expression,j?se:Se,ct))}function ar(U,j){if((U.operator===46||U.operator===47)&&Ie(U.operand)&&!Eo(U.operand)&&!eh(U.operand)&&!Nz(U.operand)){const ce=or(U.operand);if(ce){let ee,ue=He(U.operand,Se,ct);f1(U)?ue=r.updatePrefixUnaryExpression(U,ue):(ue=r.updatePostfixUnaryExpression(U,ue),j||(ee=r.createTempVariable(c),ue=r.createAssignment(ee,ue),tt(ue,U)),ue=r.createComma(ue,r.cloneNode(U.operand)),tt(ue,U));for(const M of ce)O[Oa(ue)]=!0,ue=Be(M,ue),tt(ue,U);return ee&&(O[Oa(ue)]=!0,ue=r.createComma(ue,ee),tt(ue,U)),ue}}return sr(U,Se,e)}function Jt(U){if(y===0&&p>=7)return sr(U,Se,e);const j=zT(r,U,w,g,f,u),ce=He(bl(U.arguments),Se,ct),ee=j&&(!ce||!ra(ce)||ce.text!==j.text)?j:ce,ue=!!(U.transformFlags&16384);switch(u.module){case 2:return Nn(ee,ue);case 3:return It(ee??r.createVoidZero(),ue);case 1:default:return Fi(ee)}}function It(U,j){if(z=!0,Kv(U)){const ce=Eo(U)?U:ra(U)?r.createStringLiteralFromNode(U):Vr(tt(r.cloneNode(U),U),3072);return r.createConditionalExpression(r.createIdentifier("__syncRequire"),void 0,Fi(U),void 0,Nn(ce,j))}else{const ce=r.createTempVariable(c);return r.createComma(r.createAssignment(ce,U),r.createConditionalExpression(r.createIdentifier("__syncRequire"),void 0,Fi(ce,!0),void 0,Nn(ce,j)))}}function Nn(U,j){const ce=r.createUniqueName("resolve"),ee=r.createUniqueName("reject"),ue=[r.createParameterDeclaration(void 0,void 0,ce),r.createParameterDeclaration(void 0,void 0,ee)],M=r.createBlock([r.createExpressionStatement(r.createCallExpression(r.createIdentifier("require"),void 0,[r.createArrayLiteralExpression([U||r.createOmittedExpression()]),ce,ee]))]);let De;p>=2?De=r.createArrowFunction(void 0,void 0,ue,void 0,void 0,M):(De=r.createFunctionExpression(void 0,void 0,void 0,void 0,ue,void 0,M),j&&Vr(De,16));const Ve=r.createNewExpression(r.createIdentifier("Promise"),void 0,[De]);return xm(u)?r.createCallExpression(r.createPropertyAccessExpression(Ve,r.createIdentifier("then")),void 0,[i().createImportStarCallbackHelper()]):Ve}function Fi(U,j){const ce=U&&!jd(U)&&!j,ee=r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("Promise"),"resolve"),void 0,ce?p>=2?[r.createTemplateExpression(r.createTemplateHead(""),[r.createTemplateSpan(U,r.createTemplateTail(""))])]:[r.createCallExpression(r.createPropertyAccessExpression(r.createStringLiteral(""),"concat"),void 0,[U])]:[]);let ue=r.createCallExpression(r.createIdentifier("require"),void 0,ce?[r.createIdentifier("s")]:U?[U]:[]);xm(u)&&(ue=i().createImportStarHelper(ue));const M=ce?[r.createParameterDeclaration(void 0,void 0,"s")]:[];let De;return p>=2?De=r.createArrowFunction(void 0,void 0,M,void 0,void 0,ue):De=r.createFunctionExpression(void 0,void 0,void 0,void 0,M,void 0,r.createBlock([r.createReturnStatement(ue)])),r.createCallExpression(r.createPropertyAccessExpression(ee,"then"),void 0,[De])}function ei(U,j){return!xm(u)||Op(U)&2?j:Uie(U)?i().createImportStarHelper(j):j}function zi(U,j){return!xm(u)||Op(U)&2?j:RO(U)?i().createImportStarHelper(j):lV(U)?i().createImportDefaultHelper(j):j}function Qe(U){let j;const ce=jk(U);if(y!==2)if(U.importClause){const ee=[];ce&&!oT(U)?ee.push(r.createVariableDeclaration(r.cloneNode(ce.name),void 0,void 0,zi(U,ur(U)))):(ee.push(r.createVariableDeclaration(r.getGeneratedNameForNode(U),void 0,void 0,zi(U,ur(U)))),ce&&oT(U)&&ee.push(r.createVariableDeclaration(r.cloneNode(ce.name),void 0,void 0,r.getGeneratedNameForNode(U)))),j=lr(j,rn(tt(r.createVariableStatement(void 0,r.createVariableDeclarationList(ee,p>=2?2:0)),U),U))}else return rn(tt(r.createExpressionStatement(ur(U)),U),U);else ce&&oT(U)&&(j=lr(j,r.createVariableStatement(void 0,r.createVariableDeclarationList([rn(tt(r.createVariableDeclaration(r.cloneNode(ce.name),void 0,void 0,r.getGeneratedNameForNode(U)),U),U)],p>=2?2:0))));return j=$i(j,U),um(j)}function ur(U){const j=zT(r,U,w,g,f,u),ce=[];return j&&ce.push(j),r.createCallExpression(r.createIdentifier("require"),void 0,ce)}function Dr(U){E.assert(Ky(U),"import= for internal module references should be handled in an earlier transformer.");let j;return y!==2?In(U,32)?j=lr(j,rn(tt(r.createExpressionStatement(Be(U.name,ur(U))),U),U)):j=lr(j,rn(tt(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(r.cloneNode(U.name),void 0,void 0,ur(U))],p>=2?2:0)),U),U)):In(U,32)&&(j=lr(j,rn(tt(r.createExpressionStatement(Be(r.getExportName(U),r.getLocalName(U))),U),U))),j=Qs(j,U),um(j)}function Ft(U){if(!U.moduleSpecifier)return;const j=r.getGeneratedNameForNode(U);if(U.exportClause&&gp(U.exportClause)){const ce=[];y!==2&&ce.push(rn(tt(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(j,void 0,void 0,ur(U))])),U),U));for(const ee of U.exportClause.elements)if(p===0)ce.push(rn(tt(r.createExpressionStatement(i().createCreateBindingHelper(j,r.createStringLiteralFromNode(ee.propertyName||ee.name),ee.propertyName?r.createStringLiteralFromNode(ee.name):void 0)),ee),ee));else{const ue=!!xm(u)&&!(Op(U)&2)&&an(ee.propertyName||ee.name)==="default",M=r.createPropertyAccessExpression(ue?i().createImportDefaultHelper(j):j,ee.propertyName||ee.name);ce.push(rn(tt(r.createExpressionStatement(Be(r.getExportName(ee),M,void 0,!0)),ee),ee))}return um(ce)}else if(U.exportClause){const ce=[];return ce.push(rn(tt(r.createExpressionStatement(Be(r.cloneNode(U.exportClause.name),ei(U,y!==2?ur(U):NI(U)?j:r.createIdentifier(an(U.exportClause.name))))),U),U)),um(ce)}else return rn(tt(r.createExpressionStatement(i().createExportStarHelper(y!==2?ur(U):j)),U),U)}function yr(U){if(!U.isExportEquals)return we(r.createIdentifier("default"),He(U.expression,Se,ct),U,!0)}function Tr(U){let j;return In(U,32)?j=lr(j,rn(tt(r.createFunctionDeclaration(kr(U.modifiers,gt,Ys),U.asteriskToken,r.getDeclarationName(U,!0,!0),void 0,kr(U.parameters,Se,us),void 0,sr(U.body,Se,e)),U),U)):j=lr(j,sr(U,Se,e)),j=rt(j,U),um(j)}function Xr(U){let j;return In(U,32)?j=lr(j,rn(tt(r.createClassDeclaration(kr(U.modifiers,gt,Do),r.getDeclarationName(U,!0,!0),void 0,kr(U.heritageClauses,Se,Q_),kr(U.members,Se,Pl)),U),U)):j=lr(j,sr(U,Se,e)),j=rt(j,U),um(j)}function Pi(U){let j,ce,ee;if(In(U,32)){let ue,M=!1;for(const De of U.declarationList.declarations)if(Ie(De.name)&&eh(De.name))if(ue||(ue=kr(U.modifiers,gt,Ys)),De.initializer){const Ve=r.updateVariableDeclaration(De,De.name,void 0,void 0,Be(De.name,He(De.initializer,Se,ct)));ce=lr(ce,Ve)}else ce=lr(ce,De);else if(De.initializer)if(!As(De.name)&&(go(De.initializer)||ro(De.initializer)||Nl(De.initializer))){const Ve=r.createAssignment(tt(r.createPropertyAccessExpression(r.createIdentifier("exports"),De.name),De.name),r.createIdentifier(cp(De.name))),Fe=r.createVariableDeclaration(De.name,De.exclamationToken,De.type,He(De.initializer,Se,ct));ce=lr(ce,Fe),ee=lr(ee,Ve),M=!0}else ee=lr(ee,Di(De));if(ce&&(j=lr(j,r.updateVariableStatement(U,ue,r.updateVariableDeclarationList(U.declarationList,ce)))),ee){const De=rn(tt(r.createExpressionStatement(r.inlineExpressions(ee)),U),U);M&&G8(De),j=lr(j,De)}}else j=lr(j,sr(U,Se,e));return j=Ds(j,U),um(j)}function ji(U,j,ce){const ee=or(U);if(ee){let ue=YF(U)?j:r.createAssignment(U,j);for(const M of ee)Vr(ue,8),ue=Be(M,ue,ce);return ue}return r.createAssignment(U,j)}function Di(U){return As(U.name)?jb(He(U,Se,E8),Se,e,0,!1,ji):r.createAssignment(tt(r.createPropertyAccessExpression(r.createIdentifier("exports"),U.name),U.name),U.initializer?He(U.initializer,Se,ct):r.createVoidZero())}function $i(U,j){if(D.exportEquals)return U;const ce=j.importClause;if(!ce)return U;const ee=new $T;ce.name&&(U=ft(U,ee,ce));const ue=ce.namedBindings;if(ue)switch(ue.kind){case 274:U=ft(U,ee,ue);break;case 275:for(const M of ue.elements)U=ft(U,ee,M,!0);break}return U}function Qs(U,j){return D.exportEquals?U:ft(U,new $T,j)}function Ds(U,j){return Ce(U,j.declarationList,!1)}function Ce(U,j,ce){if(D.exportEquals)return U;for(const ee of j.declarations)U=Ue(U,ee,ce);return U}function Ue(U,j,ce){if(D.exportEquals)return U;if(As(j.name))for(const ee of j.name.elements)dl(ee)||(U=Ue(U,ee,ce));else!Eo(j.name)&&(!Ei(j)||j.initializer||ce)&&(U=ft(U,new $T,j));return U}function rt(U,j){if(D.exportEquals)return U;const ce=new $T;if(In(j,32)){const ee=In(j,2048)?r.createIdentifier("default"):r.getDeclarationName(j);U=dt(U,ce,ee,r.getLocalName(j),j)}return j.name&&(U=ft(U,ce,j)),U}function ft(U,j,ce,ee){const ue=r.getDeclarationName(ce),M=D.exportSpecifiers.get(ue);if(M)for(const De of M)U=dt(U,j,De.name,ue,De.name,void 0,ee);return U}function dt(U,j,ce,ee,ue,M,De){return j.has(ce)||(j.set(ce,!0),U=lr(U,we(ce,ee,ue,M,De))),U}function fe(){let U;return p===0?U=r.createExpressionStatement(Be(r.createIdentifier("__esModule"),r.createTrue())):U=r.createExpressionStatement(r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("Object"),"defineProperty"),void 0,[r.createIdentifier("exports"),r.createStringLiteral("__esModule"),r.createObjectLiteralExpression([r.createPropertyAssignment("value",r.createTrue())])])),Vr(U,2097152),U}function we(U,j,ce,ee,ue){const M=tt(r.createExpressionStatement(Be(U,j,void 0,ue)),ce);return Ru(M),ee||Vr(M,3072),M}function Be(U,j,ce,ee){return tt(ee&&p!==0?r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("Object"),"defineProperty"),void 0,[r.createIdentifier("exports"),r.createStringLiteralFromNode(U),r.createObjectLiteralExpression([r.createPropertyAssignment("enumerable",r.createTrue()),r.createPropertyAssignment("get",r.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,r.createBlock([r.createReturnStatement(j)])))])]):r.createAssignment(r.createPropertyAccessExpression(r.createIdentifier("exports"),r.cloneNode(U)),j),ce)}function gt(U){switch(U.kind){case 95:case 90:return}return U}function G(U,j,ce){j.kind===312?(w=j,D=C[iu(w)],T(U,j,ce),w=void 0,D=void 0):T(U,j,ce)}function ht(U,j){return j=S(U,j),j.id&&O[j.id]?j:U===1?Re(j):Y_(j)?Dt(j):j}function Dt(U){const j=U.name,ce=Qt(j);if(ce!==j){if(U.objectAssignmentInitializer){const ee=r.createAssignment(ce,U.objectAssignmentInitializer);return tt(r.createPropertyAssignment(j,ee),U)}return tt(r.createPropertyAssignment(j,ce),U)}return U}function Re(U){switch(U.kind){case 80:return Qt(U);case 213:return st(U);case 215:return Ct(U);case 226:return er(U)}return U}function st(U){if(Ie(U.expression)){const j=Qt(U.expression);if(O[Oa(j)]=!0,!Ie(j)&&!(da(U.expression)&8192))return xT(r.updateCallExpression(U,j,void 0,U.arguments),16)}return U}function Ct(U){if(Ie(U.tag)){const j=Qt(U.tag);if(O[Oa(j)]=!0,!Ie(j)&&!(da(U.tag)&8192))return xT(r.updateTaggedTemplateExpression(U,j,void 0,U.template),16)}return U}function Qt(U){var j,ce;if(da(U)&8192){const ee=fw(w);return ee?r.createPropertyAccessExpression(ee,U):U}else if(!(Eo(U)&&!(U.emitNode.autoGenerate.flags&64))&&!eh(U)){const ee=f.getReferencedExportContainer(U,YF(U));if(ee&&ee.kind===312)return tt(r.createPropertyAccessExpression(r.createIdentifier("exports"),r.cloneNode(U)),U);const ue=f.getReferencedImportDeclaration(U);if(ue){if(Em(ue))return tt(r.createPropertyAccessExpression(r.getGeneratedNameForNode(ue.parent),r.createIdentifier("default")),U);if(v_(ue)){const M=ue.propertyName||ue.name;return tt(r.createPropertyAccessExpression(r.getGeneratedNameForNode(((ce=(j=ue.parent)==null?void 0:j.parent)==null?void 0:ce.parent)||ue),r.cloneNode(M)),U)}}}return U}function er(U){if(Bh(U.operatorToken.kind)&&Ie(U.left)&&(!Eo(U.left)||TP(U.left))&&!eh(U.left)){const j=or(U.left);if(j){let ce=U;for(const ee of j)O[Oa(ce)]=!0,ce=Be(ee,ce,U);return ce}}return U}function or(U){if(Eo(U)){if(TP(U)){const j=D?.exportSpecifiers.get(U);if(j){const ce=[];for(const ee of j)ce.push(ee.name);return ce}}}else{const j=f.getReferencedImportDeclaration(U);if(j)return D?.exportedBindings[iu(j)];const ce=new Set,ee=f.getReferencedValueDeclarations(U);if(ee){for(const ue of ee){const M=D?.exportedBindings[iu(ue)];if(M)for(const De of M)ce.add(De)}if(ce.size)return fs(ce)}}}}var z2e,HLe=Nt({"src/compiler/transformers/module/module.ts"(){"use strict";Ns(),z2e={name:"typescript:dynamicimport-sync-require",scoped:!0,text:` + var __syncRequire = typeof module === "object" && typeof module.exports === "object";`}}});function Sse(e){const{factory:t,startLexicalEnvironment:r,endLexicalEnvironment:i,hoistVariableDeclaration:s}=e,o=e.getCompilerOptions(),c=e.getEmitResolver(),u=e.getEmitHost(),f=e.onSubstituteNode,g=e.onEmitNode;e.onSubstituteNode=Be,e.onEmitNode=we,e.enableSubstitution(80),e.enableSubstitution(304),e.enableSubstitution(226),e.enableSubstitution(236),e.enableEmitNotification(312);const p=[],y=[],S=[],T=[];let C,w,D,O,z,W,X;return Up(e,J);function J(U){if(U.isDeclarationFile||!(sT(U,o)||U.transformFlags&8388608))return U;const j=iu(U);C=U,W=U,w=p[j]=uV(e,U),D=t.createUniqueName("exports"),y[j]=D,O=T[j]=t.createUniqueName("context");const ce=ie(w.externalImports),ee=B(U,ce),ue=t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,D),t.createParameterDeclaration(void 0,void 0,O)],void 0,ee),M=pw(t,U,u,o),De=t.createArrayLiteralExpression(Yt(ce,Fe=>Fe.name)),Ve=Vr(t.updateSourceFile(U,tt(t.createNodeArray([t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("System"),"register"),void 0,M?[M,De,ue]:[De,ue]))]),U.statements)),2048);return to(o)||Jre(Ve,ee,Fe=>!Fe.scoped),X&&(S[j]=X,X=void 0),C=void 0,w=void 0,D=void 0,O=void 0,z=void 0,W=void 0,Ve}function ie(U){const j=new Map,ce=[];for(const ee of U){const ue=zT(t,ee,C,u,c,o);if(ue){const M=ue.text,De=j.get(M);De!==void 0?ce[De].externalImports.push(ee):(j.set(M,ce.length),ce.push({name:ue,externalImports:[ee]}))}}return ce}function B(U,j){const ce=[];r();const ee=fp(o,"alwaysStrict")||!o.noImplicitUseStrict&&Nc(C),ue=t.copyPrologue(U.statements,ce,ee,$);ce.push(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration("__moduleName",void 0,void 0,t.createLogicalAnd(O,t.createPropertyAccessExpression(O,"id")))]))),He(w.externalHelpersImportDeclaration,$,Ci);const M=kr(U.statements,$,Ci,ue);Dn(ce,z),vm(ce,i());const De=Y(ce),Ve=U.transformFlags&2097152?t.createModifiersFromModifierFlags(1024):void 0,Fe=t.createObjectLiteralExpression([t.createPropertyAssignment("setters",_e(De,j)),t.createPropertyAssignment("execute",t.createFunctionExpression(Ve,void 0,void 0,void 0,[],void 0,t.createBlock(M,!0)))],!0);return ce.push(t.createReturnStatement(Fe)),t.createBlock(ce,!0)}function Y(U){if(!w.hasExportStarsToExportValues)return;if(!w.exportedNames&&w.exportSpecifiers.size===0){let ue=!1;for(const M of w.externalImports)if(M.kind===278&&M.exportClause){ue=!0;break}if(!ue){const M=ae(void 0);return U.push(M),M.name}}const j=[];if(w.exportedNames)for(const ue of w.exportedNames)ue.escapedText!=="default"&&j.push(t.createPropertyAssignment(t.createStringLiteralFromNode(ue),t.createTrue()));const ce=t.createUniqueName("exportedNames");U.push(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(ce,void 0,void 0,t.createObjectLiteralExpression(j,!0))])));const ee=ae(ce);return U.push(ee),ee.name}function ae(U){const j=t.createUniqueName("exportStar"),ce=t.createIdentifier("m"),ee=t.createIdentifier("n"),ue=t.createIdentifier("exports");let M=t.createStrictInequality(ee,t.createStringLiteral("default"));return U&&(M=t.createLogicalAnd(M,t.createLogicalNot(t.createCallExpression(t.createPropertyAccessExpression(U,"hasOwnProperty"),void 0,[ee])))),t.createFunctionDeclaration(void 0,void 0,j,void 0,[t.createParameterDeclaration(void 0,void 0,ce)],void 0,t.createBlock([t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(ue,void 0,void 0,t.createObjectLiteralExpression([]))])),t.createForInStatement(t.createVariableDeclarationList([t.createVariableDeclaration(ee)]),ce,t.createBlock([Vr(t.createIfStatement(M,t.createExpressionStatement(t.createAssignment(t.createElementAccessExpression(ue,ee),t.createElementAccessExpression(ce,ee)))),1)])),t.createExpressionStatement(t.createCallExpression(D,void 0,[ue]))],!0))}function _e(U,j){const ce=[];for(const ee of j){const ue=Zt(ee.externalImports,Ve=>TC(t,Ve,C)),M=ue?t.getGeneratedNameForNode(ue):t.createUniqueName(""),De=[];for(const Ve of ee.externalImports){const Fe=TC(t,Ve,C);switch(Ve.kind){case 272:if(!Ve.importClause)break;case 271:E.assert(Fe!==void 0),De.push(t.createExpressionStatement(t.createAssignment(Fe,M))),In(Ve,32)&&De.push(t.createExpressionStatement(t.createCallExpression(D,void 0,[t.createStringLiteral(an(Fe)),M])));break;case 278:if(E.assert(Fe!==void 0),Ve.exportClause)if(gp(Ve.exportClause)){const vt=[];for(const Lt of Ve.exportClause.elements)vt.push(t.createPropertyAssignment(t.createStringLiteral(an(Lt.name)),t.createElementAccessExpression(M,t.createStringLiteral(an(Lt.propertyName||Lt.name)))));De.push(t.createExpressionStatement(t.createCallExpression(D,void 0,[t.createObjectLiteralExpression(vt,!0)])))}else De.push(t.createExpressionStatement(t.createCallExpression(D,void 0,[t.createStringLiteral(an(Ve.exportClause.name)),M])));else De.push(t.createExpressionStatement(t.createCallExpression(U,void 0,[M])));break}}ce.push(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,M)],void 0,t.createBlock(De,!0)))}return t.createArrayLiteralExpression(ce,!0)}function $(U){switch(U.kind){case 272:return H(U);case 271:return oe(U);case 278:return K(U);case 277:return Se(U);default:return Ht(U)}}function H(U){let j;return U.importClause&&s(TC(t,U,C)),um(pt(j,U))}function K(U){E.assertIsDefined(U)}function oe(U){E.assert(Ky(U),"import= for internal module references should be handled in an earlier transformer.");let j;return s(TC(t,U,C)),um(me(j,U))}function Se(U){if(U.isExportEquals)return;const j=He(U.expression,Di,ct);return ot(t.createIdentifier("default"),j,!0)}function se(U){In(U,32)?z=lr(z,t.updateFunctionDeclaration(U,kr(U.modifiers,fe,Do),U.asteriskToken,t.getDeclarationName(U,!0,!0),void 0,kr(U.parameters,Di,us),void 0,He(U.body,Di,Ss))):z=lr(z,sr(U,Di,e)),z=it(z,U)}function Z(U){let j;const ce=t.getLocalName(U);return s(ce),j=lr(j,tt(t.createExpressionStatement(t.createAssignment(ce,tt(t.createClassExpression(kr(U.modifiers,fe,Do),U.name,void 0,kr(U.heritageClauses,Di,Q_),kr(U.members,Di,Pl)),U))),U)),j=it(j,U),um(j)}function ve(U){if(!Me(U.declarationList))return He(U,Di,Ci);let j;if(JP(U.declarationList)||BP(U.declarationList)){const ce=kr(U.modifiers,fe,Do),ee=[];for(const M of U.declarationList.declarations)ee.push(t.updateVariableDeclaration(M,t.getGeneratedNameForNode(M.name),void 0,void 0,ke(M,!1)));const ue=t.updateVariableDeclarationList(U.declarationList,ee);j=lr(j,t.updateVariableStatement(U,ce,ue))}else{let ce;const ee=In(U,32);for(const ue of U.declarationList.declarations)ue.initializer?ce=lr(ce,ke(ue,ee)):Te(ue);ce&&(j=lr(j,tt(t.createExpressionStatement(t.inlineExpressions(ce)),U)))}return j=Oe(j,U,!1),um(j)}function Te(U){if(As(U.name))for(const j of U.name.elements)dl(j)||Te(j);else s(t.cloneNode(U.name))}function Me(U){return(da(U)&4194304)===0&&(W.kind===312||(Zo(U).flags&7)===0)}function ke(U,j){const ce=j?he:be;return As(U.name)?jb(U,Di,e,0,!1,ce):U.initializer?ce(U.name,He(U.initializer,Di,ct)):U.name}function he(U,j,ce){return lt(U,j,ce,!0)}function be(U,j,ce){return lt(U,j,ce,!1)}function lt(U,j,ce,ee){return s(t.cloneNode(U)),ee?Bt(U,er(tt(t.createAssignment(U,j),ce))):er(tt(t.createAssignment(U,j),ce))}function pt(U,j){if(w.exportEquals)return U;const ce=j.importClause;if(!ce)return U;ce.name&&(U=mt(U,ce));const ee=ce.namedBindings;if(ee)switch(ee.kind){case 274:U=mt(U,ee);break;case 275:for(const ue of ee.elements)U=mt(U,ue);break}return U}function me(U,j){return w.exportEquals?U:mt(U,j)}function Oe(U,j,ce){if(w.exportEquals)return U;for(const ee of j.declarationList.declarations)(ee.initializer||ce)&&(U=Xe(U,ee,ce));return U}function Xe(U,j,ce){if(w.exportEquals)return U;if(As(j.name))for(const ee of j.name.elements)dl(ee)||(U=Xe(U,ee,ce));else if(!Eo(j.name)){let ee;ce&&(U=Je(U,j.name,t.getLocalName(j)),ee=an(j.name)),U=mt(U,j,ee)}return U}function it(U,j){if(w.exportEquals)return U;let ce;if(In(j,32)){const ee=In(j,2048)?t.createStringLiteral("default"):j.name;U=Je(U,ee,t.getLocalName(j)),ce=cp(ee)}return j.name&&(U=mt(U,j,ce)),U}function mt(U,j,ce){if(w.exportEquals)return U;const ee=t.getDeclarationName(j),ue=w.exportSpecifiers.get(ee);if(ue)for(const M of ue)M.name.escapedText!==ce&&(U=Je(U,M.name,ee));return U}function Je(U,j,ce,ee){return U=lr(U,ot(j,ce,ee)),U}function ot(U,j,ce){const ee=t.createExpressionStatement(Bt(U,j));return Ru(ee),ce||Vr(ee,3072),ee}function Bt(U,j){const ce=Ie(U)?t.createStringLiteralFromNode(U):U;return Vr(j,da(j)|3072),Ac(t.createCallExpression(D,void 0,[ce,j]),j)}function Ht(U){switch(U.kind){case 243:return ve(U);case 262:return se(U);case 263:return Z(U);case 248:return br(U,!0);case 249:return zr(U);case 250:return ar(U);case 246:return Nn(U);case 247:return Fi(U);case 256:return ei(U);case 254:return zi(U);case 245:return Qe(U);case 255:return ur(U);case 269:return Dr(U);case 296:return Ft(U);case 297:return yr(U);case 258:return Tr(U);case 299:return Xr(U);case 241:return Pi(U);default:return Di(U)}}function br(U,j){const ce=W;return W=U,U=t.updateForStatement(U,He(U.initializer,j?It:$i,Ff),He(U.condition,Di,ct),He(U.incrementor,$i,ct),Hu(U.statement,j?Ht:Di,e)),W=ce,U}function zr(U){const j=W;return W=U,U=t.updateForInStatement(U,It(U.initializer),He(U.expression,Di,ct),Hu(U.statement,Ht,e)),W=j,U}function ar(U){const j=W;return W=U,U=t.updateForOfStatement(U,U.awaitModifier,It(U.initializer),He(U.expression,Di,ct),Hu(U.statement,Ht,e)),W=j,U}function Jt(U){return ml(U)&&Me(U)}function It(U){if(Jt(U)){let j;for(const ce of U.declarations)j=lr(j,ke(ce,!1)),ce.initializer||Te(ce);return j?t.inlineExpressions(j):t.createOmittedExpression()}else return He(U,$i,Ff)}function Nn(U){return t.updateDoStatement(U,Hu(U.statement,Ht,e),He(U.expression,Di,ct))}function Fi(U){return t.updateWhileStatement(U,He(U.expression,Di,ct),Hu(U.statement,Ht,e))}function ei(U){return t.updateLabeledStatement(U,U.label,E.checkDefined(He(U.statement,Ht,Ci,t.liftToBlock)))}function zi(U){return t.updateWithStatement(U,He(U.expression,Di,ct),E.checkDefined(He(U.statement,Ht,Ci,t.liftToBlock)))}function Qe(U){return t.updateIfStatement(U,He(U.expression,Di,ct),E.checkDefined(He(U.thenStatement,Ht,Ci,t.liftToBlock)),He(U.elseStatement,Ht,Ci,t.liftToBlock))}function ur(U){return t.updateSwitchStatement(U,He(U.expression,Di,ct),E.checkDefined(He(U.caseBlock,Ht,WE)))}function Dr(U){const j=W;return W=U,U=t.updateCaseBlock(U,kr(U.clauses,Ht,SI)),W=j,U}function Ft(U){return t.updateCaseClause(U,He(U.expression,Di,ct),kr(U.statements,Ht,Ci))}function yr(U){return sr(U,Ht,e)}function Tr(U){return sr(U,Ht,e)}function Xr(U){const j=W;return W=U,U=t.updateCatchClause(U,U.variableDeclaration,E.checkDefined(He(U.block,Ht,Ss))),W=j,U}function Pi(U){const j=W;return W=U,U=sr(U,Ht,e),W=j,U}function ji(U,j){if(!(U.transformFlags&276828160))return U;switch(U.kind){case 248:return br(U,!1);case 244:return Qs(U);case 217:return Ds(U,j);case 360:return Ce(U,j);case 226:if(Jh(U))return rt(U,j);break;case 213:if(G_(U))return Ue(U);break;case 224:case 225:return dt(U,j)}return sr(U,Di,e)}function Di(U){return ji(U,!1)}function $i(U){return ji(U,!0)}function Qs(U){return t.updateExpressionStatement(U,He(U.expression,$i,ct))}function Ds(U,j){return t.updateParenthesizedExpression(U,He(U.expression,j?$i:Di,ct))}function Ce(U,j){return t.updatePartiallyEmittedExpression(U,He(U.expression,j?$i:Di,ct))}function Ue(U){const j=zT(t,U,C,u,c,o),ce=He(bl(U.arguments),Di,ct),ee=j&&(!ce||!ra(ce)||ce.text!==j.text)?j:ce;return t.createCallExpression(t.createPropertyAccessExpression(O,t.createIdentifier("import")),void 0,ee?[ee]:[])}function rt(U,j){return ft(U.left)?jb(U,Di,e,0,!j):sr(U,Di,e)}function ft(U){if(sl(U,!0))return ft(U.left);if(Od(U))return ft(U.expression);if(ma(U))return ut(U.properties,ft);if(Lu(U))return ut(U.elements,ft);if(Y_(U))return ft(U.name);if(Hc(U))return ft(U.initializer);if(Ie(U)){const j=c.getReferencedExportContainer(U);return j!==void 0&&j.kind===312}else return!1}function dt(U,j){if((U.operator===46||U.operator===47)&&Ie(U.operand)&&!Eo(U.operand)&&!eh(U.operand)&&!Nz(U.operand)){const ce=Ct(U.operand);if(ce){let ee,ue=He(U.operand,Di,ct);f1(U)?ue=t.updatePrefixUnaryExpression(U,ue):(ue=t.updatePostfixUnaryExpression(U,ue),j||(ee=t.createTempVariable(s),ue=t.createAssignment(ee,ue),tt(ue,U)),ue=t.createComma(ue,t.cloneNode(U.operand)),tt(ue,U));for(const M of ce)ue=Bt(M,er(ue));return ee&&(ue=t.createComma(ue,ee),tt(ue,U)),ue}}return sr(U,Di,e)}function fe(U){switch(U.kind){case 95:case 90:return}return U}function we(U,j,ce){if(j.kind===312){const ee=iu(j);C=j,w=p[ee],D=y[ee],X=S[ee],O=T[ee],X&&delete S[ee],g(U,j,ce),C=void 0,w=void 0,D=void 0,O=void 0,X=void 0}else g(U,j,ce)}function Be(U,j){return j=f(U,j),or(j)?j:U===1?ht(j):U===4?gt(j):j}function gt(U){switch(U.kind){case 304:return G(U)}return U}function G(U){var j,ce;const ee=U.name;if(!Eo(ee)&&!eh(ee)){const ue=c.getReferencedImportDeclaration(ee);if(ue){if(Em(ue))return tt(t.createPropertyAssignment(t.cloneNode(ee),t.createPropertyAccessExpression(t.getGeneratedNameForNode(ue.parent),t.createIdentifier("default"))),U);if(v_(ue))return tt(t.createPropertyAssignment(t.cloneNode(ee),t.createPropertyAccessExpression(t.getGeneratedNameForNode(((ce=(j=ue.parent)==null?void 0:j.parent)==null?void 0:ce.parent)||ue),t.cloneNode(ue.propertyName||ue.name))),U)}}return U}function ht(U){switch(U.kind){case 80:return Dt(U);case 226:return Re(U);case 236:return st(U)}return U}function Dt(U){var j,ce;if(da(U)&8192){const ee=fw(C);return ee?t.createPropertyAccessExpression(ee,U):U}if(!Eo(U)&&!eh(U)){const ee=c.getReferencedImportDeclaration(U);if(ee){if(Em(ee))return tt(t.createPropertyAccessExpression(t.getGeneratedNameForNode(ee.parent),t.createIdentifier("default")),U);if(v_(ee))return tt(t.createPropertyAccessExpression(t.getGeneratedNameForNode(((ce=(j=ee.parent)==null?void 0:j.parent)==null?void 0:ce.parent)||ee),t.cloneNode(ee.propertyName||ee.name)),U)}}return U}function Re(U){if(Bh(U.operatorToken.kind)&&Ie(U.left)&&(!Eo(U.left)||TP(U.left))&&!eh(U.left)){const j=Ct(U.left);if(j){let ce=U;for(const ee of j)ce=Bt(ee,er(ce));return ce}}return U}function st(U){return Ak(U)?t.createPropertyAccessExpression(O,t.createIdentifier("meta")):U}function Ct(U){let j;const ce=Qt(U);if(ce){const ee=c.getReferencedExportContainer(U,!1);ee&&ee.kind===312&&(j=lr(j,t.getDeclarationName(ce))),j=Dn(j,w?.exportedBindings[iu(ce)])}else if(Eo(U)&&TP(U)){const ee=w?.exportSpecifiers.get(U);if(ee){const ue=[];for(const M of ee)ue.push(M.name);return ue}}return j}function Qt(U){if(!Eo(U)){const j=c.getReferencedImportDeclaration(U);if(j)return j;const ce=c.getReferencedValueDeclaration(U);if(ce&&w?.exportedBindings[iu(ce)])return ce;const ee=c.getReferencedValueDeclarations(U);if(ee){for(const ue of ee)if(ue!==ce&&w?.exportedBindings[iu(ue)])return ue}return ce}}function er(U){return X===void 0&&(X=[]),X[Oa(U)]=!0,U}function or(U){return X&&U.id&&X[U.id]}}var GLe=Nt({"src/compiler/transformers/module/system.ts"(){"use strict";Ns()}});function TV(e){const{factory:t,getEmitHelperFactory:r}=e,i=e.getEmitHost(),s=e.getEmitResolver(),o=e.getCompilerOptions(),c=Da(o),u=e.onEmitNode,f=e.onSubstituteNode;e.onEmitNode=X,e.onSubstituteNode=J,e.enableEmitNotification(312),e.enableSubstitution(80);let g,p,y;return Up(e,S);function S(B){if(B.isDeclarationFile)return B;if(Nc(B)||nd(o)){p=B,y=void 0;let Y=T(B);return p=void 0,y&&(Y=t.updateSourceFile(Y,tt(t.createNodeArray(CJ(Y.statements.slice(),y)),Y.statements))),!Nc(B)||ut(Y.statements,DP)?Y:t.updateSourceFile(Y,tt(t.createNodeArray([...Y.statements,lw(t)]),Y.statements))}return B}function T(B){const Y=tU(t,r(),B,o);if(Y){const ae=[],_e=t.copyPrologue(B.statements,ae);return lr(ae,Y),Dn(ae,kr(B.statements,C,Ci,_e)),t.updateSourceFile(B,tt(t.createNodeArray(ae),B.statements))}else return sr(B,C,e)}function C(B){switch(B.kind){case 271:return Ul(o)>=100?D(B):void 0;case 277:return z(B);case 278:return W(B)}return B}function w(B){const Y=zT(t,B,E.checkDefined(p),i,s,o),ae=[];if(Y&&ae.push(Y),!y){const $=t.createUniqueName("_createRequire",48),H=t.createImportDeclaration(void 0,t.createImportClause(!1,void 0,t.createNamedImports([t.createImportSpecifier(!1,t.createIdentifier("createRequire"),$)])),t.createStringLiteral("module"),void 0),K=t.createUniqueName("__require",48),oe=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(K,void 0,void 0,t.createCallExpression(t.cloneNode($),void 0,[t.createPropertyAccessExpression(t.createMetaProperty(102,t.createIdentifier("meta")),t.createIdentifier("url"))]))],c>=2?2:0));y=[H,oe]}const _e=y[1].declarationList.declarations[0].name;return E.assertNode(_e,Ie),t.createCallExpression(t.cloneNode(_e),void 0,ae)}function D(B){E.assert(Ky(B),"import= for internal module references should be handled in an earlier transformer.");let Y;return Y=lr(Y,rn(tt(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.cloneNode(B.name),void 0,void 0,w(B))],c>=2?2:0)),B),B)),Y=O(Y,B),um(Y)}function O(B,Y){return In(Y,32)&&(B=lr(B,t.createExportDeclaration(void 0,Y.isTypeOnly,t.createNamedExports([t.createExportSpecifier(!1,void 0,an(Y.name))])))),B}function z(B){return B.isExportEquals?void 0:B}function W(B){if(o.module!==void 0&&o.module>5||!B.exportClause||!Dm(B.exportClause)||!B.moduleSpecifier)return B;const Y=B.exportClause.name,ae=t.getGeneratedNameForNode(Y),_e=t.createImportDeclaration(void 0,t.createImportClause(!1,void 0,t.createNamespaceImport(ae)),B.moduleSpecifier,B.attributes);rn(_e,B.exportClause);const $=NI(B)?t.createExportDefault(ae):t.createExportDeclaration(void 0,!1,t.createNamedExports([t.createExportSpecifier(!1,ae,Y)]));return rn($,B),[_e,$]}function X(B,Y,ae){Ai(Y)?((Nc(Y)||nd(o))&&o.importHelpers&&(g=new Map),u(B,Y,ae),g=void 0):u(B,Y,ae)}function J(B,Y){return Y=f(B,Y),g&&Ie(Y)&&da(Y)&8192?ie(Y):Y}function ie(B){const Y=an(B);let ae=g.get(Y);return ae||g.set(Y,ae=t.createUniqueName(Y,48)),ae}}var $Le=Nt({"src/compiler/transformers/module/esnextAnd2015.ts"(){"use strict";Ns()}});function Tse(e){const t=e.onSubstituteNode,r=e.onEmitNode,i=TV(e),s=e.onSubstituteNode,o=e.onEmitNode;e.onSubstituteNode=t,e.onEmitNode=r;const c=SV(e),u=e.onSubstituteNode,f=e.onEmitNode;e.onSubstituteNode=p,e.onEmitNode=y,e.enableSubstitution(312),e.enableEmitNotification(312);let g;return C;function p(D,O){return Ai(O)?(g=O,t(D,O)):g?g.impliedNodeFormat===99?s(D,O):u(D,O):t(D,O)}function y(D,O,z){return Ai(O)&&(g=O),g?g.impliedNodeFormat===99?o(D,O,z):f(D,O,z):r(D,O,z)}function S(D){return D.impliedNodeFormat===99?i:c}function T(D){if(D.isDeclarationFile)return D;g=D;const O=S(D)(D);return g=void 0,E.assert(Ai(O)),O}function C(D){return D.kind===312?T(D):w(D)}function w(D){return e.factory.createBundle(Yt(D.sourceFiles,T),D.prepends)}}var XLe=Nt({"src/compiler/transformers/module/node.ts"(){"use strict";Ns()}});function qO(e){return Ei(e)||Es(e)||ff(e)||Pa(e)||Lh(e)||B0(e)||rw(e)||cC(e)||mc(e)||fg(e)||Zc(e)||us(e)||Uo(e)||qh(e)||Hl(e)||Jp(e)||gc(e)||Cb(e)||bn(e)||mo(e)||Gr(e)||op(e)}function xse(e){if(Lh(e)||B0(e))return t;return fg(e)||mc(e)?i:Gh(e);function t(o){const c=r(o);return c!==void 0?{diagnosticMessage:c,errorNode:e,typeName:e.name}:void 0}function r(o){return Ls(e)?o.errorModuleName?o.accessibility===2?d.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:d.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:e.parent.kind===263?o.errorModuleName?o.accessibility===2?d.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:d.Public_property_0_of_exported_class_has_or_is_using_private_name_1:o.errorModuleName?d.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:d.Property_0_of_exported_interface_has_or_is_using_private_name_1}function i(o){const c=s(o);return c!==void 0?{diagnosticMessage:c,errorNode:e,typeName:e.name}:void 0}function s(o){return Ls(e)?o.errorModuleName?o.accessibility===2?d.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:d.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:e.parent.kind===263?o.errorModuleName?o.accessibility===2?d.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:d.Public_method_0_of_exported_class_has_or_is_using_private_name_1:o.errorModuleName?d.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:d.Method_0_of_exported_interface_has_or_is_using_private_name_1}}function Gh(e){if(Ei(e)||Es(e)||ff(e)||bn(e)||mo(e)||Gr(e)||Pa(e)||gc(e))return r;return Lh(e)||B0(e)?i:rw(e)||cC(e)||mc(e)||fg(e)||Zc(e)||Cb(e)?s:us(e)?E_(e,e.parent)&&In(e.parent,2)?r:o:Uo(e)?u:qh(e)?f:Hl(e)?g:Jp(e)||op(e)?p:E.assertNever(e,`Attempted to set a declaration diagnostic context for unhandled node kind: ${E.formatSyntaxKind(e.kind)}`);function t(y){if(e.kind===260||e.kind===208)return y.errorModuleName?y.accessibility===2?d.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:d.Exported_variable_0_has_or_is_using_private_name_1;if(e.kind===172||e.kind===211||e.kind===212||e.kind===226||e.kind===171||e.kind===169&&In(e.parent,2))return Ls(e)?y.errorModuleName?y.accessibility===2?d.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:d.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:e.parent.kind===263||e.kind===169?y.errorModuleName?y.accessibility===2?d.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:d.Public_property_0_of_exported_class_has_or_is_using_private_name_1:y.errorModuleName?d.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:d.Property_0_of_exported_interface_has_or_is_using_private_name_1}function r(y){const S=t(y);return S!==void 0?{diagnosticMessage:S,errorNode:e,typeName:e.name}:void 0}function i(y){let S;return e.kind===178?Ls(e)?S=y.errorModuleName?d.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:d.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:S=y.errorModuleName?d.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:d.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:Ls(e)?S=y.errorModuleName?y.accessibility===2?d.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:d.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:S=y.errorModuleName?y.accessibility===2?d.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:d.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1,{diagnosticMessage:S,errorNode:e.name,typeName:e.name}}function s(y){let S;switch(e.kind){case 180:S=y.errorModuleName?d.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:d.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 179:S=y.errorModuleName?d.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:d.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 181:S=y.errorModuleName?d.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:d.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 174:case 173:Ls(e)?S=y.errorModuleName?y.accessibility===2?d.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:d.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:d.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:e.parent.kind===263?S=y.errorModuleName?y.accessibility===2?d.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:d.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:d.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:S=y.errorModuleName?d.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:d.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 262:S=y.errorModuleName?y.accessibility===2?d.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:d.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:d.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return E.fail("This is unknown kind for signature: "+e.kind)}return{diagnosticMessage:S,errorNode:e.name||e}}function o(y){const S=c(y);return S!==void 0?{diagnosticMessage:S,errorNode:e,typeName:e.name}:void 0}function c(y){switch(e.parent.kind){case 176:return y.errorModuleName?y.accessibility===2?d.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 180:case 185:return y.errorModuleName?d.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 179:return y.errorModuleName?d.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 181:return y.errorModuleName?d.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 174:case 173:return Ls(e.parent)?y.errorModuleName?y.accessibility===2?d.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:e.parent.parent.kind===263?y.errorModuleName?y.accessibility===2?d.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:y.errorModuleName?d.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 262:case 184:return y.errorModuleName?y.accessibility===2?d.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 178:case 177:return y.errorModuleName?y.accessibility===2?d.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:d.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:d.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return E.fail(`Unknown parent for parameter: ${E.formatSyntaxKind(e.parent.kind)}`)}}function u(){let y;switch(e.parent.kind){case 263:y=d.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 264:y=d.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 200:y=d.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 185:case 180:y=d.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 179:y=d.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 174:case 173:Ls(e.parent)?y=d.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:e.parent.parent.kind===263?y=d.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:y=d.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 184:case 262:y=d.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 195:y=d.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;break;case 265:y=d.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return E.fail("This is unknown parent for type parameter: "+e.parent.kind)}return{diagnosticMessage:y,errorNode:e,typeName:e.name}}function f(){let y;return Vc(e.parent.parent)?y=Q_(e.parent)&&e.parent.token===119?d.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:e.parent.parent.name?d.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:d.extends_clause_of_exported_class_has_or_is_using_private_name_0:y=d.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1,{diagnosticMessage:y,errorNode:e,typeName:as(e.parent.parent)}}function g(){return{diagnosticMessage:d.Import_declaration_0_is_using_private_name_1,errorNode:e,typeName:e.name}}function p(y){return{diagnosticMessage:y.errorModuleName?d.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:d.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:op(e)?E.checkDefined(e.typeExpression):e.type,typeName:op(e)?as(e):e.name}}}var QLe=Nt({"src/compiler/transformers/declarations/diagnostics.ts"(){"use strict";Ns()}});function kse(e,t,r){const i=e.getCompilerOptions();return qw(t,e,I,i,r?[r]:wn(e.getSourceFiles(),GJ),[kV],!1).diagnostics}function W2e(e,t){return t.text.substring(e.pos,e.end).includes("@internal")}function xV(e,t){const r=ss(e);if(r&&r.kind===169){const s=r.parent.parameters.indexOf(r),o=s>0?r.parent.parameters[s-1]:void 0,c=t.text,u=o?Xi(Hy(c,la(c,o.end+1,!1,!0)),Km(c,e.pos)):Hy(c,la(c,e.pos,!1,!0));return u&&u.length&&W2e(Sa(u),t)}const i=r&&JJ(r,t);return!!Zt(i,s=>W2e(s,t))}function kV(e){const t=()=>E.fail("Diagnostic emitted without context");let r=t,i=!0,s=!1,o=!1,c=!1,u=!1,f,g,p,y,S,T;const{factory:C}=e,w=e.getEmitHost(),D={trackSymbol:se,reportInaccessibleThisError:ke,reportInaccessibleUniqueSymbolError:Te,reportCyclicStructureError:Me,reportPrivateInBaseOfClassExpression:Z,reportLikelyUnsafeImportRequiredError:he,reportTruncationError:be,moduleResolverHost:w,trackReferencedAmbientModule:H,trackExternalModuleSymbolOfImportTypeNode:Se,reportNonlocalAugmentation:lt,reportNonSerializableProperty:pt};let O,z,W,X,J,ie;const B=e.getEmitResolver(),Y=e.getCompilerOptions(),{noResolve:ae,stripInternal:_e}=Y;return Oe;function $(G){if(G){g=g||new Set;for(const ht of G)g.add(ht)}}function H(G,ht){const Dt=B.getTypeReferenceDirectivesForSymbol(ht,67108863);if(Ir(Dt))return $(Dt);const Re=Or(G);X.set(iu(Re),Re)}function K(G){const ht=Mk(G),Dt=ht&&B.tryFindAmbientModule(ht);if(Dt?.declarations)for(const Re of Dt.declarations)ru(Re)&&Or(Re)!==W&&H(Re,Dt)}function oe(G){if(G.accessibility===0){if(G&&G.aliasesToMakeVisible)if(!p)p=G.aliasesToMakeVisible;else for(const ht of G.aliasesToMakeVisible)tp(p,ht)}else{const ht=r(G);if(ht)return ht.typeName?e.addDiagnostic(mn(G.errorNode||ht.errorNode,ht.diagnosticMessage,Wc(ht.typeName),G.errorSymbolName,G.errorModuleName)):e.addDiagnostic(mn(G.errorNode||ht.errorNode,ht.diagnosticMessage,G.errorSymbolName,G.errorModuleName)),!0}return!1}function Se(G){s||(T||(T=[])).push(G)}function se(G,ht,Dt){if(G.flags&262144)return!1;const Re=oe(B.isSymbolAccessible(G,ht,Dt,!0));return $(B.getTypeReferenceDirectivesForSymbol(G,Dt)),Re}function Z(G){(O||z)&&e.addDiagnostic(mn(O||z,d.Property_0_of_exported_class_expression_may_not_be_private_or_protected,G))}function ve(){return O?eo(O):z&&as(z)?eo(as(z)):z&&cc(z)?z.isExportEquals?"export=":"default":"(Missing)"}function Te(){(O||z)&&e.addDiagnostic(mn(O||z,d.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,ve(),"unique symbol"))}function Me(){(O||z)&&e.addDiagnostic(mn(O||z,d.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,ve()))}function ke(){(O||z)&&e.addDiagnostic(mn(O||z,d.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,ve(),"this"))}function he(G){(O||z)&&e.addDiagnostic(mn(O||z,d.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,ve(),G))}function be(){(O||z)&&e.addDiagnostic(mn(O||z,d.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed))}function lt(G,ht,Dt){var Re;const st=(Re=ht.declarations)==null?void 0:Re.find(Qt=>Or(Qt)===G),Ct=wn(Dt.declarations,Qt=>Or(Qt)!==G);if(st&&Ct)for(const Qt of Ct)e.addDiagnostic(ua(mn(Qt,d.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),mn(st,d.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)))}function pt(G){(O||z)&&e.addDiagnostic(mn(O||z,d.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized,G))}function me(G,ht){const Dt=r;r=st=>st.errorNode&&qO(st.errorNode)?Gh(st.errorNode)(st):{diagnosticMessage:st.errorModuleName?d.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:d.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,errorNode:st.errorNode||G};const Re=B.getDeclarationStatementsForSourceFile(G,Bb,D,ht);return r=Dt,Re}function Oe(G){if(G.kind===312&&G.isDeclarationFile)return G;if(G.kind===313){s=!0,X=new Map,J=new Map;let j=!1;const ce=C.createBundle(Yt(G.sourceFiles,M=>{if(M.isDeclarationFile)return;if(j=j||M.hasNoDefaultLib,W=M,f=M,p=void 0,S=!1,y=new Map,r=t,c=!1,u=!1,Xe(M,X),it(M,J),H_(M)||ap(M)){o=!1,i=!1;const Ve=Iu(M)?C.createNodeArray(me(M,!0)):kr(M.statements,Pi,Ci);return C.updateSourceFile(M,[C.createModuleDeclaration([C.createModifier(138)],C.createStringLiteral(_5(e.getEmitHost(),M)),C.createModuleBlock(tt(C.createNodeArray(yr(Ve)),M.statements)))],!0,[],[],!1,[])}i=!0;const De=Iu(M)?C.createNodeArray(me(M)):kr(M.statements,Pi,Ci);return C.updateSourceFile(M,yr(De),!0,[],[],!1,[])}),Ii(G.prepends,M=>{if(M.kind===315){const De=vW(M,"dts",_e);return j=j||!!De.hasNoDefaultLib,Xe(De,X),$(Yt(De.typeReferenceDirectives,Ve=>[Ve.fileName,Ve.resolutionMode])),it(De,J),De}return M}));ce.syntheticFileReferences=[],ce.syntheticTypeReferences=er(),ce.syntheticLibReferences=Qt(),ce.hasNoDefaultLib=j;const ee=qn(du(d3(G,w,!0).declarationFilePath)),ue=U(ce.syntheticFileReferences,ee);return X.forEach(ue),ce}i=!0,c=!1,u=!1,f=G,W=G,r=t,s=!1,o=!1,S=!1,p=void 0,y=new Map,g=void 0,X=Xe(W,new Map),J=it(W,new Map);const ht=[],Dt=qn(du(d3(G,w,!0).declarationFilePath)),Re=U(ht,Dt);let st;if(Iu(W))st=C.createNodeArray(me(G)),X.forEach(Re),ie=wn(st,lb);else{const j=kr(G.statements,Pi,Ci);st=tt(C.createNodeArray(yr(j)),G.statements),X.forEach(Re),ie=wn(st,lb),Nc(G)&&(!o||c&&!u)&&(st=tt(C.createNodeArray([...st,lw(C)]),st))}const Ct=C.updateSourceFile(G,st,!0,ht,er(),G.hasNoDefaultLib,Qt());return Ct.exportedModulesFromDeclarationEmit=T,Ct;function Qt(){return fs(J.keys(),j=>({fileName:j,pos:-1,end:-1}))}function er(){return g?Ii(fs(g.keys()),or):[]}function or([j,ce]){if(ie){for(const ee of ie)if(Hl(ee)&&Pm(ee.moduleReference)){const ue=ee.moduleReference.expression;if(Ja(ue)&&ue.text===j)return}else if(gl(ee)&&ra(ee.moduleSpecifier)&&ee.moduleSpecifier.text===j)return}return{fileName:j,pos:-1,end:-1,...ce?{resolutionMode:ce}:void 0}}function U(j,ce){return ee=>{let ue;if(ee.isDeclarationFile)ue=ee.fileName;else{if(s&&_s(G.sourceFiles,ee))return;const M=d3(ee,w,!0);ue=M.declarationFilePath||M.jsFilePath||ee.fileName}if(ue){const M=EO(Y,W,fo(ce,w.getCurrentDirectory(),w.getCanonicalFileName),fo(ue,w.getCurrentDirectory(),w.getCanonicalFileName),w);if(!U_(M)){$([[M,void 0]]);return}let De=KS(ce,ue,w.getCurrentDirectory(),w.getCanonicalFileName,!1);if(Qi(De,"./")&&ZS(De)&&(De=De.substring(2)),Qi(De,"node_modules/")||HT(De))return;j.push({pos:-1,end:-1,fileName:De})}}}}function Xe(G,ht){return ae||!Ib(G)&&Iu(G)||Zt(G.referencedFiles,Dt=>{const Re=w.getSourceFileFromReference(G,Dt);Re&&ht.set(iu(Re),Re)}),ht}function it(G,ht){return Zt(G.libReferenceDirectives,Dt=>{w.getLibFileFromReference(Dt)&&ht.set(xd(Dt.fileName),!0)}),ht}function mt(G){if(G.kind===80)return G;return G.kind===207?C.updateArrayBindingPattern(G,kr(G.elements,ht,hI)):C.updateObjectBindingPattern(G,kr(G.elements,ht,Pa));function ht(Dt){return Dt.kind===232?Dt:(Dt.propertyName&&xa(Dt.propertyName)&&oc(Dt.propertyName.expression)&&ei(Dt.propertyName.expression,f),Dt.propertyName&&Ie(Dt.propertyName)&&Ie(Dt.name)&&!Dt.symbol.isReferenced&&!o5(Dt.propertyName)?C.updateBindingElement(Dt,Dt.dotDotDotToken,void 0,Dt.propertyName,ot(Dt)?Dt.initializer:void 0):C.updateBindingElement(Dt,Dt.dotDotDotToken,Dt.propertyName,mt(Dt.name),ot(Dt)?Dt.initializer:void 0))}}function Je(G,ht,Dt){let Re;S||(Re=r,r=Gh(G));const st=C.updateParameterDeclaration(G,ZLe(C,G,ht),G.dotDotDotToken,mt(G.name),B.isOptionalParameter(G)?G.questionToken||C.createToken(58):void 0,Ht(G,Dt||G.type,!0),Bt(G));return S||(r=Re),st}function ot(G){return KLe(G)&&B.isLiteralConstDeclaration(ss(G))}function Bt(G){if(ot(G))return B.createLiteralConstValue(ss(G),D)}function Ht(G,ht,Dt){if(!Dt&&w_(G,2)||ot(G))return;const Re=G.kind===169&&(B.isRequiredInitializedParameter(G)||B.isOptionalUninitializedParameterProperty(G));if(ht&&!Re)return He(ht,Tr,Si);if(!ss(G))return ht?He(ht,Tr,Si):C.createKeywordTypeNode(133);if(G.kind===178)return C.createKeywordTypeNode(133);O=G.name;let st;if(S||(st=r,r=Gh(G)),G.kind===260||G.kind===208)return Ct(B.createTypeOfDeclaration(G,f,Bb,D));if(G.kind===169||G.kind===172||G.kind===171)return ff(G)||!G.initializer?Ct(B.createTypeOfDeclaration(G,f,Bb,D,Re)):Ct(B.createTypeOfDeclaration(G,f,Bb,D,Re)||B.createTypeOfExpression(G.initializer,f,Bb,D));return Ct(B.createReturnTypeOfSignatureDeclaration(G,f,Bb,D));function Ct(Qt){return O=void 0,S||(r=st),Qt||C.createKeywordTypeNode(133)}}function br(G){switch(G=ss(G),G.kind){case 262:case 267:case 264:case 263:case 265:case 266:return!B.isDeclarationVisible(G);case 260:return!ar(G);case 271:case 272:case 278:case 277:return!1;case 175:return!0}return!1}function zr(G){var ht;if(G.body)return!0;const Dt=(ht=G.symbol.declarations)==null?void 0:ht.filter(Re=>Zc(Re)&&!Re.body);return!Dt||Dt.indexOf(G)===Dt.length-1}function ar(G){return dl(G)?!1:As(G.name)?ut(G.name.elements,ar):B.isDeclarationVisible(G)}function Jt(G,ht,Dt){if(w_(G,2))return C.createNodeArray();const Re=Yt(ht,st=>Je(st,Dt));return Re?C.createNodeArray(Re,ht.hasTrailingComma):C.createNodeArray()}function It(G,ht){let Dt;if(!ht){const Re=Fv(G);Re&&(Dt=[Je(Re)])}if(N_(G)){let Re;if(!ht){const st=iE(G);if(st){const Ct=Be(G,B.getAllAccessorDeclarations(G));Re=Je(st,void 0,Ct)}}Re||(Re=C.createParameterDeclaration(void 0,void 0,"value")),Dt=lr(Dt,Re)}return C.createNodeArray(Dt||ze)}function Nn(G,ht){return w_(G,2)?void 0:kr(ht,Tr,Uo)}function Fi(G){return Ai(G)||Jp(G)||vc(G)||Vc(G)||Mu(G)||ks(G)||Cb(G)||jE(G)}function ei(G,ht){const Dt=B.isEntityNameVisible(G,ht);oe(Dt),$(B.getTypeReferenceDirectivesForEntityName(G))}function zi(G,ht){return q_(G)&&q_(ht)&&(G.jsDoc=ht.jsDoc),Ac(G,Fd(ht))}function Qe(G,ht){if(ht){if(o=o||G.kind!==267&&G.kind!==205,Ja(ht))if(s){const Dt=mte(e.getEmitHost(),B,G);if(Dt)return C.createStringLiteral(Dt)}else{const Dt=B.getSymbolOfExternalModuleSpecifier(ht);Dt&&(T||(T=[])).push(Dt)}return ht}}function ur(G){if(B.isDeclarationVisible(G))if(G.moduleReference.kind===283){const ht=q4(G);return C.updateImportEqualsDeclaration(G,G.modifiers,G.isTypeOnly,G.name,C.updateExternalModuleReference(G.moduleReference,Qe(G,ht)))}else{const ht=r;return r=Gh(G),ei(G.moduleReference,f),r=ht,G}}function Dr(G){if(!G.importClause)return C.updateImportDeclaration(G,G.modifiers,G.importClause,Qe(G,G.moduleSpecifier),Ft(G.attributes));const ht=G.importClause&&G.importClause.name&&B.isDeclarationVisible(G.importClause)?G.importClause.name:void 0;if(!G.importClause.namedBindings)return ht&&C.updateImportDeclaration(G,G.modifiers,C.updateImportClause(G.importClause,G.importClause.isTypeOnly,ht,void 0),Qe(G,G.moduleSpecifier),Ft(G.attributes));if(G.importClause.namedBindings.kind===274){const Re=B.isDeclarationVisible(G.importClause.namedBindings)?G.importClause.namedBindings:void 0;return ht||Re?C.updateImportDeclaration(G,G.modifiers,C.updateImportClause(G.importClause,G.importClause.isTypeOnly,ht,Re),Qe(G,G.moduleSpecifier),Ft(G.attributes)):void 0}const Dt=Ii(G.importClause.namedBindings.elements,Re=>B.isDeclarationVisible(Re)?Re:void 0);if(Dt&&Dt.length||ht)return C.updateImportDeclaration(G,G.modifiers,C.updateImportClause(G.importClause,G.importClause.isTypeOnly,ht,Dt&&Dt.length?C.updateNamedImports(G.importClause.namedBindings,Dt):void 0),Qe(G,G.moduleSpecifier),Ft(G.attributes));if(B.isImportRequiredByAugmentation(G))return C.updateImportDeclaration(G,G.modifiers,void 0,Qe(G,G.moduleSpecifier),Ft(G.attributes))}function Ft(G){const ht=LC(G);return G&&ht!==void 0?G:void 0}function yr(G){for(;Ir(p);){const Dt=p.shift();if(!FI(Dt))return E.fail(`Late replaced statement was found which is not handled by the declaration transformer!: ${E.formatSyntaxKind(Dt.kind)}`);const Re=i;i=Dt.parent&&Ai(Dt.parent)&&!(Nc(Dt.parent)&&s);const st=$i(Dt);i=Re,y.set(iu(Dt),st)}return kr(G,ht,Ci);function ht(Dt){if(FI(Dt)){const Re=iu(Dt);if(y.has(Re)){const st=y.get(Re);return y.delete(Re),st&&((es(st)?ut(st,yI):yI(st))&&(c=!0),Ai(Dt.parent)&&(es(st)?ut(st,DP):DP(st))&&(o=!0)),st}}return Dt}}function Tr(G){if(rt(G)||hu(G)&&(br(G)||V0(G)&&!B.isLateBound(ss(G)))||ks(G)&&B.isImplementationOfOverload(G)||one(G))return;let ht;Fi(G)&&(ht=f,f=G);const Dt=r,Re=qO(G),st=S;let Ct=(G.kind===187||G.kind===200)&&G.parent.kind!==265;if((mc(G)||fg(G))&&w_(G,2))return G.symbol&&G.symbol.declarations&&G.symbol.declarations[0]!==G?void 0:Qt(C.createPropertyDeclaration(fe(G),G.name,void 0,void 0,void 0));if(Re&&!S&&(r=Gh(G)),lC(G)&&ei(G.exprName,f),Ct&&(S=!0),tMe(G))switch(G.kind){case 233:{(V_(G.expression)||oc(G.expression))&&ei(G.expression,f);const er=sr(G,Tr,e);return Qt(C.updateExpressionWithTypeArguments(er,er.expression,er.typeArguments))}case 183:{ei(G.typeName,f);const er=sr(G,Tr,e);return Qt(C.updateTypeReferenceNode(er,er.typeName,er.typeArguments))}case 180:return Qt(C.updateConstructSignature(G,Nn(G,G.typeParameters),Jt(G,G.parameters),Ht(G,G.type)));case 176:{const er=C.createConstructorDeclaration(fe(G),Jt(G,G.parameters,0),void 0);return Qt(er)}case 174:{if(Ti(G.name))return Qt(void 0);const er=C.createMethodDeclaration(fe(G),void 0,G.name,G.questionToken,Nn(G,G.typeParameters),Jt(G,G.parameters),Ht(G,G.type),void 0);return Qt(er)}case 177:{if(Ti(G.name))return Qt(void 0);const er=Be(G,B.getAllAccessorDeclarations(G));return Qt(C.updateGetAccessorDeclaration(G,fe(G),G.name,It(G,w_(G,2)),Ht(G,er),void 0))}case 178:return Ti(G.name)?Qt(void 0):Qt(C.updateSetAccessorDeclaration(G,fe(G),G.name,It(G,w_(G,2)),void 0));case 172:return Ti(G.name)?Qt(void 0):Qt(C.updatePropertyDeclaration(G,fe(G),G.name,G.questionToken,Ht(G,G.type),Bt(G)));case 171:return Ti(G.name)?Qt(void 0):Qt(C.updatePropertySignature(G,fe(G),G.name,G.questionToken,Ht(G,G.type)));case 173:return Ti(G.name)?Qt(void 0):Qt(C.updateMethodSignature(G,fe(G),G.name,G.questionToken,Nn(G,G.typeParameters),Jt(G,G.parameters),Ht(G,G.type)));case 179:return Qt(C.updateCallSignature(G,Nn(G,G.typeParameters),Jt(G,G.parameters),Ht(G,G.type)));case 181:return Qt(C.updateIndexSignature(G,fe(G),Jt(G,G.parameters),He(G.type,Tr,Si)||C.createKeywordTypeNode(133)));case 260:return As(G.name)?Ds(G.name):(Ct=!0,S=!0,Qt(C.updateVariableDeclaration(G,G.name,void 0,Ht(G,G.type),Bt(G))));case 168:return Xr(G)&&(G.default||G.constraint)?Qt(C.updateTypeParameterDeclaration(G,G.modifiers,G.name,void 0,void 0)):Qt(sr(G,Tr,e));case 194:{const er=He(G.checkType,Tr,Si),or=He(G.extendsType,Tr,Si),U=f;f=G.trueType;const j=He(G.trueType,Tr,Si);f=U;const ce=He(G.falseType,Tr,Si);return E.assert(er),E.assert(or),E.assert(j),E.assert(ce),Qt(C.updateConditionalTypeNode(G,er,or,j,ce))}case 184:return Qt(C.updateFunctionTypeNode(G,kr(G.typeParameters,Tr,Uo),Jt(G,G.parameters),E.checkDefined(He(G.type,Tr,Si))));case 185:return Qt(C.updateConstructorTypeNode(G,fe(G),kr(G.typeParameters,Tr,Uo),Jt(G,G.parameters),E.checkDefined(He(G.type,Tr,Si))));case 205:return U0(G)?(K(G),Qt(C.updateImportTypeNode(G,C.updateLiteralTypeNode(G.argument,Qe(G,G.argument.literal)),G.attributes,G.qualifier,kr(G.typeArguments,Tr,Si),G.isTypeOf))):Qt(G);default:E.assertNever(G,`Attempted to process unhandled node kind: ${E.formatSyntaxKind(G.kind)}`)}return uC(G)&&qa(W,G.pos).line===qa(W,G.end).line&&Vr(G,1),Qt(sr(G,Tr,e));function Qt(er){return er&&Re&&V0(G)&&Ue(G),Fi(G)&&(f=ht),Re&&!S&&(r=Dt),Ct&&(S=st),er===G?er:er&&rn(zi(er,G),G)}}function Xr(G){return G.parent.kind===174&&w_(G.parent,2)}function Pi(G){if(!eMe(G)||rt(G))return;switch(G.kind){case 278:return Ai(G.parent)&&(o=!0),u=!0,K(G),C.updateExportDeclaration(G,G.modifiers,G.isTypeOnly,G.exportClause,Qe(G,G.moduleSpecifier),Ft(G.attributes));case 277:{if(Ai(G.parent)&&(o=!0),u=!0,G.expression.kind===80)return G;{const Dt=C.createUniqueName("_default",16);r=()=>({diagnosticMessage:d.Default_export_of_the_module_has_or_is_using_private_name_0,errorNode:G}),z=G;const Re=C.createVariableDeclaration(Dt,void 0,B.createTypeOfExpression(G.expression,G,Bb,D),void 0);z=void 0;const st=C.createVariableStatement(i?[C.createModifier(138)]:[],C.createVariableDeclarationList([Re],2));return zi(st,G),G8(G),[st,C.updateExportAssignment(G,G.modifiers,Dt)]}}}const ht=$i(G);return y.set(iu(G),ht),G}function ji(G){if(Hl(G)||w_(G,2048)||!Wp(G))return G;const ht=C.createModifiersFromModifierFlags(Fu(G)&131039);return C.replaceModifiers(G,ht)}function Di(G,ht,Dt,Re){const st=C.updateModuleDeclaration(G,ht,Dt,Re);if(ru(st)||st.flags&32)return st;const Ct=C.createModuleDeclaration(st.modifiers,st.name,st.body,st.flags|32);return rn(Ct,st),tt(Ct,st),Ct}function $i(G){if(p)for(;HD(p,G););if(rt(G))return;switch(G.kind){case 271:{const Qt=ur(G);return Qt&&K(G),Qt}case 272:{const Qt=Dr(G);return Qt&&K(G),Qt}}if(hu(G)&&br(G)||ks(G)&&B.isImplementationOfOverload(G))return;let ht;Fi(G)&&(ht=f,f=G);const Dt=qO(G),Re=r;Dt&&(r=Gh(G));const st=i;switch(G.kind){case 265:{i=!1;const Qt=Ct(C.updateTypeAliasDeclaration(G,fe(G),G.name,kr(G.typeParameters,Tr,Uo),E.checkDefined(He(G.type,Tr,Si))));return i=st,Qt}case 264:return Ct(C.updateInterfaceDeclaration(G,fe(G),G.name,Nn(G,G.typeParameters),gt(G.heritageClauses),kr(G.members,Tr,ib)));case 262:{const Qt=Ct(C.updateFunctionDeclaration(G,fe(G),void 0,G.name,Nn(G,G.typeParameters),Jt(G,G.parameters),Ht(G,G.type),void 0));if(Qt&&B.isExpandoFunctionDeclaration(G)&&zr(G)){const er=B.getPropertiesOfContainerFunction(G),or=wm.createModuleDeclaration(void 0,Qt.name||C.createIdentifier("_default"),C.createModuleBlock([]),32);ga(or,f),or.locals=zs(er),or.symbol=er[0].parent;const U=[];let j=Ii(er,Ve=>{if(!$5(Ve.valueDeclaration))return;const Fe=bi(Ve.escapedName);if(!lf(Fe,99))return;r=Gh(Ve.valueDeclaration);const vt=B.createTypeOfDeclaration(Ve.valueDeclaration,or,Bb,D);r=Re;const Lt=_T(Fe),Wt=Lt?C.getGeneratedNameForNode(Ve.valueDeclaration):C.createIdentifier(Fe);Lt&&U.push([Wt,Fe]);const Lr=C.createVariableDeclaration(Wt,void 0,vt,void 0);return C.createVariableStatement(Lt?void 0:[C.createToken(95)],C.createVariableDeclarationList([Lr]))});U.length?j.push(C.createExportDeclaration(void 0,!1,C.createNamedExports(Yt(U,([Ve,Fe])=>C.createExportSpecifier(!1,Ve,Fe))))):j=Ii(j,Ve=>C.replaceModifiers(Ve,0));const ce=C.createModuleDeclaration(fe(G),G.name,C.createModuleBlock(j),32);if(!w_(Qt,2048))return[Qt,ce];const ee=C.createModifiersFromModifierFlags(Fu(Qt)&-2081|128),ue=C.updateFunctionDeclaration(Qt,ee,void 0,Qt.name,Qt.typeParameters,Qt.parameters,Qt.type,void 0),M=C.updateModuleDeclaration(ce,ee,ce.name,ce.body),De=C.createExportAssignment(void 0,!1,ce.name);return Ai(G.parent)&&(o=!0),u=!0,[ue,M,De]}else return Qt}case 267:{i=!1;const Qt=G.body;if(Qt&&Qt.kind===268){const er=c,or=u;u=!1,c=!1;const U=kr(Qt.statements,Pi,Ci);let j=yr(U);G.flags&33554432&&(c=!1),!Dd(G)&&!dt(j)&&!u&&(c?j=C.createNodeArray([...j,lw(C)]):j=kr(j,ji,Ci));const ce=C.updateModuleBlock(Qt,j);i=st,c=er,u=or;const ee=fe(G);return Ct(Di(G,ee,xv(G)?Qe(G,G.name):G.name,ce))}else{i=st;const er=fe(G);i=!1,He(Qt,Pi);const or=iu(Qt),U=y.get(or);return y.delete(or),Ct(Di(G,er,G.name,U))}}case 263:{O=G.name,z=G;const Qt=C.createNodeArray(fe(G)),er=Nn(G,G.typeParameters),or=cg(G);let U;if(or){const De=r;U=UD(ta(or.parameters,Ve=>{if(!In(Ve,31)||rt(Ve))return;if(r=Gh(Ve),Ve.name.kind===80)return zi(C.createPropertyDeclaration(fe(Ve),Ve.name,Ve.questionToken,Ht(Ve,Ve.type),Bt(Ve)),Ve);return Fe(Ve.name);function Fe(vt){let Lt;for(const Wt of vt.elements)dl(Wt)||(As(Wt.name)&&(Lt=Xi(Lt,Fe(Wt.name))),Lt=Lt||[],Lt.push(C.createPropertyDeclaration(fe(Ve),Wt.name,void 0,Ht(Wt,void 0),void 0)));return Lt}})),r=De}const ce=ut(G.members,De=>!!De.name&&Ti(De.name))?[C.createPropertyDeclaration(void 0,C.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:void 0,ee=Xi(Xi(ce,U),kr(G.members,Tr,Pl)),ue=C.createNodeArray(ee),M=Pd(G);if(M&&!oc(M.expression)&&M.expression.kind!==106){const De=G.name?bi(G.name.escapedText):"default",Ve=C.createUniqueName(`${De}_base`,16);r=()=>({diagnosticMessage:d.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,errorNode:M,typeName:G.name});const Fe=C.createVariableDeclaration(Ve,void 0,B.createTypeOfExpression(M.expression,G,Bb,D),void 0),vt=C.createVariableStatement(i?[C.createModifier(138)]:[],C.createVariableDeclarationList([Fe],2)),Lt=C.createNodeArray(Yt(G.heritageClauses,Wt=>{if(Wt.token===96){const Lr=r;r=Gh(Wt.types[0]);const Zr=C.updateHeritageClause(Wt,Yt(Wt.types,gn=>C.updateExpressionWithTypeArguments(gn,Ve,kr(gn.typeArguments,Tr,Si))));return r=Lr,Zr}return C.updateHeritageClause(Wt,kr(C.createNodeArray(wn(Wt.types,Lr=>oc(Lr.expression)||Lr.expression.kind===106)),Tr,qh))}));return[vt,Ct(C.updateClassDeclaration(G,Qt,G.name,er,Lt,ue))]}else{const De=gt(G.heritageClauses);return Ct(C.updateClassDeclaration(G,Qt,G.name,er,De,ue))}}case 243:return Ct(Qs(G));case 266:return Ct(C.updateEnumDeclaration(G,C.createNodeArray(fe(G)),G.name,C.createNodeArray(Ii(G.members,Qt=>{if(rt(Qt))return;const er=B.getConstantValue(Qt);return zi(C.updateEnumMember(Qt,Qt.name,er!==void 0?typeof er=="string"?C.createStringLiteral(er):C.createNumericLiteral(er):void 0),Qt)}))))}return E.assertNever(G,`Unhandled top-level node in declaration emit: ${E.formatSyntaxKind(G.kind)}`);function Ct(Qt){return Fi(G)&&(f=ht),Dt&&(r=Re),G.kind===267&&(i=st),Qt===G?Qt:(z=void 0,O=void 0,Qt&&rn(zi(Qt,G),G))}}function Qs(G){if(!Zt(G.declarationList.declarations,ar))return;const ht=kr(G.declarationList.declarations,Tr,Ei);if(!Ir(ht))return;const Dt=C.createNodeArray(fe(G));let Re;return JP(G.declarationList)||BP(G.declarationList)?(Re=C.createVariableDeclarationList(ht,2),rn(Re,G.declarationList),tt(Re,G.declarationList),Ac(Re,G.declarationList)):Re=C.updateVariableDeclarationList(G.declarationList,ht),C.updateVariableStatement(G,Dt,Re)}function Ds(G){return Np(Ii(G.elements,ht=>Ce(ht)))}function Ce(G){if(G.kind!==232&&G.name)return ar(G)?As(G.name)?Ds(G.name):C.createVariableDeclaration(G.name,void 0,Ht(G,void 0),void 0):void 0}function Ue(G){let ht;S||(ht=r,r=xse(G)),O=G.name,E.assert(B.isLateBound(ss(G)));const Re=G.name.expression;ei(Re,f),S||(r=ht),O=void 0}function rt(G){return!!_e&&!!G&&xV(G,W)}function ft(G){return cc(G)||qc(G)}function dt(G){return ut(G,ft)}function fe(G){const ht=Fu(G),Dt=we(G);return ht===Dt?zw(G.modifiers,Re=>Jn(Re,Ys),Ys):C.createModifiersFromModifierFlags(Dt)}function we(G){let ht=130030,Dt=i&&!YLe(G)?128:0;const Re=G.parent.kind===312;return(!Re||s&&Re&&Nc(G.parent))&&(ht^=128,Dt=0),U2e(G,ht,Dt)}function Be(G,ht){let Dt=Cse(G);return!Dt&&G!==ht.firstAccessor&&(Dt=Cse(ht.firstAccessor),r=Gh(ht.firstAccessor)),!Dt&&ht.secondAccessor&&G!==ht.secondAccessor&&(Dt=Cse(ht.secondAccessor),r=Gh(ht.secondAccessor)),Dt}function gt(G){return C.createNodeArray(wn(Yt(G,ht=>C.updateHeritageClause(ht,kr(C.createNodeArray(wn(ht.types,Dt=>oc(Dt.expression)||ht.token===96&&Dt.expression.kind===106)),Tr,qh))),ht=>ht.types&&!!ht.types.length))}}function YLe(e){return e.kind===264}function ZLe(e,t,r,i){return e.createModifiersFromModifierFlags(U2e(t,r,i))}function U2e(e,t=131070,r=0){let i=Fu(e)&t|r;return i&2048&&!(i&32)&&(i^=32),i&2048&&i&128&&(i^=128),i}function Cse(e){if(e)return e.kind===177?e.type:e.parameters.length>0?e.parameters[0].type:void 0}function KLe(e){switch(e.kind){case 172:case 171:return!w_(e,2);case 169:case 260:return!0}return!1}function eMe(e){switch(e.kind){case 262:case 267:case 271:case 264:case 263:case 265:case 266:case 243:case 272:case 278:case 277:return!0}return!1}function tMe(e){switch(e.kind){case 180:case 176:case 174:case 177:case 178:case 172:case 171:case 173:case 179:case 181:case 260:case 168:case 233:case 183:case 194:case 184:case 185:case 205:return!0}return!1}var Bb,rMe=Nt({"src/compiler/transformers/declarations.ts"(){"use strict";Ns(),Nie(),Bb=531469}});function nMe(e){switch(e){case 99:case 7:case 6:case 5:return TV;case 4:return Sse;case 100:case 199:return Tse;default:return SV}}function CV(e,t,r){return{scriptTransformers:iMe(e,t,r),declarationTransformers:sMe(t)}}function iMe(e,t,r){if(r)return ze;const i=Da(e),s=Ul(e),o=A8(e),c=[];return Dn(c,t&&Yt(t.before,q2e)),c.push(rse),e.experimentalDecorators&&c.push(sse),F5(e)&&c.push(gse),i<99&&c.push(fse),!e.experimentalDecorators&&(i<99||!o)&&c.push(ase),c.push(nse),i<8&&c.push(_se),i<7&&c.push(use),i<6&&c.push(lse),i<5&&c.push(cse),i<4&&c.push(ose),i<3&&c.push(hse),i<2&&(c.push(yse),c.push(bse)),c.push(nMe(s)),i<1&&c.push(vse),Dn(c,t&&Yt(t.after,q2e)),c}function sMe(e){const t=[];return t.push(kV),Dn(t,e&&Yt(e.afterDeclarations,oMe)),t}function aMe(e){return t=>zW(t)?e.transformBundle(t):e.transformSourceFile(t)}function V2e(e,t){return r=>{const i=e(r);return typeof i=="function"?t(r,i):aMe(i)}}function q2e(e){return V2e(e,Up)}function oMe(e){return V2e(e,(t,r)=>r)}function f3(e,t){return t}function Vw(e,t,r){r(e,t)}function qw(e,t,r,i,s,o,c){var u,f;const g=new Array(363);let p,y,S,T=0,C=[],w=[],D=[],O=[],z=0,W=!1,X=[],J=0,ie,B,Y=f3,ae=Vw,_e=0;const $=[],H={factory:r,getCompilerOptions:()=>i,getEmitResolver:()=>e,getEmitHost:()=>t,getEmitHelperFactory:Vu(()=>qre(H)),startLexicalEnvironment:me,suspendLexicalEnvironment:Oe,resumeLexicalEnvironment:Xe,endLexicalEnvironment:it,setLexicalEnvironmentFlags:mt,getLexicalEnvironmentFlags:Je,hoistVariableDeclaration:be,hoistFunctionDeclaration:lt,addInitializationStatement:pt,startBlockScope:ot,endBlockScope:Bt,addBlockScopedVariable:Ht,requestEmitHelper:br,readEmitHelpers:zr,enableSubstitution:Z,enableEmitNotification:Me,isSubstitutionEnabled:ve,isEmitNotificationEnabled:ke,get onSubstituteNode(){return Y},set onSubstituteNode(Jt){E.assert(_e<1,"Cannot modify transformation hooks after initialization has completed."),E.assert(Jt!==void 0,"Value must not be 'undefined'"),Y=Jt},get onEmitNode(){return ae},set onEmitNode(Jt){E.assert(_e<1,"Cannot modify transformation hooks after initialization has completed."),E.assert(Jt!==void 0,"Value must not be 'undefined'"),ae=Jt},addDiagnostic(Jt){$.push(Jt)}};for(const Jt of s)xW(Or(ss(Jt)));ko("beforeTransform");const K=o.map(Jt=>Jt(H)),oe=Jt=>{for(const It of K)Jt=It(Jt);return Jt};_e=1;const Se=[];for(const Jt of s)(u=Jr)==null||u.push(Jr.Phase.Emit,"transformNodes",Jt.kind===312?{path:Jt.path}:{kind:Jt.kind,pos:Jt.pos,end:Jt.end}),Se.push((c?oe:se)(Jt)),(f=Jr)==null||f.pop();return _e=2,ko("afterTransform"),cf("transformTime","beforeTransform","afterTransform"),{transformed:Se,substituteNode:Te,emitNodeWithNotification:he,isEmitNotificationEnabled:ke,dispose:ar,diagnostics:$};function se(Jt){return Jt&&(!Ai(Jt)||!Jt.isDeclarationFile)?oe(Jt):Jt}function Z(Jt){E.assert(_e<2,"Cannot modify the transformation context after transformation has completed."),g[Jt]|=1}function ve(Jt){return(g[Jt.kind]&1)!==0&&(da(Jt)&8)===0}function Te(Jt,It){return E.assert(_e<3,"Cannot substitute a node after the result is disposed."),It&&ve(It)&&Y(Jt,It)||It}function Me(Jt){E.assert(_e<2,"Cannot modify the transformation context after transformation has completed."),g[Jt]|=2}function ke(Jt){return(g[Jt.kind]&2)!==0||(da(Jt)&4)!==0}function he(Jt,It,Nn){E.assert(_e<3,"Cannot invoke TransformationResult callbacks after the result is disposed."),It&&(ke(It)?ae(Jt,It,Nn):Nn(Jt,It))}function be(Jt){E.assert(_e>0,"Cannot modify the lexical environment during initialization."),E.assert(_e<2,"Cannot modify the lexical environment after transformation has completed.");const It=Vr(r.createVariableDeclaration(Jt),128);p?p.push(It):p=[It],T&1&&(T|=2)}function lt(Jt){E.assert(_e>0,"Cannot modify the lexical environment during initialization."),E.assert(_e<2,"Cannot modify the lexical environment after transformation has completed."),Vr(Jt,2097152),y?y.push(Jt):y=[Jt]}function pt(Jt){E.assert(_e>0,"Cannot modify the lexical environment during initialization."),E.assert(_e<2,"Cannot modify the lexical environment after transformation has completed."),Vr(Jt,2097152),S?S.push(Jt):S=[Jt]}function me(){E.assert(_e>0,"Cannot modify the lexical environment during initialization."),E.assert(_e<2,"Cannot modify the lexical environment after transformation has completed."),E.assert(!W,"Lexical environment is suspended."),C[z]=p,w[z]=y,D[z]=S,O[z]=T,z++,p=void 0,y=void 0,S=void 0,T=0}function Oe(){E.assert(_e>0,"Cannot modify the lexical environment during initialization."),E.assert(_e<2,"Cannot modify the lexical environment after transformation has completed."),E.assert(!W,"Lexical environment is already suspended."),W=!0}function Xe(){E.assert(_e>0,"Cannot modify the lexical environment during initialization."),E.assert(_e<2,"Cannot modify the lexical environment after transformation has completed."),E.assert(W,"Lexical environment is not suspended."),W=!1}function it(){E.assert(_e>0,"Cannot modify the lexical environment during initialization."),E.assert(_e<2,"Cannot modify the lexical environment after transformation has completed."),E.assert(!W,"Lexical environment is suspended.");let Jt;if(p||y||S){if(y&&(Jt=[...y]),p){const It=r.createVariableStatement(void 0,r.createVariableDeclarationList(p));Vr(It,2097152),Jt?Jt.push(It):Jt=[It]}S&&(Jt?Jt=[...Jt,...S]:Jt=[...S])}return z--,p=C[z],y=w[z],S=D[z],T=O[z],z===0&&(C=[],w=[],D=[],O=[]),Jt}function mt(Jt,It){T=It?T|Jt:T&~Jt}function Je(){return T}function ot(){E.assert(_e>0,"Cannot start a block scope during initialization."),E.assert(_e<2,"Cannot start a block scope after transformation has completed."),X[J]=ie,J++,ie=void 0}function Bt(){E.assert(_e>0,"Cannot end a block scope during initialization."),E.assert(_e<2,"Cannot end a block scope after transformation has completed.");const Jt=ut(ie)?[r.createVariableStatement(void 0,r.createVariableDeclarationList(ie.map(It=>r.createVariableDeclaration(It)),1))]:void 0;return J--,ie=X[J],J===0&&(X=[]),Jt}function Ht(Jt){E.assert(J>0,"Cannot add a block scoped variable outside of an iteration body."),(ie||(ie=[])).push(Jt)}function br(Jt){if(E.assert(_e>0,"Cannot modify the transformation context during initialization."),E.assert(_e<2,"Cannot modify the transformation context after transformation has completed."),E.assert(!Jt.scoped,"Cannot request a scoped emit helper."),Jt.dependencies)for(const It of Jt.dependencies)br(It);B=lr(B,Jt)}function zr(){E.assert(_e>0,"Cannot modify the transformation context during initialization."),E.assert(_e<2,"Cannot modify the transformation context after transformation has completed.");const Jt=B;return B=void 0,Jt}function ar(){if(_e<3){for(const Jt of s)xW(Or(ss(Jt)));p=void 0,C=void 0,y=void 0,w=void 0,Y=void 0,ae=void 0,B=void 0,_e=3}}}var EV,cd,cMe=Nt({"src/compiler/transformer.ts"(){"use strict";Ns(),Z2(),EV={scriptTransformers:ze,declarationTransformers:ze},cd={factory:I,getCompilerOptions:()=>({}),getEmitResolver:ys,getEmitHost:ys,getEmitHelperFactory:ys,startLexicalEnvironment:Ca,resumeLexicalEnvironment:Ca,suspendLexicalEnvironment:Ca,endLexicalEnvironment:Wy,setLexicalEnvironmentFlags:Ca,getLexicalEnvironmentFlags:()=>0,hoistVariableDeclaration:Ca,hoistFunctionDeclaration:Ca,addInitializationStatement:Ca,startBlockScope:Ca,endBlockScope:Wy,addBlockScopedVariable:Ca,requestEmitHelper:Ca,readEmitHelpers:ys,enableSubstitution:Ca,enableEmitNotification:Ca,isSubstitutionEnabled:ys,isEmitNotificationEnabled:ys,onSubstituteNode:f3,onEmitNode:Vw,addDiagnostic:Ca}}});function Ese(e){return Ho(e,".tsbuildinfo")}function DV(e,t,r,i=!1,s,o){const c=es(r)?r:yz(e,r,i),u=e.getCompilerOptions();if(to(u)){const f=e.getPrependNodes();if(c.length||f.length){const g=I.createBundle(c,f),p=t(d3(g,e,i),g);if(p)return p}}else{if(!s)for(const f of c){const g=t(d3(f,e,i),f);if(g)return g}if(o){const f=$h(u);if(f)return t({buildInfoPath:f},void 0)}}}function $h(e){const t=e.configFilePath;if(!w8(e))return;if(e.tsBuildInfoFile)return e.tsBuildInfoFile;const r=to(e);let i;if(r)i=Ou(r);else{if(!t)return;const s=Ou(t);i=e.outDir?e.rootDir?I0(e.outDir,mm(e.rootDir,s,!0)):Hn(e.outDir,Pc(s)):s}return i+".tsbuildinfo"}function p3(e,t){const r=to(e),i=e.emitDeclarationOnly?void 0:r,s=i&&H2e(i,e),o=t||Rf(e)?Ou(r)+".d.ts":void 0,c=o&&A5(e)?o+".map":void 0,u=$h(e);return{jsFilePath:i,sourceMapFilePath:s,declarationFilePath:o,declarationMapPath:c,buildInfoPath:u}}function d3(e,t,r){const i=t.getCompilerOptions();if(e.kind===313)return p3(i,r);{const s=gte(e.fileName,t,HO(e.fileName,i)),o=ap(e),c=o&&qy(e.fileName,s,t.getCurrentDirectory(),!t.useCaseSensitiveFileNames())===0,u=i.emitDeclarationOnly||c?void 0:s,f=!u||ap(e)?void 0:H2e(u,i),g=r||Rf(i)&&!o?hte(e.fileName,t):void 0,p=g&&A5(i)?g+".map":void 0;return{jsFilePath:u,sourceMapFilePath:f,declarationFilePath:g,declarationMapPath:p,buildInfoPath:void 0}}}function H2e(e,t){return t.sourceMap&&!t.inlineSourceMap?e+".map":void 0}function HO(e,t){return Ho(e,".json")?".json":t.jsx===1&&Jc(e,[".jsx",".tsx"])?".jsx":Jc(e,[".mts",".mjs"])?".mjs":Jc(e,[".cts",".cjs"])?".cjs":".js"}function G2e(e,t,r,i,s){return i?I0(i,mm(s?s():h3(t,r),e,r)):e}function m3(e,t,r,i){return a1(G2e(e,t,r,t.options.declarationDir||t.options.outDir,i),v8(e))}function $2e(e,t,r,i){if(t.options.emitDeclarationOnly)return;const s=Ho(e,".json"),o=a1(G2e(e,t,r,t.options.outDir,i),HO(e,t.options));return!s||qy(e,o,E.checkDefined(t.options.configFilePath),r)!==0?o:void 0}function X2e(){let e;return{addOutput:t,getOutputs:r};function t(i){i&&(e||(e=[])).push(i)}function r(){return e||ze}}function Q2e(e,t){const{jsFilePath:r,sourceMapFilePath:i,declarationFilePath:s,declarationMapPath:o,buildInfoPath:c}=p3(e.options,!1);t(r),t(i),t(s),t(o),t(c)}function Y2e(e,t,r,i,s){if(Il(t))return;const o=$2e(t,e,r,s);if(i(o),!Ho(t,".json")&&(o&&e.options.sourceMap&&i(`${o}.map`),Rf(e.options))){const c=m3(t,e,r,s);i(c),e.options.declarationMap&&i(`${c}.map`)}}function g3(e,t,r,i,s){let o;return e.rootDir?(o=is(e.rootDir,r),s?.(e.rootDir)):e.composite&&e.configFilePath?(o=qn(du(e.configFilePath)),s?.(o)):o=Ise(t(),r,i),o&&o[o.length-1]!==Co&&(o+=Co),o}function h3({options:e,fileNames:t},r){return g3(e,()=>wn(t,i=>!(e.noEmitForJsFiles&&Jc(i,iC))&&!Il(i)),qn(du(E.checkDefined(e.configFilePath))),tu(!r))}function GO(e,t){const{addOutput:r,getOutputs:i}=X2e();if(to(e.options))Q2e(e,r);else{const s=Vu(()=>h3(e,t));for(const o of e.fileNames)Y2e(e,o,t,r,s);r($h(e.options))}return i()}function Z2e(e,t,r){t=qs(t),E.assert(_s(e.fileNames,t),"Expected fileName to be present in command line");const{addOutput:i,getOutputs:s}=X2e();return to(e.options)?Q2e(e,i):Y2e(e,t,r,i),s()}function PV(e,t){if(to(e.options)){const{jsFilePath:s,declarationFilePath:o}=p3(e.options,!1);return E.checkDefined(s||o,`project ${e.options.configFilePath} expected to have at least one output`)}const r=Vu(()=>h3(e,t));for(const s of e.fileNames){if(Il(s))continue;const o=$2e(s,e,t,r);if(o)return o;if(!Ho(s,".json")&&Rf(e.options))return m3(s,e,t,r)}const i=$h(e.options);return i||E.fail(`project ${e.options.configFilePath} expected to have at least one output`)}function $O(e,t,r,{scriptTransformers:i,declarationTransformers:s},o,c,u){var f=t.getCompilerOptions(),g=f.sourceMap||f.inlineSourceMap||A5(f)?[]:void 0,p=f.listEmittedFiles?[]:void 0,y=qk(),S=zh(f),T=h8(S),{enter:C,exit:w}=Lj("printTime","beforePrint","afterPrint"),D,O=!1;return C(),DV(t,z,yz(t,r,u),u,c,!r),w(),{emitSkipped:O,diagnostics:y.getDiagnostics(),emittedFiles:p,sourceMaps:g};function z({jsFilePath:H,sourceMapFilePath:K,declarationFilePath:oe,declarationMapPath:Se,buildInfoPath:se},Z){var ve,Te,Me,ke,he,be;let lt;se&&Z&&zW(Z)&&(lt=qn(is(se,t.getCurrentDirectory())),D={commonSourceDirectory:pt(t.getCommonSourceDirectory()),sourceFiles:Z.sourceFiles.map(me=>pt(is(me.fileName,t.getCurrentDirectory())))}),(ve=Jr)==null||ve.push(Jr.Phase.Emit,"emitJsFileOrBundle",{jsFilePath:H}),X(Z,H,K,pt),(Te=Jr)==null||Te.pop(),(Me=Jr)==null||Me.push(Jr.Phase.Emit,"emitDeclarationFileOrBundle",{declarationFilePath:oe}),J(Z,oe,Se,pt),(ke=Jr)==null||ke.pop(),(he=Jr)==null||he.push(Jr.Phase.Emit,"emitBuildInfo",{buildInfoPath:se}),W(D,se),(be=Jr)==null||be.pop(),!O&&p&&(o||(H&&p.push(H),K&&p.push(K),se&&p.push(se)),o!==0&&(oe&&p.push(oe),Se&&p.push(Se)));function pt(me){return dv(mm(lt,me,t.getCanonicalFileName))}}function W(H,K){if(!K||r||O)return;if(t.isEmitBlocked(K)){O=!0;return}const oe=t.getBuildInfo(H)||Hw(void 0,H);rE(t,y,K,Dse(oe),!1,void 0,{buildInfo:oe})}function X(H,K,oe,Se){if(!H||o||!K)return;if(t.isEmitBlocked(K)||f.noEmit){O=!0;return}const se=qw(e,t,I,f,[H],i,!1),Z={removeComments:f.removeComments,newLine:f.newLine,noEmitHelpers:f.noEmitHelpers,module:f.module,target:f.target,sourceMap:f.sourceMap,inlineSourceMap:f.inlineSourceMap,inlineSources:f.inlineSources,extendedDiagnostics:f.extendedDiagnostics,writeBundleFileInfo:!!D,relativeToBuildInfo:Se},ve=S1(Z,{hasGlobalName:e.hasGlobalName,onEmitNode:se.emitNodeWithNotification,isEmitNotificationEnabled:se.isEmitNotificationEnabled,substituteNode:se.substituteNode});E.assert(se.transformed.length===1,"Should only see one output from the transform"),B(K,oe,se,ve,f),se.dispose(),D&&(D.js=ve.bundleFileInfo)}function J(H,K,oe,Se){if(!H||o===0)return;if(!K){(o||f.emitDeclarationOnly)&&(O=!0);return}const se=Ai(H)?[H]:H.sourceFiles,Z=u?se:wn(se,GJ),ve=to(f)?[I.createBundle(Z,Ai(H)?void 0:H.prepends)]:Z;o&&!Rf(f)&&Z.forEach(ie);const Te=qw(e,t,I,f,ve,s,!1);if(Ir(Te.diagnostics))for(const be of Te.diagnostics)y.add(be);const Me={removeComments:f.removeComments,newLine:f.newLine,noEmitHelpers:!0,module:f.module,target:f.target,sourceMap:!u&&f.declarationMap,inlineSourceMap:f.inlineSourceMap,extendedDiagnostics:f.extendedDiagnostics,onlyPrintJsDocStyle:!0,omitBraceSourceMapPositions:!0,writeBundleFileInfo:!!D,recordInternalSection:!!D,relativeToBuildInfo:Se},ke=S1(Me,{hasGlobalName:e.hasGlobalName,onEmitNode:Te.emitNodeWithNotification,isEmitNotificationEnabled:Te.isEmitNotificationEnabled,substituteNode:Te.substituteNode}),he=!!Te.diagnostics&&!!Te.diagnostics.length||!!t.isEmitBlocked(K)||!!f.noEmit;O=O||he,(!he||u)&&(E.assert(Te.transformed.length===1,"Should only see one output from the decl transform"),B(K,oe,Te,ke,{sourceMap:Me.sourceMap,sourceRoot:f.sourceRoot,mapRoot:f.mapRoot,extendedDiagnostics:f.extendedDiagnostics})),Te.dispose(),D&&(D.dts=ke.bundleFileInfo)}function ie(H){if(cc(H)){H.expression.kind===80&&e.collectLinkedAliases(H.expression,!0);return}else if(vu(H)){e.collectLinkedAliases(H.propertyName||H.name,!0);return}ds(H,ie)}function B(H,K,oe,Se,se){const Z=oe.transformed[0],ve=Z.kind===313?Z:void 0,Te=Z.kind===312?Z:void 0,Me=ve?ve.sourceFiles:[Te];let ke;Y(se,Z)&&(ke=jie(t,Pc(du(H)),ae(se),_e(se,H,Te),se)),ve?Se.writeBundle(ve,T,ke):Se.writeFile(Te,T,ke);let he;if(ke){g&&g.push({inputSourceFileNames:ke.getSources(),sourceMap:ke.toJSON()});const lt=$(se,ke,H,K,Te);if(lt&&(T.isAtStartOfLine()||T.rawWrite(S),he=T.getTextPos(),T.writeComment(`//# sourceMappingURL=${lt}`)),K){const pt=ke.toString();rE(t,y,K,pt,!1,Me),Se.bundleFileInfo&&(Se.bundleFileInfo.mapHash=zb(pt,t))}}else T.writeLine();const be=T.getText();rE(t,y,H,be,!!f.emitBOM,Me,{sourceMapUrlPos:he,diagnostics:oe.diagnostics}),Se.bundleFileInfo&&(Se.bundleFileInfo.hash=zb(be,t)),T.clear()}function Y(H,K){return(H.sourceMap||H.inlineSourceMap)&&(K.kind!==312||!Ho(K.fileName,".json"))}function ae(H){const K=du(H.sourceRoot||"");return K&&Sl(K)}function _e(H,K,oe){if(H.sourceRoot)return t.getCommonSourceDirectory();if(H.mapRoot){let Se=du(H.mapRoot);return oe&&(Se=qn(d5(oe.fileName,t,Se))),pm(Se)===0&&(Se=Hn(t.getCommonSourceDirectory(),Se)),Se}return qn(qs(K))}function $(H,K,oe,Se,se){if(H.inlineSourceMap){const ve=K.toString();return`data:application/json;base64,${Rte(Bl,ve)}`}const Z=Pc(du(E.checkDefined(Se)));if(H.mapRoot){let ve=du(H.mapRoot);return se&&(ve=qn(d5(se.fileName,t,ve))),pm(ve)===0?(ve=Hn(t.getCommonSourceDirectory(),ve),encodeURI(KS(qn(qs(oe)),Hn(ve,Z),t.getCurrentDirectory(),t.getCanonicalFileName,!0))):encodeURI(Hn(ve,Z))}return encodeURI(Z)}}function Hw(e,t){return{bundle:t,program:e,version:Qm}}function Dse(e){return JSON.stringify(e)}function XO(e,t){return Pz(e,t)}function lMe(e,t,r){var i;const s=E.checkDefined(e.js),o=((i=s.sources)==null?void 0:i.prologues)&&Ph(s.sources.prologues,c=>c.file);return e.sourceFiles.map((c,u)=>{const f=o?.get(u),g=f?.directives.map(S=>{const T=tt(I.createStringLiteral(S.expression.text),S.expression),C=tt(I.createExpressionStatement(T),S);return ga(T,C),C}),p=I.createToken(1),y=I.createSourceFile(g??[],p,0);return y.fileName=mm(r.getCurrentDirectory(),is(c,t),!r.useCaseSensitiveFileNames()),y.text=f?.text??"",TE(y,0,f?.text.length??0),tC(y.statements,y),TE(p,y.end,0),ga(p,y),y})}function Pse(e,t,r,i){var s,o;(s=Jr)==null||s.push(Jr.Phase.Emit,"emitUsingBuildInfo",{},!0),ko("beforeEmit");const c=uMe(e,t,r,i);return ko("afterEmit"),cf("Emit","beforeEmit","afterEmit"),(o=Jr)==null||o.pop(),c}function uMe(e,t,r,i){const{buildInfoPath:s,jsFilePath:o,sourceMapFilePath:c,declarationFilePath:u,declarationMapPath:f}=p3(e.options,!1),g=t.getBuildInfo(s,e.options.configFilePath);if(!g||!g.bundle||!g.bundle.js||u&&!g.bundle.dts)return s;const p=t.readFile(E.checkDefined(o));if(!p||zb(p,t)!==g.bundle.js.hash)return o;const y=c&&t.readFile(c);if(c&&!y||e.options.inlineSourceMap)return c||"inline sourcemap decoding";if(c&&zb(y,t)!==g.bundle.js.mapHash)return c;const S=u&&t.readFile(u);if(u&&!S||u&&zb(S,t)!==g.bundle.dts.hash)return u;const T=f&&t.readFile(f);if(f&&!T||e.options.inlineSourceMap)return f||"inline sourcemap decoding";if(f&&zb(T,t)!==g.bundle.dts.mapHash)return f;const C=qn(is(s,t.getCurrentDirectory())),w=SW(o,p,c,y,u,S,f,T,s,g,!0),D=[],O=XV(e.projectReferences,r,ie=>t.readFile(ie),t),z=lMe(g.bundle,C,t);let W,X;const J={getPrependNodes:Vu(()=>[...O,w]),getCanonicalFileName:t.getCanonicalFileName,getCommonSourceDirectory:()=>is(g.bundle.commonSourceDirectory,C),getCompilerOptions:()=>e.options,getCurrentDirectory:()=>t.getCurrentDirectory(),getSourceFile:Wy,getSourceFileByPath:Wy,getSourceFiles:()=>z,getLibFileFromReference:ys,isSourceFileFromExternalLibrary:Kp,getResolvedProjectReferenceToRedirect:Wy,getProjectReferenceRedirect:Wy,isSourceOfProjectReferenceRedirect:Kp,writeFile:(ie,B,Y,ae,_e,$)=>{switch(ie){case o:if(p===B)return;break;case c:if(y===B)return;break;case s:break;case u:if(S===B)return;W=B,X=$;break;case f:if(T===B)return;break;default:E.fail(`Unexpected path: ${ie}`)}D.push({name:ie,text:B,writeByteOrderMark:Y,data:$})},isEmitBlocked:Kp,readFile:ie=>t.readFile(ie),fileExists:ie=>t.fileExists(ie),useCaseSensitiveFileNames:()=>t.useCaseSensitiveFileNames(),getBuildInfo:ie=>{const B=g.program;B&&W!==void 0&&e.options.composite&&(B.outSignature=zb(W,t,X));const{js:Y,dts:ae,sourceFiles:_e}=g.bundle;return ie.js.sources=Y.sources,ae&&(ie.dts.sources=ae.sources),ie.sourceFiles=_e,Hw(B,ie)},getSourceFileFromReference:Wy,redirectTargetsMap:of(),getFileIncludeReasons:ys,createHash:Os(t,t.createHash)};return $O(QO,J,void 0,CV(e.options,i)),D}function S1(e={},t={}){var{hasGlobalName:r,onEmitNode:i=Vw,isEmitNotificationEnabled:s,substituteNode:o=f3,onBeforeEmitNode:c,onAfterEmitNode:u,onBeforeEmitNodeArray:f,onAfterEmitNodeArray:g,onBeforeEmitToken:p,onAfterEmitToken:y}=t,S=!!e.extendedDiagnostics,T=!!e.omitBraceSourceMapPositions,C=zh(e),w=Ul(e),D=new Map,O,z,W,X,J,ie,B,Y,ae,_e,$,H,K,oe,Se,se=e.preserveSourceNewlines,Z,ve,Te,Me=tD,ke,he=e.writeBundleFileInfo?{sections:[]}:void 0,be=he?E.checkDefined(e.relativeToBuildInfo):void 0,lt=e.recordInternalSection,pt=0,me="text",Oe=!0,Xe,it,mt=-1,Je,ot=-1,Bt=-1,Ht=-1,br=-1,zr,ar,Jt=!1,It=!!e.removeComments,Nn,Fi,{enter:ei,exit:zi}=whe(S,"commentTime","beforeComment","afterComment"),Qe=I.parenthesizer,ur={select:k=>k===0?Qe.parenthesizeLeadingTypeArgument:void 0},Dr=bg();return ht(),{printNode:Ft,printList:yr,printFile:Xr,printBundle:Tr,writeNode:ji,writeList:Di,writeFile:dt,writeBundle:rt,bundleFileInfo:he};function Ft(k,te,at){switch(k){case 0:E.assert(Ai(te),"Expected a SourceFile node.");break;case 2:E.assert(Ie(te),"Expected an Identifier node.");break;case 1:E.assert(ct(te),"Expected an Expression node.");break}switch(te.kind){case 312:return Xr(te);case 313:return Tr(te);case 314:return Pi(te)}return ji(k,te,at,fe()),we()}function yr(k,te,at){return Di(k,te,at,fe()),we()}function Tr(k){return rt(k,fe(),void 0),we()}function Xr(k){return dt(k,fe(),void 0),we()}function Pi(k){return ft(k,fe()),we()}function ji(k,te,at,Gt){const pn=ve;G(Gt,void 0),Be(k,te,at),ht(),ve=pn}function Di(k,te,at,Gt){const pn=ve;G(Gt,void 0),at&>(at),io(void 0,te,k),ht(),ve=pn}function $i(){return ve.getTextPosWithWriteLine?ve.getTextPosWithWriteLine():ve.getTextPos()}function Qs(k,te,at){const Gt=Mo(he.sections);Gt&&Gt.kind===at?Gt.end=te:he.sections.push({pos:k,end:te,kind:at})}function Ds(k){if(lt&&he&&O&&(hu(k)||ec(k))&&xV(k,O)&&me!=="internal"){const te=me;return Ue(ve.getTextPos()),pt=$i(),me="internal",te}}function Ce(k){k&&(Ue(ve.getTextPos()),pt=$i(),me=k)}function Ue(k){return ptE.assert(Gte(ws))),he.sections.push({pos:hi,end:ve.getTextPos(),kind:"prepend",data:be(pn.fileName),texts:Mi}))}}pt=$i();for(const pn of k.sourceFiles)Be(0,pn,pn);if(he&&k.sourceFiles.length){const pn=ve.getTextPos();if(Ue(pn)){const hi=k6(k);hi&&(he.sources||(he.sources={}),he.sources.prologues=hi);const ri=Lt(k);ri&&(he.sources||(he.sources={}),he.sources.helpers=ri)}}ht(),ve=Gt}function ft(k,te){const at=ve;G(te,void 0),Be(4,k,void 0),ht(),ve=at}function dt(k,te,at){ke=!0;const Gt=ve;G(te,at),y2(k),u0(k),Be(0,k,k),ht(),ve=Gt}function fe(){return Te||(Te=h8(C))}function we(){const k=Te.getText();return Te.clear(),k}function Be(k,te,at){at&>(at),U(k,te,void 0)}function gt(k){O=k,zr=void 0,ar=void 0,k&&$1(k)}function G(k,te){k&&e.omitTrailingSemicolon&&(k=gz(k)),ve=k,Xe=te,Oe=!ve||!Xe}function ht(){z=[],W=[],X=[],J=new Set,ie=[],B=new Map,Y=[],ae=0,_e=[],$=0,H=[],K=void 0,oe=[],Se=void 0,O=void 0,zr=void 0,ar=void 0,G(void 0,void 0)}function Dt(){return zr||(zr=Wg(E.checkDefined(O)))}function Re(k,te){if(k===void 0)return;const at=Ds(k);U(4,k,te),Ce(at)}function st(k){k!==void 0&&U(2,k,void 0)}function Ct(k,te){k!==void 0&&U(1,k,te)}function Qt(k){U(ra(k)?6:4,k)}function er(k){se&&Op(k)&4&&(se=!1)}function or(k){se=k}function U(k,te,at){Fi=at,ee(0,k,te)(k,te),Fi=void 0}function j(k){return!It&&!Ai(k)}function ce(k){return!Oe&&!Ai(k)&&!QI(k)&&!Ib(k)&&!fne(k)}function ee(k,te,at){switch(k){case 0:if(i!==Vw&&(!s||s(at)))return M;case 1:if(o!==f3&&(Nn=o(te,at)||at)!==at)return Fi&&(Nn=Fi(Nn)),vt;case 2:if(j(at))return Nx;case 3:if(ce(at))return gS;case 4:return De;default:return E.assertNever(k)}}function ue(k,te,at){return ee(k+1,te,at)}function M(k,te){const at=ue(0,k,te);i(k,te,at)}function De(k,te){if(c?.(te),se){const at=se;er(te),Ve(k,te),or(at)}else Ve(k,te);u?.(te),Fi=void 0}function Ve(k,te,at=!0){if(at){const Gt=kW(te);if(Gt)return Ki(k,te,Gt)}if(k===0)return lS(Ms(te,Ai));if(k===2)return ia(Ms(te,Ie));if(k===6)return gn(Ms(te,ra),!0);if(k===3)return Fe(Ms(te,Uo));if(k===5)return E.assertNode(te,jW),Oi(!0);if(k===4){switch(te.kind){case 16:case 17:case 18:return gn(te,!1);case 80:return ia(te);case 81:return Is(te);case 166:return Cr(te);case 167:return os(te);case 168:return Ga(te);case 169:return rc(te);case 170:return Vo(te);case 171:return cl(te);case 172:return Ro(te);case 173:return hs(te);case 174:return Ws(te);case 175:return el(te);case 176:return yo(te);case 177:case 178:return Us(te);case 179:return Ic(te);case 180:return Hp(te);case 181:return Fc(te);case 182:return rs(te);case 183:return qt(te);case 184:return No(te);case 185:return xc(te);case 186:return A(te);case 187:return Pe(te);case 188:return qe(te);case 189:return dr(te);case 190:return $r(te);case 192:return yn(te);case 193:return li(te);case 194:return Tn(te);case 195:return va(te);case 196:return lc(te);case 233:return Et(te);case 197:return tl();case 198:return no(te);case 199:return rl(te);case 200:return Xa(te);case 201:return hl(te);case 202:return En(te);case 203:return $u(te);case 204:return $o(te);case 205:return xu(te);case 206:return Bf(te);case 207:return $l(te);case 208:return ye(te);case 239:return At(te);case 240:return Ao();case 241:return Mr(te);case 243:return jn(te);case 242:return Oi(!1);case 244:return sa(te);case 245:return aa(te);case 246:return Xl(te);case 247:return ll(te);case 248:return kf(te);case 249:return _a(te);case 250:return vp(te);case 251:return Sg(te);case 252:return Om(te);case 253:return i0(te);case 254:return Ee(te);case 255:return We(te);case 256:return bt(te);case 257:return Rt(te);case 258:return tr(te);case 259:return Rr(te);case 260:return nr(te);case 261:return xr(te);case 262:return ni(te);case 263:return A1(te);case 264:return sh(te);case 265:return ly(te);case 266:return Kb(te);case 267:return _2(te);case 268:return eS(te);case 269:return tS(te);case 270:return nS(te);case 271:return Z3(te);case 272:return g6(te);case 273:return N1(te);case 274:return hx(te);case 280:return f2(te);case 275:return yx(te);case 276:return h6(te);case 277:return rS(te);case 278:return y6(te);case 279:return p2(te);case 281:return I1(te);case 300:return vx(te);case 301:return bx(te);case 282:return;case 283:return Ud(te);case 12:return a0(te);case 286:case 289:return uy(te);case 287:case 290:return Lm(te);case 291:return R_(te);case 292:return Wf(te);case 293:return Yu(te);case 294:return Sx(te);case 295:return sS(te);case 296:return O1(te);case 297:return aS(te);case 298:return Cl(te);case 299:return o0(te);case 303:return c0(te);case 304:return Tg(te);case 305:return je(te);case 306:return Ol(te);case 307:return Ln(te);case 314:case 308:return On(te);case 309:case 310:return Ni(te);case 311:return Cn(te);case 312:return lS(te);case 313:return E.fail("Bundles should be printed using printBundle");case 315:return E.fail("InputFiles should not be printed");case 316:return kg(te);case 317:return l0(te);case 319:return Kr("*");case 320:return Kr("?");case 321:return ju(te);case 322:return u_(te);case 323:return vo(te);case 324:return $c(te);case 191:case 325:return Tt(te);case 326:return;case 327:return Uf(te);case 329:return cS(te);case 330:return g2(te);case 334:case 339:case 344:return oS(te);case 335:case 336:return M1(te);case 337:case 338:return;case 340:case 341:case 342:case 343:return;case 345:return Aa(te);case 346:return pd(te);case 348:case 355:return h2(te);case 347:case 349:case 350:case 351:case 356:case 357:return Bu(te);case 352:return xg(te);case 353:return K3(te);case 354:return S6(te);case 359:return}if(ct(te)&&(k=1,o!==f3)){const Gt=o(k,te)||te;Gt!==te&&(te=Gt,Fi&&(te=Fi(te)))}}if(k===1)switch(te.kind){case 9:case 10:return Zr(te);case 11:case 14:case 15:return gn(te,!1);case 80:return ia(te);case 81:return Is(te);case 209:return St(te);case 210:return Fr(te);case 211:return Wi(te);case 212:return Fs(te);case 213:return uc(te);case 214:return hc(te);case 215:return jo(te);case 216:return qo(te);case 217:return kc(te);case 218:return nc(te);case 219:return Oc(te);case 220:return xf(te);case 221:return Xu(te);case 222:return Jf(te);case 223:return vg(te);case 224:return Fm(te);case 225:return ou(te);case 226:return Dr(te);case 227:return L_(te);case 228:return zf(te);case 229:return Qu(te);case 230:return Q(te);case 231:return Ye(te);case 232:return;case 234:return Pt(te);case 235:return L(te);case 233:return Et(te);case 238:return pe(te);case 236:return Ze(te);case 237:return E.fail("SyntheticExpression should never be printed.");case 282:return;case 284:return wa(te);case 285:return iS(te);case 288:return v6(te);case 358:return E.fail("SyntaxList should not be printed");case 359:return;case 360:return Wn(te);case 361:return qd(te);case 362:return E.fail("SyntheticReferenceExpression should not be printed")}if(a_(te.kind))return Ex(te,Yi);if(cJ(te.kind))return Ex(te,Kr);E.fail(`Unhandled SyntaxKind: ${E.formatSyntaxKind(te.kind)}.`)}function Fe(k){Re(k.name),Ur(),Yi("in"),Ur(),Re(k.constraint)}function vt(k,te){const at=ue(1,k,te);E.assertIsDefined(Nn),te=Nn,Nn=void 0,at(k,te)}function Lt(k){let te;if(w===0||e.noEmitHelpers)return;const at=new Map;for(const Gt of k.sourceFiles){const pn=fw(Gt)!==void 0,hi=Lr(Gt);if(hi)for(const ri of hi)!ri.scoped&&!pn&&!at.get(ri.name)&&(at.set(ri.name,!0),(te||(te=[])).push(ri.name))}return te}function Wt(k){let te=!1;const at=k.kind===313?k:void 0;if(at&&w===0)return;const Gt=at?at.prepends.length:0,pn=at?at.sourceFiles.length+Gt:1;for(let hi=0;hi"),Ur(),Re(k.type),T_(k)}function $c(k){Yi("function"),_0(k,k.parameters),Kr(":"),Re(k.type)}function ju(k){Kr("?"),Re(k.type)}function u_(k){Kr("!"),Re(k.type)}function vo(k){Re(k.type),Kr("=")}function xc(k){cu(k),ah(k,k.modifiers),Yi("new"),Ur(),jm(k,k.typeParameters),_0(k,k.parameters),Ur(),Kr("=>"),Ur(),Re(k.type),T_(k)}function A(k){Yi("typeof"),Ur(),Re(k.exprName),Hd(k,k.typeArguments)}function Pe(k){qf(0,void 0),Kr("{");const te=da(k)&1?768:32897;io(k,k.members,te|524288),Kr("}"),U1()}function qe(k){Re(k.elementType,Qe.parenthesizeNonArrayTypeOfPostfixType),Kr("["),Kr("]")}function Tt(k){Kr("..."),Re(k.type)}function dr(k){ki(23,k.pos,Kr,k);const te=da(k)&1?528:657;io(k,k.elements,te|524288,Qe.parenthesizeElementTypeOfTupleType),ki(24,k.elements.end,Kr,k)}function En(k){Re(k.dotDotDotToken),Re(k.name),Re(k.questionToken),ki(59,k.name.end,Kr,k),Ur(),Re(k.type)}function $r(k){Re(k.type,Qe.parenthesizeTypeOfOptionalType),Kr("?")}function yn(k){io(k,k.types,516,Qe.parenthesizeConstituentTypeOfUnionType)}function li(k){io(k,k.types,520,Qe.parenthesizeConstituentTypeOfIntersectionType)}function Tn(k){Re(k.checkType,Qe.parenthesizeCheckTypeOfConditionalType),Ur(),Yi("extends"),Ur(),Re(k.extendsType,Qe.parenthesizeExtendsTypeOfConditionalType),Ur(),Kr("?"),Ur(),Re(k.trueType),Ur(),Kr(":"),Ur(),Re(k.falseType)}function va(k){Yi("infer"),Ur(),Re(k.typeParameter)}function lc(k){Kr("("),Re(k.type),Kr(")")}function tl(){Yi("this")}function no(k){oh(k.operator,Yi),Ur();const te=k.operator===148?Qe.parenthesizeOperandOfReadonlyTypeOperator:Qe.parenthesizeOperandOfTypeOperator;Re(k.type,te)}function rl(k){Re(k.objectType,Qe.parenthesizeNonArrayTypeOfPostfixType),Kr("["),Re(k.indexType),Kr("]")}function Xa(k){const te=da(k);Kr("{"),te&1?Ur():(yl(),$d()),k.readonlyToken&&(Re(k.readonlyToken),k.readonlyToken.kind!==148&&Yi("readonly"),Ur()),Kr("["),U(3,k.typeParameter),k.nameType&&(Ur(),Yi("as"),Ur(),Re(k.nameType)),Kr("]"),k.questionToken&&(Re(k.questionToken),k.questionToken.kind!==58&&Kr("?")),Kr(":"),Ur(),Re(k.type),Ql(),te&1?Ur():(yl(),Xd()),io(k,k.members,2),Kr("}")}function hl(k){Ct(k.literal)}function $u(k){Re(k.head),io(k,k.templateSpans,262144)}function xu(k){if(k.isTypeOf&&(Yi("typeof"),Ur()),Yi("import"),Kr("("),Re(k.argument),k.attributes){Kr(","),Ur(),Kr("{"),Ur(),Yi(k.attributes.token===132?"assert":"with"),Kr(":"),Ur();const te=k.attributes.elements;io(k.attributes,te,526226),Ur(),Kr("}")}Kr(")"),k.qualifier&&(Kr("."),Re(k.qualifier)),Hd(k,k.typeArguments)}function Bf(k){Kr("{"),io(k,k.elements,525136),Kr("}")}function $l(k){Kr("["),io(k,k.elements,524880),Kr("]")}function ye(k){Re(k.dotDotDotToken),k.propertyName&&(Re(k.propertyName),Kr(":"),Ur()),Re(k.name),Cg(k.initializer,k.name.end,k,Qe.parenthesizeExpressionForDisallowedComma)}function St(k){const te=k.elements,at=k.multiLine?65536:0;v2(k,te,8914|at,Qe.parenthesizeExpressionForDisallowedComma)}function Fr(k){qf(0,void 0),Zt(k.properties,dS);const te=da(k)&131072;te&&$d();const at=k.multiLine?65536:0,Gt=O&&O.languageVersion>=1&&!ap(O)?64:0;io(k,k.properties,526226|Gt|at),te&&Xd(),U1()}function Wi(k){Ct(k.expression,Qe.parenthesizeLeftSideOfAccess);const te=k.questionDotToken||km(I.createToken(25),k.expression.end,k.name.pos),at=Vf(k,k.expression,te),Gt=Vf(k,te,k.name);Dg(at,!1),te.kind!==29&&Ps(k.expression)&&!ve.hasTrailingComment()&&!ve.hasTrailingWhitespace()&&Kr("."),k.questionDotToken?Re(te):ki(te.kind,k.expression.end,Kr,k),Dg(Gt,!1),Re(k.name),Bm(at,Gt)}function Ps(k){if(k=Fp(k),A_(k)){const te=Px(k,!0,!1);return!(k.numericLiteralFlags&448)&&!te.includes(Hs(25))&&!te.includes("E")&&!te.includes("e")}else if(co(k)){const te=jre(k);return typeof te=="number"&&isFinite(te)&&te>=0&&Math.floor(te)===te}}function Fs(k){Ct(k.expression,Qe.parenthesizeLeftSideOfAccess),Re(k.questionDotToken),ki(23,k.expression.end,Kr,k),Ct(k.argumentExpression),ki(24,k.argumentExpression.end,Kr,k)}function uc(k){const te=Op(k)&16;te&&(Kr("("),j1("0"),Kr(","),Ur()),Ct(k.expression,Qe.parenthesizeLeftSideOfAccess),te&&Kr(")"),Re(k.questionDotToken),Hd(k,k.typeArguments),v2(k,k.arguments,2576,Qe.parenthesizeExpressionForDisallowedComma)}function hc(k){ki(105,k.pos,Yi,k),Ur(),Ct(k.expression,Qe.parenthesizeExpressionOfNew),Hd(k,k.typeArguments),v2(k,k.arguments,18960,Qe.parenthesizeExpressionForDisallowedComma)}function jo(k){const te=Op(k)&16;te&&(Kr("("),j1("0"),Kr(","),Ur()),Ct(k.tag,Qe.parenthesizeLeftSideOfAccess),te&&Kr(")"),Hd(k,k.typeArguments),Ur(),Ct(k.template)}function qo(k){Kr("<"),Re(k.type),Kr(">"),Ct(k.expression,Qe.parenthesizeOperandOfPrefixUnary)}function kc(k){const te=ki(21,k.pos,Kr,k),at=Dx(k.expression,k);Ct(k.expression,void 0),pS(k.expression,k),Bm(at),ki(22,k.expression?k.expression.end:te,Kr,k)}function nc(k){xp(k.name),_n(k)}function Oc(k){ah(k,k.modifiers),fn(k,yp)}function yp(k){jm(k,k.typeParameters),Tx(k,k.parameters),Mm(k.type),Ur(),Re(k.equalsGreaterThanToken)}function xf(k){ki(91,k.pos,Yi,k),Ur(),Ct(k.expression,Qe.parenthesizeOperandOfPrefixUnary)}function Xu(k){ki(114,k.pos,Yi,k),Ur(),Ct(k.expression,Qe.parenthesizeOperandOfPrefixUnary)}function Jf(k){ki(116,k.pos,Yi,k),Ur(),Ct(k.expression,Qe.parenthesizeOperandOfPrefixUnary)}function vg(k){ki(135,k.pos,Yi,k),Ur(),Ct(k.expression,Qe.parenthesizeOperandOfPrefixUnary)}function Fm(k){oh(k.operator,__),n0(k)&&Ur(),Ct(k.operand,Qe.parenthesizeOperandOfPrefixUnary)}function n0(k){const te=k.operand;return te.kind===224&&(k.operator===40&&(te.operator===40||te.operator===46)||k.operator===41&&(te.operator===41||te.operator===47))}function ou(k){Ct(k.operand,Qe.parenthesizeOperandOfPostfixUnary),oh(k.operator,__)}function bg(){return rO(k,te,at,Gt,pn,void 0);function k(ri,Mi){if(Mi){Mi.stackIndex++,Mi.preserveSourceNewlinesStack[Mi.stackIndex]=se,Mi.containerPosStack[Mi.stackIndex]=Bt,Mi.containerEndStack[Mi.stackIndex]=Ht,Mi.declarationListContainerEndStack[Mi.stackIndex]=br;const ws=Mi.shouldEmitCommentsStack[Mi.stackIndex]=j(ri),x_=Mi.shouldEmitSourceMapsStack[Mi.stackIndex]=ce(ri);c?.(ri),ws&&Ix(ri),x_&&I6(ri),er(ri)}else Mi={stackIndex:0,preserveSourceNewlinesStack:[void 0],containerPosStack:[-1],containerEndStack:[-1],declarationListContainerEndStack:[-1],shouldEmitCommentsStack:[!1],shouldEmitSourceMapsStack:[!1]};return Mi}function te(ri,Mi,ws){return hi(ri,ws,"left")}function at(ri,Mi,ws){const x_=ri.kind!==28,B_=Vf(ws,ws.left,ri),ii=Vf(ws,ri,ws.right);Dg(B_,x_),Df(ri.pos),Ex(ri,ri.kind===103?Yi:__),$p(ri.end,!0),Dg(ii,!0)}function Gt(ri,Mi,ws){return hi(ri,ws,"right")}function pn(ri,Mi){const ws=Vf(ri,ri.left,ri.operatorToken),x_=Vf(ri,ri.operatorToken,ri.right);if(Bm(ws,x_),Mi.stackIndex>0){const B_=Mi.preserveSourceNewlinesStack[Mi.stackIndex],ii=Mi.containerPosStack[Mi.stackIndex],Yd=Mi.containerEndStack[Mi.stackIndex],mr=Mi.declarationListContainerEndStack[Mi.stackIndex],vy=Mi.shouldEmitCommentsStack[Mi.stackIndex],m0=Mi.shouldEmitSourceMapsStack[Mi.stackIndex];or(B_),m0&&Gf(ri),vy&&Fx(ri,ii,Yd,mr),u?.(ri),Mi.stackIndex--}}function hi(ri,Mi,ws){const x_=ws==="left"?Qe.getParenthesizeLeftSideOfBinaryForOperator(Mi.operatorToken.kind):Qe.getParenthesizeRightSideOfBinaryForOperator(Mi.operatorToken.kind);let B_=ee(0,1,ri);if(B_===vt&&(E.assertIsDefined(Nn),ri=x_(Ms(Nn,ct)),B_=ue(1,1,ri),Nn=void 0),(B_===Nx||B_===gS||B_===De)&&Gr(ri))return ri;Fi=x_,B_(1,ri)}}function L_(k){const te=Vf(k,k.condition,k.questionToken),at=Vf(k,k.questionToken,k.whenTrue),Gt=Vf(k,k.whenTrue,k.colonToken),pn=Vf(k,k.colonToken,k.whenFalse);Ct(k.condition,Qe.parenthesizeConditionOfConditionalExpression),Dg(te,!0),Re(k.questionToken),Dg(at,!0),Ct(k.whenTrue,Qe.parenthesizeBranchOfConditionalExpression),Bm(te,at),Dg(Gt,!0),Re(k.colonToken),Dg(pn,!0),Ct(k.whenFalse,Qe.parenthesizeBranchOfConditionalExpression),Bm(Gt,pn)}function zf(k){Re(k.head),io(k,k.templateSpans,262144)}function Qu(k){ki(127,k.pos,Yi,k),Re(k.asteriskToken),Eg(k.expression&&fd(k.expression),u2)}function Q(k){ki(26,k.pos,Kr,k),Ct(k.expression,Qe.parenthesizeExpressionForDisallowedComma)}function Ye(k){xp(k.name),cy(k)}function Et(k){Ct(k.expression,Qe.parenthesizeLeftSideOfAccess),Hd(k,k.typeArguments)}function Pt(k){Ct(k.expression,void 0),k.type&&(Ur(),Yi("as"),Ur(),Re(k.type))}function L(k){Ct(k.expression,Qe.parenthesizeLeftSideOfAccess),__("!")}function pe(k){Ct(k.expression,void 0),k.type&&(Ur(),Yi("satisfies"),Ur(),Re(k.type))}function Ze(k){_y(k.keywordToken,k.pos,Kr),Kr("."),Re(k.name)}function At(k){Ct(k.expression),Re(k.literal)}function Mr(k){Rn(k,!k.multiLine&&W1(k))}function Rn(k,te){ki(19,k.pos,Kr,k);const at=te||da(k)&1?768:129;io(k,k.statements,at),ki(20,k.statements.end,Kr,k,!!(at&1))}function jn(k){Ju(k,k.modifiers,!1),Re(k.declarationList),Ql()}function Oi(k){k?Kr(";"):Ql()}function sa(k){Ct(k.expression,Qe.parenthesizeExpressionOfExpressionStatement),(!O||!ap(O)||Po(k.expression))&&Ql()}function aa(k){const te=ki(101,k.pos,Yi,k);Ur(),ki(21,te,Kr,k),Ct(k.expression),ki(22,k.expression.end,Kr,k),Rm(k,k.thenStatement),k.elseStatement&&(J1(k,k.thenStatement,k.elseStatement),ki(93,k.thenStatement.end,Yi,k),k.elseStatement.kind===245?(Ur(),Re(k.elseStatement)):Rm(k,k.elseStatement))}function Xo(k,te){const at=ki(117,te,Yi,k);Ur(),ki(21,at,Kr,k),Ct(k.expression),ki(22,k.expression.end,Kr,k)}function Xl(k){ki(92,k.pos,Yi,k),Rm(k,k.statement),Ss(k.statement)&&!se?Ur():J1(k,k.statement,k.expression),Xo(k,k.statement.end),Ql()}function ll(k){Xo(k,k.pos),Rm(k,k.statement)}function kf(k){const te=ki(99,k.pos,Yi,k);Ur();let at=ki(21,te,Kr,k);Cf(k.initializer),at=ki(27,k.initializer?k.initializer.end:at,Kr,k),Eg(k.condition),at=ki(27,k.condition?k.condition.end:at,Kr,k),Eg(k.incrementor),ki(22,k.incrementor?k.incrementor.end:at,Kr,k),Rm(k,k.statement)}function _a(k){const te=ki(99,k.pos,Yi,k);Ur(),ki(21,te,Kr,k),Cf(k.initializer),Ur(),ki(103,k.initializer.end,Yi,k),Ur(),Ct(k.expression),ki(22,k.expression.end,Kr,k),Rm(k,k.statement)}function vp(k){const te=ki(99,k.pos,Yi,k);Ur(),C6(k.awaitModifier),ki(21,te,Kr,k),Cf(k.initializer),Ur(),ki(165,k.initializer.end,Yi,k),Ur(),Ct(k.expression),ki(22,k.expression.end,Kr,k),Rm(k,k.statement)}function Cf(k){k!==void 0&&(k.kind===261?Re(k):Ct(k))}function Sg(k){ki(88,k.pos,Yi,k),R1(k.label),Ql()}function Om(k){ki(83,k.pos,Yi,k),R1(k.label),Ql()}function ki(k,te,at,Gt,pn){const hi=ss(Gt),ri=hi&&hi.kind===Gt.kind,Mi=te;if(ri&&O&&(te=la(O.text,te)),ri&&Gt.pos!==Mi){const ws=pn&&O&&!_p(Mi,te,O);ws&&$d(),Df(Mi),ws&&Xd()}if(!T&&(k===19||k===20)?te=_y(k,te,at,Gt):te=oh(k,at,te),ri&&Gt.end!==te){const ws=Gt.kind===294;$p(te,!ws,ws)}return te}function ay(k){return k.kind===2||!!k.hasTrailingNewLine}function oy(k){return O?ut(Km(O.text,k.pos),ay)||ut(sC(k),ay)?!0:WF(k)?k.pos!==k.expression.pos&&ut(Hy(O.text,k.expression.pos),ay)?!0:oy(k.expression):!1:!1}function fd(k){if(!It&&WF(k)&&oy(k)){const te=ss(k);if(te&&y_(te)){const at=I.createParenthesizedExpression(k.expression);return rn(at,k),tt(at,te),at}return I.createParenthesizedExpression(k)}return k}function u2(k){return fd(Qe.parenthesizeExpressionForDisallowedComma(k))}function i0(k){ki(107,k.pos,Yi,k),Eg(k.expression&&fd(k.expression),fd),Ql()}function Ee(k){const te=ki(118,k.pos,Yi,k);Ur(),ki(21,te,Kr,k),Ct(k.expression),ki(22,k.expression.end,Kr,k),Rm(k,k.statement)}function We(k){const te=ki(109,k.pos,Yi,k);Ur(),ki(21,te,Kr,k),Ct(k.expression),ki(22,k.expression.end,Kr,k),Ur(),Re(k.caseBlock)}function bt(k){Re(k.label),ki(59,k.label.end,Kr,k),Ur(),Re(k.statement)}function Rt(k){ki(111,k.pos,Yi,k),Eg(fd(k.expression),fd),Ql()}function tr(k){ki(113,k.pos,Yi,k),Ur(),Re(k.tryBlock),k.catchClause&&(J1(k,k.tryBlock,k.catchClause),Re(k.catchClause)),k.finallyBlock&&(J1(k,k.catchClause||k.tryBlock,k.finallyBlock),ki(98,(k.catchClause||k.tryBlock).end,Yi,k),Ur(),Re(k.finallyBlock))}function Rr(k){_y(89,k.pos,Yi),Ql()}function nr(k){var te,at,Gt;Re(k.name),Re(k.exclamationToken),Mm(k.type),Cg(k.initializer,((te=k.type)==null?void 0:te.end)??((Gt=(at=k.name.emitNode)==null?void 0:at.typeNode)==null?void 0:Gt.end)??k.name.end,k,Qe.parenthesizeExpressionForDisallowedComma)}function xr(k){if(BP(k))Yi("await"),Ur(),Yi("using");else{const te=MI(k)?"let":wk(k)?"const":JP(k)?"using":"var";Yi(te)}Ur(),io(k,k.declarations,528)}function ni(k){_n(k)}function _n(k){Ju(k,k.modifiers,!1),Yi("function"),Re(k.asteriskToken),Ur(),st(k.name),fn(k,on)}function fn(k,te){const at=k.body;if(at)if(Ss(at)){const Gt=da(k)&131072;Gt&&$d(),cu(k),Zt(k.parameters,Ll),Ll(k.body),te(k),Qa(at),T_(k),Gt&&Xd()}else te(k),Ur(),Ct(at,Qe.parenthesizeConciseBodyOfArrowFunction);else te(k),Ql()}function on(k){jm(k,k.typeParameters),_0(k,k.parameters),Mm(k.type)}function wi(k){if(da(k)&1)return!0;if(k.multiLine||!Po(k)&&O&&!bb(k,O)||fS(k,bl(k.statements),2)||fy(k,Mo(k.statements),2,k.statements))return!1;let te;for(const at of k.statements){if(ch(te,at,2)>0)return!1;te=at}return!0}function Qa(k){c?.(k),Ur(),Kr("{"),$d();const te=wi(k)?Va:M_;cn(k,k.statements,te),Xd(),_y(20,k.statements.end,Kr,k),u?.(k)}function Va(k){M_(k,!0)}function M_(k,te){const at=S_(k.statements),Gt=ve.getTextPos();Wt(k),at===0&&Gt===ve.getTextPos()&&te?(Xd(),io(k,k.statements,768),$d()):io(k,k.statements,1,void 0,at)}function A1(k){cy(k)}function cy(k){qf(0,void 0),Zt(k.members,dS),Ju(k,k.modifiers,!0),ki(86,Id(k).pos,Yi,k),k.name&&(Ur(),st(k.name));const te=da(k)&131072;te&&$d(),jm(k,k.typeParameters),io(k,k.heritageClauses,0),Ur(),Kr("{"),io(k,k.members,129),Kr("}"),te&&Xd(),U1()}function sh(k){qf(0,void 0),Ju(k,k.modifiers,!1),Yi("interface"),Ur(),Re(k.name),jm(k,k.typeParameters),io(k,k.heritageClauses,512),Ur(),Kr("{"),io(k,k.members,129),Kr("}"),U1()}function ly(k){Ju(k,k.modifiers,!1),Yi("type"),Ur(),Re(k.name),jm(k,k.typeParameters),Ur(),Kr("="),Ur(),Re(k.type),Ql()}function Kb(k){Ju(k,k.modifiers,!1),Yi("enum"),Ur(),Re(k.name),Ur(),Kr("{"),io(k,k.members,145),Kr("}")}function _2(k){Ju(k,k.modifiers,!1),~k.flags&2048&&(Yi(k.flags&32?"namespace":"module"),Ur()),Re(k.name);let te=k.body;if(!te)return Ql();for(;te&&vc(te);)Kr("."),Re(te.name),te=te.body;Ur(),Re(te)}function eS(k){cu(k),Zt(k.statements,Ll),Rn(k,W1(k)),T_(k)}function tS(k){ki(19,k.pos,Kr,k),io(k,k.clauses,129),ki(20,k.clauses.end,Kr,k,!0)}function Z3(k){Ju(k,k.modifiers,!1),ki(102,k.modifiers?k.modifiers.end:k.pos,Yi,k),Ur(),k.isTypeOnly&&(ki(156,k.pos,Yi,k),Ur()),Re(k.name),Ur(),ki(64,k.name.end,Kr,k),Ur(),gx(k.moduleReference),Ql()}function gx(k){k.kind===80?Ct(k):Re(k)}function g6(k){Ju(k,k.modifiers,!1),ki(102,k.modifiers?k.modifiers.end:k.pos,Yi,k),Ur(),k.importClause&&(Re(k.importClause),Ur(),ki(161,k.importClause.end,Yi,k),Ur()),Ct(k.moduleSpecifier),k.attributes&&R1(k.attributes),Ql()}function N1(k){k.isTypeOnly&&(ki(156,k.pos,Yi,k),Ur()),Re(k.name),k.name&&k.namedBindings&&(ki(28,k.name.end,Kr,k),Ur()),Re(k.namedBindings)}function hx(k){const te=ki(42,k.pos,Kr,k);Ur(),ki(130,te,Yi,k),Ur(),Re(k.name)}function yx(k){s0(k)}function h6(k){d2(k)}function rS(k){const te=ki(95,k.pos,Yi,k);Ur(),k.isExportEquals?ki(64,te,__,k):ki(90,te,Yi,k),Ur(),Ct(k.expression,k.isExportEquals?Qe.getParenthesizeRightSideOfBinaryForOperator(64):Qe.parenthesizeExpressionOfExportDefault),Ql()}function y6(k){Ju(k,k.modifiers,!1);let te=ki(95,k.pos,Yi,k);if(Ur(),k.isTypeOnly&&(te=ki(156,te,Yi,k),Ur()),k.exportClause?Re(k.exportClause):te=ki(42,te,Kr,k),k.moduleSpecifier){Ur();const at=k.exportClause?k.exportClause.end:te;ki(161,at,Yi,k),Ur(),Ct(k.moduleSpecifier)}k.attributes&&R1(k.attributes),Ql()}function vx(k){ki(k.token,k.pos,Yi,k),Ur();const te=k.elements;io(k,te,526226)}function bx(k){Re(k.name),Kr(":"),Ur();const te=k.value;if(!(da(te)&1024)){const at=Fd(te);$p(at.pos)}Re(te)}function nS(k){let te=ki(95,k.pos,Yi,k);Ur(),te=ki(130,te,Yi,k),Ur(),te=ki(145,te,Yi,k),Ur(),Re(k.name),Ql()}function f2(k){const te=ki(42,k.pos,Kr,k);Ur(),ki(130,te,Yi,k),Ur(),Re(k.name)}function p2(k){s0(k)}function I1(k){d2(k)}function s0(k){Kr("{"),io(k,k.elements,525136),Kr("}")}function d2(k){k.isTypeOnly&&(Yi("type"),Ur()),k.propertyName&&(Re(k.propertyName),Ur(),ki(130,k.propertyName.end,Yi,k),Ur()),Re(k.name)}function Ud(k){Yi("require"),Kr("("),Ct(k.expression),Kr(")")}function wa(k){Re(k.openingElement),io(k,k.children,262144),Re(k.closingElement)}function iS(k){Kr("<"),m2(k.tagName),Hd(k,k.typeArguments),Ur(),Re(k.attributes),Kr("/>")}function v6(k){Re(k.openingFragment),io(k,k.children,262144),Re(k.closingFragment)}function uy(k){if(Kr("<"),Md(k)){const te=Dx(k.tagName,k);m2(k.tagName),Hd(k,k.typeArguments),k.attributes.properties&&k.attributes.properties.length>0&&Ur(),Re(k.attributes),pS(k.attributes,k),Bm(te)}Kr(">")}function a0(k){ve.writeLiteral(k.text)}function Lm(k){Kr("")}function Wf(k){io(k,k.properties,262656)}function R_(k){Re(k.name),Gp("=",Kr,k.initializer,Qt)}function Yu(k){Kr("{..."),Ct(k.expression),Kr("}")}function K_(k){let te=!1;return uP(O?.text||"",k+1,()=>te=!0),te}function F1(k){let te=!1;return lP(O?.text||"",k+1,()=>te=!0),te}function b6(k){return K_(k)||F1(k)}function Sx(k){var te;if(k.expression||!It&&!Po(k)&&b6(k.pos)){const at=O&&!Po(k)&&qa(O,k.pos).line!==qa(O,k.end).line;at&&ve.increaseIndent();const Gt=ki(19,k.pos,Kr,k);Re(k.dotDotDotToken),Ct(k.expression),ki(20,((te=k.expression)==null?void 0:te.end)||Gt,Kr,k),at&&ve.decreaseIndent()}}function sS(k){st(k.namespace),Kr(":"),st(k.name)}function m2(k){k.kind===80?Ct(k):Re(k)}function O1(k){ki(84,k.pos,Yi,k),Ur(),Ct(k.expression,Qe.parenthesizeExpressionForDisallowedComma),L1(k,k.statements,k.expression.end)}function aS(k){const te=ki(90,k.pos,Yi,k);L1(k,k.statements,te)}function L1(k,te,at){const Gt=te.length===1&&(!O||Po(k)||Po(te[0])||T5(k,te[0],O));let pn=163969;Gt?(_y(59,at,Kr,k),Ur(),pn&=-130):ki(59,at,Kr,k),io(k,te,pn)}function Cl(k){Ur(),oh(k.token,Yi),Ur(),io(k,k.types,528)}function o0(k){const te=ki(85,k.pos,Yi,k);Ur(),k.variableDeclaration&&(ki(21,te,Kr,k),Re(k.variableDeclaration),ki(22,k.variableDeclaration.end,Kr,k),Ur()),Re(k.block)}function c0(k){Re(k.name),Kr(":"),Ur();const te=k.initializer;if(!(da(te)&1024)){const at=Fd(te);$p(at.pos)}Ct(te,Qe.parenthesizeExpressionForDisallowedComma)}function Tg(k){Re(k.name),k.objectAssignmentInitializer&&(Ur(),Kr("="),Ur(),Ct(k.objectAssignmentInitializer,Qe.parenthesizeExpressionForDisallowedComma))}function je(k){k.expression&&(ki(26,k.pos,Kr,k),Ct(k.expression,Qe.parenthesizeExpressionForDisallowedComma))}function Ol(k){Re(k.name),Cg(k.initializer,k.name.end,k,Qe.parenthesizeExpressionForDisallowedComma)}function Uf(k){if(Me("/**"),k.comment){const te=vP(k.comment);if(te){const at=te.split(/\r\n?|\n/g);for(const Gt of at)yl(),Ur(),Kr("*"),Ur(),Me(Gt)}}k.tags&&(k.tags.length===1&&k.tags[0].kind===351&&!k.comment?(Ur(),Re(k.tags[0])):io(k,k.tags,33)),Ur(),Me("*/")}function Bu(k){bp(k.tagName),kg(k.typeExpression),dd(k.comment)}function S6(k){bp(k.tagName),Re(k.name),dd(k.comment)}function l0(k){Ur(),Kr("{"),Re(k.name),Kr("}")}function M1(k){bp(k.tagName),Ur(),Kr("{"),Re(k.class),Kr("}"),dd(k.comment)}function xg(k){bp(k.tagName),kg(k.constraint),Ur(),io(k,k.typeParameters,528),dd(k.comment)}function K3(k){bp(k.tagName),k.typeExpression&&(k.typeExpression.kind===316?kg(k.typeExpression):(Ur(),Kr("{"),Me("Object"),k.typeExpression.isArrayType&&(Kr("["),Kr("]")),Kr("}"))),k.fullName&&(Ur(),Re(k.fullName)),dd(k.comment),k.typeExpression&&k.typeExpression.kind===329&&cS(k.typeExpression)}function Aa(k){bp(k.tagName),k.name&&(Ur(),Re(k.name)),dd(k.comment),g2(k.typeExpression)}function pd(k){dd(k.comment),g2(k.typeExpression)}function oS(k){bp(k.tagName),dd(k.comment)}function cS(k){io(k,I.createNodeArray(k.jsDocPropertyTags),33)}function g2(k){k.typeParameters&&io(k,I.createNodeArray(k.typeParameters),33),k.parameters&&io(k,I.createNodeArray(k.parameters),33),k.type&&(yl(),Ur(),Kr("*"),Ur(),Re(k.type))}function h2(k){bp(k.tagName),kg(k.typeExpression),Ur(),k.isBracketed&&Kr("["),Re(k.name),k.isBracketed&&Kr("]"),dd(k.comment)}function bp(k){Kr("@"),Re(k)}function dd(k){const te=vP(k);te&&(Ur(),Me(te))}function kg(k){k&&(Ur(),Kr("{"),Re(k.type),Kr("}"))}function lS(k){yl();const te=k.statements;if(te.length===0||!Lp(te[0])||Po(te[0])){cn(k,te,yi);return}yi(k)}function Vd(k){T6(!!k.hasNoDefaultLib,k.syntheticFileReferences||[],k.syntheticTypeReferences||[],k.syntheticLibReferences||[]);for(const te of k.prepends)if(Ib(te)&&te.syntheticReferences)for(const at of te.syntheticReferences)Re(at),yl()}function uS(k){k.isDeclarationFile&&T6(k.hasNoDefaultLib,k.referencedFiles,k.typeReferenceDirectives,k.libReferenceDirectives)}function T6(k,te,at,Gt){if(k){const pn=ve.getTextPos();Tp('/// '),he&&he.sections.push({pos:pn,end:ve.getTextPos(),kind:"no-default-lib"}),yl()}if(O&&O.moduleName&&(Tp(`/// `),yl()),O&&O.amdDependencies)for(const pn of O.amdDependencies)pn.name?Tp(`/// `):Tp(`/// `),yl();for(const pn of te){const hi=ve.getTextPos();Tp(`/// `),he&&he.sections.push({pos:hi,end:ve.getTextPos(),kind:"reference",data:pn.fileName}),yl()}for(const pn of at){const hi=ve.getTextPos(),ri=pn.resolutionMode&&pn.resolutionMode!==O?.impliedNodeFormat?`resolution-mode="${pn.resolutionMode===99?"import":"require"}"`:"";Tp(`/// `),he&&he.sections.push({pos:hi,end:ve.getTextPos(),kind:pn.resolutionMode?pn.resolutionMode===99?"type-import":"type-require":"type",data:pn.fileName}),yl()}for(const pn of Gt){const hi=ve.getTextPos();Tp(`/// `),he&&he.sections.push({pos:hi,end:ve.getTextPos(),kind:"lib",data:pn.fileName}),yl()}}function yi(k){const te=k.statements;cu(k),Zt(k.statements,Ll),Wt(k);const at=Dc(te,Gt=>!Lp(Gt));uS(k),io(k,te,1,void 0,at===-1?te.length:at),T_(k)}function Wn(k){const te=da(k);!(te&1024)&&k.pos!==k.expression.pos&&$p(k.expression.pos),Ct(k.expression),!(te&2048)&&k.end!==k.expression.end&&Df(k.expression.end)}function qd(k){v2(k,k.elements,528,void 0)}function S_(k,te,at,Gt){let pn=!!te;for(let hi=0;hi=at.length||ri===0;if(ws&&Gt&32768){f?.(at),g?.(at);return}Gt&15360&&(Kr(fMe(Gt)),ws&&at&&$p(at.pos,!0)),f?.(at),ws?Gt&1&&!(se&&(!te||O&&bb(te,O)))?yl():Gt&256&&!(Gt&524288)&&Ur():Sp(k,te,at,Gt,pn,hi,ri,at.hasTrailingComma,at),g?.(at),Gt&15360&&(ws&&at&&Df(at.end),Kr(pMe(Gt)))}function Sp(k,te,at,Gt,pn,hi,ri,Mi,ws){const x_=(Gt&262144)===0;let B_=x_;const ii=fS(te,at[hi],Gt);ii?(yl(ii),B_=!1):Gt&256&&Ur(),Gt&128&&$d();const Yd=hMe(k,pn);let mr,vy,m0=!1;for(let Jm=0;Jm0){if(Gt&131||($d(),m0=!0),B_&&Gt&60&&!id(g0.pos)){const O6=Fd(g0);$p(O6.pos,!!(Gt&512),!0)}yl(Ng),B_=!1}else mr&&Gt&512&&Ur()}if(vy=Ds(g0),B_){const Ng=Fd(g0);$p(Ng.pos)}else B_=x_;Z=g0.pos,Yd(g0,k,pn,Jm),m0&&(Xd(),m0=!1),mr=g0}const hS=mr?da(mr):0,X1=It||!!(hS&2048),Mx=Mi&&Gt&64&&Gt&16;Mx&&(mr&&!X1?ki(28,mr.end,Kr,mr):Kr(",")),mr&&(te?te.end:-1)!==mr.end&&Gt&60&&!X1&&Df(Mx&&ws?.end?ws.end:mr.end),Gt&128&&Xd(),Ce(vy);const yS=fy(te,at[hi+ri-1],Gt,ws);yS?yl(yS):Gt&2097408&&Ur()}function j1(k){ve.writeLiteral(k)}function Cx(k){ve.writeStringLiteral(k)}function tD(k){ve.write(k)}function _S(k,te){ve.writeSymbol(k,te)}function Kr(k){ve.writePunctuation(k)}function Ql(){ve.writeTrailingSemicolon(";")}function Yi(k){ve.writeKeyword(k)}function __(k){ve.writeOperator(k)}function Gd(k){ve.writeParameter(k)}function Tp(k){ve.writeComment(k)}function Ur(){ve.writeSpace(" ")}function b2(k){ve.writeProperty(k)}function B1(k){ve.nonEscapingWrite?ve.nonEscapingWrite(k):ve.write(k)}function yl(k=1){for(let te=0;te0)}function $d(){ve.increaseIndent()}function Xd(){ve.decreaseIndent()}function _y(k,te,at,Gt){return Oe?oh(k,at,te):Ag(Gt,k,at,te,oh)}function Ex(k,te){p&&p(k),te(Hs(k.kind)),y&&y(k)}function oh(k,te,at){const Gt=Hs(k);return te(Gt),at<0?at:at+Gt.length}function J1(k,te,at){if(da(k)&1)Ur();else if(se){const Gt=Vf(k,te,at);Gt?yl(Gt):Ur()}else yl()}function z1(k){const te=k.split(/\r\n?|\n/g),at=hee(te);for(const Gt of te){const pn=at?Gt.slice(at):Gt;pn.length&&(yl(),Me(pn))}}function Dg(k,te){k?($d(),yl(k)):te&&Ur()}function Bm(k,te){k&&Xd(),te&&Xd()}function fS(k,te,at){if(at&2||se){if(at&65536)return 1;if(te===void 0)return!k||O&&bb(k,O)?0:1;if(te.pos===Z||te.kind===12)return 0;if(O&&k&&!id(k.pos)&&!Po(te)&&(!te.parent||Zo(te.parent)===Zo(k)))return se?S2(Gt=>Wte(te.pos,k.pos,O,Gt)):T5(k,te,O)?0:1;if(T2(te,at))return 1}return at&1?1:0}function ch(k,te,at){if(at&2||se){if(k===void 0||te===void 0||te.kind===12)return 0;if(O&&!Po(k)&&!Po(te))return se&&f_(k,te)?S2(Gt=>Az(k,te,O,Gt)):!se&&tf(k,te)?C8(k,te,O)?0:1:at&65536?1:0;if(T2(k,at)||T2(te,at))return 1}else if(AE(te))return 1;return at&1?1:0}function fy(k,te,at,Gt){if(at&2||se){if(at&65536)return 1;if(te===void 0)return!k||O&&bb(k,O)?0:1;if(O&&k&&!id(k.pos)&&!Po(te)&&(!te.parent||te.parent===k)){if(se){const pn=Gt&&!id(Gt.end)?Gt.end:te.end;return S2(hi=>Ute(pn,k.end,O,hi))}return Bte(k,te,O)?0:1}if(T2(te,at))return 1}return at&1&&!(at&131072)?1:0}function S2(k){E.assert(!!se);const te=k(!0);return te===0?k(!1):te}function Dx(k,te){const at=se&&fS(te,k,0);return at&&Dg(at,!1),!!at}function pS(k,te){const at=se&&fy(te,k,0,void 0);at&&yl(at)}function T2(k,te){if(Po(k)){const at=AE(k);return at===void 0?(te&65536)!==0:at}return(te&65536)!==0}function Vf(k,te,at){return da(k)&262144?0:(k=Cc(k),te=Cc(te),at=Cc(at),AE(at)?1:O&&!Po(k)&&!Po(te)&&!Po(at)?se?S2(Gt=>Az(te,at,O,Gt)):C8(te,at,O)?0:1:0)}function W1(k){return k.statements.length===0&&(!O||C8(k,k,O))}function Cc(k){for(;k.kind===217&&Po(k);)k=k.expression;return k}function ul(k,te){if(Eo(k)||rb(k))return py(k);if(ra(k)&&k.textSourceNode)return ul(k.textSourceNode,te);const at=O,Gt=!!at&&!!k.parent&&!Po(k);if(tg(k)){if(!Gt||Or(k)!==Zo(at))return an(k)}else if(sd(k)){if(!Gt||Or(k)!==Zo(at))return PE(k)}else if(E.assertNode(k,vv),!Gt)return k.text;return Tv(at,k,te)}function Px(k,te,at){if(k.kind===11&&k.textSourceNode){const pn=k.textSourceNode;if(Ie(pn)||Ti(pn)||A_(pn)||sd(pn)){const hi=A_(pn)?pn.text:ul(pn);return at?`"${mz(hi)}"`:te||da(k)&16777216?`"${n1(hi)}"`:`"${g8(hi)}"`}else return Px(pn,te,at)}const Gt=(te?1:0)|(at?2:0)|(e.terminateUnterminatedLiterals?4:0)|(e.target&&e.target===99?8:0);return Pee(k,O,Gt)}function cu(k){k&&da(k)&1048576||(_e.push($),$=0,ie.push(B),B=void 0,H.push(K))}function T_(k){k&&da(k)&1048576||($=_e.pop(),B=ie.pop(),K=H.pop())}function x2(k){(!K||K===Mo(H))&&(K=new Set),K.add(k)}function qf(k,te){Y.push(ae),ae=k,oe.push(K),Se=te}function U1(){ae=Y.pop(),Se=oe.pop()}function f0(k){(!Se||Se===Mo(oe))&&(Se=new Set),Se.add(k)}function Ll(k){if(k)switch(k.kind){case 241:Zt(k.statements,Ll);break;case 256:case 254:case 246:case 247:Ll(k.statement);break;case 245:Ll(k.thenStatement),Ll(k.elseStatement);break;case 248:case 250:case 249:Ll(k.initializer),Ll(k.statement);break;case 255:Ll(k.caseBlock);break;case 269:Zt(k.clauses,Ll);break;case 296:case 297:Zt(k.statements,Ll);break;case 258:Ll(k.tryBlock),Ll(k.catchClause),Ll(k.finallyBlock);break;case 299:Ll(k.variableDeclaration),Ll(k.block);break;case 243:Ll(k.declarationList);break;case 261:Zt(k.declarations,Ll);break;case 260:case 169:case 208:case 263:xp(k.name);break;case 262:xp(k.name),da(k)&1048576&&(Zt(k.parameters,Ll),Ll(k.body));break;case 206:case 207:Zt(k.elements,Ll);break;case 272:Ll(k.importClause);break;case 273:xp(k.name),Ll(k.namedBindings);break;case 274:xp(k.name);break;case 280:xp(k.name);break;case 275:Zt(k.elements,Ll);break;case 276:xp(k.propertyName||k.name);break}}function dS(k){if(k)switch(k.kind){case 303:case 304:case 172:case 174:case 177:case 178:xp(k.name);break}}function xp(k){k&&(Eo(k)||rb(k)?py(k):As(k)&&Ll(k))}function py(k){const te=k.emitNode.autoGenerate;if((te.flags&7)===4)return P6(gw(k),Ti(k),te.flags,te.prefix,te.suffix);{const at=te.id;return X[at]||(X[at]=rD(k))}}function P6(k,te,at,Gt,pn){const hi=Oa(k),ri=te?W:z;return ri[hi]||(ri[hi]=p0(k,te,at??0,kC(Gt,py),kC(pn)))}function lo(k,te){return mS(k,te)&&!w6(k,te)&&!J.has(k)}function w6(k,te){return te?!!Se?.has(k):!!K?.has(k)}function mS(k,te){return O?wI(O,k,r):!0}function V1(k,te){for(let at=te;at&&Av(at,te);at=at.nextContainer)if(hm(at)&&at.locals){const Gt=at.locals.get(zo(k));if(Gt&&Gt.flags&3257279)return!1}return!0}function wx(k){switch(k){case"":return $;case"#":return ae;default:return B?.get(k)??0}}function Zu(k,te){switch(k){case"":$=te;break;case"#":ae=te;break;default:B??(B=new Map),B.set(k,te);break}}function Pg(k,te,at,Gt,pn){Gt.length>0&&Gt.charCodeAt(0)===35&&(Gt=Gt.slice(1));const hi=g1(at,Gt,"",pn);let ri=wx(hi);if(k&&!(ri&k)){const ws=g1(at,Gt,k===268435456?"_i":"_n",pn);if(lo(ws,at))return ri|=k,at?f0(ws):te&&x2(ws),Zu(hi,ri),ws}for(;;){const Mi=ri&268435455;if(ri++,Mi!==8&&Mi!==13){const ws=Mi<26?"_"+String.fromCharCode(97+Mi):"_"+(Mi-26),x_=g1(at,Gt,ws,pn);if(lo(x_,at))return at?f0(x_):te&&x2(x_),Zu(hi,ri),x_}}}function lh(k,te=lo,at,Gt,pn,hi,ri){if(k.length>0&&k.charCodeAt(0)===35&&(k=k.slice(1)),hi.length>0&&hi.charCodeAt(0)===35&&(hi=hi.slice(1)),at){const ws=g1(pn,hi,k,ri);if(te(ws,pn))return pn?f0(ws):Gt?x2(ws):J.add(ws),ws}k.charCodeAt(k.length-1)!==95&&(k+="_");let Mi=1;for(;;){const ws=g1(pn,hi,k+Mi,ri);if(te(ws,pn))return pn?f0(ws):Gt?x2(ws):J.add(ws),ws;Mi++}}function k2(k){return lh(k,mS,!0,!1,!1,"","")}function ef(k){const te=ul(k.name);return V1(te,Jn(k,hm))?te:lh(te,lo,!1,!1,!1,"","")}function Ax(k){const te=Rk(k),at=ra(te)?Aee(te.text):"module";return lh(at,lo,!1,!1,!1,"","")}function dy(){return lh("default",lo,!1,!1,!1,"","")}function Ef(){return lh("class",lo,!1,!1,!1,"","")}function C2(k,te,at,Gt){return Ie(k.name)?P6(k.name,te):Pg(0,!1,te,at,Gt)}function p0(k,te,at,Gt,pn){switch(k.kind){case 80:case 81:return lh(ul(k),lo,!!(at&16),!!(at&8),te,Gt,pn);case 267:case 266:return E.assert(!Gt&&!pn&&!te),ef(k);case 272:case 278:return E.assert(!Gt&&!pn&&!te),Ax(k);case 262:case 263:{E.assert(!Gt&&!pn&&!te);const hi=k.name;return hi&&!Eo(hi)?p0(hi,!1,at,Gt,pn):dy()}case 277:return E.assert(!Gt&&!pn&&!te),dy();case 231:return E.assert(!Gt&&!pn&&!te),Ef();case 174:case 177:case 178:return C2(k,te,Gt,pn);case 167:return Pg(0,!0,te,Gt,pn);default:return Pg(0,!1,te,Gt,pn)}}function rD(k){const te=k.emitNode.autoGenerate,at=kC(te.prefix,py),Gt=kC(te.suffix);switch(te.flags&7){case 1:return Pg(0,!!(te.flags&8),Ti(k),at,Gt);case 2:return E.assertNode(k,Ie),Pg(268435456,!!(te.flags&8),!1,at,Gt);case 3:return lh(an(k),te.flags&32?mS:lo,!!(te.flags&16),!!(te.flags&8),Ti(k),at,Gt)}return E.fail(`Unsupported GeneratedIdentifierKind: ${E.formatEnum(te.flags&7,B7,!0)}.`)}function Nx(k,te){const at=ue(2,k,te),Gt=Bt,pn=Ht,hi=br;Ix(te),at(k,te),Fx(te,Gt,pn,hi)}function Ix(k){const te=da(k),at=Fd(k);q1(k,te,at.pos,at.end),te&4096&&(It=!0)}function Fx(k,te,at,Gt){const pn=da(k),hi=Fd(k);pn&4096&&(It=!1),j_(k,pn,hi.pos,hi.end,te,at,Gt);const ri=Wre(k);ri&&j_(k,pn,ri.pos,ri.end,te,at,Gt)}function q1(k,te,at,Gt){ei(),Jt=!1;const pn=at<0||(te&1024)!==0||k.kind===12,hi=Gt<0||(te&2048)!==0||k.kind===12;(at>0||Gt>0)&&at!==Gt&&(pn||E2(at,k.kind!==359),(!pn||at>=0&&te&1024)&&(Bt=at),(!hi||Gt>=0&&te&2048)&&(Ht=Gt,k.kind===261&&(br=Gt))),Zt(sC(k),wg),zi()}function j_(k,te,at,Gt,pn,hi,ri){ei();const Mi=Gt<0||(te&2048)!==0||k.kind===12;Zt(X8(k),Ox),(at>0||Gt>0)&&at!==Gt&&(Bt=pn,Ht=hi,br=ri,!Mi&&k.kind!==359&&kp(Gt)),zi()}function wg(k){(k.hasLeadingNewline||k.kind===2)&&ve.writeLine(),Lx(k),k.hasTrailingNewLine||k.kind===2?ve.writeLine():ve.writeSpace(" ")}function Ox(k){ve.isAtStartOfLine()||ve.writeSpace(" "),Lx(k),k.hasTrailingNewLine&&ve.writeLine()}function Lx(k){const te=Na(k),at=k.kind===3?eT(te):void 0;$k(te,at,ve,0,te.length,C)}function Na(k){return k.kind===3?`/*${k.text}*/`:`//${k.text}`}function cn(k,te,at){ei();const{pos:Gt,end:pn}=te,hi=da(k),ri=Gt<0||(hi&1024)!==0,Mi=It||pn<0||(hi&2048)!==0;ri||N6(te),zi(),hi&4096&&!It?(It=!0,at(k),It=!1):at(k),ei(),Mi||(E2(te.end,!0),Jt&&!ve.isAtStartOfLine()&&ve.writeLine()),zi()}function tf(k,te){return k=Zo(k),k.parent&&k.parent===Zo(te).parent}function f_(k,te){if(te.pos-1&&Gt.indexOf(te)===pn+1}function E2(k,te){Jt=!1,te?k===0&&O?.isDeclarationFile?P2(k,H1):P2(k,my):k===0&&P2(k,A6)}function A6(k,te,at,Gt,pn){G1(k,te)&&my(k,te,at,Gt,pn)}function H1(k,te,at,Gt,pn){G1(k,te)||my(k,te,at,Gt,pn)}function D2(k,te){return e.onlyPrintJsDocStyle?cU(k,te)||AI(k,te):!0}function my(k,te,at,Gt,pn){!O||!D2(O.text,k)||(Jt||(kte(Dt(),ve,pn,k),Jt=!0),Qd(k),$k(O.text,Dt(),ve,k,te,C),Qd(te),Gt?ve.writeLine():at===3&&ve.writeSpace(" "))}function Df(k){It||k===-1||E2(k,!0)}function kp(k){Lc(k,gy)}function gy(k,te,at,Gt){!O||!D2(O.text,k)||(ve.isAtStartOfLine()||ve.writeSpace(" "),Qd(k),$k(O.text,Dt(),ve,k,te,C),Qd(te),Gt&&ve.writeLine())}function $p(k,te,at){It||(ei(),Lc(k,te?gy:at?Cp:d0),zi())}function Cp(k,te,at){O&&(Qd(k),$k(O.text,Dt(),ve,k,te,C),Qd(te),at===2&&ve.writeLine())}function d0(k,te,at,Gt){O&&(Qd(k),$k(O.text,Dt(),ve,k,te,C),Qd(te),Gt?ve.writeLine():ve.writeSpace(" "))}function P2(k,te){O&&(Bt===-1||k!==Bt)&&(nD(k)?Hf(te):lP(O.text,k,te,k))}function Lc(k,te){O&&(Ht===-1||k!==Ht&&k!==br)&&uP(O.text,k,te)}function nD(k){return ar!==void 0&&Sa(ar).nodePos===k}function Hf(k){if(!O)return;const te=Sa(ar).detachedCommentEndPos;ar.length-1?ar.pop():ar=void 0,lP(O.text,te,k,te)}function N6(k){const te=O&&Ete(O.text,Dt(),ve,lu,k,C,It);te&&(ar?ar.push(te):ar=[te])}function lu(k,te,at,Gt,pn,hi){!O||!D2(O.text,Gt)||(Qd(Gt),$k(k,te,at,Gt,pn,hi),Qd(pn))}function G1(k,te){return!!O&&EJ(O.text,k,te)}function w2(k){return k.parsedSourceMap===void 0&&k.sourceMapText!==void 0&&(k.parsedSourceMap=aV(k.sourceMapText)||!1),k.parsedSourceMap||void 0}function gS(k,te){const at=ue(3,k,te);I6(te),at(k,te),Gf(te)}function I6(k){const te=da(k),at=c1(k);if(oJ(k)){E.assertIsDefined(k.parent,"UnparsedNodes must have parent pointers");const Gt=w2(k.parent);Gt&&Xe&&Xe.appendSourceMap(ve.getLine(),ve.getColumn(),Gt,k.parent.sourceMapPath,k.parent.getLineAndCharacterOfPosition(k.pos),k.parent.getLineAndCharacterOfPosition(k.end))}else{const Gt=at.source||it;k.kind!==359&&!(te&32)&&at.pos>=0&&hy(at.source||it,Qo(Gt,at.pos)),te&128&&(Oe=!0)}}function Gf(k){const te=da(k),at=c1(k);oJ(k)||(te&128&&(Oe=!1),k.kind!==359&&!(te&64)&&at.end>=0&&hy(at.source||it,at.end))}function Qo(k,te){return k.skipTrivia?k.skipTrivia(te):la(k.text,te)}function Qd(k){if(Oe||id(k)||yy(it))return;const{line:te,character:at}=qa(it,k);Xe.addMapping(ve.getLine(),ve.getColumn(),mt,te,at,void 0)}function hy(k,te){if(k!==it){const at=it,Gt=mt;$1(k),Qd(te),F6(at,Gt)}else Qd(te)}function Ag(k,te,at,Gt,pn){if(Oe||k&&QI(k))return pn(te,at,Gt);const hi=k&&k.emitNode,ri=hi&&hi.flags||0,Mi=hi&&hi.tokenSourceMapRanges&&hi.tokenSourceMapRanges[te],ws=Mi&&Mi.source||it;return Gt=Qo(ws,Mi?Mi.pos:Gt),!(ri&256)&&Gt>=0&&hy(ws,Gt),Gt=pn(te,at,Gt),Mi&&(Gt=Mi.end),!(ri&512)&&Gt>=0&&hy(ws,Gt),Gt}function $1(k){if(!Oe){if(it=k,k===Je){mt=ot;return}yy(k)||(mt=Xe.addSource(k.fileName),e.inlineSources&&Xe.setSourceContent(mt,k.text),Je=k,ot=mt)}}function F6(k,te){it=k,mt=te}function yy(k){return Ho(k.fileName,".json")}}function _Me(){const e=[];return e[1024]=["{","}"],e[2048]=["(",")"],e[4096]=["<",">"],e[8192]=["[","]"],e}function fMe(e){return wse[e&15360][0]}function pMe(e){return wse[e&15360][1]}function dMe(e,t,r,i){t(e)}function mMe(e,t,r,i){t(e,r.select(i))}function gMe(e,t,r,i){t(e,r)}function hMe(e,t){return e.length===1?dMe:typeof t=="object"?mMe:gMe}var wse,QO,wV,t2,AV,Gw,yMe=Nt({"src/compiler/emitter.ts"(){"use strict";Ns(),Ns(),Z2(),wse=_Me(),QO={hasGlobalName:ys,getReferencedExportContainer:ys,getReferencedImportDeclaration:ys,getReferencedDeclarationWithCollidingName:ys,isDeclarationWithCollidingName:ys,isValueAliasDeclaration:ys,isReferencedAliasDeclaration:ys,isTopLevelValueImportEqualsWithEntityName:ys,getNodeCheckFlags:ys,isDeclarationVisible:ys,isLateBound:e=>!1,collectLinkedAliases:ys,isImplementationOfOverload:ys,isRequiredInitializedParameter:ys,isOptionalUninitializedParameterProperty:ys,isExpandoFunctionDeclaration:ys,getPropertiesOfContainerFunction:ys,createTypeOfDeclaration:ys,createReturnTypeOfSignatureDeclaration:ys,createTypeOfExpression:ys,createLiteralConstValue:ys,isSymbolAccessible:ys,isEntityNameVisible:ys,getConstantValue:ys,getReferencedValueDeclaration:ys,getReferencedValueDeclarations:ys,getTypeReferenceSerializationKind:ys,isOptionalParameter:ys,moduleExportsSomeValue:ys,isArgumentsLocalBinding:ys,getExternalModuleFileFromDeclaration:ys,getTypeReferenceDirectivesForEntityName:ys,getTypeReferenceDirectivesForSymbol:ys,isLiteralConstDeclaration:ys,getJsxFactoryEntity:ys,getJsxFragmentFactoryEntity:ys,getAllAccessorDeclarations:ys,getSymbolOfExternalModuleSpecifier:ys,isBindingCapturedByNode:ys,getDeclarationStatementsForSourceFile:ys,isImportRequiredByAugmentation:ys,tryFindAmbientModule:ys},wV=Vu(()=>S1({})),t2=Vu(()=>S1({removeComments:!0})),AV=Vu(()=>S1({removeComments:!0,neverAsciiEscape:!0})),Gw=Vu(()=>S1({removeComments:!0,omitTrailingSemicolon:!0}))}});function YO(e,t,r){if(!e.getDirectories||!e.readDirectory)return;const i=new Map,s=tu(r);return{useCaseSensitiveFileNames:r,fileExists:T,readFile:(B,Y)=>e.readFile(B,Y),directoryExists:e.directoryExists&&C,getDirectories:D,readDirectory:O,createDirectory:e.createDirectory&&w,writeFile:e.writeFile&&S,addOrDeleteFileOrDirectory:W,addOrDeleteFile:X,clearCache:ie,realpath:e.realpath&&z};function o(B){return fo(B,t,s)}function c(B){return i.get(Sl(B))}function u(B){const Y=c(qn(B));return Y&&(Y.sortedAndCanonicalizedFiles||(Y.sortedAndCanonicalizedFiles=Y.files.map(s).sort(),Y.sortedAndCanonicalizedDirectories=Y.directories.map(s).sort()),Y)}function f(B){return Pc(qs(B))}function g(B,Y){var ae;if(!e.realpath||Sl(o(e.realpath(B)))===Y){const _e={files:Yt(e.readDirectory(B,void 0,void 0,["*.*"]),f)||[],directories:e.getDirectories(B)||[]};return i.set(Sl(Y),_e),_e}if((ae=e.directoryExists)!=null&&ae.call(e,B))return i.set(Y,!1),!1}function p(B,Y){Y=Sl(Y);const ae=c(Y);if(ae)return ae;try{return g(B,Y)}catch{E.assert(!i.has(Sl(Y)));return}}function y(B,Y){return Dh(B,Y,To,Du)>=0}function S(B,Y,ae){const _e=o(B),$=u(_e);return $&&J($,f(B),!0),e.writeFile(B,Y,ae)}function T(B){const Y=o(B),ae=u(Y);return ae&&y(ae.sortedAndCanonicalizedFiles,s(f(B)))||e.fileExists(B)}function C(B){const Y=o(B);return i.has(Sl(Y))||e.directoryExists(B)}function w(B){const Y=o(B),ae=u(Y);if(ae){const _e=f(B),$=s(_e),H=ae.sortedAndCanonicalizedDirectories;P0(H,$,Du)&&ae.directories.push(_e)}e.createDirectory(B)}function D(B){const Y=o(B),ae=p(B,Y);return ae?ae.directories.slice():e.getDirectories(B)}function O(B,Y,ae,_e,$){const H=o(B),K=p(B,H);let oe;if(K!==void 0)return Uz(B,Y,ae,_e,r,t,$,Se,z);return e.readDirectory(B,Y,ae,_e,$);function Se(Z){const ve=o(Z);if(ve===H)return K||se(Z,ve);const Te=p(Z,ve);return Te!==void 0?Te||se(Z,ve):eF}function se(Z,ve){if(oe&&ve===H)return oe;const Te={files:Yt(e.readDirectory(Z,void 0,void 0,["*.*"]),f)||ze,directories:e.getDirectories(Z)||ze};return ve===H&&(oe=Te),Te}}function z(B){return e.realpath?e.realpath(B):B}function W(B,Y){if(c(Y)!==void 0){ie();return}const _e=u(Y);if(!_e)return;if(!e.directoryExists){ie();return}const $=f(B),H={fileExists:e.fileExists(Y),directoryExists:e.directoryExists(Y)};return H.directoryExists||y(_e.sortedAndCanonicalizedDirectories,s($))?ie():J(_e,$,H.fileExists),H}function X(B,Y,ae){if(ae===1)return;const _e=u(Y);_e&&J(_e,f(B),ae===0)}function J(B,Y,ae){const _e=B.sortedAndCanonicalizedFiles,$=s(Y);if(ae)P0(_e,$,Du)&&B.files.push(Y);else{const H=Dh(_e,$,To,Du);if(H>=0){_e.splice(H,1);const K=B.files.findIndex(oe=>s(oe)===$);B.files.splice(K,1)}}}function ie(){i.clear()}}function ZO(e,t,r,i,s){var o;const c=Ph(((o=t?.configFile)==null?void 0:o.extendedSourceFiles)||ze,s);r.forEach((u,f)=>{c.has(f)||(u.projects.delete(e),u.close())}),c.forEach((u,f)=>{const g=r.get(f);g?g.projects.add(e):r.set(f,{projects:new Set([e]),watcher:i(u,f),close:()=>{const p=r.get(f);!p||p.projects.size!==0||(p.watcher.close(),r.delete(f))}})})}function NV(e,t){t.forEach(r=>{r.projects.delete(e)&&r.close()})}function KO(e,t,r){e.delete(t)&&e.forEach(({extendedResult:i},s)=>{var o;(o=i.extendedSourceFiles)!=null&&o.some(c=>r(c)===t)&&KO(e,s,r)})}function K2e(e,t,r){const i=new Map(e);Qk(t,i,{createNewValue:r,onDeleteValue:rd})}function IV(e,t,r){const i=e.getMissingFilePaths(),s=Ph(i,To,zg);Qk(t,s,{createNewValue:r,onDeleteValue:rd})}function $w(e,t,r){Qk(e,t,{createNewValue:i,onDeleteValue:hf,onExistingValue:s});function i(o,c){return{watcher:r(o,c),flags:c}}function s(o,c,u){o.flags!==c&&(o.watcher.close(),e.set(u,i(u,c)))}}function Xw({watchedDirPath:e,fileOrDirectory:t,fileOrDirectoryPath:r,configFileName:i,options:s,program:o,extraFileExtensions:c,currentDirectory:u,useCaseSensitiveFileNames:f,writeLog:g,toPath:p,getScriptKind:y}){const S=p9(r);if(!S)return g(`Project: ${i} Detected ignored path: ${t}`),!0;if(r=S,r===e)return!1;if(ZS(r)&&!(ure(t,s,c)||O()))return g(`Project: ${i} Detected file add/remove of non supported extension: ${t}`),!0;if(Qne(t,s.configFile.configFileSpecs,is(qn(i),u),f,u))return g(`Project: ${i} Detected excluded file: ${t}`),!0;if(!o||to(s)||s.outDir)return!1;if(Il(r)){if(s.declarationDir)return!1}else if(!Jc(r,iC))return!1;const T=Ou(r),C=es(o)?void 0:vMe(o)?o.getProgramOrUndefined():o,w=!C&&!es(o)?o:void 0;if(D(T+".ts")||D(T+".tsx"))return g(`Project: ${i} Detected output file: ${t}`),!0;return!1;function D(z){return C?!!C.getSourceFileByPath(z):w?w.getState().fileInfos.has(z):!!kn(o,W=>p(W)===z)}function O(){if(!y)return!1;switch(y(t)){case 3:case 4:case 7:case 5:return!0;case 1:case 2:return s1(s);case 6:return Rv(s);case 0:return!1}}}function vMe(e){return!!e.getState}function Ase(e,t){return e?e.isEmittedFile(t):!1}function FV(e,t,r,i){dK(t===2?r:Ca);const s={watchFile:(w,D,O,z)=>e.watchFile(w,D,O,z),watchDirectory:(w,D,O,z)=>e.watchDirectory(w,D,(O&1)!==0,z)},o=t!==0?{watchFile:T("watchFile"),watchDirectory:T("watchDirectory")}:void 0,c=t===2?{watchFile:y,watchDirectory:S}:o||s,u=t===2?p:WC;return{watchFile:f("watchFile"),watchDirectory:f("watchDirectory")};function f(w){return(D,O,z,W,X,J)=>{var ie;return cO(D,w==="watchFile"?W?.excludeFiles:W?.excludeDirectories,g(),((ie=e.getCurrentDirectory)==null?void 0:ie.call(e))||"")?u(D,z,W,X,J):c[w].call(void 0,D,O,z,W,X,J)}}function g(){return typeof e.useCaseSensitiveFileNames=="boolean"?e.useCaseSensitiveFileNames:e.useCaseSensitiveFileNames()}function p(w,D,O,z,W){return r(`ExcludeWatcher:: Added:: ${C(w,D,O,z,W,i)}`),{close:()=>r(`ExcludeWatcher:: Close:: ${C(w,D,O,z,W,i)}`)}}function y(w,D,O,z,W,X){r(`FileWatcher:: Added:: ${C(w,O,z,W,X,i)}`);const J=o.watchFile(w,D,O,z,W,X);return{close:()=>{r(`FileWatcher:: Close:: ${C(w,O,z,W,X,i)}`),J.close()}}}function S(w,D,O,z,W,X){const J=`DirectoryWatcher:: Added:: ${C(w,O,z,W,X,i)}`;r(J);const ie=_o(),B=o.watchDirectory(w,D,O,z,W,X),Y=_o()-ie;return r(`Elapsed:: ${Y}ms ${J}`),{close:()=>{const ae=`DirectoryWatcher:: Close:: ${C(w,O,z,W,X,i)}`;r(ae);const _e=_o();B.close();const $=_o()-_e;r(`Elapsed:: ${$}ms ${ae}`)}}}function T(w){return(D,O,z,W,X,J)=>s[w].call(void 0,D,(...ie)=>{const B=`${w==="watchFile"?"FileWatcher":"DirectoryWatcher"}:: Triggered with ${ie[0]} ${ie[1]!==void 0?ie[1]:""}:: ${C(D,z,W,X,J,i)}`;r(B);const Y=_o();O.call(void 0,...ie);const ae=_o()-Y;r(`Elapsed:: ${ae}ms ${B}`)},z,W,X,J)}function C(w,D,O,z,W,X){return`WatchInfo: ${w} ${D} ${JSON.stringify(O)} ${X?X(z,W):W===void 0?z:`${z} ${W}`}`}}function Qw(e){const t=e?.fallbackPolling;return{watchFile:t!==void 0?t:1}}function hf(e){e.watcher.close()}var OV,LV,bMe=Nt({"src/compiler/watchUtilities.ts"(){"use strict";Ns(),OV=(e=>(e[e.Update=0]="Update",e[e.RootNamesAndUpdate=1]="RootNamesAndUpdate",e[e.Full=2]="Full",e))(OV||{}),LV=(e=>(e[e.None=0]="None",e[e.TriggerOnly=1]="TriggerOnly",e[e.Verbose=2]="Verbose",e))(LV||{})}});function Nse(e,t,r="tsconfig.json"){return kd(e,i=>{const s=Hn(i,r);return t(s)?s:void 0})}function e9(e,t){const r=qn(t),i=C_(e)?e:Hn(r,e);return qs(i)}function Ise(e,t,r){let i;return Zt(e,o=>{const c=rP(o,t);if(c.pop(),!i){i=c;return}const u=Math.min(i.length,c.length);for(let f=0;f{let c;try{ko("beforeIORead"),c=e(i,t().charset),ko("afterIORead"),cf("I/O Read","beforeIORead","afterIORead")}catch(u){o&&o(u.message),c=""}return c!==void 0?vw(i,c,s,r):void 0}}function RV(e,t,r){return(i,s,o,c)=>{try{ko("beforeIOWrite"),vz(i,s,o,e,t,r),ko("afterIOWrite"),cf("I/O Write","beforeIOWrite","afterIOWrite")}catch(u){c&&c(u.message)}}}function jV(e,t,r=Bl){const i=new Map,s=tu(r.useCaseSensitiveFileNames);function o(p){return i.has(p)?!0:(g.directoryExists||r.directoryExists)(p)?(i.set(p,!0),!0):!1}function c(){return qn(qs(r.getExecutingFilePath()))}const u=zh(e),f=r.realpath&&(p=>r.realpath(p)),g={getSourceFile:MV(p=>g.readFile(p),()=>e,t),getDefaultLibLocation:c,getDefaultLibFileName:p=>Hn(c(),fP(p)),writeFile:RV((p,y,S)=>r.writeFile(p,y,S),p=>(g.createDirectory||r.createDirectory)(p),p=>o(p)),getCurrentDirectory:Vu(()=>r.getCurrentDirectory()),useCaseSensitiveFileNames:()=>r.useCaseSensitiveFileNames,getCanonicalFileName:s,getNewLine:()=>u,fileExists:p=>r.fileExists(p),readFile:p=>r.readFile(p),trace:p=>r.write(p+u),directoryExists:p=>r.directoryExists(p),getEnvironmentVariable:p=>r.getEnvironmentVariable?r.getEnvironmentVariable(p):"",getDirectories:p=>r.getDirectories(p),realpath:f,readDirectory:(p,y,S,T,C)=>r.readDirectory(p,y,S,T,C),createDirectory:p=>r.createDirectory(p),createHash:Os(r,r.createHash)};return g}function Yw(e,t,r){const i=e.readFile,s=e.fileExists,o=e.directoryExists,c=e.createDirectory,u=e.writeFile,f=new Map,g=new Map,p=new Map,y=new Map,S=w=>{const D=t(w),O=f.get(D);return O!==void 0?O!==!1?O:void 0:T(D,w)},T=(w,D)=>{const O=i.call(e,D);return f.set(w,O!==void 0?O:!1),O};e.readFile=w=>{const D=t(w),O=f.get(D);return O!==void 0?O!==!1?O:void 0:!Ho(w,".json")&&!Ese(w)?i.call(e,w):T(D,w)};const C=r?(w,D,O,z)=>{const W=t(w),X=typeof D=="object"?D.impliedNodeFormat:void 0,J=y.get(X),ie=J?.get(W);if(ie)return ie;const B=r(w,D,O,z);return B&&(Il(w)||Ho(w,".json"))&&y.set(X,(J||new Map).set(W,B)),B}:void 0;return e.fileExists=w=>{const D=t(w),O=g.get(D);if(O!==void 0)return O;const z=s.call(e,w);return g.set(D,!!z),z},u&&(e.writeFile=(w,D,...O)=>{const z=t(w);g.delete(z);const W=f.get(z);W!==void 0&&W!==D?(f.delete(z),y.forEach(X=>X.delete(z))):C&&y.forEach(X=>{const J=X.get(z);J&&J.text!==D&&X.delete(z)}),u.call(e,w,D,...O)}),o&&(e.directoryExists=w=>{const D=t(w),O=p.get(D);if(O!==void 0)return O;const z=o.call(e,w);return p.set(D,!!z),z},c&&(e.createDirectory=w=>{const D=t(w);p.delete(D),c.call(e,w)})),{originalReadFile:i,originalFileExists:s,originalDirectoryExists:o,originalCreateDirectory:c,originalWriteFile:u,getSourceFileWithCache:C,readFileWithCache:S}}function ebe(e,t,r){let i;return i=Dn(i,e.getConfigFileParsingDiagnostics()),i=Dn(i,e.getOptionsDiagnostics(r)),i=Dn(i,e.getSyntacticDiagnostics(t,r)),i=Dn(i,e.getGlobalDiagnostics(r)),i=Dn(i,e.getSemanticDiagnostics(t,r)),Rf(e.getCompilerOptions())&&(i=Dn(i,e.getDeclarationDiagnostics(t,r))),pk(i||ze)}function tbe(e,t){let r="";for(const i of e)r+=BV(i,t);return r}function BV(e,t){const r=`${K2(e)} TS${e.code}: ${Bd(e.messageText,t.getNewLine())}${t.getNewLine()}`;if(e.file){const{line:i,character:s}=qa(e.file,e.start),o=e.file.fileName;return`${T4(o,t.getCurrentDirectory(),u=>t.getCanonicalFileName(u))}(${i+1},${s+1}): `+r}return r}function rbe(e){switch(e){case 1:return"\x1B[91m";case 0:return"\x1B[93m";case 2:return E.fail("Should never get an Info diagnostic on the command line.");case 3:return"\x1B[94m"}}function r2(e,t){return t+e+Rse}function nbe(e,t,r,i,s,o){const{line:c,character:u}=qa(e,t),{line:f,character:g}=qa(e,t+r),p=qa(e,e.text.length).line,y=f-c>=4;let S=(f+1+"").length;y&&(S=Math.max(jse.length,S));let T="";for(let C=c;C<=f;C++){T+=o.getNewLine(),y&&c+1r.getCanonicalFileName(f)):e.fileName;let u="";return u+=i(c,"\x1B[96m"),u+=":",u+=i(`${s+1}`,"\x1B[93m"),u+=":",u+=i(`${o+1}`,"\x1B[93m"),u}function Ose(e,t){let r="";for(const i of e){if(i.file){const{file:s,start:o}=i;r+=JV(s,o,t),r+=" - "}if(r+=r2(K2(i),rbe(i.category)),r+=r2(` TS${i.code}: `,"\x1B[90m"),r+=Bd(i.messageText,t.getNewLine()),i.file&&i.code!==d.File_appears_to_be_binary.code&&(r+=t.getNewLine(),r+=nbe(i.file,i.start,i.length,"",rbe(i.category),t)),i.relatedInformation){r+=t.getNewLine();for(const{file:s,start:o,length:c,messageText:u}of i.relatedInformation)s&&(r+=t.getNewLine(),r+=abe+JV(s,o,t),r+=nbe(s,o,c,Bse,"\x1B[96m",t)),r+=t.getNewLine(),r+=Bse+Bd(u,t.getNewLine())}r+=t.getNewLine()}return r}function Bd(e,t,r=0){if(ns(e))return e;if(e===void 0)return"";let i="";if(r){i+=t;for(let s=0;sAC(o,e,r,i,s,t,c)}}function Mse(e){return ns(e)?e:xd(e.fileName)}function r9(e,t,r,i,s){return{nameAndMode:l9,resolve:(o,c)=>uie(o,e,r,i,t,s,c)}}function Zw(e,t,r,i,s,o,c,u){if(e.length===0)return ze;const f=[],g=new Map,p=u(t,r,i,o,c);for(const y of e){const S=p.nameAndMode.getName(y),T=p.nameAndMode.getMode(y,s),C=n3(S,T);let w=g.get(C);w||g.set(C,w=p.resolve(S,T)),f.push(w)}return f}function VV(e,t){return n9(void 0,e,(r,i)=>r&&t(r,i))}function n9(e,t,r,i){let s;return o(e,t,void 0);function o(c,u,f){if(i){const g=i(c,f);if(g)return g}return Zt(u,(g,p)=>{if(g&&s?.has(g.sourceFile.path))return;const y=r(g,f,p);return y||!g?y:((s||(s=new Set)).add(g.sourceFile.path),o(g.commandLine.projectReferences,g.references,g))})}}function i9(e,t,r){const i=e.configFilePath?qn(e.configFilePath):t;return Hn(i,`__lib_node_modules_lookup_${r}__.ts`)}function qV(e){const t=e.split(".");let r=t[1],i=2;for(;t[i]&&t[i]!=="d";)r+=(i===2?"/":"-")+t[i],i++;return"@typescript/lib-"+r}function ibe(e){const t=xd(e.fileName),r=lO.get(t);return{libName:t,libFileName:r}}function T1(e){switch(e?.kind){case 3:case 4:case 5:case 7:return!0;default:return!1}}function MC(e){return e.pos!==void 0}function y3(e,t){var r,i,s,o;const c=E.checkDefined(e.getSourceFileByPath(t.file)),{kind:u,index:f}=t;let g,p,y,S;switch(u){case 3:const T=c9(c,f);if(y=(i=(r=e.getResolvedModule(c,T.text,zV(c,f)))==null?void 0:r.resolvedModule)==null?void 0:i.packageId,T.pos===-1)return{file:c,packageId:y,text:T.text};g=la(c.text,T.pos),p=T.end;break;case 4:({pos:g,end:p}=c.referencedFiles[f]);break;case 5:({pos:g,end:p,resolutionMode:S}=c.typeReferenceDirectives[f]),y=(o=(s=e.getResolvedTypeReferenceDirective(c,xd(c.typeReferenceDirectives[f].fileName),S||c.impliedNodeFormat))==null?void 0:s.resolvedTypeReferenceDirective)==null?void 0:o.packageId;break;case 7:({pos:g,end:p}=c.libReferenceDirectives[f]);break;default:return E.assertNever(u)}return{file:c,pos:g,end:p,packageId:y}}function HV(e,t,r,i,s,o,c,u,f,g){if(!e||u?.()||!Zp(e.getRootFileNames(),t))return!1;let p;if(!Zp(e.getProjectReferences(),g,C)||e.getSourceFiles().some(S)||e.getMissingFilePaths().some(s))return!1;const y=e.getCompilerOptions();if(!Iz(y,r)||e.resolvedLibReferences&&zl(e.resolvedLibReferences,(D,O)=>c(O)))return!1;if(y.configFile&&r.configFile)return y.configFile.text===r.configFile.text;return!0;function S(D){return!T(D)||o(D.path)}function T(D){return D.version===i(D.resolvedPath,D.fileName)}function C(D,O,z){return TJ(D,O)&&w(e.getResolvedProjectReferences()[z],D)}function w(D,O){if(D){if(_s(p,D))return!0;const W=RC(O),X=f(W);return!X||D.commandLine.options.configFile!==X.options.configFile||!Zp(D.commandLine.fileNames,X.fileNames)?!1:((p||(p=[])).push(D),!Zt(D.references,(J,ie)=>!w(J,D.commandLine.projectReferences[ie])))}const z=RC(O);return!f(z)}}function Jb(e){return e.options.configFile?[...e.options.configFile.parseDiagnostics,...e.errors]:e.errors}function Kw(e,t,r,i){const s=GV(e,t,r,i);return typeof s=="object"?s.impliedNodeFormat:s}function GV(e,t,r,i){switch(Vl(i)){case 3:case 99:return Jc(e,[".d.mts",".mts",".mjs"])?99:Jc(e,[".d.cts",".cts",".cjs"])?1:Jc(e,[".d.ts",".ts",".tsx",".js",".jsx"])?s():void 0;default:return}function s(){const o=Lw(t,r,i),c=[];o.failedLookupLocations=c,o.affectingLocations=c;const u=Mw(e,o);return{impliedNodeFormat:u?.contents.packageJsonContent.type==="module"?99:1,packageJsonLocations:c,packageJsonScope:u}}}function SMe(e,t){return e?kk(e.getCompilerOptions(),t,_O):!1}function TMe(e,t,r,i,s,o){return{rootNames:e,options:t,host:r,oldProgram:i,configFileParsingDiagnostics:s,typeScriptVersion:o}}function s9(e,t,r,i,s){var o,c,u,f,g,p,y,S,T,C,w,D,O,z,W,X;const J=es(e)?TMe(e,t,r,i,s):e,{rootNames:ie,options:B,configFileParsingDiagnostics:Y,projectReferences:ae,typeScriptVersion:_e}=J;let{oldProgram:$}=J;const H=Vu(()=>vp("ignoreDeprecations",d.Invalid_value_for_ignoreDeprecations));let K,oe,Se,se,Z,ve,Te;const Me=new Map;let ke=of();const he={},be={};let lt=qT(),pt,me,Oe,Xe,it,mt,Je,ot,Bt,Ht;const br=typeof B.maxNodeModuleJsDepth=="number"?B.maxNodeModuleJsDepth:0;let zr=0;const ar=new Map,Jt=new Map;(o=Jr)==null||o.push(Jr.Phase.Program,"createProgram",{configFilePath:B.configFilePath,rootDir:B.rootDir},!0),ko("beforeProgram");const It=J.host||Fse(B),Nn=o9(It);let Fi=B.noLib;const ei=Vu(()=>It.getDefaultLibFileName(B)),zi=It.getDefaultLibLocation?It.getDefaultLibLocation():qn(ei()),Qe=qk(),ur=It.getCurrentDirectory(),Dr=hE(B),Ft=N8(B,Dr),yr=new Map;let Tr,Xr,Pi;const ji=It.hasInvalidatedResolutions||Kp;It.resolveModuleNameLiterals?(Pi=It.resolveModuleNameLiterals.bind(It),Xr=(c=It.getModuleResolutionCache)==null?void 0:c.call(It)):It.resolveModuleNames?(Pi=(Ee,We,bt,Rt,tr,Rr)=>It.resolveModuleNames(Ee.map(Lse),We,Rr?.map(Lse),bt,Rt,tr).map(nr=>nr?nr.extension!==void 0?{resolvedModule:nr}:{resolvedModule:{...nr,extension:ST(nr.resolvedFileName)}}:Jse),Xr=(u=It.getModuleResolutionCache)==null?void 0:u.call(It)):(Xr=wC(ur,zf,B),Pi=(Ee,We,bt,Rt,tr)=>Zw(Ee,We,bt,Rt,tr,It,Xr,UV));let Di;if(It.resolveTypeReferenceDirectiveReferences)Di=It.resolveTypeReferenceDirectiveReferences.bind(It);else if(It.resolveTypeReferenceDirectives)Di=(Ee,We,bt,Rt,tr)=>It.resolveTypeReferenceDirectives(Ee.map(Mse),We,bt,Rt,tr?.impliedNodeFormat).map(Rr=>({resolvedTypeReferenceDirective:Rr}));else{const Ee=vO(ur,zf,void 0,Xr?.getPackageJsonInfoCache(),Xr?.optionsToRedirectsKey);Di=(We,bt,Rt,tr,Rr)=>Zw(We,bt,Rt,tr,Rr,It,Ee,r9)}const $i=It.hasInvalidatedLibResolutions||Kp;let Qs;if(It.resolveLibrary)Qs=It.resolveLibrary.bind(It);else{const Ee=wC(ur,zf,B,Xr?.getPackageJsonInfoCache());Qs=(We,bt,Rt)=>bO(We,bt,Rt,It,Ee)}const Ds=new Map;let Ce=new Map,Ue=of(),rt=!1;const ft=new Map;let dt;const fe=It.useCaseSensitiveFileNames()?new Map:void 0;let we,Be,gt,G;const ht=!!((f=It.useSourceOfProjectReferenceRedirect)!=null&&f.call(It))&&!B.disableSourceOfProjectReferenceRedirect,{onProgramCreateComplete:Dt,fileExists:Re,directoryExists:st}=xMe({compilerHost:It,getSymlinkCache:i0,useSourceOfProjectReferenceRedirect:ht,toPath:Ln,getResolvedProjectReferences:os,getSourceOfProjectReferenceRedirect:yp,forEachResolvedProjectReference:Oc}),Ct=It.readFile.bind(It);(g=Jr)==null||g.push(Jr.Phase.Program,"shouldProgramCreateNewSourceFiles",{hasOldProgram:!!$});const Qt=SMe($,B);(p=Jr)==null||p.pop();let er;if((y=Jr)==null||y.push(Jr.Phase.Program,"tryReuseStructureFromOldProgram",{}),er=ia(),(S=Jr)==null||S.pop(),er!==2){if(K=[],oe=[],ae&&(we||(we=ae.map(Ye)),ie.length&&we?.forEach((Ee,We)=>{if(!Ee)return;const bt=to(Ee.commandLine.options);if(ht){if(bt||Ul(Ee.commandLine.options)===0)for(const Rt of Ee.commandLine.fileNames)ye(Rt,{kind:1,index:We})}else if(bt)ye(a1(bt,".d.ts"),{kind:2,index:We});else if(Ul(Ee.commandLine.options)===0){const Rt=Vu(()=>h3(Ee.commandLine,!It.useCaseSensitiveFileNames()));for(const tr of Ee.commandLine.fileNames)!Il(tr)&&!Ho(tr,".json")&&ye(m3(tr,Ee.commandLine,!It.useCaseSensitiveFileNames(),Rt),{kind:2,index:We})}})),(T=Jr)==null||T.push(Jr.Phase.Program,"processRootFiles",{count:ie.length}),Zt(ie,(Ee,We)=>tl(Ee,!1,!1,{kind:0,index:We})),(C=Jr)==null||C.pop(),me??(me=ie.length?yO(B,It):ze),Oe=qT(),me.length){(w=Jr)==null||w.push(Jr.Phase.Program,"processTypeReferences",{count:me.length});const Ee=B.configFilePath?qn(B.configFilePath):ur,We=Hn(Ee,jC),bt=wr(me,We);for(let Rt=0;Rt{tl(ou(We),!0,!1,{kind:6,index:bt})})}dt=fs(nk(ft.entries(),([Ee,We])=>We===void 0?Ee:void 0)),Se=Eh(K,gn).concat(oe),K=void 0,oe=void 0}if(E.assert(!!dt),$&&It.onReleaseOldSourceFile){const Ee=$.getSourceFiles();for(const We of Ee){const bt=Us(We.resolvedPath);(Qt||!bt||bt.impliedNodeFormat!==We.impliedNodeFormat||We.resolvedPath===We.path&&bt.resolvedPath!==We.path)&&It.onReleaseOldSourceFile(We,$.getCompilerOptions(),!!Us(We.path))}It.getParsedCommandLine||$.forEachResolvedProjectReference(We=>{Xu(We.sourceFile.path)||It.onReleaseOldSourceFile(We.sourceFile,$.getCompilerOptions(),!1)})}$&&It.onReleaseParsedCommandLine&&n9($.getProjectReferences(),$.getResolvedProjectReferences(),(Ee,We,bt)=>{const Rt=We?.commandLine.projectReferences[bt]||$.getProjectReferences()[bt],tr=RC(Rt);Be?.has(Ln(tr))||It.onReleaseParsedCommandLine(tr,Ee,$.getCompilerOptions())}),$=void 0,it=void 0,Je=void 0,Bt=void 0;const or={getRootFileNames:()=>ie,getSourceFile:yo,getSourceFileByPath:Us,getSourceFiles:()=>Se,getMissingFilePaths:()=>dt,getModuleResolutionCache:()=>Xr,getFilesByNameMap:()=>ft,getCompilerOptions:()=>B,getSyntacticDiagnostics:Hp,getOptionsDiagnostics:li,getGlobalDiagnostics:va,getSemanticDiagnostics:Fc,getCachedSemanticDiagnostics:$o,getSuggestionDiagnostics:Pe,getDeclarationDiagnostics:qt,getBindAndCheckDiagnostics:Ao,getProgramDiagnostics:rs,getTypeChecker:Ro,getClassifiableNames:Cn,getCommonSourceDirectory:Ni,emit:hs,getCurrentDirectory:()=>ur,getNodeCount:()=>Ro().getNodeCount(),getIdentifierCount:()=>Ro().getIdentifierCount(),getSymbolCount:()=>Ro().getSymbolCount(),getTypeCount:()=>Ro().getTypeCount(),getInstantiationCount:()=>Ro().getInstantiationCount(),getRelationCacheSizes:()=>Ro().getRelationCacheSizes(),getFileProcessingDiagnostics:()=>pt,getResolvedTypeReferenceDirectives:()=>lt,getAutomaticTypeDirectiveNames:()=>me,getAutomaticTypeDirectiveResolutions:()=>Oe,isSourceFileFromExternalLibrary:Vo,isSourceFileDefaultLibrary:cl,getSourceFileFromReference:xu,getLibFileFromReference:$u,sourceFileToPackageName:Ce,redirectTargetsMap:Ue,usesUriStyleNodeCoreModules:rt,resolvedModules:mt,resolvedTypeReferenceDirectiveNames:ot,resolvedLibReferences:Xe,getResolvedModule:U,getResolvedTypeReferenceDirective:j,forEachResolvedModule:ce,forEachResolvedTypeReferenceDirective:ee,getCurrentPackagesMap:()=>Ht,typesPackageExists:De,packageBundlesTypes:Ve,isEmittedFile:fd,getConfigFileParsingDiagnostics:lc,getProjectReferences:Ga,getResolvedProjectReferences:os,getProjectReferenceRedirect:jo,getResolvedProjectReferenceToRedirect:nc,getResolvedProjectReferenceByPath:Xu,forEachResolvedProjectReference:Oc,isSourceOfProjectReferenceRedirect:xf,emitBuildInfo:Tc,fileExists:Re,readFile:Ct,directoryExists:st,getSymlinkCache:i0,realpath:(W=It.realpath)==null?void 0:W.bind(It),useCaseSensitiveFileNames:()=>It.useCaseSensitiveFileNames(),getCanonicalFileName:zf,getFileIncludeReasons:()=>ke,structureIsReused:er,writeFile:Cr};return Dt(),pt?.forEach(Ee=>{switch(Ee.kind){case 1:return Qe.add(At(Ee.file&&Us(Ee.file),Ee.fileProcessingReason,Ee.diagnostic,Ee.args||ze));case 0:const{file:We,pos:bt,end:Rt}=y3(or,Ee.reason);return Qe.add(xl(We,E.checkDefined(bt),E.checkDefined(Rt)-bt,Ee.diagnostic,...Ee.args||ze));case 2:return Ee.diagnostics.forEach(tr=>Qe.add(tr));default:E.assertNever(Ee)}}),Et(),ko("afterProgram"),cf("Program","beforeProgram","afterProgram"),(X=Jr)==null||X.pop(),or;function U(Ee,We,bt){var Rt;return(Rt=mt?.get(Ee.path))==null?void 0:Rt.get(We,bt)}function j(Ee,We,bt){var Rt;return(Rt=ot?.get(Ee.path))==null?void 0:Rt.get(We,bt)}function ce(Ee,We){ue(mt,Ee,We)}function ee(Ee,We){ue(ot,Ee,We)}function ue(Ee,We,bt){var Rt;bt?(Rt=Ee?.get(bt.path))==null||Rt.forEach((tr,Rr,nr)=>We(tr,Rr,nr,bt.path)):Ee?.forEach((tr,Rr)=>tr.forEach((nr,xr,ni)=>We(nr,xr,ni,Rr)))}function M(){return Ht||(Ht=new Map,ce(({resolvedModule:Ee})=>{Ee?.packageId&&Ht.set(Ee.packageId.name,Ee.extension===".d.ts"||!!Ht.get(Ee.packageId.name))}),Ht)}function De(Ee){return M().has(kO(Ee))}function Ve(Ee){return!!M().get(Ee)}function Fe(Ee){var We;(We=Ee.resolutionDiagnostics)!=null&&We.length&&(pt??(pt=[])).push({kind:2,diagnostics:Ee.resolutionDiagnostics})}function vt(Ee,We,bt,Rt){if(It.resolveModuleNameLiterals||!It.resolveModuleNames)return Fe(bt);if(!Xr||Tl(We))return;const tr=is(Ee.originalFileName,ur),Rr=qn(tr),nr=Lr(Ee),xr=Xr.getFromNonRelativeNameCache(We,Rt,Rr,nr);xr&&Fe(xr)}function Lt(Ee,We,bt){var Rt,tr;if(!Ee.length)return ze;const Rr=is(We.originalFileName,ur),nr=Lr(We);(Rt=Jr)==null||Rt.push(Jr.Phase.Program,"resolveModuleNamesWorker",{containingFileName:Rr}),ko("beforeResolveModule");const xr=Pi(Ee,Rr,nr,B,We,bt);return ko("afterResolveModule"),cf("ResolveModule","beforeResolveModule","afterResolveModule"),(tr=Jr)==null||tr.pop(),xr}function Wt(Ee,We,bt){var Rt,tr;if(!Ee.length)return[];const Rr=ns(We)?void 0:We,nr=ns(We)?We:is(We.originalFileName,ur),xr=Rr&&Lr(Rr);(Rt=Jr)==null||Rt.push(Jr.Phase.Program,"resolveTypeReferenceDirectiveNamesWorker",{containingFileName:nr}),ko("beforeResolveTypeReference");const ni=Di(Ee,nr,xr,B,Rr,bt);return ko("afterResolveTypeReference"),cf("ResolveTypeReference","beforeResolveTypeReference","afterResolveTypeReference"),(tr=Jr)==null||tr.pop(),ni}function Lr(Ee){const We=nc(Ee.originalFileName);if(We||!Il(Ee.originalFileName))return We;const bt=Zr(Ee.path);if(bt)return bt;if(!It.realpath||!B.preserveSymlinks||!Ee.originalFileName.includes(Am))return;const Rt=Ln(It.realpath(Ee.originalFileName));return Rt===Ee.path?void 0:Zr(Rt)}function Zr(Ee){const We=yp(Ee);if(ns(We))return nc(We);if(We)return Oc(bt=>{const Rt=to(bt.commandLine.options);if(Rt)return Ln(Rt)===Ee?bt:void 0})}function gn(Ee,We){return xo(On(Ee),On(We))}function On(Ee){if(dm(zi,Ee.fileName,!1)){const We=Pc(Ee.fileName);if(We==="lib.d.ts"||We==="lib.es6.d.ts")return 0;const bt=sk(g4(We,"lib."),".d.ts"),Rt=Dw.indexOf(bt);if(Rt!==-1)return Rt+1}return Dw.length+2}function Ln(Ee){return fo(Ee,ur,zf)}function Ni(){if(Z===void 0){const Ee=wn(Se,We=>fT(We,or));Z=g3(B,()=>Ii(Ee,We=>We.isDeclarationFile?void 0:We.fileName),ur,zf,We=>Q(Ee,We))}return Z}function Cn(){var Ee;if(!Te){Ro(),Te=new Set;for(const We of Se)(Ee=We.classifiableNames)==null||Ee.forEach(bt=>Te.add(bt))}return Te}function Ki(Ee,We){if(er===0&&!We.ambientModuleNames.length)return Lt(Ee,We,void 0);let bt,Rt,tr;const Rr=Jse,nr=$&&$.getSourceFile(We.fileName);for(let fn=0;fn{const Rt=(We?We.commandLine.projectReferences:ae)[bt],tr=Ye(Rt);return Ee?!tr||tr.sourceFile!==Ee.sourceFile||!Zp(Ee.commandLine.fileNames,tr.commandLine.fileNames):tr!==void 0},(Ee,We)=>{const bt=We?Xu(We.sourceFile.path).commandLine.projectReferences:ae;return!Zp(Ee,bt,TJ)})}function ia(){var Ee;if(!$)return 0;const We=$.getCompilerOptions();if(CI(We,B))return 0;const bt=$.getRootFileNames();if(!Zp(bt,ie)||!_i())return 0;ae&&(we=ae.map(Ye));const Rt=[],tr=[];if(er=2,$.getMissingFilePaths().some(_n=>It.fileExists(_n)))return 0;const Rr=$.getSourceFiles();let nr;(_n=>{_n[_n.Exists=0]="Exists",_n[_n.Modified=1]="Modified"})(nr||(nr={}));const xr=new Map;for(const _n of Rr){const fn=Ps(_n.fileName,Xr,It,B);let on=It.getSourceFileByPath?It.getSourceFileByPath(_n.fileName,_n.resolvedPath,fn,void 0,Qt):It.getSourceFile(_n.fileName,fn,void 0,Qt);if(!on)return 0;on.packageJsonLocations=(Ee=fn.packageJsonLocations)!=null&&Ee.length?fn.packageJsonLocations:void 0,on.packageJsonScope=fn.packageJsonScope,E.assert(!on.redirectInfo,"Host should not return a redirect source file from `getSourceFile`");let wi;if(_n.redirectInfo){if(on!==_n.redirectInfo.unredirected)return 0;wi=!1,on=_n}else if($.redirectTargetsMap.has(_n.path)){if(on!==_n)return 0;wi=!1}else wi=on!==_n;on.path=_n.path,on.originalFileName=_n.originalFileName,on.resolvedPath=_n.resolvedPath,on.fileName=_n.fileName;const Qa=$.sourceFileToPackageName.get(_n.path);if(Qa!==void 0){const Va=xr.get(Qa),M_=wi?1:0;if(Va!==void 0&&M_===1||Va===1)return 0;xr.set(Qa,M_)}if(wi)_n.impliedNodeFormat!==on.impliedNodeFormat?er=1:Zp(_n.libReferenceDirectives,on.libReferenceDirectives,no)?_n.hasNoDefaultLib!==on.hasNoDefaultLib?er=1:Zp(_n.referencedFiles,on.referencedFiles,no)?(hl(on),Zp(_n.imports,on.imports,rl)&&Zp(_n.moduleAugmentations,on.moduleAugmentations,rl)?(_n.flags&12582912)!==(on.flags&12582912)?er=1:Zp(_n.typeReferenceDirectives,on.typeReferenceDirectives,no)||(er=1):er=1):er=1:er=1,tr.push(on);else if(ji(_n.path))er=1,tr.push(on);else for(const Va of _n.ambientModuleNames)Me.set(Va,_n.fileName);Rt.push(on)}if(er!==2)return er;for(const _n of tr){const fn=sbe(_n),on=Ki(fn,_n);(Je??(Je=new Map)).set(_n.path,on),kJ(fn,_n,on,(A1,cy)=>$.getResolvedModule(_n,A1,cy),xee,eA)&&(er=1);const Qa=_n.typeReferenceDirectives,Va=wr(Qa,_n);(Bt??(Bt=new Map)).set(_n.path,Va),kJ(Qa,_n,Va,(A1,cy)=>$?.getResolvedTypeReferenceDirective(_n,A1,cy),kee,l9)&&(er=1)}if(er!==2)return er;if(See(We,B)||$.resolvedLibReferences&&zl($.resolvedLibReferences,(_n,fn)=>bg(fn).actual!==_n.actual))return 1;if(It.hasChangedAutomaticTypeDirectiveNames){if(It.hasChangedAutomaticTypeDirectiveNames())return 1}else if(me=yO(B,It),!Zp($.getAutomaticTypeDirectiveNames(),me))return 1;dt=$.getMissingFilePaths(),E.assert(Rt.length===$.getSourceFiles().length);for(const _n of Rt)ft.set(_n.path,_n);return $.getFilesByNameMap().forEach((_n,fn)=>{if(!_n){ft.set(fn,_n);return}if(_n.path===fn){$.isSourceFileFromExternalLibrary(_n)&&Jt.set(_n.path,!0);return}ft.set(fn,ft.get(_n.path))}),Se=Rt,ke=$.getFileIncludeReasons(),pt=$.getFileProcessingDiagnostics(),lt=$.getResolvedTypeReferenceDirectives(),me=$.getAutomaticTypeDirectiveNames(),Oe=$.getAutomaticTypeDirectiveResolutions(),Ce=$.sourceFileToPackageName,Ue=$.redirectTargetsMap,rt=$.usesUriStyleNodeCoreModules,mt=$.resolvedModules,ot=$.resolvedTypeReferenceDirectiveNames,Xe=$.resolvedLibReferences,Ht=$.getCurrentPackagesMap(),2}function Is(Ee){return{getPrependNodes:rc,getCanonicalFileName:zf,getCommonSourceDirectory:or.getCommonSourceDirectory,getCompilerOptions:or.getCompilerOptions,getCurrentDirectory:()=>ur,getSourceFile:or.getSourceFile,getSourceFileByPath:or.getSourceFileByPath,getSourceFiles:or.getSourceFiles,getLibFileFromReference:or.getLibFileFromReference,isSourceFileFromExternalLibrary:Vo,getResolvedProjectReferenceToRedirect:nc,getProjectReferenceRedirect:jo,isSourceOfProjectReferenceRedirect:xf,getSymlinkCache:i0,writeFile:Ee||Cr,isEmitBlocked:Ws,readFile:We=>It.readFile(We),fileExists:We=>{const bt=Ln(We);return Us(bt)?!0:_s(dt,bt)?!1:It.fileExists(We)},useCaseSensitiveFileNames:()=>It.useCaseSensitiveFileNames(),getBuildInfo:We=>{var bt;return(bt=or.getBuildInfo)==null?void 0:bt.call(or,We)},getSourceFileFromReference:(We,bt)=>or.getSourceFileFromReference(We,bt),redirectTargetsMap:Ue,getFileIncludeReasons:or.getFileIncludeReasons,createHash:Os(It,It.createHash)}}function Cr(Ee,We,bt,Rt,tr,Rr){It.writeFile(Ee,We,bt,Rt,tr,Rr)}function Tc(Ee){var We,bt;E.assert(!to(B)),(We=Jr)==null||We.push(Jr.Phase.Emit,"emitBuildInfo",{},!0),ko("beforeEmit");const Rt=$O(QO,Is(Ee),void 0,EV,!1,!0);return ko("afterEmit"),cf("Emit","beforeEmit","afterEmit"),(bt=Jr)==null||bt.pop(),Rt}function os(){return we}function Ga(){return ae}function rc(){return XV(ae,(Ee,We)=>{var bt;return(bt=we[We])==null?void 0:bt.commandLine},Ee=>{const We=Ln(Ee),bt=Us(We);return bt?bt.text:ft.has(We)?void 0:It.readFile(We)},It)}function Vo(Ee){return!!Jt.get(Ee.path)}function cl(Ee){if(!Ee.isDeclarationFile)return!1;if(Ee.hasNoDefaultLib)return!0;if(!B.noLib)return!1;const We=It.useCaseSensitiveFileNames()?QS:XS;return B.lib?ut(B.lib,bt=>We(Ee.fileName,Xe.get(bt).actual)):We(Ee.fileName,ei())}function Ro(){return ve||(ve=Iie(or))}function hs(Ee,We,bt,Rt,tr,Rr){var nr,xr;(nr=Jr)==null||nr.push(Jr.Phase.Emit,"emit",{path:Ee?.path},!0);const ni=$c(()=>el(or,Ee,We,bt,Rt,tr,Rr));return(xr=Jr)==null||xr.pop(),ni}function Ws(Ee){return yr.has(Ln(Ee))}function el(Ee,We,bt,Rt,tr,Rr,nr){if(!nr){const _n=$V(Ee,We,bt,Rt);if(_n)return _n}const xr=Ro().getEmitResolver(to(B)?void 0:We,Rt);ko("beforeEmit");const ni=$O(xr,Is(bt),We,CV(B,Rr,tr),tr,!1,nr);return ko("afterEmit"),cf("Emit","beforeEmit","afterEmit"),ni}function yo(Ee){return Us(Ln(Ee))}function Us(Ee){return ft.get(Ee)||void 0}function Ic(Ee,We,bt){return pk(Ee?We(Ee,bt):ta(or.getSourceFiles(),Rt=>(bt&&bt.throwIfCancellationRequested(),We(Rt,bt))))}function Hp(Ee,We){return Ic(Ee,No,We)}function Fc(Ee,We){return Ic(Ee,ju,We)}function $o(Ee){var We;return Ee?(We=he.perFile)==null?void 0:We.get(Ee.path):he.allDiagnostics}function Ao(Ee,We){return u_(Ee,We)}function rs(Ee){var We;if(vE(Ee,B,or))return ze;const bt=Qe.getDiagnostics(Ee.fileName);return(We=Ee.commentDirectives)!=null&&We.length?A(Ee,Ee.commentDirectives,bt).diagnostics:bt}function qt(Ee,We){const bt=or.getCompilerOptions();return!Ee||to(bt)?dr(Ee,We):Ic(Ee,yn,We)}function No(Ee){return Iu(Ee)?(Ee.additionalSyntacticDiagnostics||(Ee.additionalSyntacticDiagnostics=Tt(Ee)),Xi(Ee.additionalSyntacticDiagnostics,Ee.parseDiagnostics)):Ee.parseDiagnostics}function $c(Ee){try{return Ee()}catch(We){throw We instanceof lk&&(ve=void 0),We}}function ju(Ee,We){return Xi(a9(u_(Ee,We),B),rs(Ee))}function u_(Ee,We){return $r(Ee,We,he,vo)}function vo(Ee,We){return $c(()=>{if(vE(Ee,B,or))return ze;const bt=Ro();E.assert(!!Ee.bindDiagnostics);const tr=(Ee.scriptKind===1||Ee.scriptKind===2)&&O8(Ee,B),Rr=FP(Ee,B.checkJs),xr=!(!!Ee.checkJsDirective&&Ee.checkJsDirective.enabled===!1)&&(Ee.scriptKind===3||Ee.scriptKind===4||Ee.scriptKind===5||Rr||tr||Ee.scriptKind===7);let ni=xr?Ee.bindDiagnostics:ze,_n=xr?bt.getDiagnostics(Ee,We):ze;return Rr&&(ni=wn(ni,fn=>u9.has(fn.code)),_n=wn(_n,fn=>u9.has(fn.code))),xc(Ee,xr&&!Rr,ni,_n,tr?Ee.jsDocDiagnostics:void 0)})}function xc(Ee,We,...bt){var Rt;const tr=Np(bt);if(!We||!((Rt=Ee.commentDirectives)!=null&&Rt.length))return tr;const{diagnostics:Rr,directives:nr}=A(Ee,Ee.commentDirectives,tr);for(const xr of nr.getUnusedExpectations())Rr.push(Bee(Ee,xr.range,d.Unused_ts_expect_error_directive));return Rr}function A(Ee,We,bt){const Rt=Dee(Ee,We);return{diagnostics:bt.filter(Rr=>qe(Rr,Rt)===-1),directives:Rt}}function Pe(Ee,We){return $c(()=>Ro().getSuggestionDiagnostics(Ee,We))}function qe(Ee,We){const{file:bt,start:Rt}=Ee;if(!bt)return-1;const tr=Wg(bt);let Rr=_k(tr,Rt).line-1;for(;Rr>=0;){if(We.markUsed(Rr))return Rr;const nr=bt.text.slice(tr[Rr],tr[Rr+1]).trim();if(nr!==""&&!/^(\s*)\/\/(.*)$/.test(nr))return-1;Rr--}return-1}function Tt(Ee){return $c(()=>{const We=[];return bt(Ee,Ee),QE(Ee,bt,Rt),We;function bt(xr,ni){switch(ni.kind){case 169:case 172:case 174:if(ni.questionToken===xr)return We.push(nr(xr,d.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),"skip";case 173:case 176:case 177:case 178:case 218:case 262:case 219:case 260:if(ni.type===xr)return We.push(nr(xr,d.Type_annotations_can_only_be_used_in_TypeScript_files)),"skip"}switch(xr.kind){case 273:if(xr.isTypeOnly)return We.push(nr(ni,d._0_declarations_can_only_be_used_in_TypeScript_files,"import type")),"skip";break;case 278:if(xr.isTypeOnly)return We.push(nr(xr,d._0_declarations_can_only_be_used_in_TypeScript_files,"export type")),"skip";break;case 276:case 281:if(xr.isTypeOnly)return We.push(nr(xr,d._0_declarations_can_only_be_used_in_TypeScript_files,v_(xr)?"import...type":"export...type")),"skip";break;case 271:return We.push(nr(xr,d.import_can_only_be_used_in_TypeScript_files)),"skip";case 277:if(xr.isExportEquals)return We.push(nr(xr,d.export_can_only_be_used_in_TypeScript_files)),"skip";break;case 298:if(xr.token===119)return We.push(nr(xr,d.implements_clauses_can_only_be_used_in_TypeScript_files)),"skip";break;case 264:const fn=Hs(120);return E.assertIsDefined(fn),We.push(nr(xr,d._0_declarations_can_only_be_used_in_TypeScript_files,fn)),"skip";case 267:const on=xr.flags&32?Hs(145):Hs(144);return E.assertIsDefined(on),We.push(nr(xr,d._0_declarations_can_only_be_used_in_TypeScript_files,on)),"skip";case 265:return We.push(nr(xr,d.Type_aliases_can_only_be_used_in_TypeScript_files)),"skip";case 176:case 174:case 262:return xr.body?void 0:(We.push(nr(xr,d.Signature_declarations_can_only_be_used_in_TypeScript_files)),"skip");case 266:const wi=E.checkDefined(Hs(94));return We.push(nr(xr,d._0_declarations_can_only_be_used_in_TypeScript_files,wi)),"skip";case 235:return We.push(nr(xr,d.Non_null_assertions_can_only_be_used_in_TypeScript_files)),"skip";case 234:return We.push(nr(xr.type,d.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 238:return We.push(nr(xr.type,d.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 216:E.fail()}}function Rt(xr,ni){if(iU(ni)){const _n=kn(ni.modifiers,ql);_n&&We.push(nr(_n,d.Decorators_are_not_valid_here))}else if(Lb(ni)&&ni.modifiers){const _n=Dc(ni.modifiers,ql);if(_n>=0){if(us(ni)&&!B.experimentalDecorators)We.push(nr(ni.modifiers[_n],d.Decorators_are_not_valid_here));else if(Vc(ni)){const fn=Dc(ni.modifiers,wT);if(fn>=0){const on=Dc(ni.modifiers,MF);if(_n>fn&&on>=0&&_n=0&&_n=0&&We.push(ua(nr(ni.modifiers[wi],d.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),nr(ni.modifiers[_n],d.Decorator_used_before_export_here)))}}}}}switch(ni.kind){case 263:case 231:case 174:case 176:case 177:case 178:case 218:case 262:case 219:if(xr===ni.typeParameters)return We.push(Rr(xr,d.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)),"skip";case 243:if(xr===ni.modifiers)return tr(ni.modifiers,ni.kind===243),"skip";break;case 172:if(xr===ni.modifiers){for(const _n of xr)Ys(_n)&&_n.kind!==126&&_n.kind!==129&&We.push(nr(_n,d.The_0_modifier_can_only_be_used_in_TypeScript_files,Hs(_n.kind)));return"skip"}break;case 169:if(xr===ni.modifiers&&ut(xr,Ys))return We.push(Rr(xr,d.Parameter_modifiers_can_only_be_used_in_TypeScript_files)),"skip";break;case 213:case 214:case 233:case 285:case 286:case 215:if(xr===ni.typeArguments)return We.push(Rr(xr,d.Type_arguments_can_only_be_used_in_TypeScript_files)),"skip";break}}function tr(xr,ni){for(const _n of xr)switch(_n.kind){case 87:if(ni)continue;case 125:case 123:case 124:case 148:case 138:case 128:case 164:case 103:case 147:We.push(nr(_n,d.The_0_modifier_can_only_be_used_in_TypeScript_files,Hs(_n.kind)));break;case 126:case 95:case 90:case 129:}}function Rr(xr,ni,..._n){const fn=xr.pos;return xl(Ee,fn,xr.end-fn,ni,..._n)}function nr(xr,ni,..._n){return sp(Ee,xr,ni,..._n)}})}function dr(Ee,We){return $r(Ee,We,be,En)}function En(Ee,We){return $c(()=>{const bt=Ro().getEmitResolver(Ee,We);return kse(Is(Ca),bt,Ee)||ze})}function $r(Ee,We,bt,Rt){var tr;const Rr=Ee?(tr=bt.perFile)==null?void 0:tr.get(Ee.path):bt.allDiagnostics;if(Rr)return Rr;const nr=Rt(Ee,We);return Ee?(bt.perFile||(bt.perFile=new Map)).set(Ee.path,nr):bt.allDiagnostics=nr,nr}function yn(Ee,We){return Ee.isDeclarationFile?[]:dr(Ee,We)}function li(){return pk(Xi(Qe.getGlobalDiagnostics(),Tn()))}function Tn(){if(!B.configFile)return ze;let Ee=Qe.getDiagnostics(B.configFile.fileName);return Oc(We=>{Ee=Xi(Ee,Qe.getDiagnostics(We.sourceFile.fileName))}),Ee}function va(){return ie.length?pk(Ro().getGlobalDiagnostics().slice()):ze}function lc(){return Y||ze}function tl(Ee,We,bt,Rt){$l(qs(Ee),We,bt,void 0,Rt)}function no(Ee,We){return Ee.fileName===We.fileName}function rl(Ee,We){return Ee.kind===80?We.kind===80&&Ee.escapedText===We.escapedText:We.kind===11&&Ee.text===We.text}function Xa(Ee,We){const bt=I.createStringLiteral(Ee),Rt=I.createImportDeclaration(void 0,void 0,bt,void 0);return xT(Rt,2),ga(bt,Rt),ga(Rt,We),bt.flags&=-17,Rt.flags&=-17,bt}function hl(Ee){if(Ee.imports)return;const We=Iu(Ee),bt=Nc(Ee);let Rt,tr,Rr;if((nd(B)||bt)&&!Ee.isDeclarationFile){B.importHelpers&&(Rt=[Xa(X0,Ee)]);const fn=L5(O5(B,Ee),B);fn&&(Rt||(Rt=[])).push(Xa(fn,Ee))}for(const fn of Ee.statements)xr(fn,!1);const nr=We&&N5(B);(Ee.flags&4194304||nr)&&ni(Ee),Ee.imports=Rt||ze,Ee.moduleAugmentations=tr||ze,Ee.ambientModuleNames=Rr||ze;return;function xr(fn,on){if(MP(fn)){const wi=Rk(fn);wi&&ra(wi)&&wi.text&&(!on||!Tl(wi.text))&&($0(fn,!1),Rt=lr(Rt,wi),!rt&&zr===0&&!Ee.isDeclarationFile&&(rt=Qi(wi.text,"node:")))}else if(vc(fn)&&ru(fn)&&(on||In(fn,128)||Ee.isDeclarationFile)){fn.name.parent=fn;const wi=cp(fn.name);if(bt||on&&!Tl(wi))(tr||(tr=[])).push(fn.name);else if(!on){Ee.isDeclarationFile&&(Rr||(Rr=[])).push(wi);const Qa=fn.body;if(Qa)for(const Va of Qa.statements)xr(Va,!0)}}}function ni(fn){const on=/import|require/g;for(;on.exec(fn.text)!==null;){const wi=_n(fn,on.lastIndex);nr&&g_(wi,!0)||G_(wi)&&wi.arguments.length>=1&&Ja(wi.arguments[0])?($0(wi,!1),Rt=lr(Rt,wi.arguments[0])):U0(wi)&&($0(wi,!1),Rt=lr(Rt,wi.argument.literal))}}function _n(fn,on){let wi=fn;const Qa=Va=>{if(Va.pos<=on&&(onHo(tr,nr))){bt&&(jv(tr)?bt(d.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option,Ee):bt(d.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1,Ee,"'"+Np(Dr).join("', '")+"'"));return}const Rr=We(Ee);if(bt)if(Rr)T1(Rt)&&tr===It.getCanonicalFileName(Us(Rt.file).fileName)&&bt(d.A_file_cannot_have_a_reference_to_itself);else{const nr=jo(Ee);nr?bt(d.Output_file_0_has_not_been_built_from_source_file_1,nr,Ee):bt(d.File_0_not_found,Ee)}return Rr}else{const tr=B.allowNonTsExtensions&&We(Ee);if(tr)return tr;if(bt&&B.allowNonTsExtensions){bt(d.File_0_not_found,Ee);return}const Rr=Zt(Dr[0],nr=>We(Ee+nr));return bt&&!Rr&&bt(d.Could_not_resolve_the_path_0_with_the_extensions_Colon_1,Ee,"'"+Np(Dr).join("', '")+"'"),Rr}}function $l(Ee,We,bt,Rt,tr){Bf(Ee,Rr=>Wi(Rr,We,bt,tr,Rt),(Rr,...nr)=>Mr(void 0,tr,Rr,nr),tr)}function ye(Ee,We){return $l(Ee,!1,!1,void 0,We)}function St(Ee,We,bt){!T1(bt)&&ut(ke.get(We.path),T1)?Mr(We,bt,d.Already_included_file_name_0_differs_from_file_name_1_only_in_casing,[We.fileName,Ee]):Mr(We,bt,d.File_name_0_differs_from_already_included_file_name_1_only_in_casing,[Ee,We.fileName])}function Fr(Ee,We,bt,Rt,tr,Rr,nr){var xr;const ni=wm.createRedirectedSourceFile({redirectTarget:Ee,unredirected:We});return ni.fileName=bt,ni.path=Rt,ni.resolvedPath=tr,ni.originalFileName=Rr,ni.packageJsonLocations=(xr=nr.packageJsonLocations)!=null&&xr.length?nr.packageJsonLocations:void 0,ni.packageJsonScope=nr.packageJsonScope,Jt.set(Rt,zr>0),ni}function Wi(Ee,We,bt,Rt,tr){var Rr,nr;(Rr=Jr)==null||Rr.push(Jr.Phase.Program,"findSourceFile",{fileName:Ee,isDefaultLib:We||void 0,fileIncludeKind:J7[Rt.kind]});const xr=Fs(Ee,We,bt,Rt,tr);return(nr=Jr)==null||nr.pop(),xr}function Ps(Ee,We,bt,Rt){const tr=GV(is(Ee,ur),We?.getPackageJsonInfoCache(),bt,Rt),Rr=Da(Rt),nr=P8(Rt);return typeof tr=="object"?{...tr,languageVersion:Rr,setExternalModuleIndicator:nr,jsDocParsingMode:bt.jsDocParsingMode}:{languageVersion:Rr,impliedNodeFormat:tr,setExternalModuleIndicator:nr,jsDocParsingMode:bt.jsDocParsingMode}}function Fs(Ee,We,bt,Rt,tr){var Rr;const nr=Ln(Ee);if(ht){let on=yp(nr);if(!on&&It.realpath&&B.preserveSymlinks&&Il(Ee)&&Ee.includes(Am)){const wi=Ln(It.realpath(Ee));wi!==nr&&(on=yp(wi))}if(on){const wi=ns(on)?Wi(on,We,bt,Rt,tr):void 0;return wi&&hc(wi,nr,void 0),wi}}const xr=Ee;if(ft.has(nr)){const on=ft.get(nr);if(uc(on||void 0,Rt),on&&B.forceConsistentCasingInFileNames!==!1){const wi=on.fileName;Ln(wi)!==Ln(Ee)&&(Ee=jo(Ee)||Ee);const Va=WB(wi,ur),M_=WB(Ee,ur);Va!==M_&&St(Ee,on,Rt)}return on&&Jt.get(on.path)&&zr===0?(Jt.set(on.path,!1),B.noResolve||(Jf(on,We),vg(on)),B.noLib||L_(on),ar.set(on.path,!1),Qu(on)):on&&ar.get(on.path)&&zrMr(void 0,Rt,d.Cannot_read_file_0_Colon_1,[Ee,on]),Qt);if(tr){const on=z0(tr),wi=Ds.get(on);if(wi){const Qa=Fr(wi,fn,Ee,nr,Ln(Ee),xr,_n);return Ue.add(wi.path,Ee),hc(Qa,nr,ni),uc(Qa,Rt),Ce.set(nr,DI(tr)),oe.push(Qa),Qa}else fn&&(Ds.set(on,fn),Ce.set(nr,DI(tr)))}if(hc(fn,nr,ni),fn){if(Jt.set(nr,zr>0),fn.fileName=Ee,fn.path=nr,fn.resolvedPath=Ln(Ee),fn.originalFileName=xr,fn.packageJsonLocations=(Rr=_n.packageJsonLocations)!=null&&Rr.length?_n.packageJsonLocations:void 0,fn.packageJsonScope=_n.packageJsonScope,uc(fn,Rt),It.useCaseSensitiveFileNames()){const on=xd(nr),wi=fe.get(on);wi?St(Ee,wi,Rt):fe.set(on,fn)}Fi=Fi||fn.hasNoDefaultLib&&!bt,B.noResolve||(Jf(fn,We),vg(fn)),B.noLib||L_(fn),Qu(fn),We?K.push(fn):oe.push(fn)}return fn}function uc(Ee,We){Ee&&ke.add(Ee.path,We)}function hc(Ee,We,bt){bt?(ft.set(bt,Ee),ft.set(We,Ee||!1)):ft.set(We,Ee)}function jo(Ee){const We=qo(Ee);return We&&kc(We,Ee)}function qo(Ee){if(!(!we||!we.length||Il(Ee)||Ho(Ee,".json")))return nc(Ee)}function kc(Ee,We){const bt=to(Ee.commandLine.options);return bt?a1(bt,".d.ts"):m3(We,Ee.commandLine,!It.useCaseSensitiveFileNames())}function nc(Ee){gt===void 0&&(gt=new Map,Oc(bt=>{Ln(B.configFilePath)!==bt.sourceFile.path&&bt.commandLine.fileNames.forEach(Rt=>gt.set(Ln(Rt),bt.sourceFile.path))}));const We=gt.get(Ln(Ee));return We&&Xu(We)}function Oc(Ee){return VV(we,Ee)}function yp(Ee){if(Il(Ee))return G===void 0&&(G=new Map,Oc(We=>{const bt=to(We.commandLine.options);if(bt){const Rt=a1(bt,".d.ts");G.set(Ln(Rt),!0)}else{const Rt=Vu(()=>h3(We.commandLine,!It.useCaseSensitiveFileNames()));Zt(We.commandLine.fileNames,tr=>{if(!Il(tr)&&!Ho(tr,".json")){const Rr=m3(tr,We.commandLine,!It.useCaseSensitiveFileNames(),Rt);G.set(Ln(Rr),tr)}})}})),G.get(Ee)}function xf(Ee){return ht&&!!nc(Ee)}function Xu(Ee){if(Be)return Be.get(Ee)||void 0}function Jf(Ee,We){Zt(Ee.referencedFiles,(bt,Rt)=>{$l(e9(bt.fileName,Ee.fileName),We,!1,void 0,{kind:4,file:Ee.path,index:Rt})})}function vg(Ee){const We=Ee.typeReferenceDirectives;if(!We.length)return;const bt=Bt?.get(Ee.path)||wr(We,Ee),Rt=qT();(ot??(ot=new Map)).set(Ee.path,Rt);for(let tr=0;tr{const{libName:Rt,libFileName:tr}=ibe(We);if(tr)tl(ou(tr),!0,!0,{kind:7,file:Ee.path,index:bt});else{const Rr=sk(g4(Rt,"lib."),".d.ts"),nr=m4(Rr,Dw,To),xr=nr?d.Cannot_find_lib_definition_for_0_Did_you_mean_1:d.Cannot_find_lib_definition_for_0,ni=nr?[Rt,nr]:[Rt];(pt||(pt=[])).push({kind:0,reason:{kind:7,file:Ee.path,index:bt},diagnostic:xr,args:ni})}})}function zf(Ee){return It.getCanonicalFileName(Ee)}function Qu(Ee){var We;if(hl(Ee),Ee.imports.length||Ee.moduleAugmentations.length){const bt=sbe(Ee),Rt=Je?.get(Ee.path)||Ki(bt,Ee);E.assert(Rt.length===bt.length);const tr=(ht?(We=Lr(Ee))==null?void 0:We.commandLine.options:void 0)||B,Rr=qT();(mt??(mt=new Map)).set(Ee.path,Rr);for(let nr=0;nrbr,M_=Qa&&!QV(tr,xr,Ee)&&!tr.noResolve&&nrNc(nr)&&!nr.isDeclarationFile);if(B.isolatedModules||B.verbatimModuleSyntax)B.module===0&&We<2&&B.isolatedModules&&_a(d.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher,"isolatedModules","target"),B.preserveConstEnums===!1&&_a(d.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled,B.verbatimModuleSyntax?"verbatimModuleSyntax":"isolatedModules","preserveConstEnums");else if(bt&&We<2&&B.module===0){const nr=kv(bt,typeof bt.externalModuleIndicator=="boolean"?bt:bt.externalModuleIndicator);Qe.add(xl(bt,nr.start,nr.length,d.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none))}if(Ee&&!B.emitDeclarationOnly){if(B.module&&!(B.module===2||B.module===4))_a(d.Only_amd_and_system_modules_are_supported_alongside_0,B.out?"out":"outFile","module");else if(B.module===void 0&&bt){const nr=kv(bt,typeof bt.externalModuleIndicator=="boolean"?bt:bt.externalModuleIndicator);Qe.add(xl(bt,nr.start,nr.length,d.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system,B.out?"out":"outFile"))}}if(Rv(B)&&(Vl(B)===1?_a(d.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic,"resolveJsonModule"):w5(B)||_a(d.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext,"resolveJsonModule","module")),B.outDir||B.rootDir||B.sourceRoot||B.mapRoot){const nr=Ni();B.outDir&&nr===""&&Se.some(xr=>pm(xr.fileName)>1)&&_a(d.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir")}B.useDefineForClassFields&&We===0&&_a(d.Option_0_cannot_be_specified_when_option_target_is_ES3,"useDefineForClassFields"),B.checkJs&&!s1(B)&&Qe.add(dc(d.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs")),B.emitDeclarationOnly&&(Rf(B)||_a(d.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite"),B.noEmit&&_a(d.Option_0_cannot_be_specified_with_option_1,"emitDeclarationOnly","noEmit")),B.emitDecoratorMetadata&&!B.experimentalDecorators&&_a(d.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators"),B.jsxFactory?(B.reactNamespace&&_a(d.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory"),(B.jsx===4||B.jsx===5)&&_a(d.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",e3.get(""+B.jsx)),WT(B.jsxFactory,We)||vp("jsxFactory",d.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,B.jsxFactory)):B.reactNamespace&&!lf(B.reactNamespace,We)&&vp("reactNamespace",d.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,B.reactNamespace),B.jsxFragmentFactory&&(B.jsxFactory||_a(d.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory"),(B.jsx===4||B.jsx===5)&&_a(d.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",e3.get(""+B.jsx)),WT(B.jsxFragmentFactory,We)||vp("jsxFragmentFactory",d.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,B.jsxFragmentFactory)),B.reactNamespace&&(B.jsx===4||B.jsx===5)&&_a(d.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",e3.get(""+B.jsx)),B.jsxImportSource&&B.jsx===2&&_a(d.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",e3.get(""+B.jsx)),B.preserveValueImports&&Ul(B)<5&&_a(d.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later,"preserveValueImports");const Rt=Ul(B);B.verbatimModuleSyntax&&((Rt===2||Rt===3||Rt===4)&&_a(d.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System,"verbatimModuleSyntax"),B.preserveValueImports&&ay("preserveValueImports","verbatimModuleSyntax"),B.importsNotUsedAsValues&&ay("importsNotUsedAsValues","verbatimModuleSyntax")),B.allowImportingTsExtensions&&!(B.noEmit||B.emitDeclarationOnly)&&vp("allowImportingTsExtensions",d.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);const tr=Vl(B);if(B.resolvePackageJsonExports&&!bT(tr)&&_a(d.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"resolvePackageJsonExports"),B.resolvePackageJsonImports&&!bT(tr)&&_a(d.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"resolvePackageJsonImports"),B.customConditions&&!bT(tr)&&_a(d.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"customConditions"),tr===100&&!P5(Rt)&&vp("moduleResolution",d.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later,"bundler"),y4[Rt]&&100<=Rt&&Rt<=199&&!(3<=tr&&tr<=99)){const nr=y4[Rt];vp("moduleResolution",d.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1,nr,nr)}else if(uk[tr]&&3<=tr&&tr<=99&&!(100<=Rt&&Rt<=199)){const nr=uk[tr];vp("module",d.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1,nr,nr)}if(!B.noEmit&&!B.suppressOutputPathCheck){const nr=Is(),xr=new Set;DV(nr,ni=>{B.emitDeclarationOnly||Rr(ni.jsFilePath,xr),Rr(ni.declarationFilePath,xr)})}function Rr(nr,xr){if(nr){const ni=Ln(nr);if(ft.has(ni)){let fn;B.configFilePath||(fn=ps(void 0,d.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig)),fn=ps(fn,d.Cannot_write_file_0_because_it_would_overwrite_input_file,nr),oy(nr,E5(fn))}const _n=It.useCaseSensitiveFileNames()?ni:xd(ni);xr.has(_n)?oy(nr,dc(d.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files,nr)):xr.add(_n)}}}function Pt(){const Ee=B.ignoreDeprecations;if(Ee){if(Ee==="5.0")return new Ip(Ee);H()}return Ip.zero}function L(Ee,We,bt,Rt){const tr=new Ip(Ee),Rr=new Ip(We),nr=new Ip(_e||rk),xr=Pt(),ni=Rr.compareTo(nr)!==1,_n=!ni&&xr.compareTo(tr)===-1;(ni||_n)&&Rt((fn,on,wi)=>{ni?on===void 0?bt(fn,on,wi,d.Option_0_has_been_removed_Please_remove_it_from_your_configuration,fn):bt(fn,on,wi,d.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration,fn,on):on===void 0?bt(fn,on,wi,d.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error,fn,We,Ee):bt(fn,on,wi,d.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error,fn,on,We,Ee)})}function pe(){function Ee(We,bt,Rt,tr,...Rr){if(Rt){const nr=ps(void 0,d.Use_0_instead,Rt),xr=ps(nr,tr,...Rr);Sg(!bt,We,void 0,xr)}else Sg(!bt,We,void 0,tr,...Rr)}L("5.0","5.5",Ee,We=>{B.target===0&&We("target","ES3"),B.noImplicitUseStrict&&We("noImplicitUseStrict"),B.keyofStringsOnly&&We("keyofStringsOnly"),B.suppressExcessPropertyErrors&&We("suppressExcessPropertyErrors"),B.suppressImplicitAnyIndexErrors&&We("suppressImplicitAnyIndexErrors"),B.noStrictGenericChecks&&We("noStrictGenericChecks"),B.charset&&We("charset"),B.out&&We("out",void 0,"outFile"),B.importsNotUsedAsValues&&We("importsNotUsedAsValues",void 0,"verbatimModuleSyntax"),B.preserveValueImports&&We("preserveValueImports",void 0,"verbatimModuleSyntax")})}function Ze(Ee,We,bt){function Rt(tr,Rr,nr,xr,...ni){Cf(We,bt,xr,...ni)}L("5.0","5.5",Rt,tr=>{Ee.prepend&&tr("prepend")})}function At(Ee,We,bt,Rt){var tr;let Rr,nr,xr=T1(We)?We:void 0;Ee&&((tr=ke.get(Ee.path))==null||tr.forEach(wi)),We&&wi(We),xr&&Rr?.length===1&&(Rr=void 0);const ni=xr&&y3(or,xr),_n=Rr&&ps(Rr,d.The_file_is_in_the_program_because_Colon),fn=Ee&&pq(Ee),on=ps(fn?_n?[_n,...fn]:fn:_n,bt,...Rt||ze);return ni&&MC(ni)?OI(ni.file,ni.pos,ni.end-ni.pos,on,nr):E5(on,nr);function wi(Qa){(Rr||(Rr=[])).push(gq(or,Qa)),!xr&&T1(Qa)?xr=Qa:xr!==Qa&&(nr=lr(nr,jn(Qa))),Qa===We&&(We=void 0)}}function Mr(Ee,We,bt,Rt){(pt||(pt=[])).push({kind:1,file:Ee&&Ee.path,fileProcessingReason:We,diagnostic:bt,args:Rt})}function Rn(Ee,We,bt){Qe.add(At(Ee,void 0,We,bt))}function jn(Ee){if(T1(Ee)){const Rt=y3(or,Ee);let tr;switch(Ee.kind){case 3:tr=d.File_is_included_via_import_here;break;case 4:tr=d.File_is_included_via_reference_here;break;case 5:tr=d.File_is_included_via_type_library_reference_here;break;case 7:tr=d.File_is_included_via_library_reference_here;break;default:E.assertNever(Ee)}return MC(Rt)?xl(Rt.file,Rt.pos,Rt.end-Rt.pos,tr):void 0}if(!B.configFile)return;let We,bt;switch(Ee.kind){case 0:if(!B.configFile.configFileSpecs)return;const Rt=is(ie[Ee.index],ur),tr=dq(or,Rt);if(tr){We=zI(B.configFile,"files",tr),bt=d.File_is_matched_by_files_list_specified_here;break}const Rr=mq(or,Rt);if(!Rr||!ns(Rr))return;We=zI(B.configFile,"include",Rr),bt=d.File_is_matched_by_include_pattern_specified_here;break;case 1:case 2:const nr=E.checkDefined(we?.[Ee.index]),xr=n9(ae,we,(wi,Qa,Va)=>wi===nr?{sourceFile:Qa?.sourceFile||B.configFile,index:Va}:void 0);if(!xr)return;const{sourceFile:ni,index:_n}=xr,fn=WP(ni,"references",wi=>Lu(wi.initializer)?wi.initializer:void 0);return fn&&fn.elements.length>_n?sp(ni,fn.elements[_n],Ee.kind===2?d.File_is_output_from_referenced_project_specified_here:d.File_is_source_from_referenced_project_specified_here):void 0;case 8:if(!B.types)return;We=kf("types",Ee.typeReference),bt=d.File_is_entry_point_of_type_library_specified_here;break;case 6:if(Ee.index!==void 0){We=kf("lib",B.lib[Ee.index]),bt=d.File_is_library_specified_here;break}const on=zl(ww.type,(wi,Qa)=>wi===Da(B)?Qa:void 0);We=on?ll("target",on):void 0,bt=d.File_is_default_library_for_target_specified_here;break;default:E.assertNever(Ee)}return We&&sp(B.configFile,We,bt)}function Oi(){const Ee=B.suppressOutputPathCheck?void 0:$h(B);n9(ae,we,(We,bt,Rt)=>{const tr=(bt?bt.commandLine.projectReferences:ae)[Rt],Rr=bt&&bt.sourceFile;if(Ze(tr,Rr,Rt),!We){Cf(Rr,Rt,d.File_0_not_found,tr.path);return}const nr=We.commandLine.options;if((!nr.composite||nr.noEmit)&&(bt?bt.commandLine.fileNames:ie).length&&(nr.composite||Cf(Rr,Rt,d.Referenced_project_0_must_have_setting_composite_Colon_true,tr.path),nr.noEmit&&Cf(Rr,Rt,d.Referenced_project_0_may_not_disable_emit,tr.path)),tr.prepend){const xr=to(nr);xr?It.fileExists(xr)||Cf(Rr,Rt,d.Output_file_0_from_project_1_does_not_exist,xr,tr.path):Cf(Rr,Rt,d.Cannot_prepend_project_0_because_it_does_not_have_outFile_set,tr.path)}!bt&&Ee&&Ee===$h(nr)&&(Cf(Rr,Rt,d.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1,Ee,tr.path),yr.set(Ln(Ee),!0))})}function sa(Ee,We,bt,...Rt){let tr=!0;Xl(Rr=>{ma(Rr.initializer)&&Ik(Rr.initializer,Ee,nr=>{const xr=nr.initializer;Lu(xr)&&xr.elements.length>We&&(Qe.add(sp(B.configFile,xr.elements[We],bt,...Rt)),tr=!1)})}),tr&&Qe.add(dc(bt,...Rt))}function aa(Ee,We,bt,...Rt){let tr=!0;Xl(Rr=>{ma(Rr.initializer)&&ki(Rr.initializer,Ee,We,void 0,bt,...Rt)&&(tr=!1)}),tr&&Qe.add(dc(bt,...Rt))}function Xo(Ee,We){return Ik(Om(),Ee,We)}function Xl(Ee){return Xo("paths",Ee)}function ll(Ee,We){return Xo(Ee,bt=>ra(bt.initializer)&&bt.initializer.text===We?bt.initializer:void 0)}function kf(Ee,We){const bt=Om();return bt&&$ee(bt,Ee,We)}function _a(Ee,We,bt,Rt){Sg(!0,We,bt,Ee,We,bt,Rt)}function vp(Ee,We,...bt){Sg(!1,Ee,void 0,We,...bt)}function Cf(Ee,We,bt,...Rt){const tr=WP(Ee||B.configFile,"references",Rr=>Lu(Rr.initializer)?Rr.initializer:void 0);tr&&tr.elements.length>We?Qe.add(sp(Ee||B.configFile,tr.elements[We],bt,...Rt)):Qe.add(dc(bt,...Rt))}function Sg(Ee,We,bt,Rt,...tr){const Rr=Om();(!Rr||!ki(Rr,Ee,We,bt,Rt,...tr))&&("messageText"in Rt?Qe.add(E5(Rt)):Qe.add(dc(Rt,...tr)))}function Om(){return Tr===void 0&&(Tr=Ik(W4(B.configFile),"compilerOptions",Ee=>ma(Ee.initializer)?Ee.initializer:void 0)||!1),Tr||void 0}function ki(Ee,We,bt,Rt,tr,...Rr){let nr=!1;return Ik(Ee,bt,xr=>{"messageText"in tr?Qe.add(Hg(B.configFile,We?xr.name:xr.initializer,tr)):Qe.add(sp(B.configFile,We?xr.name:xr.initializer,tr,...Rr)),nr=!0},Rt),nr}function ay(Ee,We){const bt=Om();bt?ki(bt,!0,Ee,void 0,d.Option_0_is_redundant_and_cannot_be_specified_with_option_1,Ee,We):_a(d.Option_0_is_redundant_and_cannot_be_specified_with_option_1,Ee,We)}function oy(Ee,We){yr.set(Ln(Ee),!0),Qe.add(We)}function fd(Ee){if(B.noEmit)return!1;const We=Ln(Ee);if(Us(We))return!1;const bt=to(B);if(bt)return u2(We,bt)||u2(We,Ou(bt)+".d.ts");if(B.declarationDir&&dm(B.declarationDir,We,ur,!It.useCaseSensitiveFileNames()))return!0;if(B.outDir)return dm(B.outDir,We,ur,!It.useCaseSensitiveFileNames());if(Jc(We,iC)||Il(We)){const Rt=Ou(We);return!!Us(Rt+".ts")||!!Us(Rt+".tsx")}return!1}function u2(Ee,We){return qy(Ee,We,ur,!It.useCaseSensitiveFileNames())===0}function i0(){return It.getSymlinkCache?It.getSymlinkCache():(se||(se=Bz(ur,zf)),Se&&!se.hasProcessedResolutions()&&se.setSymlinksFromResolutions(ce,ee,Oe),se)}}function xMe(e){let t;const r=e.compilerHost.fileExists,i=e.compilerHost.directoryExists,s=e.compilerHost.getDirectories,o=e.compilerHost.realpath;if(!e.useSourceOfProjectReferenceRedirect)return{onProgramCreateComplete:Ca,fileExists:f};e.compilerHost.fileExists=f;let c;return i&&(c=e.compilerHost.directoryExists=T=>i.call(e.compilerHost,T)?(y(T),!0):e.getResolvedProjectReferences()?(t||(t=new Set,e.forEachResolvedProjectReference(C=>{const w=to(C.commandLine.options);if(w)t.add(qn(e.toPath(w)));else{const D=C.commandLine.options.declarationDir||C.commandLine.options.outDir;D&&t.add(e.toPath(D))}})),S(T,!1)):!1),s&&(e.compilerHost.getDirectories=T=>!e.getResolvedProjectReferences()||i&&i.call(e.compilerHost,T)?s.call(e.compilerHost,T):[]),o&&(e.compilerHost.realpath=T=>{var C;return((C=e.getSymlinkCache().getSymlinkedFiles())==null?void 0:C.get(e.toPath(T)))||o.call(e.compilerHost,T)}),{onProgramCreateComplete:u,fileExists:f,directoryExists:c};function u(){e.compilerHost.fileExists=r,e.compilerHost.directoryExists=i,e.compilerHost.getDirectories=s}function f(T){return r.call(e.compilerHost,T)?!0:!e.getResolvedProjectReferences()||!Il(T)?!1:S(T,!0)}function g(T){const C=e.getSourceOfProjectReferenceRedirect(e.toPath(T));return C!==void 0?ns(C)?r.call(e.compilerHost,C):!0:void 0}function p(T){const C=e.toPath(T),w=`${C}${Co}`;return ng(t,D=>C===D||Qi(D,w)||Qi(C,`${D}/`))}function y(T){var C;if(!e.getResolvedProjectReferences()||xE(T)||!o||!T.includes(Am))return;const w=e.getSymlinkCache(),D=Sl(e.toPath(T));if((C=w.getSymlinkedDirectories())!=null&&C.has(D))return;const O=qs(o.call(e.compilerHost,T));let z;if(O===T||(z=Sl(e.toPath(O)))===D){w.setSymlinkedDirectory(D,!1);return}w.setSymlinkedDirectory(T,{real:Sl(O),realPath:z})}function S(T,C){var w;const D=C?J=>g(J):J=>p(J),O=D(T);if(O!==void 0)return O;const z=e.getSymlinkCache(),W=z.getSymlinkedDirectories();if(!W)return!1;const X=e.toPath(T);return X.includes(Am)?C&&((w=z.getSymlinkedFiles())!=null&&w.has(X))?!0:JD(W.entries(),([J,ie])=>{if(!ie||!Qi(X,J))return;const B=D(X.replace(J,ie.realPath));if(C&&B){const Y=is(T,e.compilerHost.getCurrentDirectory());z.setSymlinkedFile(X,`${ie.real}${Y.replace(new RegExp(J,"i"),"")}`)}return B})||!1:!1}}function $V(e,t,r,i){const s=e.getCompilerOptions();if(s.noEmit)return e.getSemanticDiagnostics(t,i),t||to(s)?_9:e.emitBuildInfo(r,i);if(!s.noEmitOnError)return;let o=[...e.getOptionsDiagnostics(i),...e.getSyntacticDiagnostics(t,i),...e.getGlobalDiagnostics(i),...e.getSemanticDiagnostics(t,i)];if(o.length===0&&Rf(e.getCompilerOptions())&&(o=e.getDeclarationDiagnostics(void 0,i)),!o.length)return;let c;if(!t&&!to(s)){const u=e.emitBuildInfo(r,i);u.diagnostics&&(o=[...o,...u.diagnostics]),c=u.emittedFiles}return{diagnostics:o,sourceMaps:void 0,emittedFiles:c,emitSkipped:!0}}function a9(e,t){return wn(e,r=>!r.skippedOn||!t[r.skippedOn])}function o9(e,t=e){return{fileExists:r=>t.fileExists(r),readDirectory(r,i,s,o,c){return E.assertIsDefined(t.readDirectory,"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"),t.readDirectory(r,i,s,o,c)},readFile:r=>t.readFile(r),directoryExists:Os(t,t.directoryExists),getDirectories:Os(t,t.getDirectories),realpath:Os(t,t.realpath),useCaseSensitiveFileNames:e.useCaseSensitiveFileNames(),getCurrentDirectory:()=>e.getCurrentDirectory(),onUnRecoverableConfigFileDiagnostic:e.onUnRecoverableConfigFileDiagnostic||Wy,trace:e.trace?r=>e.trace(r):void 0}}function XV(e,t,r,i){if(!e)return ze;let s;for(let o=0;oi);for(const i of t)i.kind===11&&r.push(i);return r}function c9({imports:e,moduleAugmentations:t},r){if(r(e.Grey="\x1B[90m",e.Red="\x1B[91m",e.Yellow="\x1B[93m",e.Blue="\x1B[94m",e.Cyan="\x1B[96m",e))(YV||{}),ZV="\x1B[7m",KV=" ",Rse="\x1B[0m",jse="...",abe=" ",Bse=" ",Jse={resolvedModule:void 0,resolvedTypeReferenceDirective:void 0},eA={getName:Lse,getMode:(e,t)=>ld(t,e)},l9={getName:Mse,getMode:(e,t)=>t9(e,t?.impliedNodeFormat)},jC="__inferred type names__.ts",u9=new Set([d.Cannot_redeclare_block_scoped_variable_0.code,d.A_module_cannot_have_multiple_default_exports.code,d.Another_export_default_is_here.code,d.The_first_export_default_is_here.code,d.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,d.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,d.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,d.constructor_is_a_reserved_word.code,d.delete_cannot_be_called_on_an_identifier_in_strict_mode.code,d.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code,d.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code,d.Invalid_use_of_0_in_strict_mode.code,d.A_label_is_not_allowed_here.code,d.with_statements_are_not_allowed_in_strict_mode.code,d.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,d.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,d.A_class_declaration_without_the_default_modifier_must_have_a_name.code,d.A_class_member_cannot_have_the_0_keyword.code,d.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,d.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,d.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,d.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,d.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,d.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,d.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,d.A_destructuring_declaration_must_have_an_initializer.code,d.A_get_accessor_cannot_have_parameters.code,d.A_rest_element_cannot_contain_a_binding_pattern.code,d.A_rest_element_cannot_have_a_property_name.code,d.A_rest_element_cannot_have_an_initializer.code,d.A_rest_element_must_be_last_in_a_destructuring_pattern.code,d.A_rest_parameter_cannot_have_an_initializer.code,d.A_rest_parameter_must_be_last_in_a_parameter_list.code,d.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,d.A_return_statement_cannot_be_used_inside_a_class_static_block.code,d.A_set_accessor_cannot_have_rest_parameter.code,d.A_set_accessor_must_have_exactly_one_parameter.code,d.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,d.An_export_declaration_cannot_have_modifiers.code,d.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,d.An_import_declaration_cannot_have_modifiers.code,d.An_object_member_cannot_be_declared_optional.code,d.Argument_of_dynamic_import_cannot_be_spread_element.code,d.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,d.Cannot_redeclare_identifier_0_in_catch_clause.code,d.Catch_clause_variable_cannot_have_an_initializer.code,d.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,d.Classes_can_only_extend_a_single_class.code,d.Classes_may_not_have_a_field_named_constructor.code,d.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,d.Duplicate_label_0.code,d.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,d.for_await_loops_cannot_be_used_inside_a_class_static_block.code,d.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,d.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,d.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,d.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,d.Jump_target_cannot_cross_function_boundary.code,d.Line_terminator_not_permitted_before_arrow.code,d.Modifiers_cannot_appear_here.code,d.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,d.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,d.Private_identifiers_are_not_allowed_outside_class_bodies.code,d.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,d.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,d.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,d.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,d.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,d.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,d.Trailing_comma_not_allowed.code,d.Variable_declaration_list_cannot_be_empty.code,d._0_and_1_operations_cannot_be_mixed_without_parentheses.code,d._0_expected.code,d._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,d._0_list_cannot_be_empty.code,d._0_modifier_already_seen.code,d._0_modifier_cannot_appear_on_a_constructor_declaration.code,d._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,d._0_modifier_cannot_appear_on_a_parameter.code,d._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,d._0_modifier_cannot_be_used_here.code,d._0_modifier_must_precede_1_modifier.code,d._0_declarations_can_only_be_declared_inside_a_block.code,d._0_declarations_must_be_initialized.code,d.extends_clause_already_seen.code,d.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,d.Class_constructor_may_not_be_a_generator.code,d.Class_constructor_may_not_be_an_accessor.code,d.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,d.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,d.Private_field_0_must_be_declared_in_an_enclosing_class.code,d.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code]),_9={diagnostics:ze,sourceMaps:void 0,emittedFiles:void 0,emitSkipped:!0}}}),CMe=Nt({"src/compiler/builderStatePublic.ts"(){"use strict"}});function zse(e,t,r,i,s,o){const c=[],{emitSkipped:u,diagnostics:f}=e.emit(t,g,i,r,s,o);return{outputFiles:c,emitSkipped:u,diagnostics:f};function g(p,y,S){c.push({name:p,writeByteOrderMark:S,text:y})}}var Vp,EMe=Nt({"src/compiler/builderState.ts"(){"use strict";Ns(),(e=>{function t(){function $(H,K,oe){const Se={getKeys:se=>K.get(se),getValues:se=>H.get(se),keys:()=>H.keys(),deleteKey:se=>{(oe||(oe=new Set)).add(se);const Z=H.get(se);return Z?(Z.forEach(ve=>i(K,ve,se)),H.delete(se),!0):!1},set:(se,Z)=>{oe?.delete(se);const ve=H.get(se);return H.set(se,Z),ve?.forEach(Te=>{Z.has(Te)||i(K,Te,se)}),Z.forEach(Te=>{ve?.has(Te)||r(K,Te,se)}),Se}};return Se}return $(new Map,new Map,void 0)}e.createManyToManyPathMap=t;function r($,H,K){let oe=$.get(H);oe||(oe=new Set,$.set(H,oe)),oe.add(K)}function i($,H,K){const oe=$.get(H);return oe?.delete(K)?(oe.size||$.delete(H),!0):!1}function s($){return Ii($.declarations,H=>{var K;return(K=Or(H))==null?void 0:K.resolvedPath})}function o($,H){const K=$.getSymbolAtLocation(H);return K&&s(K)}function c($,H,K,oe){return fo($.getProjectReferenceRedirect(H)||H,K,oe)}function u($,H,K){let oe;if(H.imports&&H.imports.length>0){const ve=$.getTypeChecker();for(const Te of H.imports){const Me=o(ve,Te);Me?.forEach(Z)}}const Se=qn(H.resolvedPath);if(H.referencedFiles&&H.referencedFiles.length>0)for(const ve of H.referencedFiles){const Te=c($,ve.fileName,Se,K);Z(Te)}if($.forEachResolvedTypeReferenceDirective(({resolvedTypeReferenceDirective:ve})=>{if(!ve)return;const Te=ve.resolvedFileName,Me=c($,Te,Se,K);Z(Me)},H),H.moduleAugmentations.length){const ve=$.getTypeChecker();for(const Te of H.moduleAugmentations){if(!ra(Te))continue;const Me=ve.getSymbolAtLocation(Te);Me&&se(Me)}}for(const ve of $.getTypeChecker().getAmbientModules())ve.declarations&&ve.declarations.length>1&&se(ve);return oe;function se(ve){if(ve.declarations)for(const Te of ve.declarations){const Me=Or(Te);Me&&Me!==H&&Z(Me.resolvedPath)}}function Z(ve){(oe||(oe=new Set)).add(ve)}}function f($,H){return H&&!H.referencedMap==!$}e.canReuseOldState=f;function g($,H,K){var oe,Se,se;const Z=new Map,ve=$.getCompilerOptions(),Te=to(ve),Me=ve.module!==0&&!Te?t():void 0,ke=Me?t():void 0,he=f(Me,H);$.getTypeChecker();for(const be of $.getSourceFiles()){const lt=E.checkDefined(be.version,"Program intended to be used with Builder should have source files with versions set"),pt=he?(oe=H.oldSignatures)==null?void 0:oe.get(be.resolvedPath):void 0,me=pt===void 0?he?(Se=H.fileInfos.get(be.resolvedPath))==null?void 0:Se.signature:void 0:pt||void 0;if(Me){const Oe=u($,be,$.getCanonicalFileName);if(Oe&&Me.set(be.resolvedPath,Oe),he){const Xe=(se=H.oldExportedModulesMap)==null?void 0:se.get(be.resolvedPath),it=Xe===void 0?H.exportedModulesMap.getValues(be.resolvedPath):Xe||void 0;it&&ke.set(be.resolvedPath,it)}}Z.set(be.resolvedPath,{version:lt,signature:me,affectsGlobalScope:Te?void 0:B(be)||void 0,impliedFormat:be.impliedNodeFormat})}return{fileInfos:Z,referencedMap:Me,exportedModulesMap:ke,useFileVersionAsSignature:!K&&!he}}e.create=g;function p($){$.allFilesExcludingDefaultLibraryFile=void 0,$.allFileNames=void 0}e.releaseCache=p;function y($,H,K,oe,Se){var se,Z;const ve=S($,H,K,oe,Se);return(se=$.oldSignatures)==null||se.clear(),(Z=$.oldExportedModulesMap)==null||Z.clear(),ve}e.getFilesAffectedBy=y;function S($,H,K,oe,Se){const se=H.getSourceFileByPath(K);return se?w($,H,se,oe,Se)?($.referencedMap?_e:ae)($,H,se,oe,Se):[se]:ze}e.getFilesAffectedByWithOldState=S;function T($,H,K){$.fileInfos.get(K).signature=H,($.hasCalledUpdateShapeSignature||($.hasCalledUpdateShapeSignature=new Set)).add(K)}e.updateSignatureOfFile=T;function C($,H,K,oe,Se){$.emit(H,(se,Z,ve,Te,Me,ke)=>{E.assert(Il(se),`File extension for signature expected to be dts: Got:: ${se}`),Se(tq($,H,Z,oe,ke),Me)},K,!0,void 0,!0)}e.computeDtsSignature=C;function w($,H,K,oe,Se,se=$.useFileVersionAsSignature){var Z;if((Z=$.hasCalledUpdateShapeSignature)!=null&&Z.has(K.resolvedPath))return!1;const ve=$.fileInfos.get(K.resolvedPath),Te=ve.signature;let Me;if(!K.isDeclarationFile&&!se&&C(H,K,oe,Se,(ke,he)=>{Me=ke,Me!==Te&&D($,K,he[0].exportedModulesFromDeclarationEmit)}),Me===void 0&&(Me=K.version,$.exportedModulesMap&&Me!==Te)){($.oldExportedModulesMap||($.oldExportedModulesMap=new Map)).set(K.resolvedPath,$.exportedModulesMap.getValues(K.resolvedPath)||!1);const ke=$.referencedMap?$.referencedMap.getValues(K.resolvedPath):void 0;ke?$.exportedModulesMap.set(K.resolvedPath,ke):$.exportedModulesMap.deleteKey(K.resolvedPath)}return($.oldSignatures||($.oldSignatures=new Map)).set(K.resolvedPath,Te||!1),($.hasCalledUpdateShapeSignature||($.hasCalledUpdateShapeSignature=new Set)).add(K.resolvedPath),ve.signature=Me,Me!==Te}e.updateShapeSignature=w;function D($,H,K){if(!$.exportedModulesMap)return;($.oldExportedModulesMap||($.oldExportedModulesMap=new Map)).set(H.resolvedPath,$.exportedModulesMap.getValues(H.resolvedPath)||!1);const oe=O(K);oe?$.exportedModulesMap.set(H.resolvedPath,oe):$.exportedModulesMap.deleteKey(H.resolvedPath)}e.updateExportedModules=D;function O($){let H;return $?.forEach(K=>s(K).forEach(oe=>(H??(H=new Set)).add(oe))),H}e.getExportedModules=O;function z($,H,K){const oe=H.getCompilerOptions();if(to(oe)||!$.referencedMap||B(K))return W($,H);const Se=new Set,se=[K.resolvedPath];for(;se.length;){const Z=se.pop();if(!Se.has(Z)){Se.add(Z);const ve=$.referencedMap.getValues(Z);if(ve)for(const Te of ve.keys())se.push(Te)}}return fs(nk(Se.keys(),Z=>{var ve;return((ve=H.getSourceFileByPath(Z))==null?void 0:ve.fileName)??Z}))}e.getAllDependencies=z;function W($,H){if(!$.allFileNames){const K=H.getSourceFiles();$.allFileNames=K===ze?ze:K.map(oe=>oe.fileName)}return $.allFileNames}function X($,H){const K=$.referencedMap.getKeys(H);return K?fs(K.keys()):[]}e.getReferencedByPaths=X;function J($){for(const H of $.statements)if(!II(H))return!1;return!0}function ie($){return ut($.moduleAugmentations,H=>Dd(H.parent))}function B($){return ie($)||!H_($)&&!ap($)&&!J($)}function Y($,H,K){if($.allFilesExcludingDefaultLibraryFile)return $.allFilesExcludingDefaultLibraryFile;let oe;K&&Se(K);for(const se of H.getSourceFiles())se!==K&&Se(se);return $.allFilesExcludingDefaultLibraryFile=oe||ze,$.allFilesExcludingDefaultLibraryFile;function Se(se){H.isSourceFileDefaultLibrary(se)||(oe||(oe=[])).push(se)}}e.getAllFilesExcludingDefaultLibraryFile=Y;function ae($,H,K){const oe=H.getCompilerOptions();return oe&&to(oe)?[K]:Y($,H,K)}function _e($,H,K,oe,Se){if(B(K))return Y($,H,K);const se=H.getCompilerOptions();if(se&&(nd(se)||to(se)))return[K];const Z=new Map;Z.set(K.resolvedPath,K);const ve=X($,K.resolvedPath);for(;ve.length>0;){const Te=ve.pop();if(!Z.has(Te)){const Me=H.getSourceFileByPath(Te);Z.set(Te,Me),Me&&w($,H,Me,oe,Se)&&ve.push(...X($,Me.resolvedPath))}}return fs(nk(Z.values(),Te=>Te))}})(Vp||(Vp={}))}});function ty(e){let t=1;return e.sourceMap&&(t=t|2),e.inlineSourceMap&&(t=t|4),Rf(e)&&(t=t|8),e.declarationMap&&(t=t|16),e.emitDeclarationOnly&&(t=t&24),t}function BC(e,t){const r=t&&(wh(t)?t:ty(t)),i=wh(e)?e:ty(e);if(r===i)return 0;if(!r||!i)return i;const s=r^i;let o=0;return s&7&&(o=i&7),s&24&&(o=o|i&24),o}function DMe(e,t){return e===t||e!==void 0&&t!==void 0&&e.size===t.size&&!ng(e,r=>!t.has(r))}function PMe(e,t){var r,i;const s=Vp.create(e,t,!1);s.program=e;const o=e.getCompilerOptions();s.compilerOptions=o;const c=to(o);c?o.composite&&t?.outSignature&&c===to(t?.compilerOptions)&&(s.outSignature=t.outSignature&&cbe(o,t.compilerOptions,t.outSignature)):s.semanticDiagnosticsPerFile=new Map,s.changedFilesSet=new Set,s.latestChangedDtsFile=o.composite?t?.latestChangedDtsFile:void 0;const u=Vp.canReuseOldState(s.referencedMap,t),f=u?t.compilerOptions:void 0,g=u&&t.semanticDiagnosticsPerFile&&!!s.semanticDiagnosticsPerFile&&!sre(o,f),p=o.composite&&t?.emitSignatures&&!c&&!ore(o,t.compilerOptions);u?((r=t.changedFilesSet)==null||r.forEach(w=>s.changedFilesSet.add(w)),!c&&((i=t.affectedFilesPendingEmit)!=null&&i.size)&&(s.affectedFilesPendingEmit=new Map(t.affectedFilesPendingEmit),s.seenAffectedFiles=new Set),s.programEmitPending=t.programEmitPending):s.buildInfoEmitPending=!0;const y=s.referencedMap,S=u?t.referencedMap:void 0,T=g&&!o.skipLibCheck==!f.skipLibCheck,C=T&&!o.skipDefaultLibCheck==!f.skipDefaultLibCheck;if(s.fileInfos.forEach((w,D)=>{let O,z;if(!u||!(O=t.fileInfos.get(D))||O.version!==w.version||O.impliedFormat!==w.impliedFormat||!DMe(z=y&&y.getValues(D),S&&S.getValues(D))||z&&ng(z,W=>!s.fileInfos.has(W)&&t.fileInfos.has(W)))obe(s,D);else if(g){const W=e.getSourceFileByPath(D);if(W.isDeclarationFile&&!T||W.hasNoDefaultLib&&!C)return;const X=t.semanticDiagnosticsPerFile.get(D);X&&(s.semanticDiagnosticsPerFile.set(D,t.hasReusableDiagnostic?AMe(X,e):wMe(X,e)),s.semanticDiagnosticsFromOldState||(s.semanticDiagnosticsFromOldState=new Set),s.semanticDiagnosticsFromOldState.add(D))}if(p){const W=t.emitSignatures.get(D);W&&(s.emitSignatures??(s.emitSignatures=new Map)).set(D,cbe(o,t.compilerOptions,W))}}),u&&zl(t.fileInfos,(w,D)=>s.fileInfos.has(D)?!1:c||w.affectsGlobalScope?!0:(s.buildInfoEmitPending=!0,!1)))Vp.getAllFilesExcludingDefaultLibraryFile(s,e,void 0).forEach(w=>obe(s,w.resolvedPath));else if(f){const w=are(o,f)?ty(o):BC(o,f);w!==0&&(c?s.programEmitPending=s.programEmitPending?s.programEmitPending|w:w:(e.getSourceFiles().forEach(D=>{s.changedFilesSet.has(D.resolvedPath)||$se(s,D.resolvedPath,w)}),E.assert(!s.seenAffectedFiles||!s.seenAffectedFiles.size),s.seenAffectedFiles=s.seenAffectedFiles||new Set,s.buildInfoEmitPending=!0))}return c&&!s.changedFilesSet.size&&(u&&(s.bundle=t.bundle),ut(e.getProjectReferences(),w=>!!w.prepend)&&(s.programEmitPending=ty(o))),s}function obe(e,t){e.changedFilesSet.add(t),e.buildInfoEmitPending=!0,e.programEmitPending=void 0}function cbe(e,t,r){return!!e.declarationMap==!!t.declarationMap?r:ns(r)?[r]:r[0]}function wMe(e,t){return e.length?Yc(e,r=>{if(ns(r.messageText))return r;const i=Wse(r.messageText,r.file,t,s=>{var o;return(o=s.repopulateInfo)==null?void 0:o.call(s)});return i===r.messageText?r:{...r,messageText:i}}):e}function Wse(e,t,r,i){const s=i(e);if(s)return{...xJ(t,r,s.moduleReference,s.mode,s.packageName||s.moduleReference),next:lbe(e.next,t,r,i)};const o=lbe(e.next,t,r,i);return o===e.next?e:{...e,next:o}}function lbe(e,t,r,i){return Yc(e,s=>Wse(s,t,r,i))}function AMe(e,t){if(!e.length)return ze;let r;return e.map(s=>{const o=ube(s,t,i);o.reportsUnnecessary=s.reportsUnnecessary,o.reportsDeprecated=s.reportDeprecated,o.source=s.source,o.skippedOn=s.skippedOn;const{relatedInformation:c}=s;return o.relatedInformation=c?c.length?c.map(u=>ube(u,t,i)):[]:void 0,o});function i(s){return r??(r=qn(is($h(t.getCompilerOptions()),t.getCurrentDirectory()))),fo(s,r,t.getCanonicalFileName)}}function ube(e,t,r){const{file:i}=e,s=i?t.getSourceFileByPath(r(i)):void 0;return{...e,file:s,messageText:ns(e.messageText)?e.messageText:Wse(e.messageText,s,t,o=>o.info)}}function NMe(e){Vp.releaseCache(e),e.program=void 0}function IMe(e){const t=to(e.compilerOptions);return E.assert(!e.changedFilesSet.size||t),{affectedFilesPendingEmit:e.affectedFilesPendingEmit&&new Map(e.affectedFilesPendingEmit),seenEmittedFiles:e.seenEmittedFiles&&new Map(e.seenEmittedFiles),programEmitPending:e.programEmitPending,emitSignatures:e.emitSignatures&&new Map(e.emitSignatures),outSignature:e.outSignature,latestChangedDtsFile:e.latestChangedDtsFile,hasChangedEmitSignature:e.hasChangedEmitSignature,changedFilesSet:t?new Set(e.changedFilesSet):void 0}}function FMe(e,t){e.affectedFilesPendingEmit=t.affectedFilesPendingEmit,e.seenEmittedFiles=t.seenEmittedFiles,e.programEmitPending=t.programEmitPending,e.emitSignatures=t.emitSignatures,e.outSignature=t.outSignature,e.latestChangedDtsFile=t.latestChangedDtsFile,e.hasChangedEmitSignature=t.hasChangedEmitSignature,t.changedFilesSet&&(e.changedFilesSet=t.changedFilesSet)}function _be(e,t){E.assert(!t||!e.affectedFiles||e.affectedFiles[e.affectedFilesIndex-1]!==t||!e.semanticDiagnosticsPerFile.has(t.resolvedPath))}function fbe(e,t,r){for(var i,s;;){const{affectedFiles:o}=e;if(o){const g=e.seenAffectedFiles;let p=e.affectedFilesIndex;for(;p{const o=i&7;o?e.affectedFilesPendingEmit.set(s,o):e.affectedFilesPendingEmit.delete(s)})}}function LMe(e,t){var r;if((r=e.affectedFilesPendingEmit)!=null&&r.size)return zl(e.affectedFilesPendingEmit,(i,s)=>{var o;const c=e.program.getSourceFileByPath(s);if(!c||!fT(c,e.program)){e.affectedFilesPendingEmit.delete(s);return}const u=(o=e.seenEmittedFiles)==null?void 0:o.get(c.resolvedPath);let f=BC(i,u);if(t&&(f=f&24),f)return{affectedFile:c,emitKind:f}})}function pbe(e){if(!e.cleanedDiagnosticsOfLibFiles){e.cleanedDiagnosticsOfLibFiles=!0;const t=E.checkDefined(e.program),r=t.getCompilerOptions();Zt(t.getSourceFiles(),i=>t.isSourceFileDefaultLibrary(i)&&!vE(i,r,t)&&Use(e,i.resolvedPath))}}function MMe(e,t,r,i){if(Use(e,t.resolvedPath),e.allFilesExcludingDefaultLibraryFile===e.affectedFiles){pbe(e),Vp.updateShapeSignature(e,E.checkDefined(e.program),t,r,i);return}e.compilerOptions.assumeChangesOnlyAffectDirectDependencies||RMe(e,t,r,i)}function eq(e,t,r,i){if(Use(e,t),!e.changedFilesSet.has(t)){const s=E.checkDefined(e.program),o=s.getSourceFileByPath(t);o&&(Vp.updateShapeSignature(e,s,o,r,i,!0),Rf(e.compilerOptions)&&$se(e,t,e.compilerOptions.declarationMap?24:8))}}function Use(e,t){return e.semanticDiagnosticsFromOldState?(e.semanticDiagnosticsFromOldState.delete(t),e.semanticDiagnosticsPerFile.delete(t),!e.semanticDiagnosticsFromOldState.size):!0}function dbe(e,t){const r=E.checkDefined(e.oldSignatures).get(t)||void 0;return E.checkDefined(e.fileInfos.get(t)).signature!==r}function Vse(e,t,r,i){var s;return(s=e.fileInfos.get(t))!=null&&s.affectsGlobalScope?(Vp.getAllFilesExcludingDefaultLibraryFile(e,e.program,void 0).forEach(o=>eq(e,o.resolvedPath,r,i)),pbe(e),!0):!1}function RMe(e,t,r,i){var s;if(!e.exportedModulesMap||!e.changedFilesSet.has(t.resolvedPath)||!dbe(e,t.resolvedPath))return;if(nd(e.compilerOptions)){const c=new Map;c.set(t.resolvedPath,!0);const u=Vp.getReferencedByPaths(e,t.resolvedPath);for(;u.length>0;){const f=u.pop();if(!c.has(f)){if(c.set(f,!0),Vse(e,f,r,i))return;if(eq(e,f,r,i),dbe(e,f)){const g=E.checkDefined(e.program).getSourceFileByPath(f);u.push(...Vp.getReferencedByPaths(e,g.resolvedPath))}}}}const o=new Set;(s=e.exportedModulesMap.getKeys(t.resolvedPath))==null||s.forEach(c=>{if(Vse(e,c,r,i))return!0;const u=e.referencedMap.getKeys(c);return u&&ng(u,f=>mbe(e,f,o,r,i))})}function mbe(e,t,r,i,s){var o,c;if(zy(r,t)){if(Vse(e,t,i,s))return!0;eq(e,t,i,s),(o=e.exportedModulesMap.getKeys(t))==null||o.forEach(u=>mbe(e,u,r,i,s)),(c=e.referencedMap.getKeys(t))==null||c.forEach(u=>!r.has(u)&&eq(e,u,i,s))}}function qse(e,t,r){return Xi(jMe(e,t,r),E.checkDefined(e.program).getProgramDiagnostics(t))}function jMe(e,t,r){const i=t.resolvedPath;if(e.semanticDiagnosticsPerFile){const o=e.semanticDiagnosticsPerFile.get(i);if(o)return a9(o,e.compilerOptions)}const s=E.checkDefined(e.program).getBindAndCheckDiagnostics(t,r);return e.semanticDiagnosticsPerFile&&e.semanticDiagnosticsPerFile.set(i,s),a9(s,e.compilerOptions)}function Hse(e){return!!to(e.options||{})}function BMe(e,t){var r,i,s;const o=E.checkDefined(e.program).getCurrentDirectory(),c=qn(is($h(e.compilerOptions),o)),u=e.latestChangedDtsFile?J(e.latestChangedDtsFile):void 0,f=[],g=new Map,p=[];if(to(e.compilerOptions)){const $=fs(e.fileInfos.entries(),([Z,ve])=>{const Te=B(Z);return ae(Z,Te),ve.impliedFormat?{version:ve.version,impliedFormat:ve.impliedFormat,signature:void 0,affectsGlobalScope:void 0}:ve.version}),H={fileNames:f,fileInfos:$,root:p,options:_e(e.compilerOptions),outSignature:e.outSignature,latestChangedDtsFile:u,pendingEmit:e.programEmitPending?e.programEmitPending===ty(e.compilerOptions)?!1:e.programEmitPending:void 0},{js:K,dts:oe,commonSourceDirectory:Se,sourceFiles:se}=t;return e.bundle=t={commonSourceDirectory:Se,sourceFiles:se,js:K||(e.compilerOptions.emitDeclarationOnly||(r=e.bundle)==null?void 0:r.js),dts:oe||(Rf(e.compilerOptions)?(i=e.bundle)==null?void 0:i.dts:void 0)},Hw(H,t)}let y,S,T;const C=fs(e.fileInfos.entries(),([$,H])=>{var K,oe;const Se=B($);ae($,Se),E.assert(f[Se-1]===ie($));const se=(K=e.oldSignatures)==null?void 0:K.get($),Z=se!==void 0?se||void 0:H.signature;if(e.compilerOptions.composite){const ve=e.program.getSourceFileByPath($);if(!ap(ve)&&fT(ve,e.program)){const Te=(oe=e.emitSignatures)==null?void 0:oe.get($);Te!==Z&&(T||(T=[])).push(Te===void 0?Se:[Se,!ns(Te)&&Te[0]===Z?ze:Te])}}return H.version===Z?H.affectsGlobalScope||H.impliedFormat?{version:H.version,signature:void 0,affectsGlobalScope:H.affectsGlobalScope,impliedFormat:H.impliedFormat}:H.version:Z!==void 0?se===void 0?H:{version:H.version,signature:Z,affectsGlobalScope:H.affectsGlobalScope,impliedFormat:H.impliedFormat}:{version:H.version,signature:!1,affectsGlobalScope:H.affectsGlobalScope,impliedFormat:H.impliedFormat}});let w;e.referencedMap&&(w=fs(e.referencedMap.keys()).sort(Du).map($=>[B($),Y(e.referencedMap.getValues($))]));let D;e.exportedModulesMap&&(D=Ii(fs(e.exportedModulesMap.keys()).sort(Du),$=>{var H;const K=(H=e.oldExportedModulesMap)==null?void 0:H.get($);if(K===void 0)return[B($),Y(e.exportedModulesMap.getValues($))];if(K)return[B($),Y(K)]}));let O;if(e.semanticDiagnosticsPerFile)for(const $ of fs(e.semanticDiagnosticsPerFile.keys()).sort(Du)){const H=e.semanticDiagnosticsPerFile.get($);(O||(O=[])).push(H.length?[B($),zMe(H,ie)]:B($))}let z;if((s=e.affectedFilesPendingEmit)!=null&&s.size){const $=ty(e.compilerOptions),H=new Set;for(const K of fs(e.affectedFilesPendingEmit.keys()).sort(Du))if(zy(H,K)){const oe=e.program.getSourceFileByPath(K);if(!oe||!fT(oe,e.program))continue;const Se=B(K),se=e.affectedFilesPendingEmit.get(K);(z||(z=[])).push(se===$?Se:se===8?[Se]:[Se,se])}}let W;if(e.changedFilesSet.size)for(const $ of fs(e.changedFilesSet.keys()).sort(Du))(W||(W=[])).push(B($));const X={fileNames:f,fileInfos:C,root:p,options:_e(e.compilerOptions),fileIdsList:y,referencedMap:w,exportedModulesMap:D,semanticDiagnosticsPerFile:O,affectedFilesPendingEmit:z,changeFileSet:W,emitSignatures:T,latestChangedDtsFile:u};return Hw(X,t);function J($){return ie(is($,o))}function ie($){return dv(mm(c,$,e.program.getCanonicalFileName))}function B($){let H=g.get($);return H===void 0&&(f.push(ie($)),g.set($,H=f.length)),H}function Y($){const H=fs($.keys(),B).sort(xo),K=H.join();let oe=S?.get(K);return oe===void 0&&((y||(y=[])).push(H),(S||(S=new Map)).set(K,oe=y.length)),oe}function ae($,H){const K=e.program.getSourceFile($);if(!e.program.getFileIncludeReasons().get(K.path).some(Z=>Z.kind===0))return;if(!p.length)return p.push(H);const oe=p[p.length-1],Se=es(oe);if(Se&&oe[1]===H-1)return oe[1]=H;if(Se||p.length===1||oe!==H-1)return p.push(H);const se=p[p.length-2];return!wh(se)||se!==oe-1?p.push(H):(p[p.length-2]=[se,H],p.length=p.length-1)}function _e($){let H;const{optionsNameMap:K}=EC();for(const oe of Jg($).sort(Du)){const Se=K.get(oe.toLowerCase());Se?.affectsBuildInfo&&((H||(H={}))[oe]=JMe(Se,$[oe],J))}return H}}function JMe(e,t,r){if(e){if(E.assert(e.type!=="listOrElement"),e.type==="list"){const i=t;if(e.element.isFilePath&&i.length)return i.map(r)}else if(e.isFilePath)return r(t)}return t}function zMe(e,t){return E.assert(!!e.length),e.map(r=>{const i=gbe(r,t);i.reportsUnnecessary=r.reportsUnnecessary,i.reportDeprecated=r.reportsDeprecated,i.source=r.source,i.skippedOn=r.skippedOn;const{relatedInformation:s}=r;return i.relatedInformation=s?s.length?s.map(o=>gbe(o,t)):[]:void 0,i})}function gbe(e,t){const{file:r}=e;return{...e,file:r?t(r.resolvedPath):void 0,messageText:ns(e.messageText)?e.messageText:Gse(e.messageText)}}function Gse(e){if(e.repopulateInfo)return{info:e.repopulateInfo(),next:hbe(e.next)};const t=hbe(e.next);return t===e.next?e:{...e,next:t}}function hbe(e){return e&&(Zt(e,(t,r)=>{const i=Gse(t);if(t===i)return;const s=r>0?e.slice(0,r-1):[];s.push(i);for(let o=r+1;o`${f(g)}${YD[g.category]}${g.code}: ${u(g.messageText)}`).join(` +`)),(i.createHash??v4)(r);function u(g){return ns(g)?g:g===void 0?"":g.next?g.messageText+g.next.map(u).join(` +`):g.messageText}function f(g){return g.file.resolvedPath===t.resolvedPath?`(${g.start},${g.length})`:(c===void 0&&(c=qn(t.resolvedPath)),`${dv(mm(c,g.file.resolvedPath,e.getCanonicalFileName))}(${g.start},${g.length})`)}}function zb(e,t,r){return(t.createHash??v4)(ybe(e,r))}function rq(e,{newProgram:t,host:r,oldProgram:i,configFileParsingDiagnostics:s}){let o=i&&i.getState();if(o&&t===o.program&&s===t.getConfigFileParsingDiagnostics())return t=void 0,o=void 0,i;const c=PMe(t,o);t.getBuildInfo=w=>BMe(c,w),t=void 0,i=void 0,o=void 0;const u=()=>c,f=iq(u,s);return f.getState=u,f.saveEmitState=()=>IMe(c),f.restoreEmitState=w=>FMe(c,w),f.hasChangedEmitSignature=()=>!!c.hasChangedEmitSignature,f.getAllDependencies=w=>Vp.getAllDependencies(c,E.checkDefined(c.program),w),f.getSemanticDiagnostics=C,f.emit=S,f.releaseProgram=()=>NMe(c),e===0?f.getSemanticDiagnosticsOfNextAffectedFile=T:e===1?(f.getSemanticDiagnosticsOfNextAffectedFile=T,f.emitNextAffectedFile=p,f.emitBuildInfo=g):ys(),f;function g(w,D){if(c.buildInfoEmitPending){const O=E.checkDefined(c.program).emitBuildInfo(w||Os(r,r.writeFile),D);return c.buildInfoEmitPending=!1,O}return _9}function p(w,D,O,z){var W,X,J;let ie=fbe(c,D,r);const B=ty(c.compilerOptions);let Y=O?B&24:B;if(!ie)if(to(c.compilerOptions)){if(!c.programEmitPending||(Y=c.programEmitPending,O&&(Y=Y&24),!Y))return;ie=c.program}else{const $=LMe(c,O);if(!$){if(!c.buildInfoEmitPending)return;const H=c.program,K=H.emitBuildInfo(w||Os(r,r.writeFile),D);return c.buildInfoEmitPending=!1,{result:K,affected:H}}({affectedFile:ie,emitKind:Y}=$)}let ae;Y&7&&(ae=0),Y&24&&(ae=ae===void 0?1:void 0),ie===c.program&&(c.programEmitPending=c.changedFilesSet.size?BC(B,Y):c.programEmitPending?BC(c.programEmitPending,Y):void 0);const _e=c.program.emit(ie===c.program?void 0:ie,y(w,z),D,ae,z);if(ie!==c.program){const $=ie;c.seenAffectedFiles.add($.resolvedPath),c.affectedFilesIndex!==void 0&&c.affectedFilesIndex++,c.buildInfoEmitPending=!0;const H=((W=c.seenEmittedFiles)==null?void 0:W.get($.resolvedPath))||0;(c.seenEmittedFiles??(c.seenEmittedFiles=new Map)).set($.resolvedPath,Y|H);const K=((X=c.affectedFilesPendingEmit)==null?void 0:X.get($.resolvedPath))||B,oe=BC(K,Y|H);oe?(c.affectedFilesPendingEmit??(c.affectedFilesPendingEmit=new Map)).set($.resolvedPath,oe):(J=c.affectedFilesPendingEmit)==null||J.delete($.resolvedPath)}else c.changedFilesSet.clear();return{result:_e,affected:ie}}function y(w,D){return Rf(c.compilerOptions)?(O,z,W,X,J,ie)=>{var B,Y,ae,_e;if(Il(O))if(to(c.compilerOptions)){if(c.compilerOptions.composite){const H=$(c.outSignature,void 0);if(!H)return;c.outSignature=H}}else{E.assert(J?.length===1);let H;if(!D){const K=J[0],oe=c.fileInfos.get(K.resolvedPath);if(oe.signature===K.version){const Se=tq(c.program,K,z,r,ie);(B=ie?.diagnostics)!=null&&B.length||(H=Se),Se!==K.version&&(r.storeFilesChangingSignatureDuringEmit&&(c.filesChangingSignature??(c.filesChangingSignature=new Set)).add(K.resolvedPath),c.exportedModulesMap&&Vp.updateExportedModules(c,K,K.exportedModulesFromDeclarationEmit),c.affectedFiles?(((Y=c.oldSignatures)==null?void 0:Y.get(K.resolvedPath))===void 0&&(c.oldSignatures??(c.oldSignatures=new Map)).set(K.resolvedPath,oe.signature||!1),oe.signature=Se):(oe.signature=Se,(ae=c.oldExportedModulesMap)==null||ae.clear()))}}if(c.compilerOptions.composite){const K=J[0].resolvedPath;if(H=$((_e=c.emitSignatures)==null?void 0:_e.get(K),H),!H)return;(c.emitSignatures??(c.emitSignatures=new Map)).set(K,H)}}w?w(O,z,W,X,J,ie):r.writeFile?r.writeFile(O,z,W,X,J,ie):c.program.writeFile(O,z,W,X,J,ie);function $(H,K){const oe=!H||ns(H)?H:H[0];if(K??(K=zb(z,r,ie)),K===oe){if(H===oe)return;ie?ie.differsOnlyInMap=!0:ie={differsOnlyInMap:!0}}else c.hasChangedEmitSignature=!0,c.latestChangedDtsFile=O;return K}}:w||Os(r,r.writeFile)}function S(w,D,O,z,W){e===1&&_be(c,w);const X=$V(f,w,D,O);if(X)return X;if(!w)if(e===1){let J=[],ie=!1,B,Y=[],ae;for(;ae=p(D,O,z,W);)ie=ie||ae.result.emitSkipped,B=Dn(B,ae.result.diagnostics),Y=Dn(Y,ae.result.emittedFiles),J=Dn(J,ae.result.sourceMaps);return{emitSkipped:ie,diagnostics:B||ze,emittedFiles:Y,sourceMaps:J}}else OMe(c,z);return E.checkDefined(c.program).emit(w,y(D,W),O,z,W)}function T(w,D){for(;;){const O=fbe(c,w,r);let z;if(O)if(O!==c.program){const W=O;if((!D||!D(W))&&(z=qse(c,W,w)),c.seenAffectedFiles.add(W.resolvedPath),c.affectedFilesIndex++,c.buildInfoEmitPending=!0,!z)continue}else z=c.program.getSemanticDiagnostics(void 0,w),c.changedFilesSet.clear(),c.programEmitPending=ty(c.compilerOptions);else return;return{result:z,affected:O}}}function C(w,D){_be(c,w);const O=E.checkDefined(c.program).getCompilerOptions();if(to(O))return E.assert(!c.semanticDiagnosticsPerFile),E.checkDefined(c.program).getSemanticDiagnostics(w,D);if(w)return qse(c,w,D);for(;T(D););let z;for(const W of E.checkDefined(c.program).getSourceFiles())z=Dn(z,qse(c,W,D));return z||ze}}function $se(e,t,r){var i;const s=((i=e.affectedFilesPendingEmit)==null?void 0:i.get(t))||0;(e.affectedFilesPendingEmit??(e.affectedFilesPendingEmit=new Map)).set(t,s|r)}function Xse(e){return ns(e)?{version:e,signature:e,affectsGlobalScope:void 0,impliedFormat:void 0}:ns(e.signature)?e:{version:e.version,signature:e.signature===!1?void 0:e.version,affectsGlobalScope:e.affectsGlobalScope,impliedFormat:e.impliedFormat}}function Qse(e,t){return wh(e)?t:e[1]||8}function Yse(e,t){return e||ty(t||{})}function Zse(e,t,r){var i,s,o,c;const u=e.program,f=qn(is(t,r.getCurrentDirectory())),g=tu(r.useCaseSensitiveFileNames());let p;const y=(i=u.fileNames)==null?void 0:i.map(C);let S;const T=u.latestChangedDtsFile?w(u.latestChangedDtsFile):void 0;if(Hse(u)){const W=new Map;u.fileInfos.forEach((X,J)=>{const ie=D(J+1);W.set(ie,ns(X)?{version:X,signature:void 0,affectsGlobalScope:void 0,impliedFormat:void 0}:X)}),p={fileInfos:W,compilerOptions:u.options?xU(u.options,w):{},latestChangedDtsFile:T,outSignature:u.outSignature,programEmitPending:u.pendingEmit===void 0?void 0:Yse(u.pendingEmit,u.options),bundle:e.bundle}}else{S=(s=u.fileIdsList)==null?void 0:s.map(ie=>new Set(ie.map(D)));const W=new Map,X=(o=u.options)!=null&&o.composite&&!to(u.options)?new Map:void 0;u.fileInfos.forEach((ie,B)=>{const Y=D(B+1),ae=Xse(ie);W.set(Y,ae),X&&ae.signature&&X.set(Y,ae.signature)}),(c=u.emitSignatures)==null||c.forEach(ie=>{if(wh(ie))X.delete(D(ie));else{const B=D(ie[0]);X.set(B,!ns(ie[1])&&!ie[1].length?[X.get(B)]:ie[1])}});const J=u.affectedFilesPendingEmit?ty(u.options||{}):void 0;p={fileInfos:W,compilerOptions:u.options?xU(u.options,w):{},referencedMap:z(u.referencedMap),exportedModulesMap:z(u.exportedModulesMap),semanticDiagnosticsPerFile:u.semanticDiagnosticsPerFile&&Ph(u.semanticDiagnosticsPerFile,ie=>D(wh(ie)?ie:ie[0]),ie=>wh(ie)?ze:ie[1]),hasReusableDiagnostic:!0,affectedFilesPendingEmit:u.affectedFilesPendingEmit&&Ph(u.affectedFilesPendingEmit,ie=>D(wh(ie)?ie:ie[0]),ie=>Qse(ie,J)),changedFilesSet:new Set(Yt(u.changeFileSet,D)),latestChangedDtsFile:T,emitSignatures:X?.size?X:void 0}}return{getState:()=>p,saveEmitState:Ca,restoreEmitState:Ca,getProgram:ys,getProgramOrUndefined:Wy,releaseProgram:Ca,getCompilerOptions:()=>p.compilerOptions,getSourceFile:ys,getSourceFiles:ys,getOptionsDiagnostics:ys,getGlobalDiagnostics:ys,getConfigFileParsingDiagnostics:ys,getSyntacticDiagnostics:ys,getDeclarationDiagnostics:ys,getSemanticDiagnostics:ys,emit:ys,getAllDependencies:ys,getCurrentDirectory:ys,emitNextAffectedFile:ys,getSemanticDiagnosticsOfNextAffectedFile:ys,emitBuildInfo:ys,close:Ca,hasChangedEmitSignature:Kp};function C(W){return fo(W,f,g)}function w(W){return is(W,f)}function D(W){return y[W-1]}function O(W){return S[W-1]}function z(W){if(!W)return;const X=Vp.createManyToManyPathMap();return W.forEach(([J,ie])=>X.set(D(J),O(ie))),X}}function nq(e,t,r){const i=qn(is(t,r.getCurrentDirectory())),s=tu(r.useCaseSensitiveFileNames()),o=new Map;let c=0;const u=[];return e.fileInfos.forEach((f,g)=>{const p=fo(e.fileNames[g],i,s),y=ns(f)?f:f.version;if(o.set(p,y),ce().program,releaseProgram:()=>e().program=void 0,getCompilerOptions:()=>e().compilerOptions,getSourceFile:i=>r().getSourceFile(i),getSourceFiles:()=>r().getSourceFiles(),getOptionsDiagnostics:i=>r().getOptionsDiagnostics(i),getGlobalDiagnostics:i=>r().getGlobalDiagnostics(i),getConfigFileParsingDiagnostics:()=>t,getSyntacticDiagnostics:(i,s)=>r().getSyntacticDiagnostics(i,s),getDeclarationDiagnostics:(i,s)=>r().getDeclarationDiagnostics(i,s),getSemanticDiagnostics:(i,s)=>r().getSemanticDiagnostics(i,s),emit:(i,s,o,c,u)=>r().emit(i,s,o,c,u),emitBuildInfo:(i,s)=>r().emitBuildInfo(i,s),getAllDependencies:ys,getCurrentDirectory:()=>r().getCurrentDirectory(),close:Ca};function r(){return E.checkDefined(e().program)}}var sq,aq,WMe=Nt({"src/compiler/builder.ts"(){"use strict";Ns(),sq=(e=>(e[e.None=0]="None",e[e.Js=1]="Js",e[e.JsMap=2]="JsMap",e[e.JsInlineMap=4]="JsInlineMap",e[e.Dts=8]="Dts",e[e.DtsMap=16]="DtsMap",e[e.AllJs=7]="AllJs",e[e.AllDts=24]="AllDts",e[e.All=31]="All",e))(sq||{}),aq=(e=>(e[e.SemanticDiagnosticsBuilderProgram=0]="SemanticDiagnosticsBuilderProgram",e[e.EmitAndSemanticDiagnosticsBuilderProgram=1]="EmitAndSemanticDiagnosticsBuilderProgram",e))(aq||{})}});function vbe(e,t,r,i,s,o){return rq(0,f9(e,t,r,i,s,o))}function oq(e,t,r,i,s,o){return rq(1,f9(e,t,r,i,s,o))}function bbe(e,t,r,i,s,o){const{newProgram:c,configFileParsingDiagnostics:u}=f9(e,t,r,i,s,o);return iq(()=>({program:c,compilerOptions:c.getCompilerOptions()}),u)}var UMe=Nt({"src/compiler/builderPublic.ts"(){"use strict";Ns()}});function p9(e){return fc(e,"/node_modules/.staging")?sk(e,"/.staging"):ut(tP,t=>e.includes(t))?void 0:e}function Kse(e,t){if(t<=1)return 1;let r=1,i=e[0].search(/[a-zA-Z]:/)===0;if(e[0]!==Co&&!i&&e[1].search(/[a-zA-Z]\$$/)===0){if(t===2)return 2;r=2,i=!0}return i&&!e[r].match(/^users$/i)?r:e[r].match(/^workspaces$/i)?r+1:r+2}function d9(e,t){if(t===void 0&&(t=e.length),t<=2)return!1;const r=Kse(e,t);return t>r+1}function eae(e){return Tbe(qn(e))}function Sbe(e,t){if(t.lengths.length+1?rae(u,c,Math.max(s.length+1,f+1)):{dir:r,dirPath:i,nonRecursive:!0}:xbe(u,c,c.length-1,f,g,s)}function xbe(e,t,r,i,s,o){if(s!==-1)return rae(e,t,s+1);let c=!0,u=r;for(let f=0;fVMe(i,s,o,e,r,t,c)}}function VMe(e,t,r,i,s,o,c){const u=m9(e),f=AC(r,i,s,u,t,o,c);if(!e.getGlobalCache)return f;const g=e.getGlobalCache();if(g!==void 0&&!Tl(r)&&!(f.resolvedModule&&z5(f.resolvedModule.extension))){const{resolvedModule:p,failedLookupLocations:y,affectingLocations:S,resolutionDiagnostics:T}=xie(E.checkDefined(e.globalCacheResolutionModuleName)(r),e.projectName,s,u,g,t);if(p)return f.resolvedModule=p,f.failedLookupLocations=PC(f.failedLookupLocations,y),f.affectingLocations=PC(f.affectingLocations,S),f.resolutionDiagnostics=PC(f.resolutionDiagnostics,T),f}return f}function lq(e,t,r){let i,s,o;const c=of(),u=new Set,f=new Set,g=new Map,p=new Map;let y=!1,S,T,C,w,D,O=!1;const z=Vu(()=>e.getCurrentDirectory()),W=e.getCachedDirectoryStructureHost(),X=new Map,J=wC(z(),e.getCanonicalFileName,e.getCompilationSettings()),ie=new Map,B=vO(z(),e.getCanonicalFileName,e.getCompilationSettings(),J.getPackageJsonInfoCache(),J.optionsToRedirectsKey),Y=new Map,ae=wC(z(),e.getCanonicalFileName,BU(e.getCompilationSettings()),J.getPackageJsonInfoCache()),_e=new Map,$=new Map,H=iae(t,z),K=e.toPath(H),oe=fl(K),Se=new Map;return{rootDirForResolution:t,resolvedModuleNames:X,resolvedTypeReferenceDirectives:ie,resolvedLibraries:Y,resolvedFileToResolution:g,resolutionsWithFailedLookups:u,resolutionsWithOnlyAffectingLocations:f,directoryWatchesOfFailedLookups:_e,fileWatchesOfAffectingLocations:$,watchFailedLookupLocationsOfExternalModuleResolutions:br,getModuleResolutionCache:()=>J,startRecordingFilesWithChangedResolutions:Me,finishRecordingFilesWithChangedResolutions:ke,startCachingPerDirectoryResolution:lt,finishCachingPerDirectoryResolution:me,resolveModuleNameLiterals:Je,resolveTypeReferenceDirectiveReferences:mt,resolveLibrary:ot,resolveSingleModuleNameWithoutWatching:Bt,removeResolutionsFromProjectReferenceRedirects:yr,removeResolutionsOfFile:Tr,hasChangedAutomaticTypeDirectiveNames:()=>y,invalidateResolutionOfFile:Pi,invalidateResolutionsOfFailedLookupLocations:Qs,setFilesWithInvalidatedNonRelativeUnresolvedImports:ji,createHasInvalidatedResolutions:be,isFileWithInvalidatedNonRelativeUnresolvedImports:he,updateTypeRootsWatch:dt,closeTypeRootsWatch:rt,clear:ve,onChangesAffectModuleResolution:Te};function se(we){return we.resolvedModule}function Z(we){return we.resolvedTypeReferenceDirective}function ve(){o_(_e,hf),o_($,hf),c.clear(),rt(),X.clear(),ie.clear(),g.clear(),u.clear(),f.clear(),C=void 0,w=void 0,D=void 0,T=void 0,S=void 0,O=!1,J.clear(),B.clear(),J.update(e.getCompilationSettings()),B.update(e.getCompilationSettings()),ae.clear(),p.clear(),Y.clear(),y=!1}function Te(){O=!0,J.clearAllExceptPackageJsonInfoCache(),B.clearAllExceptPackageJsonInfoCache(),J.update(e.getCompilationSettings()),B.update(e.getCompilationSettings())}function Me(){i=[]}function ke(){const we=i;return i=void 0,we}function he(we){if(!o)return!1;const Be=o.get(we);return!!Be&&!!Be.length}function be(we,Be){Qs();const gt=s;return s=void 0,{hasInvalidatedResolutions:G=>we(G)||O||!!gt?.has(G)||he(G),hasInvalidatedLibResolutions:G=>{var ht;return Be(G)||!!((ht=Y?.get(G))!=null&&ht.isInvalidated)}}}function lt(){J.isReadonly=void 0,B.isReadonly=void 0,ae.isReadonly=void 0,J.getPackageJsonInfoCache().isReadonly=void 0,J.clearAllExceptPackageJsonInfoCache(),B.clearAllExceptPackageJsonInfoCache(),ae.clearAllExceptPackageJsonInfoCache(),c.forEach(Fi),c.clear()}function pt(we){Y.forEach((Be,gt)=>{var G;(G=we?.resolvedLibReferences)!=null&&G.has(gt)||(Qe(Be,e.toPath(i9(e.getCompilationSettings(),z(),gt)),se),Y.delete(gt))})}function me(we,Be){o=void 0,O=!1,c.forEach(Fi),c.clear(),we!==Be&&(pt(we),we?.getSourceFiles().forEach(gt=>{var G;const ht=H_(gt)?((G=gt.packageJsonLocations)==null?void 0:G.length)??0:0,Dt=p.get(gt.path)??ze;for(let Re=Dt.length;Reht)for(let Re=ht;Re{we?.getSourceFileByPath(G)||(gt.forEach(ht=>$.get(ht).files--),p.delete(G))})),_e.forEach(Oe),$.forEach(Xe),y=!1,J.isReadonly=!0,B.isReadonly=!0,ae.isReadonly=!0,J.getPackageJsonInfoCache().isReadonly=!0}function Oe(we,Be){we.refCount===0&&(_e.delete(Be),we.watcher.close())}function Xe(we,Be){var gt;we.files===0&&we.resolutions===0&&!((gt=we.symlinks)!=null&>.size)&&($.delete(Be),we.watcher.close())}function it({entries:we,containingFile:Be,containingSourceFile:gt,redirectedReference:G,options:ht,perFileCache:Dt,reusedNames:Re,loader:st,getResolutionWithResolvedFileName:Ct,deferWatchingNonRelativeResolution:Qt,shouldRetryResolution:er,logChanges:or}){const U=e.toPath(Be),j=Dt.get(U)||Dt.set(U,qT()).get(U),ce=[],ee=or&&he(U),ue=e.getCurrentProgram(),M=ue&&ue.getResolvedProjectReferenceToRedirect(Be),De=M?!G||G.sourceFile.path!==M.sourceFile.path:!!G,Ve=qT();for(const vt of we){const Lt=st.nameAndMode.getName(vt),Wt=st.nameAndMode.getMode(vt,gt);let Lr=j.get(Lt,Wt);if(!Ve.has(Lt,Wt)&&(O||De||!Lr||Lr.isInvalidated||ee&&!Tl(Lt)&&er(Lr))){const Zr=Lr;Lr=st.resolve(Lt,Wt),e.onDiscoveredSymlink&&qMe(Lr)&&e.onDiscoveredSymlink(),j.set(Lt,Wt,Lr),Lr!==Zr&&(br(Lt,Lr,U,Ct,Qt),Zr&&Qe(Zr,U,Ct)),or&&i&&!Fe(Zr,Lr)&&(i.push(U),or=!1)}else{const Zr=m9(e);if(th(ht,Zr)&&!Ve.has(Lt,Wt)){const gn=Ct(Lr);Gi(Zr,Dt===X?gn?.resolvedFileName?gn.packageId?d.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:d.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:d.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:gn?.resolvedFileName?gn.packageId?d.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:d.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:d.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,Lt,Be,gn?.resolvedFileName,gn?.packageId&&z0(gn.packageId))}}E.assert(Lr!==void 0&&!Lr.isInvalidated),Ve.set(Lt,Wt,!0),ce.push(Lr)}return Re?.forEach(vt=>Ve.set(st.nameAndMode.getName(vt),st.nameAndMode.getMode(vt,gt),!0)),j.size()!==Ve.size()&&j.forEach((vt,Lt,Wt)=>{Ve.has(Lt,Wt)||(Qe(vt,U,Ct),j.delete(Lt,Wt))}),ce;function Fe(vt,Lt){if(vt===Lt)return!0;if(!vt||!Lt)return!1;const Wt=Ct(vt),Lr=Ct(Lt);return Wt===Lr?!0:!Wt||!Lr?!1:Wt.resolvedFileName===Lr.resolvedFileName}}function mt(we,Be,gt,G,ht,Dt){return it({entries:we,containingFile:Be,containingSourceFile:ht,redirectedReference:gt,options:G,reusedNames:Dt,perFileCache:ie,loader:r9(Be,gt,G,m9(e),B),getResolutionWithResolvedFileName:Z,shouldRetryResolution:Re=>Re.resolvedTypeReferenceDirective===void 0,deferWatchingNonRelativeResolution:!1})}function Je(we,Be,gt,G,ht,Dt){return it({entries:we,containingFile:Be,containingSourceFile:ht,redirectedReference:gt,options:G,reusedNames:Dt,perFileCache:X,loader:sae(Be,gt,G,e,J),getResolutionWithResolvedFileName:se,shouldRetryResolution:Re=>!Re.resolvedModule||!yE(Re.resolvedModule.extension),logChanges:r,deferWatchingNonRelativeResolution:!0})}function ot(we,Be,gt,G){const ht=m9(e);let Dt=Y?.get(G);if(!Dt||Dt.isInvalidated){const Re=Dt;Dt=bO(we,Be,gt,ht,ae);const st=e.toPath(Be);br(we,Dt,st,se,!1),Y.set(G,Dt),Re&&Qe(Re,st,se)}else if(th(gt,ht)){const Re=se(Dt);Gi(ht,Re?.resolvedFileName?Re.packageId?d.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:d.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:d.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved,we,Be,Re?.resolvedFileName,Re?.packageId&&z0(Re.packageId))}return Dt}function Bt(we,Be){var gt,G;const ht=e.toPath(Be),Dt=X.get(ht),Re=Dt?.get(we,void 0);if(Re&&!Re.isInvalidated)return Re;const st=(gt=e.beforeResolveSingleModuleNameWithoutWatching)==null?void 0:gt.call(e,J),Ct=m9(e),Qt=AC(we,Be,e.getCompilationSettings(),Ct,J);return(G=e.afterResolveSingleModuleNameWithoutWatching)==null||G.call(e,J,we,Be,Qt,st),Qt}function Ht(we){return fc(we,"/node_modules/@types")}function br(we,Be,gt,G,ht){var Dt;if(Be.refCount)Be.refCount++,E.assertIsDefined(Be.files);else{Be.refCount=1,E.assert(!((Dt=Be.files)!=null&&Dt.size)),!ht||Tl(we)?ar(Be):c.add(we,Be);const Re=G(Be);if(Re&&Re.resolvedFileName){const st=e.toPath(Re.resolvedFileName);let Ct=g.get(st);Ct||g.set(st,Ct=new Set),Ct.add(Be)}}(Be.files??(Be.files=new Set)).add(gt)}function zr(we,Be){const gt=e.toPath(we),G=cq(we,gt,H,K,oe,z);if(G){const{dir:ht,dirPath:Dt,nonRecursive:Re}=G;Dt===K?(E.assert(Re),Be=!0):ei(ht,Dt,Re)}return Be}function ar(we){E.assert(!!we.refCount);const{failedLookupLocations:Be,affectingLocations:gt,node10Result:G}=we;if(!Be?.length&&!gt?.length&&!G)return;(Be?.length||G)&&u.add(we);let ht=!1;if(Be)for(const Dt of Be)ht=zr(Dt,ht);G&&(ht=zr(G,ht)),ht&&ei(H,K,!0),Jt(we,!Be?.length&&!G)}function Jt(we,Be){E.assert(!!we.refCount);const{affectingLocations:gt}=we;if(gt?.length){Be&&f.add(we);for(const G of gt)It(G,!0)}}function It(we,Be){const gt=$.get(we);if(gt){Be?gt.resolutions++:gt.files++;return}let G=we,ht=!1,Dt;e.realpath&&(G=e.realpath(we),we!==G&&(ht=!0,Dt=$.get(G)));const Re=Be?1:0,st=Be?0:1;if(!ht||!Dt){const Ct={watcher:tae(e.toPath(G))?e.watchAffectingFileLocation(G,(Qt,er)=>{W?.addOrDeleteFile(Qt,e.toPath(G),er),Nn(G,J.getPackageJsonInfoCache().getInternalMap()),e.scheduleInvalidateResolutionsOfFailedLookupLocations()}):zC,resolutions:ht?0:Re,files:ht?0:st,symlinks:void 0};$.set(G,Ct),ht&&(Dt=Ct)}if(ht){E.assert(!!Dt);const Ct={watcher:{close:()=>{var Qt;const er=$.get(G);(Qt=er?.symlinks)!=null&&Qt.delete(we)&&!er.symlinks.size&&!er.resolutions&&!er.files&&($.delete(G),er.watcher.close())}},resolutions:Re,files:st,symlinks:void 0};$.set(we,Ct),(Dt.symlinks??(Dt.symlinks=new Set)).add(we)}}function Nn(we,Be){var gt;const G=$.get(we);G?.resolutions&&(T??(T=new Set)).add(we),G?.files&&(S??(S=new Set)).add(we),(gt=G?.symlinks)==null||gt.forEach(ht=>Nn(ht,Be)),Be?.delete(e.toPath(we))}function Fi(we,Be){const gt=e.getCurrentProgram();!gt||!gt.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(Be)?we.forEach(ar):we.forEach(G=>Jt(G,!0))}function ei(we,Be,gt){const G=_e.get(Be);G?(E.assert(!!gt==!!G.nonRecursive),G.refCount++):_e.set(Be,{watcher:Dr(we,Be,gt),refCount:1,nonRecursive:gt})}function zi(we,Be,gt){const G=e.toPath(we),ht=cq(we,G,H,K,oe,z);if(ht){const{dirPath:Dt}=ht;Dt===K?Be=!0:ur(Dt,gt)}return Be}function Qe(we,Be,gt,G){if(E.checkDefined(we.files).delete(Be),we.refCount--,we.refCount)return;const ht=gt(we);if(ht&&ht.resolvedFileName){const Ct=e.toPath(ht.resolvedFileName),Qt=g.get(Ct);Qt?.delete(we)&&!Qt.size&&g.delete(Ct)}const{failedLookupLocations:Dt,affectingLocations:Re,node10Result:st}=we;if(u.delete(we)){let Ct=!1;if(Dt)for(const Qt of Dt)Ct=zi(Qt,Ct,G);st&&(Ct=zi(st,Ct,G)),Ct&&ur(K,G)}else Re?.length&&f.delete(we);if(Re)for(const Ct of Re){const Qt=$.get(Ct);Qt.resolutions--,G&&Xe(Qt,Ct)}}function ur(we,Be){const gt=_e.get(we);gt.refCount--,Be&&Oe(gt,we)}function Dr(we,Be,gt){return e.watchDirectoryOfFailedLookupLocation(we,G=>{const ht=e.toPath(G);W&&W.addOrDeleteFileOrDirectory(G,ht),Di(ht,Be===ht)},gt?0:1)}function Ft(we,Be,gt,G){const ht=we.get(Be);ht&&(ht.forEach(Dt=>Qe(Dt,Be,gt,G)),we.delete(Be))}function yr(we){if(!Ho(we,".json"))return;const Be=e.getCurrentProgram();if(!Be)return;const gt=Be.getResolvedProjectReferenceByPath(we);gt&>.commandLine.fileNames.forEach(G=>Tr(e.toPath(G)))}function Tr(we,Be){Ft(X,we,se,Be),Ft(ie,we,Z,Be)}function Xr(we,Be){if(!we)return!1;let gt=!1;return we.forEach(G=>{if(!(G.isInvalidated||!Be(G))){G.isInvalidated=gt=!0;for(const ht of E.checkDefined(G.files))(s??(s=new Set)).add(ht),y=y||fc(ht,jC)}}),gt}function Pi(we){Tr(we);const Be=y;Xr(g.get(we),zg)&&y&&!Be&&e.onChangedAutomaticTypeDirectiveNames()}function ji(we){E.assert(o===we||o===void 0),o=we}function Di(we,Be){if(Be)(D||(D=new Set)).add(we);else{const gt=p9(we);if(!gt||(we=gt,e.fileIsOpen(we)))return!1;const G=qn(we);if(Ht(we)||eI(we)||Ht(G)||eI(G))(C||(C=new Set)).add(we),(w||(w=new Set)).add(we);else{if(Ase(e.getCurrentProgram(),we)||Ho(we,".map"))return!1;(C||(C=new Set)).add(we);const ht=Ow(we,!0);ht&&(w||(w=new Set)).add(ht)}}e.scheduleInvalidateResolutionsOfFailedLookupLocations()}function $i(){const we=J.getPackageJsonInfoCache().getInternalMap();we&&(C||w||D)&&we.forEach((Be,gt)=>Ce(gt)?we.delete(gt):void 0)}function Qs(){var we;if(O)return S=void 0,$i(),(C||w||D||T)&&Xr(Y,Ds),C=void 0,w=void 0,D=void 0,T=void 0,!0;let Be=!1;return S&&((we=e.getCurrentProgram())==null||we.getSourceFiles().forEach(gt=>{ut(gt.packageJsonLocations,G=>S.has(G))&&((s??(s=new Set)).add(gt.path),Be=!0)}),S=void 0),!C&&!w&&!D&&!T||(Be=Xr(u,Ds)||Be,$i(),C=void 0,w=void 0,D=void 0,Be=Xr(f,Ue)||Be,T=void 0),Be}function Ds(we){var Be;return Ue(we)?!0:!C&&!w&&!D?!1:((Be=we.failedLookupLocations)==null?void 0:Be.some(gt=>Ce(e.toPath(gt))))||!!we.node10Result&&Ce(e.toPath(we.node10Result))}function Ce(we){return C?.has(we)||JD(w?.keys()||[],Be=>Qi(we,Be)?!0:void 0)||JD(D?.keys()||[],Be=>we.length>Be.length&&Qi(we,Be)&&(JB(Be)||we[Be.length]===Co)?!0:void 0)}function Ue(we){var Be;return!!T&&((Be=we.affectingLocations)==null?void 0:Be.some(gt=>T.has(gt)))}function rt(){o_(Se,rd)}function ft(we,Be){return fe(we)?e.watchTypeRootsDirectory(Be,gt=>{const G=e.toPath(gt);W&&W.addOrDeleteFileOrDirectory(gt,G),y=!0,e.onChangedAutomaticTypeDirectiveNames();const ht=nae(Be,we,K,oe,z,Dt=>_e.has(Dt));ht&&Di(G,ht===G)},1):zC}function dt(){const we=e.getCompilationSettings();if(we.types){rt();return}const Be=r3(we,{getCurrentDirectory:z});Be?Qk(Se,Ph(Be,gt=>e.toPath(gt)),{createNewValue:ft,onDeleteValue:rd}):rt()}function fe(we){return e.getCompilationSettings().typeRoots?!0:eae(e.toPath(we))}}function qMe(e){var t,r;return!!((t=e.resolvedModule)!=null&&t.originalPath||(r=e.resolvedTypeReferenceDirective)!=null&&r.originalPath)}var HMe=Nt({"src/compiler/resolutionCache.ts"(){"use strict";Ns()}});function tA(e,t){const r=e===Bl&&fae?fae:{getCurrentDirectory:()=>e.getCurrentDirectory(),getNewLine:()=>e.newLine,getCanonicalFileName:tu(e.useCaseSensitiveFileNames)};if(!t)return s=>e.write(BV(s,r));const i=new Array(1);return s=>{i[0]=s,e.write(Ose(i,r)+r.getNewLine()),i[0]=void 0}}function Cbe(e,t,r){return e.clearScreen&&!r.preserveWatchOutput&&!r.extendedDiagnostics&&!r.diagnostics&&_s(S9,t.code)?(e.clearScreen(),!0):!1}function GMe(e,t){return _s(S9,e.code)?t+t:t}function rA(e){return e.now?e.now().toLocaleTimeString("en-US",{timeZone:"UTC"}).replace("\u202F"," "):new Date().toLocaleTimeString()}function aae(e,t){return t?(r,i,s)=>{Cbe(e,r,s);let o=`[${r2(rA(e),"\x1B[90m")}] `;o+=`${Bd(r.messageText,e.newLine)}${i+i}`,e.write(o)}:(r,i,s)=>{let o="";Cbe(e,r,s)||(o+=i),o+=`${rA(e)} - `,o+=`${Bd(r.messageText,e.newLine)}${GMe(r,i)}`,e.write(o)}}function Ebe(e,t,r,i,s,o){const c=s;c.onUnRecoverableConfigFileDiagnostic=f=>wbe(s,o,f);const u=Sw(e,t,c,r,i);return c.onUnRecoverableConfigFileDiagnostic=void 0,u}function g9(e){return Ch(e,t=>t.category===1)}function h9(e){return wn(e,r=>r.category===1).map(r=>{if(r.file!==void 0)return`${r.file.fileName}`}).map(r=>{if(r===void 0)return;const i=kn(e,s=>s.file!==void 0&&s.file.fileName===r);if(i!==void 0){const{line:s}=qa(i.file,i.start);return{fileName:r,line:s+1}}})}function uq(e){return e===1?d.Found_1_error_Watching_for_file_changes:d.Found_0_errors_Watching_for_file_changes}function Dbe(e,t){const r=r2(":"+e.line,"\x1B[90m");return b4(e.fileName)&&b4(t)?mm(t,e.fileName,!1)+r:e.fileName+r}function oae(e,t,r,i){if(e===0)return"";const s=t.filter(p=>p!==void 0),o=s.map(p=>`${p.fileName}:${p.line}`).filter((p,y,S)=>S.indexOf(p)===y),c=s[0]&&Dbe(s[0],i.getCurrentDirectory());let u;e===1?u=t[0]!==void 0?[d.Found_1_error_in_0,c]:[d.Found_1_error]:u=o.length===0?[d.Found_0_errors,e]:o.length===1?[d.Found_0_errors_in_the_same_file_starting_at_Colon_1,e,c]:[d.Found_0_errors_in_1_files,e,o.length];const f=dc(...u),g=o.length>1?$Me(s,i):"";return`${r}${Bd(f.messageText,r)}${r}${r}${g}`}function $Me(e,t){const r=e.filter((y,S,T)=>S===T.findIndex(C=>C?.fileName===y?.fileName));if(r.length===0)return"";const i=y=>Math.log(y)*Math.LOG10E+1,s=r.map(y=>[y,Ch(e,S=>S.fileName===y.fileName)]),o=s.reduce((y,S)=>Math.max(y,S[1]||0),0),c=d.Errors_Files.message,u=c.split(" ")[0].length,f=Math.max(u,i(o)),g=Math.max(i(o)-u,0);let p="";return p+=" ".repeat(g)+c+` +`,s.forEach(y=>{const[S,T]=y,C=Math.log(T)*Math.LOG10E+1|0,w=C{t(i.fileName)})}function fq(e,t){var r,i;const s=e.getFileIncludeReasons(),o=c=>T4(c,e.getCurrentDirectory(),e.getCanonicalFileName);for(const c of e.getSourceFiles())t(`${JC(c,o)}`),(r=s.get(c.path))==null||r.forEach(u=>t(` ${gq(e,u,o).messageText}`)),(i=pq(c,o))==null||i.forEach(u=>t(` ${u.messageText}`))}function pq(e,t){var r;let i;if(e.path!==e.resolvedPath&&(i??(i=[])).push(ps(void 0,d.File_is_output_of_project_reference_source_0,JC(e.originalFileName,t))),e.redirectInfo&&(i??(i=[])).push(ps(void 0,d.File_redirects_to_file_0,JC(e.redirectInfo.redirectTarget,t))),H_(e))switch(e.impliedNodeFormat){case 99:e.packageJsonScope&&(i??(i=[])).push(ps(void 0,d.File_is_ECMAScript_module_because_0_has_field_type_with_value_module,JC(Sa(e.packageJsonLocations),t)));break;case 1:e.packageJsonScope?(i??(i=[])).push(ps(void 0,e.packageJsonScope.contents.packageJsonContent.type?d.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:d.File_is_CommonJS_module_because_0_does_not_have_field_type,JC(Sa(e.packageJsonLocations),t))):(r=e.packageJsonLocations)!=null&&r.length&&(i??(i=[])).push(ps(void 0,d.File_is_CommonJS_module_because_package_json_was_not_found));break}return i}function dq(e,t){var r;const i=e.getCompilerOptions().configFile;if(!((r=i?.configFileSpecs)!=null&&r.validatedFilesSpec))return;const s=e.getCanonicalFileName(t),o=qn(is(i.fileName,e.getCurrentDirectory()));return kn(i.configFileSpecs.validatedFilesSpec,c=>e.getCanonicalFileName(is(c,o))===s)}function mq(e,t){var r,i;const s=e.getCompilerOptions().configFile;if(!((r=s?.configFileSpecs)!=null&&r.validatedIncludeSpecs))return;if(s.configFileSpecs.isDefaultIncludeSpec)return!0;const o=Ho(t,".json"),c=qn(is(s.fileName,e.getCurrentDirectory())),u=e.useCaseSensitiveFileNames();return kn((i=s?.configFileSpecs)==null?void 0:i.validatedIncludeSpecs,f=>{if(o&&!fc(f,".json"))return!1;const g=Wz(f,c,"files");return!!g&&G0(`(${g})$`,u).test(t)})}function gq(e,t,r){var i,s;const o=e.getCompilerOptions();if(T1(t)){const c=y3(e,t),u=MC(c)?c.file.text.substring(c.pos,c.end):`"${c.text}"`;let f;switch(E.assert(MC(c)||t.kind===3,"Only synthetic references are imports"),t.kind){case 3:MC(c)?f=c.packageId?d.Imported_via_0_from_file_1_with_packageId_2:d.Imported_via_0_from_file_1:c.text===X0?f=c.packageId?d.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:d.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:f=c.packageId?d.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:d.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions;break;case 4:E.assert(!c.packageId),f=d.Referenced_via_0_from_file_1;break;case 5:f=c.packageId?d.Type_library_referenced_via_0_from_file_1_with_packageId_2:d.Type_library_referenced_via_0_from_file_1;break;case 7:E.assert(!c.packageId),f=d.Library_referenced_via_0_from_file_1;break;default:E.assertNever(t)}return ps(void 0,f,u,JC(c.file,r),c.packageId&&z0(c.packageId))}switch(t.kind){case 0:if(!((i=o.configFile)!=null&&i.configFileSpecs))return ps(void 0,d.Root_file_specified_for_compilation);const c=is(e.getRootFileNames()[t.index],e.getCurrentDirectory());if(dq(e,c))return ps(void 0,d.Part_of_files_list_in_tsconfig_json);const f=mq(e,c);return ns(f)?ps(void 0,d.Matched_by_include_pattern_0_in_1,f,JC(o.configFile,r)):ps(void 0,f?d.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:d.Root_file_specified_for_compilation);case 1:case 2:const g=t.kind===2,p=E.checkDefined((s=e.getResolvedProjectReferences())==null?void 0:s[t.index]);return ps(void 0,to(o)?g?d.Output_from_referenced_project_0_included_because_1_specified:d.Source_from_referenced_project_0_included_because_1_specified:g?d.Output_from_referenced_project_0_included_because_module_is_specified_as_none:d.Source_from_referenced_project_0_included_because_module_is_specified_as_none,JC(p.sourceFile.fileName,r),o.outFile?"--outFile":"--out");case 8:{const y=o.types?t.packageId?[d.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1,t.typeReference,z0(t.packageId)]:[d.Entry_point_of_type_library_0_specified_in_compilerOptions,t.typeReference]:t.packageId?[d.Entry_point_for_implicit_type_library_0_with_packageId_1,t.typeReference,z0(t.packageId)]:[d.Entry_point_for_implicit_type_library_0,t.typeReference];return ps(void 0,...y)}case 6:{if(t.index!==void 0)return ps(void 0,d.Library_0_specified_in_compilerOptions,o.lib[t.index]);const y=zl(ww.type,(T,C)=>T===Da(o)?C:void 0),S=y?[d.Default_library_for_target_0,y]:[d.Default_library];return ps(void 0,...S)}default:E.assertNever(t)}}function JC(e,t){const r=ns(e)?e:e.fileName;return t?t(r):r}function y9(e,t,r,i,s,o,c,u){const f=!!e.getCompilerOptions().listFilesOnly,g=e.getConfigFileParsingDiagnostics().slice(),p=g.length;Dn(g,e.getSyntacticDiagnostics(void 0,o)),g.length===p&&(Dn(g,e.getOptionsDiagnostics(o)),f||(Dn(g,e.getGlobalDiagnostics(o)),g.length===p&&Dn(g,e.getSemanticDiagnostics(void 0,o))));const y=f?{emitSkipped:!0,diagnostics:ze}:e.emit(void 0,s,o,c,u),{emittedFiles:S,diagnostics:T}=y;Dn(g,T);const C=pk(g);if(C.forEach(t),r){const w=e.getCurrentDirectory();Zt(S,D=>{const O=is(D,w);r(`TSFILE: ${O}`)}),_q(e,r)}return i&&i(g9(C),h9(C)),{emitResult:y,diagnostics:C}}function lae(e,t,r,i,s,o,c,u){const{emitResult:f,diagnostics:g}=y9(e,t,r,i,s,o,c,u);return f.emitSkipped&&g.length>0?1:g.length>0?2:0}function hq(e=Bl,t){return{onWatchStatusChange:t||aae(e),watchFile:Os(e,e.watchFile)||WC,watchDirectory:Os(e,e.watchDirectory)||WC,setTimeout:Os(e,e.setTimeout)||Ca,clearTimeout:Os(e,e.clearTimeout)||Ca}}function yq(e,t){const r=e.trace?t.extendedDiagnostics?2:t.diagnostics?1:0:0,i=r!==0?o=>e.trace(o):Ca,s=FV(e,r,i);return s.writeLog=i,s}function vq(e,t,r=e){const i=e.useCaseSensitiveFileNames(),s={getSourceFile:MV((o,c)=>c?e.readFile(o,c):s.readFile(o),t,void 0),getDefaultLibLocation:Os(e,e.getDefaultLibLocation),getDefaultLibFileName:o=>e.getDefaultLibFileName(o),writeFile:RV((o,c,u)=>e.writeFile(o,c,u),o=>e.createDirectory(o),o=>e.directoryExists(o)),getCurrentDirectory:Vu(()=>e.getCurrentDirectory()),useCaseSensitiveFileNames:()=>i,getCanonicalFileName:tu(i),getNewLine:()=>zh(t()),fileExists:o=>e.fileExists(o),readFile:o=>e.readFile(o),trace:Os(e,e.trace),directoryExists:Os(r,r.directoryExists),getDirectories:Os(r,r.getDirectories),realpath:Os(e,e.realpath),getEnvironmentVariable:Os(e,e.getEnvironmentVariable)||(()=>""),createHash:Os(e,e.createHash),readDirectory:Os(e,e.readDirectory),storeFilesChangingSignatureDuringEmit:e.storeFilesChangingSignatureDuringEmit,jsDocParsingMode:e.jsDocParsingMode};return s}function v9(e,t){if(t.match(cV)){let r=t.length,i=r;for(let s=r-1;s>=0;s--){const o=t.charCodeAt(s);switch(o){case 10:s&&t.charCodeAt(s-1)===13&&s--;case 13:break;default:if(o<127||!mu(o)){i=s;continue}break}const c=t.substring(i,r);if(c.match(OO)){t=t.substring(0,i);break}else if(!c.match(LO))break;r=i}}return(e.createHash||v4)(t)}function b9(e){const t=e.getSourceFile;e.getSourceFile=(...r)=>{const i=t.call(e,...r);return i&&(i.version=v9(e,i.text)),i}}function bq(e,t){const r=Vu(()=>qn(qs(e.getExecutingFilePath())));return{useCaseSensitiveFileNames:()=>e.useCaseSensitiveFileNames,getNewLine:()=>e.newLine,getCurrentDirectory:Vu(()=>e.getCurrentDirectory()),getDefaultLibLocation:r,getDefaultLibFileName:i=>Hn(r(),fP(i)),fileExists:i=>e.fileExists(i),readFile:(i,s)=>e.readFile(i,s),directoryExists:i=>e.directoryExists(i),getDirectories:i=>e.getDirectories(i),readDirectory:(i,s,o,c,u)=>e.readDirectory(i,s,o,c,u),realpath:Os(e,e.realpath),getEnvironmentVariable:Os(e,e.getEnvironmentVariable),trace:i=>e.write(i+e.newLine),createDirectory:i=>e.createDirectory(i),writeFile:(i,s,o)=>e.writeFile(i,s,o),createHash:Os(e,e.createHash),createProgram:t||oq,storeFilesChangingSignatureDuringEmit:e.storeFilesChangingSignatureDuringEmit,now:Os(e,e.now)}}function Pbe(e=Bl,t,r,i){const s=c=>e.write(c+e.newLine),o=bq(e,t);return Sj(o,hq(e,i)),o.afterProgramCreate=c=>{const u=c.getCompilerOptions(),f=zh(u);y9(c,r,s,g=>o.onWatchStatusChange(dc(uq(g),g),f,u,g))},o}function wbe(e,t,r){t(r),e.exit(1)}function uae({configFileName:e,optionsToExtend:t,watchOptionsToExtend:r,extraFileExtensions:i,system:s,createProgram:o,reportDiagnostic:c,reportWatchStatus:u}){const f=c||tA(s),g=Pbe(s,o,f,u);return g.onUnRecoverableConfigFileDiagnostic=p=>wbe(s,f,p),g.configFileName=e,g.optionsToExtend=t,g.watchOptionsToExtend=r,g.extraFileExtensions=i,g}function _ae({rootFiles:e,options:t,watchOptions:r,projectReferences:i,system:s,createProgram:o,reportDiagnostic:c,reportWatchStatus:u}){const f=Pbe(s,o,c||tA(s),u);return f.rootFiles=e,f.options=t,f.watchOptions=r,f.projectReferences=i,f}function Abe(e){const t=e.system||Bl,r=e.host||(e.host=Sq(e.options,t)),i=pae(e),s=lae(i,e.reportDiagnostic||tA(t),o=>r.trace&&r.trace(o),e.reportErrorSummary||e.options.pretty?(o,c)=>t.write(oae(o,c,t.newLine,r)):void 0);return e.afterProgramEmitAndDiagnostics&&e.afterProgramEmitAndDiagnostics(i),s}var fae,S9,zC,WC,al,XMe=Nt({"src/compiler/watch.ts"(){"use strict";Ns(),fae=Bl?{getCurrentDirectory:()=>Bl.getCurrentDirectory(),getNewLine:()=>Bl.newLine,getCanonicalFileName:tu(Bl.useCaseSensitiveFileNames)}:void 0,S9=[d.Starting_compilation_in_watch_mode.code,d.File_change_detected_Starting_incremental_compilation.code],zC={close:Ca},WC=()=>zC,al={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",AffectingFileLocation:"File location affecting resolution",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file",ClosedScriptInfo:"Closed Script info",ConfigFileForInferredRoot:"Config file for the inferred project root",NodeModules:"node_modules for closed script infos and package.jsons affecting module specifier cache",MissingSourceMapFile:"Missing source map file",NoopConfigFileForInferredRoot:"Noop Config file for the inferred project root",MissingGeneratedFile:"Missing generated file",NodeModulesForModuleSpecifierCache:"node_modules for module specifier cache invalidation",TypingInstallerLocationFile:"File location for typing installer",TypingInstallerLocationDirectory:"Directory location for typing installer"}}});function T9(e,t){const r=$h(e);if(!r)return;let i;if(t.getBuildInfo)i=t.getBuildInfo(r,e.configFilePath);else{const s=t.readFile(r);if(!s)return;i=XO(r,s)}if(!(!i||i.version!==Qm||!i.program))return Zse(i,r,t)}function Sq(e,t=Bl){const r=jV(e,void 0,t);return r.createHash=Os(t,t.createHash),r.storeFilesChangingSignatureDuringEmit=t.storeFilesChangingSignatureDuringEmit,b9(r),Yw(r,i=>fo(i,r.getCurrentDirectory(),r.getCanonicalFileName)),r}function pae({rootNames:e,options:t,configFileParsingDiagnostics:r,projectReferences:i,host:s,createProgram:o}){s=s||Sq(t),o=o||oq;const c=T9(t,s);return o(e,t,s,c,r,i)}function Nbe(e,t,r,i,s,o,c,u){return es(e)?_ae({rootFiles:e,options:t,watchOptions:u,projectReferences:c,system:r,createProgram:i,reportDiagnostic:s,reportWatchStatus:o}):uae({configFileName:e,optionsToExtend:t,watchOptionsToExtend:c,extraFileExtensions:u,system:r,createProgram:i,reportDiagnostic:s,reportWatchStatus:o})}function Ibe(e){let t,r,i,s,o,c,u,f,g=e.extendedConfigCache,p=!1;const y=new Map;let S,T=!1;const C=e.useCaseSensitiveFileNames(),w=e.getCurrentDirectory(),{configFileName:D,optionsToExtend:O={},watchOptionsToExtend:z,extraFileExtensions:W,createProgram:X}=e;let{rootFiles:J,options:ie,watchOptions:B,projectReferences:Y}=e,ae,_e,$=!1,H=!1;const K=D===void 0?void 0:YO(e,w,C),oe=K||e,Se=o9(e,oe);let se=br();D&&e.configFileParsingResult&&(Ds(e.configFileParsingResult),se=br()),Qe(d.Starting_compilation_in_watch_mode),D&&!e.configFileParsingResult&&(se=zh(O),E.assert(!J),Qs(),se=br()),E.assert(ie),E.assert(J);const{watchFile:Z,watchDirectory:ve,writeLog:Te}=yq(e,ie),Me=tu(C);Te(`Current directory: ${w} CaseSensitiveFileNames: ${C}`);let ke;D&&(ke=Z(D,Xr,2e3,B,al.ConfigFile));const he=vq(e,()=>ie,oe);b9(he);const be=he.getSourceFile;he.getSourceFile=(Re,...st)=>Nn(Re,zr(Re),...st),he.getSourceFileByPath=Nn,he.getNewLine=()=>se,he.fileExists=It,he.onReleaseOldSourceFile=zi,he.onReleaseParsedCommandLine=rt,he.toPath=zr,he.getCompilationSettings=()=>ie,he.useSourceOfProjectReferenceRedirect=Os(e,e.useSourceOfProjectReferenceRedirect),he.watchDirectoryOfFailedLookupLocation=(Re,st,Ct)=>ve(Re,st,Ct,B,al.FailedLookupLocations),he.watchAffectingFileLocation=(Re,st)=>Z(Re,st,2e3,B,al.AffectingFileLocation),he.watchTypeRootsDirectory=(Re,st,Ct)=>ve(Re,st,Ct,B,al.TypeRoots),he.getCachedDirectoryStructureHost=()=>K,he.scheduleInvalidateResolutionsOfFailedLookupLocations=Ft,he.onInvalidatedResolution=Tr,he.onChangedAutomaticTypeDirectiveNames=Tr,he.fileIsOpen=Kp,he.getCurrentProgram=Je,he.writeLog=Te,he.getParsedCommandLine=Ce;const lt=lq(he,D?qn(is(D,w)):w,!1);he.resolveModuleNameLiterals=Os(e,e.resolveModuleNameLiterals),he.resolveModuleNames=Os(e,e.resolveModuleNames),!he.resolveModuleNameLiterals&&!he.resolveModuleNames&&(he.resolveModuleNameLiterals=lt.resolveModuleNameLiterals.bind(lt)),he.resolveTypeReferenceDirectiveReferences=Os(e,e.resolveTypeReferenceDirectiveReferences),he.resolveTypeReferenceDirectives=Os(e,e.resolveTypeReferenceDirectives),!he.resolveTypeReferenceDirectiveReferences&&!he.resolveTypeReferenceDirectives&&(he.resolveTypeReferenceDirectiveReferences=lt.resolveTypeReferenceDirectiveReferences.bind(lt)),he.resolveLibrary=e.resolveLibrary?e.resolveLibrary.bind(e):lt.resolveLibrary.bind(lt),he.getModuleResolutionCache=e.resolveModuleNameLiterals||e.resolveModuleNames?Os(e,e.getModuleResolutionCache):()=>lt.getModuleResolutionCache();const me=!!e.resolveModuleNameLiterals||!!e.resolveTypeReferenceDirectiveReferences||!!e.resolveModuleNames||!!e.resolveTypeReferenceDirectives?Os(e,e.hasInvalidatedResolutions)||zg:Kp,Oe=e.resolveLibrary?Os(e,e.hasInvalidatedLibResolutions)||zg:Kp;return t=T9(ie,he),ot(),gt(),D&&ht(zr(D),ie,B,al.ExtendedConfigFile),D?{getCurrentProgram:mt,getProgram:ji,close:Xe,getResolutionCache:it}:{getCurrentProgram:mt,getProgram:ji,updateRootFileNames:Ht,close:Xe,getResolutionCache:it};function Xe(){Dr(),lt.clear(),o_(y,Re=>{Re&&Re.fileWatcher&&(Re.fileWatcher.close(),Re.fileWatcher=void 0)}),ke&&(ke.close(),ke=void 0),g?.clear(),g=void 0,f&&(o_(f,hf),f=void 0),s&&(o_(s,hf),s=void 0),i&&(o_(i,rd),i=void 0),u&&(o_(u,Re=>{var st;(st=Re.watcher)==null||st.close(),Re.watcher=void 0,Re.watchedDirectories&&o_(Re.watchedDirectories,hf),Re.watchedDirectories=void 0}),u=void 0)}function it(){return lt}function mt(){return t}function Je(){return t&&t.getProgramOrUndefined()}function ot(){Te("Synchronizing program"),E.assert(ie),E.assert(J),Dr();const Re=mt();T&&(se=br(),Re&&CI(Re.getCompilerOptions(),ie)&<.onChangesAffectModuleResolution());const{hasInvalidatedResolutions:st,hasInvalidatedLibResolutions:Ct}=lt.createHasInvalidatedResolutions(me,Oe),{originalReadFile:Qt,originalFileExists:er,originalDirectoryExists:or,originalCreateDirectory:U,originalWriteFile:j,readFileWithCache:ce}=Yw(he,zr);return HV(Je(),J,ie,ee=>ei(ee,ce),ee=>he.fileExists(ee),st,Ct,ur,Ce,Y)?H&&(p&&Qe(d.File_change_detected_Starting_incremental_compilation),t=X(void 0,void 0,he,t,_e,Y),H=!1):(p&&Qe(d.File_change_detected_Starting_incremental_compilation),Bt(st,Ct)),p=!1,e.afterProgramCreate&&Re!==t&&e.afterProgramCreate(t),he.readFile=Qt,he.fileExists=er,he.directoryExists=or,he.createDirectory=U,he.writeFile=j,t}function Bt(Re,st){Te("CreatingProgramWith::"),Te(` roots: ${JSON.stringify(J)}`),Te(` options: ${JSON.stringify(ie)}`),Y&&Te(` projectReferences: ${JSON.stringify(Y)}`);const Ct=T||!Je();T=!1,H=!1,lt.startCachingPerDirectoryResolution(),he.hasInvalidatedResolutions=Re,he.hasInvalidatedLibResolutions=st,he.hasChangedAutomaticTypeDirectiveNames=ur;const Qt=Je();if(t=X(J,ie,he,t,_e,Y),lt.finishCachingPerDirectoryResolution(t.getProgram(),Qt),IV(t.getProgram(),i||(i=new Map),we),Ct&<.updateTypeRootsWatch(),S){for(const er of S)i.has(er)||y.delete(er);S=void 0}}function Ht(Re){E.assert(!D,"Cannot update root file names with config file watch mode"),J=Re,Tr()}function br(){return zh(ie||O)}function zr(Re){return fo(Re,w,Me)}function ar(Re){return typeof Re=="boolean"}function Jt(Re){return typeof Re.version=="boolean"}function It(Re){const st=zr(Re);return ar(y.get(st))?!1:oe.fileExists(Re)}function Nn(Re,st,Ct,Qt,er){const or=y.get(st);if(ar(or))return;const U=typeof Ct=="object"?Ct.impliedNodeFormat:void 0;if(or===void 0||er||Jt(or)||or.sourceFile.impliedNodeFormat!==U){const j=be(Re,Ct,Qt);if(or)j?(or.sourceFile=j,or.version=j.version,or.fileWatcher||(or.fileWatcher=ft(st,Re,dt,250,B,al.SourceFile))):(or.fileWatcher&&or.fileWatcher.close(),y.set(st,!1));else if(j){const ce=ft(st,Re,dt,250,B,al.SourceFile);y.set(st,{sourceFile:j,version:j.version,fileWatcher:ce})}else y.set(st,!1);return j}return or.sourceFile}function Fi(Re){const st=y.get(Re);st!==void 0&&(ar(st)?y.set(Re,{version:!1}):st.version=!1)}function ei(Re,st){const Ct=y.get(Re);if(!Ct)return;if(Ct.version)return Ct.version;const Qt=st(Re);return Qt!==void 0?v9(he,Qt):void 0}function zi(Re,st,Ct){const Qt=y.get(Re.resolvedPath);Qt!==void 0&&(ar(Qt)?(S||(S=[])).push(Re.path):Qt.sourceFile===Re&&(Qt.fileWatcher&&Qt.fileWatcher.close(),y.delete(Re.resolvedPath),Ct||lt.removeResolutionsOfFile(Re.path)))}function Qe(Re){e.onWatchStatusChange&&e.onWatchStatusChange(dc(Re),se,ie||O)}function ur(){return lt.hasChangedAutomaticTypeDirectiveNames()}function Dr(){return c?(e.clearTimeout(c),c=void 0,!0):!1}function Ft(){if(!e.setTimeout||!e.clearTimeout)return lt.invalidateResolutionsOfFailedLookupLocations();const Re=Dr();Te(`Scheduling invalidateFailedLookup${Re?", Cancelled earlier one":""}`),c=e.setTimeout(yr,250,"timerToInvalidateFailedLookupResolutions")}function yr(){c=void 0,lt.invalidateResolutionsOfFailedLookupLocations()&&Tr()}function Tr(){!e.setTimeout||!e.clearTimeout||(o&&e.clearTimeout(o),Te("Scheduling update"),o=e.setTimeout(Pi,250,"timerToUpdateProgram"))}function Xr(){E.assert(!!D),r=2,Tr()}function Pi(){o=void 0,p=!0,ji()}function ji(){var Re,st,Ct,Qt;switch(r){case 1:(Re=Pu)==null||Re.logStartUpdateProgram("PartialConfigReload"),Di();break;case 2:(st=Pu)==null||st.logStartUpdateProgram("FullConfigReload"),$i();break;default:(Ct=Pu)==null||Ct.logStartUpdateProgram("SynchronizeProgram"),ot();break}return(Qt=Pu)==null||Qt.logStopUpdateProgram("Done"),mt()}function Di(){Te("Reloading new file names and options"),E.assert(ie),E.assert(D),r=0,J=KE(ie.configFile.configFileSpecs,is(qn(D),w),ie,Se,W),oO(J,is(D,w),ie.configFile.configFileSpecs,_e,$)&&(H=!0),ot()}function $i(){E.assert(D),Te(`Reloading config file: ${D}`),r=0,K&&K.clearCache(),Qs(),T=!0,ot(),gt(),ht(zr(D),ie,B,al.ExtendedConfigFile)}function Qs(){E.assert(D),Ds(Sw(D,O,Se,g||(g=new Map),z,W))}function Ds(Re){J=Re.fileNames,ie=Re.options,B=Re.watchOptions,Y=Re.projectReferences,ae=Re.wildcardDirectories,_e=Jb(Re).slice(),$=ZE(Re.raw),H=!0}function Ce(Re){const st=zr(Re);let Ct=u?.get(st);if(Ct){if(!Ct.updateLevel)return Ct.parsedCommandLine;if(Ct.parsedCommandLine&&Ct.updateLevel===1&&!e.getParsedCommandLine){Te("Reloading new file names and options"),E.assert(ie);const er=KE(Ct.parsedCommandLine.options.configFile.configFileSpecs,is(qn(Re),w),ie,Se);return Ct.parsedCommandLine={...Ct.parsedCommandLine,fileNames:er},Ct.updateLevel=void 0,Ct.parsedCommandLine}}Te(`Loading config file: ${Re}`);const Qt=e.getParsedCommandLine?e.getParsedCommandLine(Re):Ue(Re);return Ct?(Ct.parsedCommandLine=Qt,Ct.updateLevel=void 0):(u||(u=new Map)).set(st,Ct={parsedCommandLine:Qt}),Dt(Re,st,Ct),Qt}function Ue(Re){const st=Se.onUnRecoverableConfigFileDiagnostic;Se.onUnRecoverableConfigFileDiagnostic=Ca;const Ct=Sw(Re,void 0,Se,g||(g=new Map),z);return Se.onUnRecoverableConfigFileDiagnostic=st,Ct}function rt(Re){var st;const Ct=zr(Re),Qt=u?.get(Ct);Qt&&(u.delete(Ct),Qt.watchedDirectories&&o_(Qt.watchedDirectories,hf),(st=Qt.watcher)==null||st.close(),NV(Ct,f))}function ft(Re,st,Ct,Qt,er,or){return Z(st,(U,j)=>Ct(U,j,Re),Qt,er,or)}function dt(Re,st,Ct){fe(Re,Ct,st),st===2&&y.has(Ct)&<.invalidateResolutionOfFile(Ct),Fi(Ct),Tr()}function fe(Re,st,Ct){K&&K.addOrDeleteFile(Re,st,Ct)}function we(Re){return u?.has(Re)?zC:ft(Re,Re,Be,500,B,al.MissingFile)}function Be(Re,st,Ct){fe(Re,Ct,st),st===0&&i.has(Ct)&&(i.get(Ct).close(),i.delete(Ct),Fi(Ct),Tr())}function gt(){ae?$w(s||(s=new Map),new Map(Object.entries(ae)),G):s&&o_(s,hf)}function G(Re,st){return ve(Re,Ct=>{E.assert(D),E.assert(ie);const Qt=zr(Ct);K&&K.addOrDeleteFileOrDirectory(Ct,Qt),Fi(Qt),!Xw({watchedDirPath:zr(Re),fileOrDirectory:Ct,fileOrDirectoryPath:Qt,configFileName:D,extraFileExtensions:W,options:ie,program:mt()||J,currentDirectory:w,useCaseSensitiveFileNames:C,writeLog:Te,toPath:zr})&&r!==2&&(r=1,Tr())},st,B,al.WildcardDirectory)}function ht(Re,st,Ct,Qt){ZO(Re,st,f||(f=new Map),(er,or)=>Z(er,(U,j)=>{var ce;fe(er,or,j),g&&KO(g,or,zr);const ee=(ce=f.get(or))==null?void 0:ce.projects;ee?.size&&ee.forEach(ue=>{if(D&&zr(D)===ue)r=2;else{const M=u?.get(ue);M&&(M.updateLevel=2),lt.removeResolutionsFromProjectReferenceRedirects(ue)}Tr()})},2e3,Ct,Qt),zr)}function Dt(Re,st,Ct){var Qt,er,or,U,j;Ct.watcher||(Ct.watcher=Z(Re,(ce,ee)=>{fe(Re,st,ee);const ue=u?.get(st);ue&&(ue.updateLevel=2),lt.removeResolutionsFromProjectReferenceRedirects(st),Tr()},2e3,((Qt=Ct.parsedCommandLine)==null?void 0:Qt.watchOptions)||B,al.ConfigFileOfReferencedProject)),(er=Ct.parsedCommandLine)!=null&&er.wildcardDirectories?$w(Ct.watchedDirectories||(Ct.watchedDirectories=new Map),new Map(Object.entries((or=Ct.parsedCommandLine)==null?void 0:or.wildcardDirectories)),(ce,ee)=>{var ue;return ve(ce,M=>{const De=zr(M);K&&K.addOrDeleteFileOrDirectory(M,De),Fi(De);const Ve=u?.get(st);Ve?.parsedCommandLine&&(Xw({watchedDirPath:zr(ce),fileOrDirectory:M,fileOrDirectoryPath:De,configFileName:Re,options:Ve.parsedCommandLine.options,program:Ve.parsedCommandLine.fileNames,currentDirectory:w,useCaseSensitiveFileNames:C,writeLog:Te,toPath:zr})||Ve.updateLevel!==2&&(Ve.updateLevel=1,Tr()))},ee,((ue=Ct.parsedCommandLine)==null?void 0:ue.watchOptions)||B,al.WildcardDirectoryOfReferencedProject)}):Ct.watchedDirectories&&(o_(Ct.watchedDirectories,hf),Ct.watchedDirectories=void 0),ht(st,(U=Ct.parsedCommandLine)==null?void 0:U.options,((j=Ct.parsedCommandLine)==null?void 0:j.watchOptions)||B,al.ExtendedConfigOfReferencedProject)}}var QMe=Nt({"src/compiler/watchPublic.ts"(){"use strict";Ns()}});function Tq(e){return Ho(e,".json")?e:Hn(e,"tsconfig.json")}var xq,YMe=Nt({"src/compiler/tsbuild.ts"(){"use strict";Ns(),xq=(e=>(e[e.Unbuildable=0]="Unbuildable",e[e.UpToDate=1]="UpToDate",e[e.UpToDateWithUpstreamTypes=2]="UpToDateWithUpstreamTypes",e[e.OutOfDateWithPrepend=3]="OutOfDateWithPrepend",e[e.OutputMissing=4]="OutputMissing",e[e.ErrorReadingFile=5]="ErrorReadingFile",e[e.OutOfDateWithSelf=6]="OutOfDateWithSelf",e[e.OutOfDateWithUpstream=7]="OutOfDateWithUpstream",e[e.OutOfDateBuildInfo=8]="OutOfDateBuildInfo",e[e.OutOfDateOptions=9]="OutOfDateOptions",e[e.OutOfDateRoots=10]="OutOfDateRoots",e[e.UpstreamOutOfDate=11]="UpstreamOutOfDate",e[e.UpstreamBlocked=12]="UpstreamBlocked",e[e.ComputingUpstream=13]="ComputingUpstream",e[e.TsVersionOutputOfDate=14]="TsVersionOutputOfDate",e[e.UpToDateWithInputFileText=15]="UpToDateWithInputFileText",e[e.ContainerOnly=16]="ContainerOnly",e[e.ForceBuild=17]="ForceBuild",e))(xq||{})}});function ZMe(e,t,r){const i=e.get(t);let s;return i||(s=r(),e.set(t,s)),i||s}function dae(e,t){return ZMe(e,t,()=>new Map)}function nA(e){return e.now?e.now():new Date}function YT(e){return!!e&&!!e.buildOrder}function x9(e){return YT(e)?e.buildOrder:e}function mae(e,t){return r=>{let i=t?`[${r2(rA(e),"\x1B[90m")}] `:`${rA(e)} - `;i+=`${Bd(r.messageText,e.newLine)}${e.newLine+e.newLine}`,e.write(i)}}function Fbe(e,t,r,i){const s=bq(e,t);return s.getModifiedTime=e.getModifiedTime?o=>e.getModifiedTime(o):Wy,s.setModifiedTime=e.setModifiedTime?(o,c)=>e.setModifiedTime(o,c):Ca,s.deleteFile=e.deleteFile?o=>e.deleteFile(o):Ca,s.reportDiagnostic=r||tA(e),s.reportSolutionBuilderStatus=i||mae(e),s.now=Os(e,e.now),s}function Obe(e=Bl,t,r,i,s){const o=Fbe(e,t,r,i);return o.reportErrorSummary=s,o}function Lbe(e=Bl,t,r,i,s){const o=Fbe(e,t,r,i),c=hq(e,s);return Sj(o,c),o}function KMe(e){const t={};return Pw.forEach(r=>{Ya(e,r.name)&&(t[r.name]=e[r.name])}),t}function Mbe(e,t,r){return aSe(!1,e,t,r)}function Rbe(e,t,r,i){return aSe(!0,e,t,r,i)}function eRe(e,t,r,i,s){const o=t,c=t,u=KMe(i),f=vq(o,()=>w.projectCompilerOptions);b9(f),f.getParsedCommandLine=D=>ZT(w,D,Jd(w,D)),f.resolveModuleNameLiterals=Os(o,o.resolveModuleNameLiterals),f.resolveTypeReferenceDirectiveReferences=Os(o,o.resolveTypeReferenceDirectiveReferences),f.resolveLibrary=Os(o,o.resolveLibrary),f.resolveModuleNames=Os(o,o.resolveModuleNames),f.resolveTypeReferenceDirectives=Os(o,o.resolveTypeReferenceDirectives),f.getModuleResolutionCache=Os(o,o.getModuleResolutionCache);let g,p;!f.resolveModuleNameLiterals&&!f.resolveModuleNames&&(g=wC(f.getCurrentDirectory(),f.getCanonicalFileName),f.resolveModuleNameLiterals=(D,O,z,W,X)=>Zw(D,O,z,W,X,o,g,UV),f.getModuleResolutionCache=()=>g),!f.resolveTypeReferenceDirectiveReferences&&!f.resolveTypeReferenceDirectives&&(p=vO(f.getCurrentDirectory(),f.getCanonicalFileName,void 0,g?.getPackageJsonInfoCache(),g?.optionsToRedirectsKey),f.resolveTypeReferenceDirectiveReferences=(D,O,z,W,X)=>Zw(D,O,z,W,X,o,p,r9));let y;f.resolveLibrary||(y=wC(f.getCurrentDirectory(),f.getCanonicalFileName,void 0,g?.getPackageJsonInfoCache()),f.resolveLibrary=(D,O,z)=>bO(D,O,z,o,y)),f.getBuildInfo=(D,O)=>Ybe(w,D,Jd(w,O),void 0);const{watchFile:S,watchDirectory:T,writeLog:C}=yq(c,i),w={host:o,hostWithWatch:c,parseConfigFileHost:o9(o),write:Os(o,o.trace),options:i,baseCompilerOptions:u,rootNames:r,baseWatchOptions:s,resolvedConfigFilePaths:new Map,configFileCache:new Map,projectStatus:new Map,extendedConfigCache:new Map,buildInfoCache:new Map,outputTimeStamps:new Map,builderPrograms:new Map,diagnostics:new Map,projectPendingBuild:new Map,projectErrorsReported:new Map,compilerHost:f,moduleResolutionCache:g,typeReferenceDirectiveResolutionCache:p,libraryResolutionCache:y,buildOrder:void 0,readFileWithCache:D=>o.readFile(D),projectCompilerOptions:u,cache:void 0,allProjectBuildPending:!0,needsSummary:!0,watchAllProjectsPending:e,watch:e,allWatchedWildcardDirectories:new Map,allWatchedInputFiles:new Map,allWatchedConfigFiles:new Map,allWatchedExtendedConfigFiles:new Map,allWatchedPackageJsonFiles:new Map,filesWatched:new Map,lastCachedPackageJsonLookups:new Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:!1,watchFile:S,watchDirectory:T,writeLog:C};return w}function Z_(e,t){return fo(t,e.compilerHost.getCurrentDirectory(),e.compilerHost.getCanonicalFileName)}function Jd(e,t){const{resolvedConfigFilePaths:r}=e,i=r.get(t);if(i!==void 0)return i;const s=Z_(e,t);return r.set(t,s),s}function jbe(e){return!!e.options}function tRe(e,t){const r=e.configFileCache.get(t);return r&&jbe(r)?r:void 0}function ZT(e,t,r){const{configFileCache:i}=e,s=i.get(r);if(s)return jbe(s)?s:void 0;ko("SolutionBuilder::beforeConfigFileParsing");let o;const{parseConfigFileHost:c,baseCompilerOptions:u,baseWatchOptions:f,extendedConfigCache:g,host:p}=e;let y;return p.getParsedCommandLine?(y=p.getParsedCommandLine(t),y||(o=dc(d.File_0_not_found,t))):(c.onUnRecoverableConfigFileDiagnostic=S=>o=S,y=Sw(t,u,c,g,f),c.onUnRecoverableConfigFileDiagnostic=Ca),i.set(r,y||o),ko("SolutionBuilder::afterConfigFileParsing"),cf("SolutionBuilder::Config file parsing","SolutionBuilder::beforeConfigFileParsing","SolutionBuilder::afterConfigFileParsing"),y}function v3(e,t){return Tq(I0(e.compilerHost.getCurrentDirectory(),t))}function Bbe(e,t){const r=new Map,i=new Map,s=[];let o,c;for(const f of t)u(f);return c?{buildOrder:o||ze,circularDiagnostics:c}:o||ze;function u(f,g){const p=Jd(e,f);if(i.has(p))return;if(r.has(p)){g||(c||(c=[])).push(dc(d.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,s.join(`\r +`)));return}r.set(p,!0),s.push(f);const y=ZT(e,f,p);if(y&&y.projectReferences)for(const S of y.projectReferences){const T=v3(e,S.path);u(T,g||S.circular)}s.pop(),i.set(p,!0),(o||(o=[])).push(f)}}function k9(e){return e.buildOrder||rRe(e)}function rRe(e){const t=Bbe(e,e.rootNames.map(s=>v3(e,s)));e.resolvedConfigFilePaths.clear();const r=new Map(x9(t).map(s=>[Jd(e,s),!0])),i={onDeleteValue:Ca};return Xg(e.configFileCache,r,i),Xg(e.projectStatus,r,i),Xg(e.builderPrograms,r,i),Xg(e.diagnostics,r,i),Xg(e.projectPendingBuild,r,i),Xg(e.projectErrorsReported,r,i),Xg(e.buildInfoCache,r,i),Xg(e.outputTimeStamps,r,i),e.watch&&(Xg(e.allWatchedConfigFiles,r,{onDeleteValue:rd}),e.allWatchedExtendedConfigFiles.forEach(s=>{s.projects.forEach(o=>{r.has(o)||s.projects.delete(o)}),s.close()}),Xg(e.allWatchedWildcardDirectories,r,{onDeleteValue:s=>s.forEach(hf)}),Xg(e.allWatchedInputFiles,r,{onDeleteValue:s=>s.forEach(rd)}),Xg(e.allWatchedPackageJsonFiles,r,{onDeleteValue:s=>s.forEach(rd)})),e.buildOrder=t}function Jbe(e,t,r){const i=t&&v3(e,t),s=k9(e);if(YT(s))return s;if(i){const c=Jd(e,i);if(Dc(s,f=>Jd(e,f)===c)===-1)return}const o=i?Bbe(e,[i]):s;return E.assert(!YT(o)),E.assert(!r||i!==void 0),E.assert(!r||o[o.length-1]===i),r?o.slice(0,o.length-1):o}function zbe(e){e.cache&&gae(e);const{compilerHost:t,host:r}=e,i=e.readFileWithCache,s=t.getSourceFile,{originalReadFile:o,originalFileExists:c,originalDirectoryExists:u,originalCreateDirectory:f,originalWriteFile:g,getSourceFileWithCache:p,readFileWithCache:y}=Yw(r,S=>Z_(e,S),(...S)=>s.call(t,...S));e.readFileWithCache=y,t.getSourceFile=p,e.cache={originalReadFile:o,originalFileExists:c,originalDirectoryExists:u,originalCreateDirectory:f,originalWriteFile:g,originalReadFileWithCache:i,originalGetSourceFile:s}}function gae(e){if(!e.cache)return;const{cache:t,host:r,compilerHost:i,extendedConfigCache:s,moduleResolutionCache:o,typeReferenceDirectiveResolutionCache:c,libraryResolutionCache:u}=e;r.readFile=t.originalReadFile,r.fileExists=t.originalFileExists,r.directoryExists=t.originalDirectoryExists,r.createDirectory=t.originalCreateDirectory,r.writeFile=t.originalWriteFile,i.getSourceFile=t.originalGetSourceFile,e.readFileWithCache=t.originalReadFileWithCache,s.clear(),o?.clear(),c?.clear(),u?.clear(),e.cache=void 0}function Wbe(e,t){e.projectStatus.delete(t),e.diagnostics.delete(t)}function Ube({projectPendingBuild:e},t,r){const i=e.get(t);(i===void 0||ie.projectPendingBuild.set(Jd(e,i),0)),t&&t.throwIfCancellationRequested()}function qbe(e,t){return e.projectPendingBuild.delete(t),e.diagnostics.has(t)?1:0}function nRe(e,t,r,i,s){let o=!0;return{kind:2,project:t,projectPath:r,buildOrder:s,getCompilerOptions:()=>i.options,getCurrentDirectory:()=>e.compilerHost.getCurrentDirectory(),updateOutputFileStatmps:()=>{Kbe(e,i,r),o=!1},done:()=>(o&&Kbe(e,i,r),ko("SolutionBuilder::Timestamps only updates"),qbe(e,r))}}function Hbe(e,t,r,i,s,o,c){let u=e===0?0:4,f,g,p;return e===0?{kind:e,project:r,projectPath:i,buildOrder:c,getCompilerOptions:()=>o.options,getCurrentDirectory:()=>t.compilerHost.getCurrentDirectory(),getBuilderProgram:()=>S(To),getProgram:()=>S(B=>B.getProgramOrUndefined()),getSourceFile:B=>S(Y=>Y.getSourceFile(B)),getSourceFiles:()=>T(B=>B.getSourceFiles()),getOptionsDiagnostics:B=>T(Y=>Y.getOptionsDiagnostics(B)),getGlobalDiagnostics:B=>T(Y=>Y.getGlobalDiagnostics(B)),getConfigFileParsingDiagnostics:()=>T(B=>B.getConfigFileParsingDiagnostics()),getSyntacticDiagnostics:(B,Y)=>T(ae=>ae.getSyntacticDiagnostics(B,Y)),getAllDependencies:B=>T(Y=>Y.getAllDependencies(B)),getSemanticDiagnostics:(B,Y)=>T(ae=>ae.getSemanticDiagnostics(B,Y)),getSemanticDiagnosticsOfNextAffectedFile:(B,Y)=>S(ae=>ae.getSemanticDiagnosticsOfNextAffectedFile&&ae.getSemanticDiagnosticsOfNextAffectedFile(B,Y)),emit:(B,Y,ae,_e,$)=>{if(B||_e)return S(H=>{var K,oe;return H.emit(B,Y,ae,_e,$||((oe=(K=t.host).getCustomTransformers)==null?void 0:oe.call(K,r)))});if(ie(2,ae),u===5)return W(Y,ae);if(u===3)return z(Y,ae,$)},done:y}:{kind:e,project:r,projectPath:i,buildOrder:c,getCompilerOptions:()=>o.options,getCurrentDirectory:()=>t.compilerHost.getCurrentDirectory(),emit:(B,Y)=>u!==4?p:J(B,Y),done:y};function y(B,Y,ae){return ie(8,B,Y,ae),ko(e===0?"SolutionBuilder::Projects built":"SolutionBuilder::Bundles updated"),qbe(t,i)}function S(B){return ie(0),f&&B(f)}function T(B){return S(B)||ze}function C(){var B,Y;if(E.assert(f===void 0),t.options.dry){Gu(t,d.A_non_dry_build_would_build_project_0,r),g=1,u=7;return}if(t.options.verbose&&Gu(t,d.Building_project_0,r),o.fileNames.length===0){b3(t,i,Jb(o)),g=0,u=7;return}const{host:ae,compilerHost:_e}=t;t.projectCompilerOptions=o.options,(B=t.moduleResolutionCache)==null||B.update(o.options),(Y=t.typeReferenceDirectiveResolutionCache)==null||Y.update(o.options),f=ae.createProgram(o.fileNames,o.options,_e,sRe(t,i,o),Jb(o),o.projectReferences),t.watch&&(t.lastCachedPackageJsonLookups.set(i,t.moduleResolutionCache&&Yt(t.moduleResolutionCache.getPackageJsonInfoCache().entries(),([$,H])=>[t.host.realpath&&H?Z_(t,t.host.realpath($)):$,H])),t.builderPrograms.set(i,f)),u++}function w(B,Y,ae){B.length?{buildResult:g,step:u}=vae(t,i,f,o,B,Y,ae):u++}function D(B){E.assertIsDefined(f),w([...f.getConfigFileParsingDiagnostics(),...f.getOptionsDiagnostics(B),...f.getGlobalDiagnostics(B),...f.getSyntacticDiagnostics(void 0,B)],8,"Syntactic")}function O(B){w(E.checkDefined(f).getSemanticDiagnostics(void 0,B),16,"Semantic")}function z(B,Y,ae){var _e,$,H;E.assertIsDefined(f),E.assert(u===3);const K=f.saveEmitState();let oe;const Se=Oe=>(oe||(oe=[])).push(Oe),se=[],{emitResult:Z}=y9(f,Se,void 0,void 0,(Oe,Xe,it,mt,Je,ot)=>se.push({name:Oe,text:Xe,writeByteOrderMark:it,data:ot}),Y,!1,ae||(($=(_e=t.host).getCustomTransformers)==null?void 0:$.call(_e,r)));if(oe)return f.restoreEmitState(K),{buildResult:g,step:u}=vae(t,i,f,o,oe,32,"Declaration file"),{emitSkipped:!0,diagnostics:Z.diagnostics};const{host:ve,compilerHost:Te}=t,Me=(H=f.hasChangedEmitSignature)!=null&&H.call(f)?0:2,ke=qk(),he=new Map,be=f.getCompilerOptions(),lt=w8(be);let pt,me;return se.forEach(({name:Oe,text:Xe,writeByteOrderMark:it,data:mt})=>{const Je=Z_(t,Oe);he.set(Z_(t,Oe),Oe),mt?.buildInfo&&Sae(t,mt.buildInfo,i,be,Me);const ot=mt?.differsOnlyInMap?YS(t.host,Oe):void 0;rE(B?{writeFile:B}:Te,ke,Oe,Xe,it),mt?.differsOnlyInMap?t.host.setModifiedTime(Oe,ot):!lt&&t.watch&&(pt||(pt=bae(t,i))).set(Je,me||(me=nA(t.host)))}),X(ke,he,se.length?se[0].name:PV(o,!ve.useCaseSensitiveFileNames()),Me),Z}function W(B,Y){E.assertIsDefined(f),E.assert(u===5);const ae=f.emitBuildInfo((_e,$,H,K,oe,Se)=>{Se?.buildInfo&&Sae(t,Se.buildInfo,i,f.getCompilerOptions(),2),B?B(_e,$,H,K,oe,Se):t.compilerHost.writeFile(_e,$,H,K,oe,Se)},Y);return ae.diagnostics.length&&(E9(t,ae.diagnostics),t.diagnostics.set(i,[...t.diagnostics.get(i),...ae.diagnostics]),g=64&g),ae.emittedFiles&&t.write&&ae.emittedFiles.forEach(_e=>Xbe(t,o,_e)),yae(t,f,o),u=7,ae}function X(B,Y,ae,_e){const $=B.getDiagnostics();return $.length?({buildResult:g,step:u}=vae(t,i,f,o,$,64,"Emit"),$):(t.write&&Y.forEach(H=>Xbe(t,o,H)),Zbe(t,o,i,d.Updating_unchanged_output_timestamps_of_project_0,Y),t.diagnostics.delete(i),t.projectStatus.set(i,{type:1,oldestOutputFileName:ae}),yae(t,f,o),u=7,g=_e,$)}function J(B,Y){var ae,_e,$,H;if(E.assert(e===1),t.options.dry){Gu(t,d.A_non_dry_build_would_update_output_of_project_0,r),g=1,u=7;return}t.options.verbose&&Gu(t,d.Updating_output_of_project_0,r);const{compilerHost:K}=t;t.projectCompilerOptions=o.options,(_e=(ae=t.host).beforeEmitBundle)==null||_e.call(ae,o);const oe=Pse(o,K,Me=>{const ke=v3(t,Me.path);return ZT(t,ke,Jd(t,ke))},Y||((H=($=t.host).getCustomTransformers)==null?void 0:H.call($,r)));if(ns(oe))return Gu(t,d.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1,r,Fl(t,oe)),u=6,p=Hbe(0,t,r,i,s,o,c);E.assert(!!oe.length);const Se=qk(),se=new Map;let Z=2;const ve=t.buildInfoCache.get(i).buildInfo||void 0;return oe.forEach(({name:Me,text:ke,writeByteOrderMark:he,data:be})=>{var lt,pt;se.set(Z_(t,Me),Me),be?.buildInfo&&(((lt=be.buildInfo.program)==null?void 0:lt.outSignature)!==((pt=ve?.program)==null?void 0:pt.outSignature)&&(Z&=-3),Sae(t,be.buildInfo,i,o.options,Z)),rE(B?{writeFile:B}:K,Se,Me,ke,he)}),{emitSkipped:!1,diagnostics:X(Se,se,oe[0].name,Z)}}function ie(B,Y,ae,_e){for(;u<=B&&u<8;){const $=u;switch(u){case 0:C();break;case 1:D(Y);break;case 2:O(Y);break;case 3:z(ae,Y,_e);break;case 5:W(ae,Y);break;case 4:J(ae,_e);break;case 6:E.checkDefined(p).done(Y,ae,_e),u=8;break;case 7:lRe(t,r,i,s,o,c,E.checkDefined(g)),u++;break;case 8:default:}E.assert(u>$)}}}function iRe({options:e},t,r){return t.type!==3||e.force?!0:r.fileNames.length===0||!!Jb(r).length||!w8(r.options)}function Gbe(e,t,r){if(!e.projectPendingBuild.size||YT(t))return;const{options:i,projectPendingBuild:s}=e;for(let o=0;o{const T=E.checkDefined(e.filesWatched.get(u));E.assert(kq(T)),T.modifiedTime=S,T.callbacks.forEach(C=>C(p,y,S))},i,s,o,c);e.filesWatched.set(u,{callbacks:[r],watcher:g,modifiedTime:f})}return{close:()=>{const g=E.checkDefined(e.filesWatched.get(u));E.assert(kq(g)),g.callbacks.length===1?(e.filesWatched.delete(u),hf(g)):X2(g.callbacks,r)}}}function bae(e,t){if(!e.watch)return;let r=e.outputTimeStamps.get(t);return r||e.outputTimeStamps.set(t,r=new Map),r}function Sae(e,t,r,i,s){const o=$h(i),c=Tae(e,o,r),u=nA(e.host);c?(c.buildInfo=t,c.modifiedTime=u,s&2||(c.latestChangedDtsTime=u)):e.buildInfoCache.set(r,{path:Z_(e,o),buildInfo:t,modifiedTime:u,latestChangedDtsTime:s&2?void 0:u})}function Tae(e,t,r){const i=Z_(e,t),s=e.buildInfoCache.get(r);return s?.path===i?s:void 0}function Ybe(e,t,r,i){const s=Z_(e,t),o=e.buildInfoCache.get(r);if(o!==void 0&&o.path===s)return o.buildInfo||void 0;const c=e.readFileWithCache(t),u=c?XO(t,c):void 0;return e.buildInfoCache.set(r,{path:s,buildInfo:u||!1,modifiedTime:i||Zm}),u}function xae(e,t,r,i){const s=Qbe(e,t);if(rw&&(C=ae,w=_e),S&&O.add(Z_(e,ae))}if(S){T||(T=nq(S,f,u));for(const ae of T.roots)if(!O.has(ae))return{type:10,buildInfoFile:f,inputFile:ae}}if(!f){const ae=GO(t,!u.useCaseSensitiveFileNames()),_e=bae(e,r);for(const $ of ae){const H=Z_(e,$);let K=_e?.get(H);if(K||(K=YS(e.host,$),_e?.set(H,K)),K===Zm)return{type:4,missingOutputFileName:$};if(Kxae(e,ae,p,g));if(B)return B;const Y=Zt(e.lastCachedPackageJsonLookups.get(r)||ze,([ae])=>xae(e,ae,p,g));return Y||(X&&W?{type:3,outOfDateOutputFileName:g,newerProjectName:J}:{type:W?2:D?15:1,newestInputFileTime:w,newestInputFileName:C,oldestOutputFileName:g})}function oRe(e,t,r){return e.buildInfoCache.get(r).path===t.path}function kae(e,t,r){if(t===void 0)return{type:0,reason:"File deleted mid-build"};const i=e.projectStatus.get(r);if(i!==void 0)return i;ko("SolutionBuilder::beforeUpToDateCheck");const s=aRe(e,t,r);return ko("SolutionBuilder::afterUpToDateCheck"),cf("SolutionBuilder::Up-to-date check","SolutionBuilder::beforeUpToDateCheck","SolutionBuilder::afterUpToDateCheck"),e.projectStatus.set(r,s),s}function Zbe(e,t,r,i,s){if(t.options.noEmit)return;let o;const c=$h(t.options);if(c){s?.has(Z_(e,c))||(e.options.verbose&&Gu(e,i,t.options.configFilePath),e.host.setModifiedTime(c,o=nA(e.host)),Tae(e,c,r).modifiedTime=o),e.outputTimeStamps.delete(r);return}const{host:u}=e,f=GO(t,!u.useCaseSensitiveFileNames()),g=bae(e,r),p=g?new Set:void 0;if(!s||f.length!==s.size){let y=!!e.options.verbose;for(const S of f){const T=Z_(e,S);s?.has(T)||(y&&(y=!1,Gu(e,i,t.options.configFilePath)),u.setModifiedTime(S,o||(o=nA(e.host))),g&&(g.set(T,o),p.add(T)))}}g?.forEach((y,S)=>{!s?.has(S)&&!p.has(S)&&g.delete(S)})}function cRe(e,t,r){if(!t.composite)return;const i=E.checkDefined(e.buildInfoCache.get(r));if(i.latestChangedDtsTime!==void 0)return i.latestChangedDtsTime||void 0;const s=i.buildInfo&&i.buildInfo.program&&i.buildInfo.program.latestChangedDtsFile?e.host.getModifiedTime(is(i.buildInfo.program.latestChangedDtsFile,qn(i.path))):void 0;return i.latestChangedDtsTime=s||!1,s}function Kbe(e,t,r){if(e.options.dry)return Gu(e,d.A_non_dry_build_would_update_timestamps_for_output_of_project_0,t.options.configFilePath);Zbe(e,t,r,d.Updating_output_timestamps_of_project_0),e.projectStatus.set(r,{type:1,oldestOutputFileName:PV(t,!e.host.useCaseSensitiveFileNames())})}function lRe(e,t,r,i,s,o,c){if(!(c&124)&&s.options.composite)for(let u=i+1;ue.diagnostics.has(Jd(e,g)))?f?2:1:0}function tSe(e,t,r){ko("SolutionBuilder::beforeClean");const i=_Re(e,t,r);return ko("SolutionBuilder::afterClean"),cf("SolutionBuilder::Clean","SolutionBuilder::beforeClean","SolutionBuilder::afterClean"),i}function _Re(e,t,r){const i=Jbe(e,t,r);if(!i)return 3;if(YT(i))return E9(e,i.circularDiagnostics),4;const{options:s,host:o}=e,c=s.dry?[]:void 0;for(const u of i){const f=Jd(e,u),g=ZT(e,u,f);if(g===void 0){oSe(e,f);continue}const p=GO(g,!o.useCaseSensitiveFileNames());if(!p.length)continue;const y=new Set(g.fileNames.map(S=>Z_(e,S)));for(const S of p)y.has(Z_(e,S))||o.fileExists(S)&&(c?c.push(S):(o.deleteFile(S),Cae(e,f,0)))}return c&&Gu(e,d.A_non_dry_build_would_delete_the_following_files_Colon_0,c.map(u=>`\r + * ${u}`).join("")),0}function Cae(e,t,r){e.host.getParsedCommandLine&&r===1&&(r=2),r===2&&(e.configFileCache.delete(t),e.buildOrder=void 0),e.needsSummary=!0,Wbe(e,t),Ube(e,t,r),zbe(e)}function C9(e,t,r){e.reportFileChangeDetected=!0,Cae(e,t,r),rSe(e,250,!0)}function rSe(e,t,r){const{hostWithWatch:i}=e;!i.setTimeout||!i.clearTimeout||(e.timerToBuildInvalidatedProject&&i.clearTimeout(e.timerToBuildInvalidatedProject),e.timerToBuildInvalidatedProject=i.setTimeout(fRe,t,"timerToBuildInvalidatedProject",e,r))}function fRe(e,t,r){ko("SolutionBuilder::beforeBuild");const i=pRe(t,r);ko("SolutionBuilder::afterBuild"),cf("SolutionBuilder::Build","SolutionBuilder::beforeBuild","SolutionBuilder::afterBuild"),i&&cSe(t,i)}function pRe(e,t){e.timerToBuildInvalidatedProject=void 0,e.reportFileChangeDetected&&(e.reportFileChangeDetected=!1,e.projectErrorsReported.clear(),Pae(e,d.File_change_detected_Starting_incremental_compilation));let r=0;const i=k9(e),s=hae(e,i,!1);if(s)for(s.done(),r++;e.projectPendingBuild.size;){if(e.timerToBuildInvalidatedProject)return;const o=Gbe(e,i,!1);if(!o)break;if(o.kind!==2&&(t||r===5)){rSe(e,100,!1);return}$be(e,o,i).done(),o.kind!==2&&r++}return gae(e),i}function nSe(e,t,r,i){!e.watch||e.allWatchedConfigFiles.has(r)||e.allWatchedConfigFiles.set(r,Cq(e,t,()=>C9(e,r,2),2e3,i?.watchOptions,al.ConfigFile,t))}function iSe(e,t,r){ZO(t,r?.options,e.allWatchedExtendedConfigFiles,(i,s)=>Cq(e,i,()=>{var o;return(o=e.allWatchedExtendedConfigFiles.get(s))==null?void 0:o.projects.forEach(c=>C9(e,c,2))},2e3,r?.watchOptions,al.ExtendedConfigFile),i=>Z_(e,i))}function sSe(e,t,r,i){e.watch&&$w(dae(e.allWatchedWildcardDirectories,r),new Map(Object.entries(i.wildcardDirectories)),(s,o)=>e.watchDirectory(s,c=>{var u;Xw({watchedDirPath:Z_(e,s),fileOrDirectory:c,fileOrDirectoryPath:Z_(e,c),configFileName:t,currentDirectory:e.compilerHost.getCurrentDirectory(),options:i.options,program:e.builderPrograms.get(r)||((u=tRe(e,r))==null?void 0:u.fileNames),useCaseSensitiveFileNames:e.parseConfigFileHost.useCaseSensitiveFileNames,writeLog:f=>e.writeLog(f),toPath:f=>Z_(e,f)})||C9(e,r,1)},o,i?.watchOptions,al.WildcardDirectory,t))}function Eae(e,t,r,i){e.watch&&Qk(dae(e.allWatchedInputFiles,r),Ph(i.fileNames,s=>Z_(e,s)),{createNewValue:(s,o)=>Cq(e,o,()=>C9(e,r,0),250,i?.watchOptions,al.SourceFile,t),onDeleteValue:rd})}function Dae(e,t,r,i){!e.watch||!e.lastCachedPackageJsonLookups||Qk(dae(e.allWatchedPackageJsonFiles,r),new Map(e.lastCachedPackageJsonLookups.get(r)),{createNewValue:(s,o)=>Cq(e,s,()=>C9(e,r,0),2e3,i?.watchOptions,al.PackageJson,t),onDeleteValue:rd})}function dRe(e,t){if(e.watchAllProjectsPending){ko("SolutionBuilder::beforeWatcherCreation"),e.watchAllProjectsPending=!1;for(const r of x9(t)){const i=Jd(e,r),s=ZT(e,r,i);nSe(e,r,i,s),iSe(e,i,s),s&&(sSe(e,r,i,s),Eae(e,r,i,s),Dae(e,r,i,s))}ko("SolutionBuilder::afterWatcherCreation"),cf("SolutionBuilder::Watcher creation","SolutionBuilder::beforeWatcherCreation","SolutionBuilder::afterWatcherCreation")}}function mRe(e){o_(e.allWatchedConfigFiles,rd),o_(e.allWatchedExtendedConfigFiles,hf),o_(e.allWatchedWildcardDirectories,t=>o_(t,hf)),o_(e.allWatchedInputFiles,t=>o_(t,rd)),o_(e.allWatchedPackageJsonFiles,t=>o_(t,rd))}function aSe(e,t,r,i,s){const o=eRe(e,t,r,i,s);return{build:(c,u,f,g)=>eSe(o,c,u,f,g),clean:c=>tSe(o,c),buildReferences:(c,u,f,g)=>eSe(o,c,u,f,g,!0),cleanReferences:c=>tSe(o,c,!0),getNextInvalidatedProject:c=>(Vbe(o,c),hae(o,k9(o),!1)),getBuildOrder:()=>k9(o),getUpToDateStatusOfProject:c=>{const u=v3(o,c),f=Jd(o,u);return kae(o,ZT(o,u,f),f)},invalidateProject:(c,u)=>Cae(o,c,u||0),close:()=>mRe(o)}}function Fl(e,t){return T4(t,e.compilerHost.getCurrentDirectory(),e.compilerHost.getCanonicalFileName)}function Gu(e,t,...r){e.host.reportSolutionBuilderStatus(dc(t,...r))}function Pae(e,t,...r){var i,s;(s=(i=e.hostWithWatch).onWatchStatusChange)==null||s.call(i,dc(t,...r),e.host.getNewLine(),e.baseCompilerOptions)}function E9({host:e},t){t.forEach(r=>e.reportDiagnostic(r))}function b3(e,t,r){E9(e,r),e.projectErrorsReported.set(t,!0),r.length&&e.diagnostics.set(t,r)}function oSe(e,t){b3(e,t,[e.configFileCache.get(t)])}function cSe(e,t){if(!e.needsSummary)return;e.needsSummary=!1;const r=e.watch||!!e.host.reportErrorSummary,{diagnostics:i}=e;let s=0,o=[];YT(t)?(lSe(e,t.buildOrder),E9(e,t.circularDiagnostics),r&&(s+=g9(t.circularDiagnostics)),r&&(o=[...o,...h9(t.circularDiagnostics)])):(t.forEach(c=>{const u=Jd(e,c);e.projectErrorsReported.has(u)||E9(e,i.get(u)||ze)}),r&&i.forEach(c=>s+=g9(c)),r&&i.forEach(c=>[...o,...h9(c)])),e.watch?Pae(e,uq(s),s):e.host.reportErrorSummary&&e.host.reportErrorSummary(s,o)}function lSe(e,t){e.options.verbose&&Gu(e,d.Projects_in_this_build_Colon_0,t.map(r=>`\r + * `+Fl(e,r)).join(""))}function gRe(e,t,r){switch(r.type){case 6:return Gu(e,d.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,Fl(e,t),Fl(e,r.outOfDateOutputFileName),Fl(e,r.newerInputFileName));case 7:return Gu(e,d.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,Fl(e,t),Fl(e,r.outOfDateOutputFileName),Fl(e,r.newerProjectName));case 4:return Gu(e,d.Project_0_is_out_of_date_because_output_file_1_does_not_exist,Fl(e,t),Fl(e,r.missingOutputFileName));case 5:return Gu(e,d.Project_0_is_out_of_date_because_there_was_error_reading_file_1,Fl(e,t),Fl(e,r.fileName));case 8:return Gu(e,d.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,Fl(e,t),Fl(e,r.buildInfoFile));case 9:return Gu(e,d.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions,Fl(e,t),Fl(e,r.buildInfoFile));case 10:return Gu(e,d.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,Fl(e,t),Fl(e,r.buildInfoFile),Fl(e,r.inputFile));case 1:if(r.newestInputFileTime!==void 0)return Gu(e,d.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2,Fl(e,t),Fl(e,r.newestInputFileName||""),Fl(e,r.oldestOutputFileName||""));break;case 3:return Gu(e,d.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed,Fl(e,t),Fl(e,r.newerProjectName));case 2:return Gu(e,d.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,Fl(e,t));case 15:return Gu(e,d.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,Fl(e,t));case 11:return Gu(e,d.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,Fl(e,t),Fl(e,r.upstreamProjectName));case 12:return Gu(e,r.upstreamProjectBlocked?d.Project_0_can_t_be_built_because_its_dependency_1_was_not_built:d.Project_0_can_t_be_built_because_its_dependency_1_has_errors,Fl(e,t),Fl(e,r.upstreamProjectName));case 0:return Gu(e,d.Failed_to_parse_file_0_Colon_1,Fl(e,t),r.reason);case 14:return Gu(e,d.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,Fl(e,t),r.version,Qm);case 17:return Gu(e,d.Project_0_is_being_forcibly_rebuilt,Fl(e,t));case 16:case 13:break;default:}}function Eq(e,t,r){e.options.verbose&&gRe(e,t,r)}var uSe,_Se,Dq,hRe=Nt({"src/compiler/tsbuildPublic.ts"(){"use strict";Ns(),Z2(),uSe=new Date(-864e13),_Se=new Date(864e13),Dq=(e=>(e[e.Build=0]="Build",e[e.UpdateBundle=1]="UpdateBundle",e[e.UpdateOutputFileStamps=2]="UpdateOutputFileStamps",e))(Dq||{})}}),Ns=Nt({"src/compiler/_namespaces/ts.ts"(){"use strict";gIe(),CIe(),EIe(),MIe(),BIe(),JIe(),YIe(),Ahe(),a5e(),_5e(),f5e(),h5e(),x5e(),SFe(),TFe(),xFe(),kFe(),FFe(),OFe(),LFe(),MFe(),lOe(),uOe(),bOe(),jOe(),_9e(),h9e(),y9e(),w9e(),L9e(),U9e(),Q9e(),lLe(),uLe(),vLe(),bLe(),SLe(),PLe(),wLe(),ALe(),NLe(),ILe(),FLe(),OLe(),LLe(),MLe(),BLe(),JLe(),zLe(),WLe(),ULe(),qLe(),HLe(),GLe(),$Le(),XLe(),QLe(),rMe(),cMe(),yMe(),bMe(),kMe(),CMe(),EMe(),WMe(),UMe(),HMe(),XMe(),QMe(),YMe(),hRe(),Nie(),Z2()}});function fSe(e){return Bl.args.includes(e)}function pSe(e){const t=Bl.args.indexOf(e);return t>=0&&t{e.GlobalCacheLocation="--globalTypingsCacheLocation",e.LogFile="--logFile",e.EnableTelemetry="--enableTelemetry",e.TypingSafeListLocation="--typingSafeListLocation",e.TypesMapLocation="--typesMapLocation",e.NpmLocation="--npmLocation",e.ValidateDefaultNpmLocation="--validateDefaultNpmLocation"})(Aq||(Aq={})),Iae=` + `}}),vRe=Nt({"src/jsTyping/types.ts"(){"use strict"}}),w9=Nt({"src/jsTyping/_namespaces/ts.server.ts"(){"use strict";yRe(),vRe()}});function mSe(e,t){return new Ip(x7(t,`ts${rk}`)||x7(t,"latest")).compareTo(e.version)<=0}function gSe(e){return Rae.has(e)?"node":e}function bRe(e,t){const r=Tw(t,i=>e.readFile(i));return new Map(Object.entries(r.config))}function SRe(e,t){var r;const i=Tw(t,s=>e.readFile(s));if((r=i.config)!=null&&r.simpleMap)return new Map(Object.entries(i.config.simpleMap))}function TRe(e,t,r,i,s,o,c,u,f,g){if(!c||!c.enable)return{cachedTypingPaths:[],newTypingNames:[],filesToWatch:[]};const p=new Map;r=Ii(r,X=>{const J=qs(X);if(jv(J))return J});const y=[];c.include&&O(c.include,"Explicitly included types");const S=c.exclude||[];if(!g.types){const X=new Set(r.map(qn));X.add(i),X.forEach(J=>{z(J,"bower.json","bower_components",y),z(J,"package.json","node_modules",y)})}if(c.disableFilenameBasedTypeAcquisition||W(r),u){const X=VS(u.map(gSe),QS,Du);O(X,"Inferred typings from unresolved imports")}for(const X of S)p.delete(X)&&t&&t(`Typing for ${X} is in exclude list, will be ignored.`);o.forEach((X,J)=>{const ie=f.get(J);p.get(J)===!1&&ie!==void 0&&mSe(X,ie)&&p.set(J,X.typingLocation)});const T=[],C=[];p.forEach((X,J)=>{X?C.push(X):T.push(J)});const w={cachedTypingPaths:C,newTypingNames:T,filesToWatch:y};return t&&t(`Finished typings discovery:${UC(w)}`),w;function D(X){p.has(X)||p.set(X,!1)}function O(X,J){t&&t(`${J}: ${JSON.stringify(X)}`),Zt(X,D)}function z(X,J,ie,B){const Y=Hn(X,J);let ae,_e;e.fileExists(Y)&&(B.push(Y),ae=Tw(Y,oe=>e.readFile(oe)).config,_e=ta([ae.dependencies,ae.devDependencies,ae.optionalDependencies,ae.peerDependencies],Jg),O(_e,`Typing names in '${Y}' dependencies`));const $=Hn(X,ie);if(B.push($),!e.directoryExists($))return;const H=[],K=_e?_e.map(oe=>Hn($,oe,J)):e.readDirectory($,[".json"],void 0,void 0,3).filter(oe=>{if(Pc(oe)!==J)return!1;const Se=fl(qs(oe)),se=Se[Se.length-3][0]==="@";return se&&xd(Se[Se.length-4])===ie||!se&&xd(Se[Se.length-3])===ie});t&&t(`Searching for typing names in ${$}; all files: ${JSON.stringify(K)}`);for(const oe of K){const Se=qs(oe),Z=Tw(Se,Te=>e.readFile(Te)).config;if(!Z.name)continue;const ve=Z.types||Z.typings;if(ve){const Te=is(ve,qn(Se));e.fileExists(Te)?(t&&t(` Package '${Z.name}' provides its own types.`),p.set(Z.name,Te)):t&&t(` Package '${Z.name}' provides its own types but they are missing.`)}else H.push(Z.name)}O(H," Found package names")}function W(X){const J=Ii(X,B=>{if(!jv(B))return;const Y=Ou(xd(Pc(B))),ae=kj(Y);return s.get(ae)});J.length&&O(J,"Inferred typings from file names"),ut(X,B=>Ho(B,".jsx"))&&(t&&t("Inferred 'react' typings due to presence of '.jsx' extension"),D("react"))}}function xRe(e){return Fae(e,!0)}function Fae(e,t){if(!e)return 1;if(e.length>Bae)return 2;if(e.charCodeAt(0)===46)return 3;if(e.charCodeAt(0)===95)return 4;if(t){const r=/^@([^/]+)\/([^/]+)$/.exec(e);if(r){const i=Fae(r[1],!1);if(i!==0)return{name:r[1],isScopeName:!0,result:i};const s=Fae(r[2],!1);return s!==0?{name:r[2],isScopeName:!1,result:s}:0}}return encodeURIComponent(e)!==e?5:0}function kRe(e,t){return typeof e=="object"?hSe(t,e.result,e.name,e.isScopeName):hSe(t,e,t,!1)}function hSe(e,t,r,i){const s=i?"Scope":"Package";switch(t){case 1:return`'${e}':: ${s} name '${r}' cannot be empty`;case 2:return`'${e}':: ${s} name '${r}' should be less than ${Bae} characters`;case 3:return`'${e}':: ${s} name '${r}' cannot start with '.'`;case 4:return`'${e}':: ${s} name '${r}' cannot start with '_'`;case 5:return`'${e}':: ${s} name '${r}' contains non URI safe characters`;case 0:return E.fail();default:E.assertNever(t)}}var Oae,Lae,Mae,Rae,jae,Bae,CRe=Nt({"src/jsTyping/jsTyping.ts"(){"use strict";sA(),w9(),Oae=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","https","http2","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","stream/promises","string_decoder","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"],Lae=Oae.map(e=>`node:${e}`),Mae=[...Oae,...Lae],Rae=new Set(Mae),jae=(e=>(e[e.Ok=0]="Ok",e[e.EmptyName=1]="EmptyName",e[e.NameTooLong=2]="NameTooLong",e[e.NameStartsWithDot=3]="NameStartsWithDot",e[e.NameStartsWithUnderscore=4]="NameStartsWithUnderscore",e[e.NameContainsNonURISafeCharacters=5]="NameContainsNonURISafeCharacters",e))(jae||{}),Bae=214}}),gg={};jl(gg,{NameValidationResult:()=>jae,discoverTypings:()=>TRe,isTypingUpToDate:()=>mSe,loadSafeList:()=>bRe,loadTypesMap:()=>SRe,nodeCoreModuleList:()=>Mae,nodeCoreModules:()=>Rae,nonRelativeModuleNameForTypingCache:()=>gSe,prefixedNodeCoreModuleList:()=>Lae,renderPackageNameValidationFailure:()=>kRe,validatePackageName:()=>xRe});var ERe=Nt({"src/jsTyping/_namespaces/ts.JsTyping.ts"(){"use strict";CRe()}}),sA=Nt({"src/jsTyping/_namespaces/ts.ts"(){"use strict";Ns(),ERe(),w9()}});function A9(e){return{indentSize:4,tabSize:4,newLineCharacter:e||` +`,convertTabsToSpaces:!0,indentStyle:2,insertSpaceAfterConstructor:!1,insertSpaceAfterCommaDelimiter:!0,insertSpaceAfterSemicolonInForStatements:!0,insertSpaceBeforeAndAfterBinaryOperators:!0,insertSpaceAfterKeywordsInControlFlowStatements:!0,insertSpaceAfterFunctionKeywordForAnonymousFunctions:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:!1,insertSpaceBeforeFunctionParenthesis:!1,placeOpenBraceOnNewLineForFunctions:!1,placeOpenBraceOnNewLineForControlBlocks:!1,semicolons:"ignore",trimTrailingWhitespace:!0,indentSwitchCase:!0}}var N9,Nq,Iq,Fq,jf,Oq,Lq,Mq,Rq,jq,Bq,Jq,Jae,aA,zq,Wq,Uq,Vq,qq,Hq,Gq,$q,Xq,DRe=Nt({"src/services/types.ts"(){"use strict";(e=>{class t{constructor(s){this.text=s}getText(s,o){return s===0&&o===this.text.length?this.text:this.text.substring(s,o)}getLength(){return this.text.length}getChangeRange(){}}function r(i){return new t(i)}e.fromString=r})(N9||(N9={})),Nq=(e=>(e[e.Dependencies=1]="Dependencies",e[e.DevDependencies=2]="DevDependencies",e[e.PeerDependencies=4]="PeerDependencies",e[e.OptionalDependencies=8]="OptionalDependencies",e[e.All=15]="All",e))(Nq||{}),Iq=(e=>(e[e.Off=0]="Off",e[e.On=1]="On",e[e.Auto=2]="Auto",e))(Iq||{}),Fq=(e=>(e[e.Semantic=0]="Semantic",e[e.PartialSemantic=1]="PartialSemantic",e[e.Syntactic=2]="Syntactic",e))(Fq||{}),jf={},Oq=(e=>(e.Original="original",e.TwentyTwenty="2020",e))(Oq||{}),Lq=(e=>(e.All="All",e.SortAndCombine="SortAndCombine",e.RemoveUnused="RemoveUnused",e))(Lq||{}),Mq=(e=>(e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",e))(Mq||{}),Rq=(e=>(e.Type="Type",e.Parameter="Parameter",e.Enum="Enum",e))(Rq||{}),jq=(e=>(e.none="none",e.definition="definition",e.reference="reference",e.writtenReference="writtenReference",e))(jq||{}),Bq=(e=>(e[e.None=0]="None",e[e.Block=1]="Block",e[e.Smart=2]="Smart",e))(Bq||{}),Jq=(e=>(e.Ignore="ignore",e.Insert="insert",e.Remove="remove",e))(Jq||{}),Jae=A9(` +`),aA=(e=>(e[e.aliasName=0]="aliasName",e[e.className=1]="className",e[e.enumName=2]="enumName",e[e.fieldName=3]="fieldName",e[e.interfaceName=4]="interfaceName",e[e.keyword=5]="keyword",e[e.lineBreak=6]="lineBreak",e[e.numericLiteral=7]="numericLiteral",e[e.stringLiteral=8]="stringLiteral",e[e.localName=9]="localName",e[e.methodName=10]="methodName",e[e.moduleName=11]="moduleName",e[e.operator=12]="operator",e[e.parameterName=13]="parameterName",e[e.propertyName=14]="propertyName",e[e.punctuation=15]="punctuation",e[e.space=16]="space",e[e.text=17]="text",e[e.typeParameterName=18]="typeParameterName",e[e.enumMemberName=19]="enumMemberName",e[e.functionName=20]="functionName",e[e.regularExpressionLiteral=21]="regularExpressionLiteral",e[e.link=22]="link",e[e.linkName=23]="linkName",e[e.linkText=24]="linkText",e))(aA||{}),zq=(e=>(e[e.None=0]="None",e[e.MayIncludeAutoImports=1]="MayIncludeAutoImports",e[e.IsImportStatementCompletion=2]="IsImportStatementCompletion",e[e.IsContinuation=4]="IsContinuation",e[e.ResolvedModuleSpecifiers=8]="ResolvedModuleSpecifiers",e[e.ResolvedModuleSpecifiersBeyondLimit=16]="ResolvedModuleSpecifiersBeyondLimit",e[e.MayIncludeMethodSnippets=32]="MayIncludeMethodSnippets",e))(zq||{}),Wq=(e=>(e.Comment="comment",e.Region="region",e.Code="code",e.Imports="imports",e))(Wq||{}),Uq=(e=>(e[e.JavaScript=0]="JavaScript",e[e.SourceMap=1]="SourceMap",e[e.Declaration=2]="Declaration",e))(Uq||{}),Vq=(e=>(e[e.None=0]="None",e[e.InMultiLineCommentTrivia=1]="InMultiLineCommentTrivia",e[e.InSingleQuoteStringLiteral=2]="InSingleQuoteStringLiteral",e[e.InDoubleQuoteStringLiteral=3]="InDoubleQuoteStringLiteral",e[e.InTemplateHeadOrNoSubstitutionTemplate=4]="InTemplateHeadOrNoSubstitutionTemplate",e[e.InTemplateMiddleOrTail=5]="InTemplateMiddleOrTail",e[e.InTemplateSubstitutionPosition=6]="InTemplateSubstitutionPosition",e))(Vq||{}),qq=(e=>(e[e.Punctuation=0]="Punctuation",e[e.Keyword=1]="Keyword",e[e.Operator=2]="Operator",e[e.Comment=3]="Comment",e[e.Whitespace=4]="Whitespace",e[e.Identifier=5]="Identifier",e[e.NumberLiteral=6]="NumberLiteral",e[e.BigIntLiteral=7]="BigIntLiteral",e[e.StringLiteral=8]="StringLiteral",e[e.RegExpLiteral=9]="RegExpLiteral",e))(qq||{}),Hq=(e=>(e.unknown="",e.warning="warning",e.keyword="keyword",e.scriptElement="script",e.moduleElement="module",e.classElement="class",e.localClassElement="local class",e.interfaceElement="interface",e.typeElement="type",e.enumElement="enum",e.enumMemberElement="enum member",e.variableElement="var",e.localVariableElement="local var",e.variableUsingElement="using",e.variableAwaitUsingElement="await using",e.functionElement="function",e.localFunctionElement="local function",e.memberFunctionElement="method",e.memberGetAccessorElement="getter",e.memberSetAccessorElement="setter",e.memberVariableElement="property",e.memberAccessorVariableElement="accessor",e.constructorImplementationElement="constructor",e.callSignatureElement="call",e.indexSignatureElement="index",e.constructSignatureElement="construct",e.parameterElement="parameter",e.typeParameterElement="type parameter",e.primitiveType="primitive type",e.label="label",e.alias="alias",e.constElement="const",e.letElement="let",e.directory="directory",e.externalModuleName="external module name",e.jsxAttribute="JSX attribute",e.string="string",e.link="link",e.linkName="link name",e.linkText="link text",e))(Hq||{}),Gq=(e=>(e.none="",e.publicMemberModifier="public",e.privateMemberModifier="private",e.protectedMemberModifier="protected",e.exportedModifier="export",e.ambientModifier="declare",e.staticModifier="static",e.abstractModifier="abstract",e.optionalModifier="optional",e.deprecatedModifier="deprecated",e.dtsModifier=".d.ts",e.tsModifier=".ts",e.tsxModifier=".tsx",e.jsModifier=".js",e.jsxModifier=".jsx",e.jsonModifier=".json",e.dmtsModifier=".d.mts",e.mtsModifier=".mts",e.mjsModifier=".mjs",e.dctsModifier=".d.cts",e.ctsModifier=".cts",e.cjsModifier=".cjs",e))(Gq||{}),$q=(e=>(e.comment="comment",e.identifier="identifier",e.keyword="keyword",e.numericLiteral="number",e.bigintLiteral="bigint",e.operator="operator",e.stringLiteral="string",e.whiteSpace="whitespace",e.text="text",e.punctuation="punctuation",e.className="class name",e.enumName="enum name",e.interfaceName="interface name",e.moduleName="module name",e.typeParameterName="type parameter name",e.typeAliasName="type alias name",e.parameterName="parameter name",e.docCommentTagName="doc comment tag name",e.jsxOpenTagName="jsx open tag name",e.jsxCloseTagName="jsx close tag name",e.jsxSelfClosingTagName="jsx self closing tag name",e.jsxAttribute="jsx attribute",e.jsxText="jsx text",e.jsxAttributeStringLiteralValue="jsx attribute string literal value",e))($q||{}),Xq=(e=>(e[e.comment=1]="comment",e[e.identifier=2]="identifier",e[e.keyword=3]="keyword",e[e.numericLiteral=4]="numericLiteral",e[e.operator=5]="operator",e[e.stringLiteral=6]="stringLiteral",e[e.regularExpressionLiteral=7]="regularExpressionLiteral",e[e.whiteSpace=8]="whiteSpace",e[e.text=9]="text",e[e.punctuation=10]="punctuation",e[e.className=11]="className",e[e.enumName=12]="enumName",e[e.interfaceName=13]="interfaceName",e[e.moduleName=14]="moduleName",e[e.typeParameterName=15]="typeParameterName",e[e.typeAliasName=16]="typeAliasName",e[e.parameterName=17]="parameterName",e[e.docCommentTagName=18]="docCommentTagName",e[e.jsxOpenTagName=19]="jsxOpenTagName",e[e.jsxCloseTagName=20]="jsxCloseTagName",e[e.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",e[e.jsxAttribute=22]="jsxAttribute",e[e.jsxText=23]="jsxText",e[e.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",e[e.bigintLiteral=25]="bigintLiteral",e))(Xq||{})}});function oA(e){switch(e.kind){case 260:return Hr(e)&&tJ(e)?7:1;case 169:case 208:case 172:case 171:case 303:case 304:case 174:case 173:case 176:case 177:case 178:case 262:case 218:case 219:case 299:case 291:return 1;case 168:case 264:case 265:case 187:return 2;case 353:return e.name===void 0?3:2;case 306:case 263:return 3;case 267:return ru(e)||rh(e)===1?5:4;case 266:case 275:case 276:case 271:case 272:case 277:case 278:return 7;case 312:return 5}return 7}function Wb(e){e=cH(e);const t=e.parent;return e.kind===312?1:cc(t)||vu(t)||Pm(t)||v_(t)||Em(t)||Hl(t)&&e===t.name?7:I9(e)?PRe(e):$g(e)?oA(t):V_(e)&&Ar(e,ed(VE,iT,d1))?7:IRe(e)?2:wRe(e)?4:Uo(t)?(E.assert(od(t.parent)),2):_1(t)?3:1}function PRe(e){const t=e.kind===166?e:h_(e.parent)&&e.parent.right===e?e.parent:void 0;return t&&t.parent.kind===271?7:4}function I9(e){for(;e.parent.kind===166;)e=e.parent;return Ok(e.parent)&&e.parent.moduleReference===e}function wRe(e){return ARe(e)||NRe(e)}function ARe(e){let t=e,r=!0;if(t.parent.kind===166){for(;t.parent&&t.parent.kind===166;)t=t.parent;r=t.right===e}return t.parent.kind===183&&!r}function NRe(e){let t=e,r=!0;if(t.parent.kind===211){for(;t.parent&&t.parent.kind===211;)t=t.parent;r=t.name===e}if(!r&&t.parent.kind===233&&t.parent.parent.kind===298){const i=t.parent.parent.parent;return i.kind===263&&t.parent.parent.token===119||i.kind===264&&t.parent.parent.token===96}return!1}function IRe(e){switch(cE(e)&&(e=e.parent),e.kind){case 110:return!sg(e);case 197:return!0}switch(e.parent.kind){case 183:return!0;case 205:return!e.parent.isTypeOf;case 233:return ig(e.parent)}return!1}function Qq(e,t=!1,r=!1){return cA(e,Rs,Zq,t,r)}function T3(e,t=!1,r=!1){return cA(e,Wv,Zq,t,r)}function Yq(e,t=!1,r=!1){return cA(e,gm,Zq,t,r)}function zae(e,t=!1,r=!1){return cA(e,Db,FRe,t,r)}function Wae(e,t=!1,r=!1){return cA(e,ql,Zq,t,r)}function Uae(e,t=!1,r=!1){return cA(e,qu,ORe,t,r)}function Zq(e){return e.expression}function FRe(e){return e.tag}function ORe(e){return e.tagName}function cA(e,t,r,i,s){let o=i?Vae(e):F9(e);return s&&(o=bc(o)),!!o&&!!o.parent&&t(o.parent)&&r(o.parent)===o}function F9(e){return VC(e)?e.parent:e}function Vae(e){return VC(e)||rH(e)?e.parent:e}function O9(e,t){for(;e;){if(e.kind===256&&e.label.escapedText===t)return e.label;e=e.parent}}function lA(e,t){return bn(e.expression)?e.expression.name.text===t:!1}function uA(e){var t;return Ie(e)&&((t=Jn(e.parent,N4))==null?void 0:t.label)===e}function Kq(e){var t;return Ie(e)&&((t=Jn(e.parent,Uv))==null?void 0:t.label)===e}function eH(e){return Kq(e)||uA(e)}function tH(e){var t;return((t=Jn(e.parent,xk))==null?void 0:t.tagName)===e}function qae(e){var t;return((t=Jn(e.parent,h_))==null?void 0:t.right)===e}function VC(e){var t;return((t=Jn(e.parent,bn))==null?void 0:t.name)===e}function rH(e){var t;return((t=Jn(e.parent,mo))==null?void 0:t.argumentExpression)===e}function nH(e){var t;return((t=Jn(e.parent,vc))==null?void 0:t.name)===e}function iH(e){var t;return Ie(e)&&((t=Jn(e.parent,ks))==null?void 0:t.name)===e}function L9(e){switch(e.parent.kind){case 172:case 171:case 303:case 306:case 174:case 173:case 177:case 178:case 267:return as(e.parent)===e;case 212:return e.parent.argumentExpression===e;case 167:return!0;case 201:return e.parent.parent.kind===199;default:return!1}}function Hae(e){return Ky(e.parent.parent)&&q4(e.parent.parent)===e}function Ub(e){for(op(e)&&(e=e.parent.parent);;){if(e=e.parent,!e)return;switch(e.kind){case 312:case 174:case 173:case 262:case 218:case 177:case 178:case 263:case 264:case 266:case 267:return e}}}function n2(e){switch(e.kind){case 312:return Nc(e)?"module":"script";case 267:return"module";case 263:case 231:return"class";case 264:return"interface";case 265:case 345:case 353:return"type";case 266:return"enum";case 260:return t(e);case 208:return t(Tm(e));case 219:case 262:case 218:return"function";case 177:return"getter";case 178:return"setter";case 174:case 173:return"method";case 303:const{initializer:r}=e;return ks(r)?"method":"property";case 172:case 171:case 304:case 305:return"property";case 181:return"index";case 180:return"construct";case 179:return"call";case 176:case 175:return"constructor";case 168:return"type parameter";case 306:return"enum member";case 169:return In(e,31)?"property":"parameter";case 271:case 276:case 281:case 274:case 280:return"alias";case 226:const i=ac(e),{right:s}=e;switch(i){case 7:case 8:case 9:case 0:return"";case 1:case 2:const c=n2(s);return c===""?"const":c;case 3:return ro(s)?"method":"property";case 4:return"property";case 5:return ro(s)?"method":"property";case 6:return"local class";default:return""}case 80:return Em(e.parent)?"alias":"";case 277:const o=n2(e.expression);return o===""?"const":o;default:return""}function t(r){return wk(r)?"const":MI(r)?"let":"var"}}function qC(e){switch(e.kind){case 110:return!0;case 80:return bz(e)&&e.parent.kind===169;default:return!1}}function hp(e,t){const r=Wg(t),i=t.getLineAndCharacterOfPosition(e).line;return r[i]}function yf(e,t){return sH(e.pos,e.end,t)}function Gae(e,t){return fA(e,t.pos)&&fA(e,t.end)}function _A(e,t){return e.pos<=t&&t<=e.end}function fA(e,t){return e.pos=r.end}function pA(e,t,r){return e.pos<=t&&e.end>=r}function x3(e,t,r){return R9(e.pos,e.end,t,r)}function M9(e,t,r,i){return R9(e.getStart(t),e.end,r,i)}function R9(e,t,r,i){const s=Math.max(e,r),o=Math.min(t,i);return si.kind===t)}function j9(e){const t=kn(e.parent.getChildren(),r=>SC(r)&&yf(r,e));return E.assert(!t||_s(t.getChildren(),e)),t}function ySe(e){return e.kind===90}function LRe(e){return e.kind===86}function MRe(e){return e.kind===100}function RRe(e){if(Au(e))return e.name;if(Vc(e)){const t=e.modifiers&&kn(e.modifiers,ySe);if(t)return t}if(Nl(e)){const t=kn(e.getChildren(),LRe);if(t)return t}}function jRe(e){if(Au(e))return e.name;if(Zc(e)){const t=kn(e.modifiers,ySe);if(t)return t}if(ro(e)){const t=kn(e.getChildren(),MRe);if(t)return t}}function BRe(e){let t;return Ar(e,r=>(Si(r)&&(t=r),!h_(r.parent)&&!Si(r.parent)&&!ib(r.parent))),t}function B9(e,t){if(e.flags&16777216)return;const r=sL(e,t);if(r)return r;const i=BRe(e);return i&&t.getTypeAtLocation(i)}function JRe(e,t){if(!t)switch(e.kind){case 263:case 231:return RRe(e);case 262:case 218:return jRe(e);case 176:return e}if(Au(e))return e.name}function vSe(e,t){if(e.importClause){if(e.importClause.name&&e.importClause.namedBindings)return;if(e.importClause.name)return e.importClause.name;if(e.importClause.namedBindings){if(Kg(e.importClause.namedBindings)){const r=lm(e.importClause.namedBindings.elements);return r?r.name:void 0}else if(K0(e.importClause.namedBindings))return e.importClause.namedBindings.name}}if(!t)return e.moduleSpecifier}function bSe(e,t){if(e.exportClause){if(gp(e.exportClause))return lm(e.exportClause.elements)?e.exportClause.elements[0].name:void 0;if(Dm(e.exportClause))return e.exportClause.name}if(!t)return e.moduleSpecifier}function zRe(e){if(e.types.length===1)return e.types[0].expression}function SSe(e,t){const{parent:r}=e;if(Ys(e)&&(t||e.kind!==90)?Wp(r)&&_s(r.modifiers,e):e.kind===86?Vc(r)||Nl(e):e.kind===100?Zc(r)||ro(e):e.kind===120?Mu(r):e.kind===94?p1(r):e.kind===156?Jp(r):e.kind===145||e.kind===144?vc(r):e.kind===102?Hl(r):e.kind===139?pf(r):e.kind===153&&N_(r)){const i=JRe(r,t);if(i)return i}if((e.kind===115||e.kind===87||e.kind===121)&&ml(r)&&r.declarations.length===1){const i=r.declarations[0];if(Ie(i.name))return i.name}if(e.kind===156){if(Em(r)&&r.isTypeOnly){const i=vSe(r.parent,t);if(i)return i}if(qc(r)&&r.isTypeOnly){const i=bSe(r,t);if(i)return i}}if(e.kind===130){if(v_(r)&&r.propertyName||vu(r)&&r.propertyName||K0(r)||Dm(r))return r.name;if(qc(r)&&r.exportClause&&Dm(r.exportClause))return r.exportClause.name}if(e.kind===102&&gl(r)){const i=vSe(r,t);if(i)return i}if(e.kind===95){if(qc(r)){const i=bSe(r,t);if(i)return i}if(cc(r))return bc(r.expression)}if(e.kind===149&&Pm(r))return r.expression;if(e.kind===161&&(gl(r)||qc(r))&&r.moduleSpecifier)return r.moduleSpecifier;if((e.kind===96||e.kind===119)&&Q_(r)&&r.token===e.kind){const i=zRe(r);if(i)return i}if(e.kind===96){if(Uo(r)&&r.constraint&&mp(r.constraint))return r.constraint.typeName;if(fC(r)&&mp(r.extendsType))return r.extendsType.typeName}if(e.kind===140&&NT(r))return r.typeParameter.name;if(e.kind===103&&Uo(r)&&jE(r.parent))return r.name;if(e.kind===143&&FT(r)&&r.operator===143&&mp(r.type))return r.type.typeName;if(e.kind===148&&FT(r)&&r.operator===148&&jF(r.type)&&mp(r.type.elementType))return r.type.elementType.typeName;if(!t){if((e.kind===105&&Wv(r)||e.kind===116&<(r)||e.kind===114&&pC(r)||e.kind===135&&Z0(r)||e.kind===127&&zF(r)||e.kind===91&&sne(r))&&r.expression)return bc(r.expression);if((e.kind===103||e.kind===104)&&Gr(r)&&r.operatorToken===e)return bc(r.right);if(e.kind===130&&nw(r)&&mp(r.type))return r.type.typeName;if(e.kind===103&&UF(r)||e.kind===165&&iw(r))return bc(r.expression)}return e}function cH(e){return SSe(e,!1)}function J9(e){return SSe(e,!0)}function c_(e,t){return k3(e,t,r=>wd(r)||a_(r.kind)||Ti(r))}function k3(e,t,r){return TSe(e,t,!1,r,!1)}function Ji(e,t){return TSe(e,t,!0,void 0,!1)}function TSe(e,t,r,i,s){let o=e,c;e:for(;;){const f=o.getChildren(e),g=HS(f,t,(p,y)=>y,(p,y)=>{const S=f[p].getEnd();if(St?1:u(f[p],T,S)?f[p-1]&&u(f[p-1])?1:0:i&&T===t&&f[p-1]&&f[p-1].getEnd()===t&&u(f[p-1])?1:-1});if(c)return c;if(g>=0&&f[g]){o=f[g];continue e}return o}function u(f,g,p){if(p??(p=f.getEnd()),pt))return!1;if(tr.getStart(e)&&t(o.pos<=e.pos&&o.end>e.end||o.pos===e.end)&&roe(o,r)?i(o):void 0)}}function Kc(e,t,r,i){const s=o(r||t);return E.assert(!(s&&W9(s))),s;function o(c){if(xSe(c)&&c.kind!==1)return c;const u=c.getChildren(t),f=HS(u,e,(p,y)=>y,(p,y)=>e=u[p-1].end?0:1:-1);if(f>=0&&u[f]){const p=u[f];if(e=e||!roe(p,t)||W9(p)){const T=Yae(u,f,t,c.kind);return T?!i&&TI(T)&&T.getChildren(t).length?o(T):Qae(T,t):void 0}else return o(p)}E.assert(r!==void 0||c.kind===312||c.kind===1||TI(c));const g=Yae(u,u.length,t,c.kind);return g&&Qae(g,t)}}function xSe(e){return tT(e)&&!W9(e)}function Qae(e,t){if(xSe(e))return e;const r=e.getChildren(t);if(r.length===0)return e;const i=Yae(r,r.length,t,e.kind);return i&&Qae(i,t)}function Yae(e,t,r,i){for(let s=t-1;s>=0;s--){const o=e[s];if(W9(o))s===0&&(i===12||i===285)&&E.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");else if(roe(e[s],r))return e[s]}}function Vb(e,t,r=Kc(t,e)){if(r&&uJ(r)){const i=r.getStart(e),s=r.getEnd();if(ir.getStart(e)}function Kae(e,t){const r=Ji(e,t);return!!(DT(r)||r.kind===19&&UE(r.parent)&&dg(r.parent.parent)||r.kind===30&&qu(r.parent)&&dg(r.parent.parent))}function U9(e,t){function r(i){for(;i;)if(i.kind>=285&&i.kind<=294||i.kind===12||i.kind===30||i.kind===32||i.kind===80||i.kind===20||i.kind===19||i.kind===44)i=i.parent;else if(i.kind===284){if(t>i.getStart(e))return!0;i=i.parent}else return!1;return!1}return r(Ji(e,t))}function V9(e,t,r){const i=Hs(e.kind),s=Hs(t),o=e.getFullStart(),c=r.text.lastIndexOf(s,o);if(c===-1)return;if(r.text.lastIndexOf(i,o-1)!!o.typeParameters&&o.typeParameters.length>=t)}function _H(e,t){if(t.text.lastIndexOf("<",e?e.pos:t.text.length)===-1)return;let r=e,i=0,s=0;for(;r;){switch(r.kind){case 30:if(r=Kc(r.getFullStart(),t),r&&r.kind===29&&(r=Kc(r.getFullStart(),t)),!r||!Ie(r))return;if(!i)return $g(r)?void 0:{called:r,nTypeArguments:s};i--;break;case 50:i=3;break;case 49:i=2;break;case 32:i++;break;case 20:if(r=V9(r,19,t),!r)return;break;case 22:if(r=V9(r,21,t),!r)return;break;case 24:if(r=V9(r,23,t),!r)return;break;case 28:s++;break;case 39:case 80:case 11:case 9:case 10:case 112:case 97:case 114:case 96:case 143:case 25:case 52:case 58:case 59:break;default:if(Si(r))break;return}r=Kc(r.getFullStart(),t)}}function Xh(e,t,r){return ol.getRangeOfEnclosingComment(e,t,void 0,r)}function toe(e,t){const r=Ji(e,t);return!!Ar(r,zp)}function roe(e,t){return e.kind===1?!!e.jsDoc:e.getWidth(t)!==0}function C3(e,t=0){const r=[],i=hu(e)?QB(e)&~t:0;return i&2&&r.push("private"),i&4&&r.push("protected"),i&1&&r.push("public"),(i&256||Go(e))&&r.push("static"),i&64&&r.push("abstract"),i&32&&r.push("export"),i&65536&&r.push("deprecated"),e.flags&33554432&&r.push("declare"),e.kind===277&&r.push("export"),r.length>0?r.join(","):""}function noe(e){if(e.kind===183||e.kind===213)return e.typeArguments;if(ks(e)||e.kind===263||e.kind===264)return e.typeParameters}function q9(e){return e===2||e===3}function fH(e){return!!(e===11||e===14||M0(e))}function kSe(e,t,r){return!!(t.flags&4)&&e.isEmptyAnonymousObjectType(r)}function ioe(e){if(!e.isIntersection())return!1;const{types:t,checker:r}=e;return t.length===2&&(kSe(r,t[0],t[1])||kSe(r,t[1],t[0]))}function gA(e,t,r){return M0(e.kind)&&e.getStart(r){const r=Oa(t);return!e[r]&&(e[r]=!0)}}function HC(e){return e.getText(0,e.getLength())}function vA(e,t){let r="";for(let i=0;i!t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!(t.externalModuleIndicator||t.commonJsModuleIndicator))}function coe(e){return e.getSourceFiles().some(t=>!t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!t.externalModuleIndicator)}function bH(e){return!!e.module||Da(e)>=2||!!e.noEmit}function qb(e,t){return{fileExists:r=>e.fileExists(r),getCurrentDirectory:()=>t.getCurrentDirectory(),readFile:Os(t,t.readFile),useCaseSensitiveFileNames:Os(t,t.useCaseSensitiveFileNames),getSymlinkCache:Os(t,t.getSymlinkCache)||e.getSymlinkCache,getModuleSpecifierCache:Os(t,t.getModuleSpecifierCache),getPackageJsonInfoCache:()=>{var r;return(r=e.getModuleResolutionCache())==null?void 0:r.getPackageJsonInfoCache()},getGlobalTypingsCacheLocation:Os(t,t.getGlobalTypingsCacheLocation),redirectTargetsMap:e.redirectTargetsMap,getProjectReferenceRedirect:r=>e.getProjectReferenceRedirect(r),isSourceOfProjectReferenceRedirect:r=>e.isSourceOfProjectReferenceRedirect(r),getNearestAncestorDirectoryWithPackageJson:Os(t,t.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:()=>e.getFileIncludeReasons()}}function SH(e,t){return{...qb(e,t),getCommonSourceDirectory:()=>e.getCommonSourceDirectory()}}function X9(e){return e===2||e>=3&&e<=99||e===100}function loe(e,t,r,i){return e||t&&t.length?Yh(e,t,r,i):void 0}function Yh(e,t,r,i,s){return I.createImportDeclaration(void 0,e||t?I.createImportClause(!!s,e,t&&t.length?I.createNamedImports(t):void 0):void 0,typeof r=="string"?ex(r,i):r,void 0)}function ex(e,t){return I.createStringLiteral(e,t===0)}function TH(e,t){return KI(e,t)?1:0}function vf(e,t){if(t.quotePreference&&t.quotePreference!=="auto")return t.quotePreference==="single"?0:1;{const r=e.imports&&kn(e.imports,i=>ra(i)&&!Po(i.parent));return r?TH(r,e):1}}function xH(e){switch(e){case 0:return"'";case 1:return'"';default:return E.assertNever(e)}}function Q9(e){const t=Y9(e);return t===void 0?void 0:bi(t)}function Y9(e){return e.escapedName!=="default"?e.escapedName:ic(e.declarations,t=>{const r=as(t);return r&&r.kind===80?r.escapedText:void 0})}function Z9(e){return Ja(e)&&(Pm(e.parent)||gl(e.parent)||g_(e.parent,!1)&&e.parent.arguments[0]===e||G_(e.parent)&&e.parent.arguments[0]===e)}function SA(e){return Pa(e)&&jp(e.parent)&&Ie(e.name)&&!e.propertyName}function K9(e,t){const r=e.getTypeAtLocation(t.parent);return r&&e.getPropertyOfType(r,t.name.text)}function TA(e,t,r){if(e)for(;e.parent;){if(Ai(e.parent)||!WRe(r,e.parent,t))return e;e=e.parent}}function WRe(e,t,r){return XB(e,t.getStart(r))&&t.getEnd()<=yc(e)}function GC(e,t){return Wp(e)?kn(e.modifiers,r=>r.kind===t):void 0}function D3(e,t,r,i,s){const c=(es(r)?r[0]:r).kind===243?$J:lb,u=wn(t.statements,c);let f=es(r)?qp.detectImportDeclarationSorting(r,s):3;const g=qp.getOrganizeImportsComparer(s,f===2),p=es(r)?Eh(r,(y,S)=>qp.compareImportsOrRequireStatements(y,S,g)):[r];if(!u.length)e.insertNodesAtTopOfFile(t,p,i);else if(u&&(f=qp.detectImportDeclarationSorting(u,s))){const y=qp.getOrganizeImportsComparer(s,f===2);for(const S of p){const T=qp.getImportDeclarationInsertionIndex(u,S,y);if(T===0){const C=u[0]===t.statements[0]?{leadingTriviaOption:Qr.LeadingTriviaOption.Exclude}:{};e.insertNodeBefore(t,u[0],S,!1,C)}else{const C=u[T-1];e.insertNodeAfter(t,C,S)}}}else{const y=Mo(u);y?e.insertNodesAfter(t,y,p):e.insertNodesAtTopOfFile(t,p,i)}}function kH(e,t){return E.assert(e.isTypeOnly),Ms(e.getChildAt(0,t),yH)}function $C(e,t){return!!e&&!!t&&e.start===t.start&&e.length===t.length}function eL(e,t){return e.fileName===t.fileName&&$C(e.textSpan,t.textSpan)}function CH(e,t){if(e){for(let r=0;rus(r)?!0:Pa(r)||jp(r)||Eb(r)?!1:"quit")}function URe(){const e=B8*10;let t,r,i,s;p();const o=y=>u(y,17);return{displayParts:()=>{const y=t.length&&t[t.length-1].text;return s>e&&y&&y!=="..."&&(Ug(y.charCodeAt(y.length-1))||t.push(b_(" ",16)),t.push(b_("...",15))),t},writeKeyword:y=>u(y,5),writeOperator:y=>u(y,12),writePunctuation:y=>u(y,15),writeTrailingSemicolon:y=>u(y,15),writeSpace:y=>u(y,16),writeStringLiteral:y=>u(y,8),writeParameter:y=>u(y,13),writeProperty:y=>u(y,14),writeLiteral:y=>u(y,8),writeSymbol:f,writeLine:g,write:o,writeComment:o,getText:()=>"",getTextPos:()=>0,getColumn:()=>0,getLine:()=>0,isAtStartOfLine:()=>!1,hasTrailingWhitespace:()=>!1,hasTrailingComment:()=>!1,rawWrite:ys,getIndent:()=>i,increaseIndent:()=>{i++},decreaseIndent:()=>{i--},clear:p};function c(){if(!(s>e)&&r){const y=u5(i);y&&(s+=y.length,t.push(b_(y,16))),r=!1}}function u(y,S){s>e||(c(),s+=y.length,t.push(b_(y,S)))}function f(y,S){s>e||(c(),s+=y.length,t.push(_oe(y,S)))}function g(){s>e||(s+=1,t.push(XC()),r=!0)}function p(){t=[],r=!0,i=0,s=0}}function _oe(e,t){return b_(e,r(t));function r(i){const s=i.flags;return s&3?DH(i)?13:9:s&4||s&32768||s&65536?14:s&8?19:s&16?20:s&32?1:s&64?4:s&384?2:s&1536?11:s&8192?10:s&262144?18:s&524288||s&2097152?0:17}}function b_(e,t){return{text:e,kind:aA[t]}}function tc(){return b_(" ",16)}function F_(e){return b_(Hs(e),5)}function Su(e){return b_(Hs(e),15)}function w3(e){return b_(Hs(e),12)}function foe(e){return b_(e,13)}function poe(e){return b_(e,14)}function PH(e){const t=mv(e);return t===void 0?bf(e):F_(t)}function bf(e){return b_(e,17)}function doe(e){return b_(e,0)}function moe(e){return b_(e,18)}function rL(e){return b_(e,24)}function goe(e,t){return{text:e,kind:aA[23],target:{fileName:Or(t).fileName,textSpan:l_(t)}}}function wH(e){return b_(e,22)}function hoe(e,t){var r;const i=pne(e)?"link":dne(e)?"linkcode":"linkplain",s=[wH(`{@${i} `)];if(!e.name)e.text&&s.push(rL(e.text));else{const o=t?.getSymbolAtLocation(e.name),c=qRe(e.text),u=Wc(e.name)+e.text.slice(0,c),f=VRe(e.text.slice(c)),g=o?.valueDeclaration||((r=o?.declarations)==null?void 0:r[0]);g?(s.push(goe(u,g)),f&&s.push(rL(f))):s.push(rL(u+(c?"":" ")+f))}return s.push(wH("}")),s}function VRe(e){let t=0;if(e.charCodeAt(t++)===124){for(;t"&&r--,i++,!r)return i}return 0}function Zh(e,t){var r;return t?.newLineCharacter||((r=e.getNewLine)==null?void 0:r.call(e))||OSe}function XC(){return b_(` +`,6)}function ny(e){try{return e($H),$H.displayParts()}finally{$H.clear()}}function xA(e,t,r,i=0){return ny(s=>{e.writeType(t,r,i|1024|16384,s)})}function A3(e,t,r,i,s=0){return ny(o=>{e.writeSymbol(t,r,i,s|8,o)})}function AH(e,t,r,i=0){return i|=25632,ny(s=>{e.writeSignature(t,r,i,void 0,s)})}function ESe(e,t){const r=t.getSourceFile();return ny(i=>{Gw().writeNode(4,e,r,i)})}function yoe(e){return!!e.parent&&rT(e.parent)&&e.parent.propertyName===e}function NH(e,t){return j5(e,t.getScriptKind&&t.getScriptKind(e))}function voe(e,t){let r=e;for(;HRe(r)||ym(r)&&r.links.target;)ym(r)&&r.links.target?r=r.links.target:r=yu(r,t);return r}function HRe(e){return(e.flags&2097152)!==0}function boe(e,t){return Xs(yu(e,t))}function Soe(e,t){for(;Ug(e.charCodeAt(t));)t+=1;return t}function nL(e,t){for(;t>-1&&Cd(e.charCodeAt(t));)t-=1;return t+1}function wo(e,t=!0){const r=e&&DSe(e);return r&&!t&&O_(r),r}function kA(e,t,r){let i=r(e);return i?rn(i,e):i=DSe(e,r),i&&!t&&O_(i),i}function DSe(e,t){const r=t?o=>kA(o,!0,t):wo,s=sr(e,r,cd,t?o=>o&&IH(o,!0,t):o=>o&&s2(o),r);if(s===e){const o=ra(e)?rn(I.createStringLiteralFromNode(e),e):A_(e)?rn(I.createNumericLiteral(e.text,e.numericLiteralFlags),e):I.cloneNode(e);return tt(o,e)}return s.parent=void 0,s}function s2(e,t=!0){if(e){const r=I.createNodeArray(e.map(i=>wo(i,t)),e.hasTrailingComma);return tt(r,e),r}return e}function IH(e,t,r){return I.createNodeArray(e.map(i=>kA(i,t,r)),e.hasTrailingComma)}function O_(e){FH(e),Toe(e)}function FH(e){xoe(e,1024,$Re)}function Toe(e){xoe(e,2048,Fz)}function Hb(e,t){const r=e.getSourceFile(),i=r.text;GRe(e,i)?QC(e,t,r):EA(e,t,r),N3(e,t,r)}function GRe(e,t){const r=e.getFullStart(),i=e.getStart();for(let s=r;st)}function Gb(e,t){let r=e;for(let i=1;!wI(t,r);i++)r=`${e}_${i}`;return r}function CA(e,t,r,i){let s=0,o=-1;for(const{fileName:c,textChanges:u}of e){E.assert(c===t);for(const f of u){const{span:g,newText:p}=f,y=XRe(p,n1(r));if(y!==-1&&(o=g.start+s+y,!i))return o;s+=p.length-g.length}}return E.assert(i),E.assert(o>=0),o}function QC(e,t,r,i,s){lP(r.text,e.pos,koe(t,r,i,s,NE))}function N3(e,t,r,i,s){uP(r.text,e.end,koe(t,r,i,s,iF))}function EA(e,t,r,i,s){uP(r.text,e.pos,koe(t,r,i,s,NE))}function koe(e,t,r,i,s){return(o,c,u,f)=>{u===3?(o+=2,c-=2):o+=2,s(e,r||u,t.text.slice(o,c),i!==void 0?i:f)}}function XRe(e,t){if(Qi(e,t))return 0;let r=e.indexOf(" "+t);return r===-1&&(r=e.indexOf("."+t)),r===-1&&(r=e.indexOf('"'+t)),r===-1?-1:r+1}function iL(e){return Gr(e)&&e.operatorToken.kind===28||ma(e)||(nw(e)||ane(e))&&ma(e.expression)}function sL(e,t,r){const i=Rh(e.parent);switch(i.kind){case 214:return t.getContextualType(i,r);case 226:{const{left:s,operatorToken:o,right:c}=i;return aL(o.kind)?t.getTypeAtLocation(e===c?s:c):t.getContextualType(e,r)}case 296:return LH(i,t);default:return t.getContextualType(e,r)}}function I3(e,t,r){const i=vf(e,t),s=JSON.stringify(r);return i===0?`'${lp(s).replace(/'/g,"\\'").replace(/\\"/g,'"')}'`:s}function aL(e){switch(e){case 37:case 35:case 38:case 36:return!0;default:return!1}}function Coe(e){switch(e.kind){case 11:case 15:case 228:case 215:return!0;default:return!1}}function OH(e){return!!e.getStringIndexType()||!!e.getNumberIndexType()}function LH(e,t){return t.getTypeAtLocation(e.parent.parent.expression)}function F3(e,t,r,i){const s=r.getTypeChecker();let o=!0;const c=()=>o=!1,u=s.typeToTypeNode(e,t,1,{trackSymbol:(f,g,p)=>(o=o&&s.isSymbolAccessible(f,g,p,!1).accessibility===0,!o),reportInaccessibleThisError:c,reportPrivateInBaseOfClassExpression:c,reportInaccessibleUniqueSymbolError:c,moduleResolverHost:SH(r,i)});return o?u:void 0}function Eoe(e){return e===179||e===180||e===181||e===171||e===173}function PSe(e){return e===262||e===176||e===174||e===177||e===178}function wSe(e){return e===267}function oL(e){return e===243||e===244||e===246||e===251||e===252||e===253||e===257||e===259||e===172||e===265||e===272||e===271||e===278||e===270||e===277}function QRe(e,t){const r=e.getLastToken(t);if(r&&r.kind===27)return!1;if(Eoe(e.kind)){if(r&&r.kind===28)return!1}else if(wSe(e.kind)){const u=Sa(e.getChildren(t));if(u&&Ld(u))return!1}else if(PSe(e.kind)){const u=Sa(e.getChildren(t));if(u&&Dv(u))return!1}else if(!oL(e.kind))return!1;if(e.kind===246)return!0;const i=Ar(e,u=>!u.parent),s=i2(e,i,t);if(!s||s.kind===20)return!0;const o=t.getLineAndCharacterOfPosition(e.getEnd()).line,c=t.getLineAndCharacterOfPosition(s.getStart(t)).line;return o!==c}function cL(e,t,r){const i=Ar(t,s=>s.end!==e?"quit":XH(s.kind));return!!i&&QRe(i,r)}function DA(e){let t=0,r=0;const i=5;return ds(e,function s(o){if(oL(o.kind)){const c=o.getLastToken(e);c?.kind===27?t++:r++}else if(Eoe(o.kind)){const c=o.getLastToken(e);if(c?.kind===27)t++;else if(c&&c.kind!==28){const u=qa(e,c.getStart(e)).line,f=qa(e,Sm(e,c.end).start).line;u!==f&&r++}}return t+r>=i?!0:ds(o,s)}),t===0&&r<=1?!0:t/r>1/i}function lL(e,t){return fL(e,e.getDirectories,t)||[]}function MH(e,t,r,i,s){return fL(e,e.readDirectory,t,r,i,s)||ze}function PA(e,t){return fL(e,e.fileExists,t)}function uL(e,t){return _L(()=>td(t,e))||!1}function _L(e){try{return e()}catch{return}}function fL(e,t,...r){return _L(()=>t&&t.apply(e,r))}function RH(e,t,r){const i=[];return kd(e,s=>{if(s===r)return!0;const o=Hn(s,"package.json");PA(t,o)&&i.push(o)}),i}function Doe(e,t){let r;return kd(e,i=>{if(i==="node_modules"||(r=Nse(i,s=>PA(t,s),"package.json"),r))return!0}),r}function Poe(e,t){if(!t.fileExists)return[];const r=[];return kd(qn(e),i=>{const s=Hn(i,"package.json");if(t.fileExists(s)){const o=jH(s,t);o&&r.push(o)}}),r}function jH(e,t){if(!t.readFile)return;const r=["dependencies","devDependencies","optionalDependencies","peerDependencies"],i=t.readFile(e)||"",s=YRe(i),o={};if(s)for(const f of r){const g=s[f];if(!g)continue;const p=new Map;for(const y in g)p.set(y,g[y]);o[f]=p}const c=[[1,o.dependencies],[2,o.devDependencies],[8,o.optionalDependencies],[4,o.peerDependencies]];return{...o,parseable:!!s,fileName:e,get:u,has(f,g){return!!u(f,g)}};function u(f,g=15){for(const[p,y]of c)if(y&&g&p){const S=y.get(f);if(S!==void 0)return S}}}function O3(e,t,r){const i=(r.getPackageJsonsVisibleToFile&&r.getPackageJsonsVisibleToFile(e.fileName)||Poe(e.fileName,r)).filter(C=>C.parseable);let s,o,c;return{allowsImportingAmbientModule:f,allowsImportingSourceFile:g,allowsImportingSpecifier:p};function u(C){const w=T(C);for(const D of i)if(D.has(w)||D.has(kO(w)))return!0;return!1}function f(C,w){if(!i.length||!C.valueDeclaration)return!0;if(!o)o=new Map;else{const X=o.get(C);if(X!==void 0)return X}const D=lp(C.getName());if(y(D))return o.set(C,!0),!0;const O=C.valueDeclaration.getSourceFile(),z=S(O.fileName,w);if(typeof z>"u")return o.set(C,!0),!0;const W=u(z)||u(D);return o.set(C,W),W}function g(C,w){if(!i.length)return!0;if(!c)c=new Map;else{const z=c.get(C);if(z!==void 0)return z}const D=S(C.fileName,w);if(!D)return c.set(C,!0),!0;const O=u(D);return c.set(C,O),O}function p(C){return!i.length||y(C)||U_(C)||C_(C)?!0:u(C)}function y(C){return!!(Iu(e)&&gg.nodeCoreModules.has(C)&&(s===void 0&&(s=pL(e)),s))}function S(C,w){if(!C.includes("node_modules"))return;const D=Zv.getNodeModulesPackageName(r.getCompilationSettings(),e,C,w,t);if(D&&!U_(D)&&!C_(D))return T(D)}function T(C){const w=fl(i3(C)).slice(1);return Qi(w[0],"@")?`${w[0]}/${w[1]}`:w[0]}}function YRe(e){try{return JSON.parse(e)}catch{return}}function pL(e){return ut(e.imports,({text:t})=>gg.nodeCoreModules.has(t))}function wA(e){return _s(fl(e),"node_modules")}function BH(e){return e.file!==void 0&&e.start!==void 0&&e.length!==void 0}function woe(e,t){const r=l_(e),i=HS(t,r,To,E7);if(i>=0){const s=t[i];return E.assertEqual(s.file,e.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"),Ms(s,BH)}}function Aoe(e,t){var r;let i=HS(t,e.start,c=>c.start,xo);for(i<0&&(i=~i);((r=t[i-1])==null?void 0:r.start)===e.start;)i--;const s=[],o=yc(e);for(;;){const c=Jn(t[i],BH);if(!c||c.start>o)break;DK(e,c)&&s.push(c),i++}return s}function tx({startPosition:e,endPosition:t}){return zc(e,t===void 0?e:t)}function JH(e,t){const r=Ji(e,t.start);return Ar(r,s=>s.getStart(e)yc(t)?"quit":ct(s)&&$C(t,l_(s,e)))}function zH(e,t,r=To){return e?es(e)?r(Yt(e,t)):t(e,0):void 0}function WH(e){return es(e)?ba(e):e}function Noe(e,t){if(ASe(e)){const r=NSe(e);if(r)return r;const i=su.moduleSymbolToValidIdentifier(Ioe(e),t,!1),s=su.moduleSymbolToValidIdentifier(Ioe(e),t,!0);return i===s?i:[i,s]}return e.name}function dL(e,t,r){return ASe(e)?NSe(e)||su.moduleSymbolToValidIdentifier(Ioe(e),t,!!r):e.name}function ASe(e){return!(e.flags&33554432)&&(e.escapedName==="export="||e.escapedName==="default")}function NSe(e){return ic(e.declarations,t=>{var r,i,s;return cc(t)?(r=Jn(bc(t.expression),Ie))==null?void 0:r.text:vu(t)&&t.symbol.flags===2097152?(i=Jn(t.propertyName,Ie))==null?void 0:i.text:(s=Jn(as(t),Ie))==null?void 0:s.text})}function Ioe(e){var t;return E.checkDefined(e.parent,`Symbol parent was undefined. Flags: ${E.formatSymbolFlags(e.flags)}. Declarations: ${(t=e.declarations)==null?void 0:t.map(r=>{const i=E.formatSyntaxKind(r.kind),s=Hr(r),{expression:o}=r;return(s?"[JS]":"")+i+(o?` (expression: ${E.formatSyntaxKind(o.kind)})`:"")}).join(", ")}.`)}function Foe(e,t,r){const i=t.length;if(i+r>e.length)return!1;for(let s=0;svc(r)&&Dd(r))}function mL(e){return!!(QB(e)&65536)}function gL(e,t){return ic(e.imports,i=>{if(gg.nodeCoreModules.has(i.text))return Qi(i.text,"node:")})??t.usesUriStyleNodeCoreModules}function AA(e){return e===` +`?1:0}function $b(e){return es(e)?lg(ls(e[0]),e.slice(1)):ls(e)}function hL({options:e},t){const r=!e.semicolons||e.semicolons==="ignore",i=e.semicolons==="remove"||r&&!DA(t);return{...e,semicolons:i?"remove":"ignore"}}function VH(e){return e===2||e===3}function L3(e,t){return e.isSourceFileFromExternalLibrary(t)||e.isSourceFileDefaultLibrary(t)}function yL(e,t){const r=new Set,i=new Set,s=new Set;for(const u of t)if(!ow(u)){const f=Ha(u.expression);if(vv(f))switch(f.kind){case 15:case 11:r.add(f.text);break;case 9:i.add(parseInt(f.text));break;case 10:const g=pre(fc(f.text,"n")?f.text.slice(0,-1):f.text);g&&s.add(Bv(g));break}else{const g=e.getSymbolAtLocation(u.expression);if(g&&g.valueDeclaration&&$v(g.valueDeclaration)){const p=e.getConstantValue(g.valueDeclaration);p!==void 0&&o(p)}}}return{addValue:o,hasValue:c};function o(u){switch(typeof u){case"string":r.add(u);break;case"number":i.add(u)}}function c(u){switch(typeof u){case"string":return r.has(u);case"number":return i.has(u);case"object":return s.has(Bv(u))}}}function qH(e,t,r,i){var s;const o=typeof e=="string"?e:e.fileName;if(!jv(o))return!1;const c=t.getCompilerOptions(),u=Ul(c),f=typeof e=="string"?Kw(fo(e,r.getCurrentDirectory(),jh(r)),(s=t.getPackageJsonInfoCache)==null?void 0:s.call(t),r,c):e.impliedNodeFormat;if(f===99)return!1;if(f===1||c.verbatimModuleSyntax&&u===1)return!0;if(c.verbatimModuleSyntax&&P5(u))return!1;if(typeof e=="object"){if(e.commonJsModuleIndicator)return!0;if(e.externalModuleIndicator)return!1}return i}var Tu,HH,FSe,vL,GH,$H,OSe,bL,XH,ZRe=Nt({"src/services/utilities.ts"(){"use strict";zn(),Tu=Ih(99,!0),HH=(e=>(e[e.None=0]="None",e[e.Value=1]="Value",e[e.Type=2]="Type",e[e.Namespace=4]="Namespace",e[e.All=7]="All",e))(HH||{}),FSe=/^\/\/\/\s*(e[e.Single=0]="Single",e[e.Double=1]="Double",e))(GH||{}),$H=URe(),OSe=` +`,bL="anonymous function",XH=ed(Eoe,PSe,wSe,oL)}});function QH(e){let t=1;const r=of(),i=new Map,s=new Map;let o;const c={isUsableByFile:T=>T===o,isEmpty:()=>!r.size,clear:()=>{r.clear(),i.clear(),o=void 0},add:(T,C,w,D,O,z,W,X)=>{T!==o&&(c.clear(),o=T);let J;if(O){const se=H5(O.fileName);if(se){const{topLevelNodeModulesIndex:Z,topLevelPackageNameIndex:ve,packageRootIndex:Te}=se;if(J=Bw(i3(O.fileName.substring(ve+1,Te))),Qi(T,O.path.substring(0,Z))){const Me=s.get(J),ke=O.fileName.substring(0,ve+1);if(Me){const he=Me.indexOf(Am);Z>he&&s.set(J,ke)}else s.set(J,ke)}}}const B=z===1&&Xk(C)||C,Y=z===0||yA(B)?bi(w):Noe(B,void 0),ae=typeof Y=="string"?Y:Y[0],_e=typeof Y=="string"?void 0:Y[1],$=lp(D.name),H=t++,K=yu(C,X),oe=C.flags&33554432?void 0:C,Se=D.flags&33554432?void 0:D;(!oe||!Se)&&i.set(H,[C,D]),r.add(f(ae,C,Tl($)?void 0:$,X),{id:H,symbolTableKey:w,symbolName:ae,capitalizedSymbolName:_e,moduleName:$,moduleFile:O,moduleFileName:O?.fileName,packageName:J,exportKind:z,targetFlags:K.flags,isFromPackageJson:W,symbol:oe,moduleSymbol:Se})},get:(T,C)=>{if(T!==o)return;const w=r.get(C);return w?.map(u)},search:(T,C,w,D)=>{if(T===o)return zl(r,(O,z)=>{const{symbolName:W,ambientModuleName:X}=g(z),J=C&&O[0].capitalizedSymbolName||W;if(w(J,O[0].targetFlags)){const B=O.map(u).filter((Y,ae)=>S(Y,O[ae].packageName));if(B.length){const Y=D(B,J,!!X,z);if(Y!==void 0)return Y}}})},releaseSymbols:()=>{i.clear()},onFileChanged:(T,C,w)=>p(T)&&p(C)?!1:o&&o!==C.path||w&&pL(T)!==pL(C)||!Zp(T.moduleAugmentations,C.moduleAugmentations)||!y(T,C)?(c.clear(),!0):(o=C.path,!1)};return E.isDebugging&&Object.defineProperty(c,"__cache",{value:r}),c;function u(T){if(T.symbol&&T.moduleSymbol)return T;const{id:C,exportKind:w,targetFlags:D,isFromPackageJson:O,moduleFileName:z}=T,[W,X]=i.get(C)||ze;if(W&&X)return{symbol:W,moduleSymbol:X,moduleFileName:z,exportKind:w,targetFlags:D,isFromPackageJson:O};const J=(O?e.getPackageJsonAutoImportProvider():e.getCurrentProgram()).getTypeChecker(),ie=T.moduleSymbol||X||E.checkDefined(T.moduleFile?J.getMergedSymbol(T.moduleFile.symbol):J.tryFindAmbientModule(T.moduleName)),B=T.symbol||W||E.checkDefined(w===2?J.resolveExternalModuleSymbol(ie):J.tryGetMemberInModuleExportsAndProperties(bi(T.symbolTableKey),ie),`Could not find symbol '${T.symbolName}' by key '${T.symbolTableKey}' in module ${ie.name}`);return i.set(C,[B,ie]),{symbol:B,moduleSymbol:ie,moduleFileName:z,exportKind:w,targetFlags:D,isFromPackageJson:O}}function f(T,C,w,D){const O=w||"";return`${T.length} ${Xs(yu(C,D))} ${T} ${O}`}function g(T){const C=T.indexOf(" "),w=T.indexOf(" ",C+1),D=parseInt(T.substring(0,C),10),O=T.substring(w+1),z=O.substring(0,D),W=O.substring(D+1);return{symbolName:z,ambientModuleName:W===""?void 0:W}}function p(T){return!T.commonJsModuleIndicator&&!T.externalModuleIndicator&&!T.moduleAugmentations&&!T.ambientModuleNames}function y(T,C){if(!Zp(T.ambientModuleNames,C.ambientModuleNames))return!1;let w=-1,D=-1;for(const O of C.ambientModuleNames){const z=W=>AJ(W)&&W.name.text===O;if(w=Dc(T.statements,z,w+1),D=Dc(C.statements,z,D+1),T.statements[w]!==C.statements[D])return!1}return!0}function S(T,C){if(!C||!T.moduleFileName)return!0;const w=e.getGlobalTypingsCacheLocation();if(w&&Qi(T.moduleFileName,w))return!0;const D=s.get(C);return!D||Qi(T.moduleFileName,D)}}function YH(e,t,r,i,s,o,c){var u;if(t===r)return!1;const f=c?.get(t.path,r.path,i,{});if(f?.isBlockedByPackageJsonDependencies!==void 0)return!f.isBlockedByPackageJsonDependencies;const g=jh(o),p=(u=o.getGlobalTypingsCacheLocation)==null?void 0:u.call(o),y=!!Zv.forEachFileNameOfModule(t.fileName,r.fileName,o,!1,S=>{const T=e.getSourceFile(S);return(T===r||!T)&&KRe(t.fileName,S,g,p)});if(s){const S=y&&s.allowsImportingSourceFile(r,o);return c?.setBlockedByPackageJsonDependencies(t.path,r.path,i,{},!S),S}return y}function KRe(e,t,r,i){const s=kd(t,c=>Pc(c)==="node_modules"?c:void 0),o=s&&qn(r(s));return o===void 0||Qi(r(e),o)||!!i&&Qi(r(i),o)}function ZH(e,t,r,i,s){var o,c;const u=y8(t),f=r.autoImportFileExcludePatterns&&Ii(r.autoImportFileExcludePatterns,p=>{const y=Wz(p,"","exclude");return y?G0(y,u):void 0});LSe(e.getTypeChecker(),e.getSourceFiles(),f,(p,y)=>s(p,y,e,!1));const g=i&&((o=t.getPackageJsonAutoImportProvider)==null?void 0:o.call(t));if(g){const p=_o(),y=e.getTypeChecker();LSe(g.getTypeChecker(),g.getSourceFiles(),f,(S,T)=>{(T&&!e.getSourceFile(T.fileName)||!T&&!y.resolveName(S.name,void 0,1536,!1))&&s(S,T,g,!0)}),(c=t.log)==null||c.call(t,`forEachExternalModuleToImportFrom autoImportProvider: ${_o()-p}`)}}function LSe(e,t,r,i){var s;const o=r&&(c=>r.some(u=>u.test(c)));for(const c of e.getAmbientModules())!c.name.includes("*")&&!(r&&((s=c.declarations)!=null&&s.every(u=>o(u.getSourceFile().fileName))))&&i(c,void 0);for(const c of t)H_(c)&&!o?.(c.fileName)&&i(e.getMergedSymbol(c.symbol),c)}function NA(e,t,r,i,s){var o,c,u,f,g;const p=_o();(o=t.getPackageJsonAutoImportProvider)==null||o.call(t);const y=((c=t.getCachedExportInfoMap)==null?void 0:c.call(t))||QH({getCurrentProgram:()=>r,getPackageJsonAutoImportProvider:()=>{var C;return(C=t.getPackageJsonAutoImportProvider)==null?void 0:C.call(t)},getGlobalTypingsCacheLocation:()=>{var C;return(C=t.getGlobalTypingsCacheLocation)==null?void 0:C.call(t)}});if(y.isUsableByFile(e.path))return(u=t.log)==null||u.call(t,"getExportInfoMap: cache hit"),y;(f=t.log)==null||f.call(t,"getExportInfoMap: cache miss or empty; calculating new results");const S=r.getCompilerOptions();let T=0;try{ZH(r,t,i,!0,(C,w,D,O)=>{++T%100===0&&s?.throwIfCancellationRequested();const z=new Map,W=D.getTypeChecker(),X=SL(C,W,S);X&&MSe(X.symbol,W)&&y.add(e.path,X.symbol,X.exportKind===1?"default":"export=",C,w,X.exportKind,O,W),W.forEachExportAndPropertyOfModule(C,(J,ie)=>{J!==X?.symbol&&MSe(J,W)&&Rp(z,ie)&&y.add(e.path,J,ie,C,w,0,O,W)})})}catch(C){throw y.clear(),C}return(g=t.log)==null||g.call(t,`getExportInfoMap: done in ${_o()-p} ms`),y}function SL(e,t,r){const i=eje(e,t);if(!i)return;const{symbol:s,exportKind:o}=i,c=TL(s,t,r);return c&&{symbol:s,exportKind:o,...c}}function MSe(e,t){return!t.isUndefinedSymbol(e)&&!t.isUnknownSymbol(e)&&!p8(e)&&!fte(e)}function eje(e,t){const r=t.resolveExternalModuleSymbol(e);if(r!==e)return{symbol:r,exportKind:2};const i=t.tryGetMemberInModuleExports("default",e);if(i)return{symbol:i,exportKind:1}}function TL(e,t,r){const i=Xk(e);if(i)return{resolvedSymbol:i,name:i.name};const s=tje(e);if(s!==void 0)return{resolvedSymbol:e,name:s};if(e.flags&2097152){const o=t.getImmediateAliasedSymbol(e);if(o&&o.parent)return TL(o,t,r)}return e.escapedName!=="default"&&e.escapedName!=="export="?{resolvedSymbol:e,name:e.getName()}:{resolvedSymbol:e,name:dL(e,r.target)}}function tje(e){return e.declarations&&ic(e.declarations,t=>{var r;if(cc(t))return(r=Jn(bc(t.expression),Ie))==null?void 0:r.text;if(vu(t))return E.assert(t.name.text==="default","Expected the specifier to be a default export"),t.propertyName&&t.propertyName.text})}var KH,eG,rje=Nt({"src/services/exportInfoMap.ts"(){"use strict";zn(),KH=(e=>(e[e.Named=0]="Named",e[e.Default=1]="Default",e[e.Namespace=2]="Namespace",e[e.CommonJS=3]="CommonJS",e))(KH||{}),eG=(e=>(e[e.Named=0]="Named",e[e.Default=1]="Default",e[e.ExportEquals=2]="ExportEquals",e[e.UMD=3]="UMD",e))(eG||{})}});function RSe(){const e=Ih(99,!1);function t(i,s,o){return sje(r(i,s,o),i)}function r(i,s,o){let c=0,u=0;const f=[],{prefix:g,pushTemplate:p}=cje(s);i=g+i;const y=g.length;p&&f.push(16),e.setText(i);let S=0;const T=[];let C=0;do{c=e.scan(),Uk(c)||(w(),u=c);const D=e.getTokenEnd();if(ije(e.getTokenStart(),D,y,_je(c),T),D>=i.length){const O=nje(e,c,Mo(f));O!==void 0&&(S=O)}}while(c!==1);function w(){switch(c){case 44:case 69:!zSe[u]&&e.reScanSlashToken()===14&&(c=14);break;case 30:u===80&&C++;break;case 32:C>0&&C--;break;case 133:case 154:case 150:case 136:case 155:C>0&&!o&&(c=80);break;case 16:f.push(c);break;case 19:f.length>0&&f.push(c);break;case 20:if(f.length>0){const D=Mo(f);D===16?(c=e.reScanTemplateToken(!1),c===18?f.pop():E.assertEqual(c,17,"Should have been a template middle.")):(E.assertEqual(D,19,"Should have been an open brace"),f.pop())}break;default:if(!a_(c))break;(u===25||a_(u)&&a_(c)&&!oje(u,c))&&(c=80)}}return{endOfLineState:S,spans:T}}return{getClassificationsForLine:t,getEncodedLexicalClassifications:r}}function nje(e,t,r){switch(t){case 11:{if(!e.isUnterminated())return;const i=e.getTokenText(),s=i.length-1;let o=0;for(;i.charCodeAt(s-o)===92;)o++;return o&1?i.charCodeAt(0)===34?3:2:void 0}case 3:return e.isUnterminated()?1:void 0;default:if(M0(t)){if(!e.isUnterminated())return;switch(t){case 18:return 5;case 15:return 4;default:return E.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+t)}}return r===16?6:void 0}}function ije(e,t,r,i,s){if(i===8)return;e===0&&r>0&&(e+=r);const o=t-e;o>0&&s.push(e-r,o,i)}function sje(e,t){const r=[],i=e.spans;let s=0;for(let c=0;c=0){const p=u-s;p>0&&r.push({length:p,classification:4})}r.push({length:f,classification:aje(g)}),s=u+f}const o=t.length-s;return o>0&&r.push({length:o,classification:4}),{entries:r,finalLexState:e.endOfLineState}}function aje(e){switch(e){case 1:return 3;case 3:return 1;case 4:return 6;case 25:return 7;case 5:return 2;case 6:return 8;case 8:return 4;case 10:return 0;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return 5;default:return}}function oje(e,t){if(!pH(e))return!0;switch(t){case 139:case 153:case 137:case 126:case 129:return!0;default:return!1}}function cje(e){switch(e){case 3:return{prefix:`"\\ +`};case 2:return{prefix:`'\\ +`};case 1:return{prefix:`/* +`};case 4:return{prefix:"`\n"};case 5:return{prefix:`} +`,pushTemplate:!0};case 6:return{prefix:"",pushTemplate:!0};case 0:return{prefix:""};default:return E.assertNever(e)}}function lje(e){switch(e){case 42:case 44:case 45:case 40:case 41:case 48:case 49:case 50:case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:case 35:case 36:case 37:case 38:case 51:case 53:case 52:case 56:case 57:case 75:case 74:case 79:case 71:case 72:case 73:case 65:case 66:case 67:case 69:case 70:case 64:case 28:case 61:case 76:case 77:case 78:return!0;default:return!1}}function uje(e){switch(e){case 40:case 41:case 55:case 54:case 46:case 47:return!0;default:return!1}}function _je(e){if(a_(e))return 3;if(lje(e)||uje(e))return 5;if(e>=19&&e<=79)return 10;switch(e){case 9:return 4;case 10:return 25;case 11:return 6;case 14:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;case 80:default:return M0(e)?6:2}}function Loe(e,t,r,i,s){return JSe(tG(e,t,r,i,s))}function jSe(e,t){switch(t){case 267:case 263:case 264:case 262:case 231:case 218:case 219:e.throwIfCancellationRequested()}}function tG(e,t,r,i,s){const o=[];return r.forEachChild(function u(f){if(!(!f||!oI(s,f.pos,f.getFullWidth()))){if(jSe(t,f.kind),Ie(f)&&!sc(f)&&i.has(f.escapedText)){const g=e.getSymbolAtLocation(f),p=g&&BSe(g,Wb(f),e);p&&c(f.getStart(r),f.getEnd(),p)}f.forEachChild(u)}}),{spans:o,endOfLineState:0};function c(u,f,g){const p=f-u;E.assert(p>0,`Classification had non-positive length of ${p}`),o.push(u),o.push(p),o.push(g)}}function BSe(e,t,r){const i=e.getFlags();if(i&2885600)return i&32?11:i&384?12:i&524288?16:i&1536?t&4||t&1&&fje(e)?14:void 0:i&2097152?BSe(r.getAliasedSymbol(e),t,r):t&2?i&64?13:i&262144?15:void 0:void 0}function fje(e){return ut(e.declarations,t=>vc(t)&&rh(t)===1)}function pje(e){switch(e){case 1:return"comment";case 2:return"identifier";case 3:return"keyword";case 4:return"number";case 25:return"bigint";case 5:return"operator";case 6:return"string";case 8:return"whitespace";case 9:return"text";case 10:return"punctuation";case 11:return"class name";case 12:return"enum name";case 13:return"interface name";case 14:return"module name";case 15:return"type parameter name";case 16:return"type alias name";case 17:return"parameter name";case 18:return"doc comment tag name";case 19:return"jsx open tag name";case 20:return"jsx close tag name";case 21:return"jsx self closing tag name";case 22:return"jsx attribute";case 23:return"jsx text";case 24:return"jsx attribute string literal value";default:return}}function JSe(e){E.assert(e.spans.length%3===0);const t=e.spans,r=[];for(let i=0;i])*)(\/>)?)?/im,Y=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/img,ae=t.text.substr(J,ie),_e=B.exec(ae);if(!_e||!_e[3]||!(_e[3]in ZD))return!1;let $=J;y($,_e[1].length),$+=_e[1].length,f($,_e[2].length,10),$+=_e[2].length,f($,_e[3].length,21),$+=_e[3].length;const H=_e[4];let K=$;for(;;){const Se=Y.exec(H);if(!Se)break;const se=$+Se.index+Se[1].length;se>K&&(y(K,se-K),K=se),f(K,Se[2].length,22),K+=Se[2].length,Se[3].length&&(y(K,Se[3].length),K+=Se[3].length),f(K,Se[4].length,5),K+=Se[4].length,Se[5].length&&(y(K,Se[5].length),K+=Se[5].length),f(K,Se[6].length,24),K+=Se[6].length}$+=_e[4].length,$>K&&y(K,$-K),_e[5]&&(f($,_e[5].length,10),$+=_e[5].length);const oe=J+ie;return $=0),Y>0){const ae=ie||W(J.kind,J);ae&&f(B,Y,ae)}return!0}function z(J){switch(J.parent&&J.parent.kind){case 286:if(J.parent.tagName===J)return 19;break;case 287:if(J.parent.tagName===J)return 20;break;case 285:if(J.parent.tagName===J)return 21;break;case 291:if(J.parent.name===J)return 22;break}}function W(J,ie){if(a_(J))return 3;if((J===30||J===32)&&ie&&noe(ie.parent))return 10;if(az(J)){if(ie){const B=ie.parent;if(J===64&&(B.kind===260||B.kind===172||B.kind===169||B.kind===291)||B.kind===226||B.kind===224||B.kind===225||B.kind===227)return 5}return 10}else{if(J===9)return 4;if(J===10)return 25;if(J===11)return ie&&ie.parent.kind===291?24:6;if(J===14)return 6;if(M0(J))return 6;if(J===12)return 23;if(J===80){if(ie){switch(ie.parent.kind){case 263:return ie.parent.name===ie?11:void 0;case 168:return ie.parent.name===ie?15:void 0;case 264:return ie.parent.name===ie?13:void 0;case 266:return ie.parent.name===ie?12:void 0;case 267:return ie.parent.name===ie?14:void 0;case 169:return ie.parent.name===ie?Lv(ie)?3:17:void 0}if(Vg(ie.parent))return 3}return 2}}}function X(J){if(J&&dP(i,s,J.pos,J.getFullWidth())){jSe(e,J.kind);for(const ie of J.getChildren(t))O(ie)||X(ie)}}}var zSe,WSe=Nt({"src/services/classifier.ts"(){"use strict";zn(),zSe=UZ([80,11,9,10,14,110,46,47,22,24,20,112,97],e=>e,()=>!0)}}),xL,dje=Nt({"src/services/documentHighlights.ts"(){"use strict";zn(),(e=>{function t($,H,K,oe,Se){const se=c_(K,oe);if(se.parent&&(Md(se.parent)&&se.parent.tagName===se||Vv(se.parent))){const{openingElement:Z,closingElement:ve}=se.parent.parent,Te=[Z,ve].map(({tagName:Me})=>r(Me,K));return[{fileName:K.fileName,highlightSpans:Te}]}return i(oe,se,$,H,Se)||s(se,K)}e.getDocumentHighlights=t;function r($,H){return{fileName:H.fileName,textSpan:l_($,H),kind:"none"}}function i($,H,K,oe,Se){const se=new Set(Se.map(Me=>Me.fileName)),Z=ho.getReferenceEntriesForNode($,H,K,Se,oe,void 0,se);if(!Z)return;const ve=VD(Z.map(ho.toHighlightSpan),Me=>Me.fileName,Me=>Me.span),Te=tu(K.useCaseSensitiveFileNames());return fs(nk(ve.entries(),([Me,ke])=>{if(!se.has(Me)){if(!K.redirectTargetsMap.has(fo(Me,K.getCurrentDirectory(),Te)))return;const he=K.getSourceFile(Me);Me=kn(Se,lt=>!!lt.redirectInfo&<.redirectInfo.redirectTarget===he).fileName,E.assert(se.has(Me))}return{fileName:Me,highlightSpans:ke}}))}function s($,H){const K=o($,H);return K&&[{fileName:H.fileName,highlightSpans:K}]}function o($,H){switch($.kind){case 101:case 93:return Pb($.parent)?Y($.parent,H):void 0;case 107:return oe($.parent,Bp,X);case 111:return oe($.parent,BW,W);case 113:case 85:case 98:const se=$.kind===85?$.parent.parent:$.parent;return oe(se,Ab,z);case 109:return oe($.parent,sw,O);case 84:case 90:return ow($.parent)||mC($.parent)?oe($.parent.parent.parent,sw,O):void 0;case 83:case 88:return oe($.parent,N4,D);case 99:case 117:case 92:return oe($.parent,Z=>j0(Z,!0),w);case 137:return K(gc,[137]);case 139:case 153:return K(R0,[139,153]);case 135:return oe($.parent,Z0,J);case 134:return Se(J($));case 127:return Se(ie($));case 103:return;default:return Oh($.kind)&&(hu($.parent)||ec($.parent))?Se(S($.kind,$.parent)):void 0}function K(se,Z){return oe($.parent,se,ve=>{var Te;return Ii((Te=Jn(ve,Ed))==null?void 0:Te.symbol.declarations,Me=>se(Me)?kn(Me.getChildren(H),ke=>_s(Z,ke.kind)):void 0)})}function oe(se,Z,ve){return Z(se)?Se(ve(se,H)):void 0}function Se(se){return se&&se.map(Z=>r(Z,H))}}function c($){return BW($)?[$]:Ab($)?Xi($.catchClause?c($.catchClause):$.tryBlock&&c($.tryBlock),$.finallyBlock&&c($.finallyBlock)):ks($)?void 0:g($,c)}function u($){let H=$;for(;H.parent;){const K=H.parent;if(Dv(K)||K.kind===312)return K;if(Ab(K)&&K.tryBlock===H&&K.catchClause)return H;H=K}}function f($){return N4($)?[$]:ks($)?void 0:g($,f)}function g($,H){const K=[];return $.forEachChild(oe=>{const Se=H(oe);Se!==void 0&&K.push(...$S(Se))}),K}function p($,H){const K=y(H);return!!K&&K===$}function y($){return Ar($,H=>{switch(H.kind){case 255:if($.kind===251)return!1;case 248:case 249:case 250:case 247:case 246:return!$.label||_e(H,$.label.escapedText);default:return ks(H)&&"quit"}})}function S($,H){return Ii(T(H,mT($)),K=>GC(K,$))}function T($,H){const K=$.parent;switch(K.kind){case 268:case 312:case 241:case 296:case 297:return H&64&&Vc($)?[...$.members,$]:K.statements;case 176:case 174:case 262:return[...K.parameters,...Qn(K.parent)?K.parent.members:[]];case 263:case 231:case 264:case 187:const oe=K.members;if(H&15){const Se=kn(K.members,gc);if(Se)return[...oe,...Se.parameters]}else if(H&64)return[...oe,K];return oe;case 210:return;default:E.assertNever(K,"Invalid container kind.")}}function C($,H,...K){return H&&_s(K,H.kind)?($.push(H),!0):!1}function w($){const H=[];if(C(H,$.getFirstToken(),99,117,92)&&$.kind===246){const K=$.getChildren();for(let oe=K.length-1;oe>=0&&!C(H,K[oe],117);oe--);}return Zt(f($.statement),K=>{p($,K)&&C(H,K.getFirstToken(),83,88)}),H}function D($){const H=y($);if(H)switch(H.kind){case 248:case 249:case 250:case 246:case 247:return w(H);case 255:return O(H)}}function O($){const H=[];return C(H,$.getFirstToken(),109),Zt($.caseBlock.clauses,K=>{C(H,K.getFirstToken(),84,90),Zt(f(K),oe=>{p($,oe)&&C(H,oe.getFirstToken(),83)})}),H}function z($,H){const K=[];if(C(K,$.getFirstToken(),113),$.catchClause&&C(K,$.catchClause.getFirstToken(),85),$.finallyBlock){const oe=Ua($,98,H);C(K,oe,98)}return K}function W($,H){const K=u($);if(!K)return;const oe=[];return Zt(c(K),Se=>{oe.push(Ua(Se,111,H))}),Dv(K)&&Ev(K,Se=>{oe.push(Ua(Se,107,H))}),oe}function X($,H){const K=uf($);if(!K)return;const oe=[];return Ev(Ms(K.body,Ss),Se=>{oe.push(Ua(Se,107,H))}),Zt(c(K.body),Se=>{oe.push(Ua(Se,111,H))}),oe}function J($){const H=uf($);if(!H)return;const K=[];return H.modifiers&&H.modifiers.forEach(oe=>{C(K,oe,134)}),ds(H,oe=>{B(oe,Se=>{Z0(Se)&&C(K,Se.getFirstToken(),135)})}),K}function ie($){const H=uf($);if(!H)return;const K=[];return ds(H,oe=>{B(oe,Se=>{zF(Se)&&C(K,Se.getFirstToken(),127)})}),K}function B($,H){H($),!ks($)&&!Qn($)&&!Mu($)&&!vc($)&&!Jp($)&&!Si($)&&ds($,K=>B(K,H))}function Y($,H){const K=ae($,H),oe=[];for(let Se=0;Se=se.end;Te--)if(!Cd(H.text.charCodeAt(Te))){ve=!1;break}if(ve){oe.push({fileName:H.fileName,textSpan:zc(se.getStart(),Z.end),kind:"reference"}),Se++;continue}}oe.push(r(K[Se],H))}return oe}function ae($,H){const K=[];for(;Pb($.parent)&&$.parent.elseStatement===$;)$=$.parent;for(;;){const oe=$.getChildren(H);C(K,oe[0],101);for(let Se=oe.length-1;Se>=0&&!C(K,oe[Se],93);Se--);if(!$.elseStatement||!Pb($.elseStatement))break;$=$.elseStatement}return K}function _e($,H){return!!Ar($.parent,K=>Uv(K)?K.label.escapedText===H:"quit")}})(xL||(xL={}))}});function IA(e){return!!e.sourceFile}function Roe(e,t,r){return nG(e,t,r)}function nG(e,t="",r,i){const s=new Map,o=tu(!!e);function c(){const D=fs(s.keys()).filter(O=>O&&O.charAt(0)==="_").map(O=>{const z=s.get(O),W=[];return z.forEach((X,J)=>{IA(X)?W.push({name:J,scriptKind:X.sourceFile.scriptKind,refCount:X.languageServiceRefCount}):X.forEach((ie,B)=>W.push({name:J,scriptKind:B,refCount:ie.languageServiceRefCount}))}),W.sort((X,J)=>J.refCount-X.refCount),{bucket:O,sourceFiles:W}});return JSON.stringify(D,void 0,2)}function u(D){return typeof D.getCompilationSettings=="function"?D.getCompilationSettings():D}function f(D,O,z,W,X,J){const ie=fo(D,t,o),B=iG(u(O));return g(D,ie,O,B,z,W,X,J)}function g(D,O,z,W,X,J,ie,B){return T(D,O,z,W,X,J,!0,ie,B)}function p(D,O,z,W,X,J){const ie=fo(D,t,o),B=iG(u(O));return y(D,ie,O,B,z,W,X,J)}function y(D,O,z,W,X,J,ie,B){return T(D,O,u(z),W,X,J,!1,ie,B)}function S(D,O){const z=IA(D)?D:D.get(E.checkDefined(O,"If there are more than one scriptKind's for same document the scriptKind should be provided"));return E.assert(O===void 0||!z||z.sourceFile.scriptKind===O,`Script kind should match provided ScriptKind:${O} and sourceFile.scriptKind: ${z?.sourceFile.scriptKind}, !entry: ${!z}`),z}function T(D,O,z,W,X,J,ie,B,Y){var ae,_e,$,H;B=j5(D,B);const K=u(z),oe=z===K?void 0:z,Se=B===6?100:Da(K),se=typeof Y=="object"?Y:{languageVersion:Se,impliedNodeFormat:oe&&Kw(O,(H=($=(_e=(ae=oe.getCompilerHost)==null?void 0:ae.call(oe))==null?void 0:_e.getModuleResolutionCache)==null?void 0:$.call(_e))==null?void 0:H.getPackageJsonInfoCache(),oe,K),setExternalModuleIndicator:P8(K),jsDocParsingMode:r};se.languageVersion=Se,E.assertEqual(r,se.jsDocParsingMode);const Z=s.size,ve=joe(W,se.impliedNodeFormat),Te=u4(s,ve,()=>new Map);if(Jr){s.size>Z&&Jr.instant(Jr.Phase.Session,"createdDocumentRegistryBucket",{configFilePath:K.configFilePath,key:ve});const be=!Il(O)&&zl(s,(lt,pt)=>pt!==ve&<.has(O)&&pt);be&&Jr.instant(Jr.Phase.Session,"documentRegistryBucketOverlap",{path:O,key1:be,key2:ve})}const Me=Te.get(O);let ke=Me&&S(Me,B);if(!ke&&i){const be=i.getDocument(ve,O);be&&(E.assert(ie),ke={sourceFile:be,languageServiceRefCount:0},he())}if(ke)ke.sourceFile.version!==J&&(ke.sourceFile=HG(ke.sourceFile,X,J,X.getChangeRange(ke.sourceFile.scriptSnapshot)),i&&i.setDocument(ve,O,ke.sourceFile)),ie&&ke.languageServiceRefCount++;else{const be=$L(D,X,se,J,!1,B);i&&i.setDocument(ve,O,be),ke={sourceFile:be,languageServiceRefCount:1},he()}return E.assert(ke.languageServiceRefCount!==0),ke.sourceFile;function he(){if(!Me)Te.set(O,ke);else if(IA(Me)){const be=new Map;be.set(Me.sourceFile.scriptKind,Me),be.set(B,ke),Te.set(O,be)}else Me.set(B,ke)}}function C(D,O,z,W){const X=fo(D,t,o),J=iG(O);return w(X,J,z,W)}function w(D,O,z,W){const X=E.checkDefined(s.get(joe(O,W))),J=X.get(D),ie=S(J,z);ie.languageServiceRefCount--,E.assert(ie.languageServiceRefCount>=0),ie.languageServiceRefCount===0&&(IA(J)?X.delete(D):(J.delete(z),J.size===1&&X.set(D,JD(J.values(),To))))}return{acquireDocument:f,acquireDocumentWithKey:g,updateDocument:p,updateDocumentWithKey:y,releaseDocument:C,releaseDocumentWithKey:w,getKeyForCompilationSettings:iG,getDocumentRegistryBucketKeyWithMode:joe,reportStats:c,getBuckets:()=>s}}function iG(e){return RU(e,_O)}function joe(e,t){return t?`${e}|${t}`:e}var mje=Nt({"src/services/documentRegistry.ts"(){"use strict";zn()}});function Boe(e,t,r,i,s,o,c){const u=y8(i),f=tu(u),g=sG(t,r,f,c),p=sG(r,t,f,c);return Qr.ChangeTracker.with({host:i,formatContext:s,preferences:o},y=>{hje(e,y,g,t,r,i.getCurrentDirectory(),u),yje(e,y,g,p,i,f)})}function sG(e,t,r,i){const s=r(e);return c=>{const u=i&&i.tryGetSourcePosition({fileName:c,pos:0}),f=o(u?u.fileName:c);return u?f===void 0?void 0:gje(u.fileName,f,c,r):f};function o(c){if(r(c)===s)return t;const u=Jz(c,s,r);return u===void 0?void 0:t+"/"+u}}function gje(e,t,r,i){const s=iP(e,t,i);return Joe(qn(r),s)}function hje(e,t,r,i,s,o,c){const{configFile:u}=e.getCompilerOptions();if(!u)return;const f=qn(u.fileName),g=W4(u);if(!g)return;zoe(g,(T,C)=>{switch(C){case"files":case"include":case"exclude":{if(p(T)||C!=="include"||!Lu(T.initializer))return;const D=Ii(T.initializer.elements,z=>ra(z)?z.text:void 0);if(D.length===0)return;const O=R5(f,[],D,c,o);G0(E.checkDefined(O.includeFilePattern),c).test(i)&&!G0(E.checkDefined(O.includeFilePattern),c).test(s)&&t.insertNodeAfter(u,Sa(T.initializer.elements),I.createStringLiteral(S(s)));return}case"compilerOptions":zoe(T.initializer,(w,D)=>{const O=gU(D);E.assert(O?.type!=="listOrElement"),O&&(O.isFilePath||O.type==="list"&&O.element.isFilePath)?p(w):D==="paths"&&zoe(w.initializer,z=>{if(Lu(z.initializer))for(const W of z.initializer.elements)y(W)})});return}});function p(T){const C=Lu(T.initializer)?T.initializer.elements:[T.initializer];let w=!1;for(const D of C)w=y(D)||w;return w}function y(T){if(!ra(T))return!1;const C=Joe(f,T.text),w=r(C);return w!==void 0?(t.replaceRangeWithText(u,VSe(T,u),S(w)),!0):!1}function S(T){return mm(f,T,!c)}}function yje(e,t,r,i,s,o){const c=e.getSourceFiles();for(const u of c){const f=r(u.fileName),g=f??u.fileName,p=qn(g),y=i(u.fileName),S=y||u.fileName,T=qn(S),C=f!==void 0||y!==void 0;Sje(u,t,w=>{if(!U_(w))return;const D=Joe(T,w),O=r(D);return O===void 0?void 0:dv(mm(p,O,o))},w=>{const D=e.getTypeChecker().getSymbolAtLocation(w);if(D?.declarations&&D.declarations.some(z=>ru(z)))return;const O=y!==void 0?USe(w,AC(w.text,S,e.getCompilerOptions(),s),r,c):bje(D,w,u,e,s,r);return O!==void 0&&(O.updated||C&&U_(w.text))?Zv.updateModuleSpecifier(e.getCompilerOptions(),u,o(g),O.newFileName,qb(e,s),w.text):void 0})}}function vje(e,t){return qs(Hn(e,t))}function Joe(e,t){return dv(vje(e,t))}function bje(e,t,r,i,s,o){if(e){const c=kn(e.declarations,Ai).fileName,u=o(c);return u===void 0?{newFileName:c,updated:!1}:{newFileName:u,updated:!0}}else{const c=ld(r,t),u=s.resolveModuleNameLiterals||!s.resolveModuleNames?i.getResolvedModule(r,t.text,c):s.getResolvedModuleWithFailedLookupLocationsFromCache&&s.getResolvedModuleWithFailedLookupLocationsFromCache(t.text,r.fileName,c);return USe(t,u,o,i.getSourceFiles())}}function USe(e,t,r,i){if(!t)return;if(t.resolvedModule){const f=u(t.resolvedModule.resolvedFileName);if(f)return f}const s=Zt(t.failedLookupLocations,o)||U_(e.text)&&Zt(t.failedLookupLocations,c);if(s)return s;return t.resolvedModule&&{newFileName:t.resolvedModule.resolvedFileName,updated:!1};function o(f){const g=r(f);return g&&kn(i,p=>p.fileName===g)?c(f):void 0}function c(f){return fc(f,"/package.json")?void 0:u(f)}function u(f){const g=r(f);return g&&{newFileName:g,updated:!0}}}function Sje(e,t,r,i){for(const s of e.referencedFiles||ze){const o=r(s.fileName);o!==void 0&&o!==e.text.slice(s.pos,s.end)&&t.replaceRangeWithText(e,s,o)}for(const s of e.imports){const o=i(s);o!==void 0&&o!==s.text&&t.replaceRangeWithText(e,VSe(s,e),o)}}function VSe(e,t){return Lf(e.getStart(t)+1,e.end-1)}function zoe(e,t){if(ma(e))for(const r of e.properties)Hc(r)&&ra(r.name)&&t(r,r.name.text)}var Tje=Nt({"src/services/getEditsForFileRename.ts"(){"use strict";zn()}});function M3(e,t){return{kind:e,isCaseSensitive:t}}function Woe(e){const t=new Map,r=e.trim().split(".").map(i=>Eje(i.trim()));if(r.length===1&&r[0].totalTextChunk.text==="")return{getMatchForLastSegmentOfPattern:()=>M3(2,!0),getFullMatch:()=>M3(2,!0),patternContainsDots:!1};if(!r.some(i=>!i.subWordTextChunks.length))return{getFullMatch:(i,s)=>xje(i,s,r,t),getMatchForLastSegmentOfPattern:i=>Uoe(i,Sa(r),t),patternContainsDots:r.length>1}}function xje(e,t,r,i){if(!Uoe(t,Sa(r),i)||r.length-1>e.length)return;let o;for(let c=r.length-2,u=e.length-1;c>=0;c-=1,u-=1)o=GSe(o,Uoe(e[u],r[c],i));return o}function qSe(e,t){let r=t.get(e);return r||t.set(e,r=Xoe(e)),r}function HSe(e,t,r){const i=Dje(e,t.textLowerCase);if(i===0)return M3(t.text.length===e.length?0:1,Qi(e,t.text));if(t.isLowerCase){if(i===-1)return;const s=qSe(e,r);for(const o of s)if(Voe(e,o,t.text,!0))return M3(2,Voe(e,o,t.text,!1));if(t.text.length0)return M3(2,!0);if(t.characterSpans.length>0){const s=qSe(e,r),o=$Se(e,s,t,!1)?!0:$Se(e,s,t,!0)?!1:void 0;if(o!==void 0)return M3(3,o)}}}function Uoe(e,t,r){if(aG(t.totalTextChunk.text,o=>o!==32&&o!==42)){const o=HSe(e,t.totalTextChunk,r);if(o)return o}const i=t.subWordTextChunks;let s;for(const o of i)s=GSe(s,HSe(e,o,r));return s}function GSe(e,t){return xj([e,t],kje)}function kje(e,t){return e===void 0?1:t===void 0?-1:xo(e.kind,t.kind)||pv(!e.isCaseSensitive,!t.isCaseSensitive)}function Voe(e,t,r,i,s={start:0,length:r.length}){return s.length<=t.length&&ZSe(0,s.length,o=>Cje(r.charCodeAt(s.start+o),e.charCodeAt(t.start+o),i))}function Cje(e,t,r){return r?qoe(e)===qoe(t):e===t}function $Se(e,t,r,i){const s=r.characterSpans;let o=0,c=0,u,f;for(;;){if(c===s.length)return!0;if(o===t.length)return!1;let g=t[o],p=!1;for(;c=65&&e<=90)return!0;if(e<127||!rI(e,99))return!1;const t=String.fromCharCode(e);return t===t.toUpperCase()}function XSe(e){if(e>=97&&e<=122)return!0;if(e<127||!rI(e,99))return!1;const t=String.fromCharCode(e);return t===t.toLowerCase()}function Dje(e,t){const r=e.length-t.length;for(let i=0;i<=r;i++)if(aG(t,(s,o)=>qoe(e.charCodeAt(o+i))===s))return i;return-1}function qoe(e){return e>=65&&e<=90?97+(e-65):e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function Hoe(e){return e>=48&&e<=57}function Pje(e){return YC(e)||XSe(e)||Hoe(e)||e===95||e===36}function wje(e){const t=[];let r=0,i=0;for(let s=0;s0&&(t.push(Goe(e.substr(r,i))),i=0)}return i>0&&t.push(Goe(e.substr(r,i))),t}function Goe(e){const t=e.toLowerCase();return{text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:$oe(e)}}function $oe(e){return QSe(e,!1)}function Xoe(e){return QSe(e,!0)}function QSe(e,t){const r=[];let i=0;for(let s=1;sQoe(i)&&i!==95,t,r)}function Aje(e,t,r){return t!==r&&t+1t(e.charCodeAt(s),s))}var kL,Ije=Nt({"src/services/patternMatcher.ts"(){"use strict";zn(),kL=(e=>(e[e.exact=0]="exact",e[e.prefix=1]="prefix",e[e.substring=2]="substring",e[e.camelCase=3]="camelCase",e))(kL||{})}});function KSe(e,t=!0,r=!1){const i={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0},s=[];let o,c,u,f=0,g=!1;function p(){return c=u,u=Tu.scan(),u===19?f++:u===20&&f--,u}function y(){const J=Tu.getTokenValue(),ie=Tu.getTokenStart();return{fileName:J,pos:ie,end:ie+J.length}}function S(){o||(o=[]),o.push({ref:y(),depth:f})}function T(){s.push(y()),C()}function C(){f===0&&(g=!0)}function w(){let J=Tu.getToken();return J===138?(J=p(),J===144&&(J=p(),J===11&&S()),!0):!1}function D(){if(c===25)return!1;let J=Tu.getToken();if(J===102){if(J=p(),J===21){if(J=p(),J===11||J===15)return T(),!0}else{if(J===11)return T(),!0;if(J===156&&Tu.lookAhead(()=>{const B=Tu.scan();return B!==161&&(B===42||B===19||B===80||a_(B))})&&(J=p()),J===80||a_(J))if(J=p(),J===161){if(J=p(),J===11)return T(),!0}else if(J===64){if(z(!0))return!0}else if(J===28)J=p();else return!0;if(J===19){for(J=p();J!==20&&J!==1;)J=p();J===20&&(J=p(),J===161&&(J=p(),J===11&&T()))}else J===42&&(J=p(),J===130&&(J=p(),(J===80||a_(J))&&(J=p(),J===161&&(J=p(),J===11&&T()))))}return!0}return!1}function O(){let J=Tu.getToken();if(J===95){if(C(),J=p(),J===156&&Tu.lookAhead(()=>{const B=Tu.scan();return B===42||B===19})&&(J=p()),J===19){for(J=p();J!==20&&J!==1;)J=p();J===20&&(J=p(),J===161&&(J=p(),J===11&&T()))}else if(J===42)J=p(),J===161&&(J=p(),J===11&&T());else if(J===102&&(J=p(),J===156&&Tu.lookAhead(()=>{const B=Tu.scan();return B===80||a_(B)})&&(J=p()),(J===80||a_(J))&&(J=p(),J===64&&z(!0))))return!0;return!0}return!1}function z(J,ie=!1){let B=J?p():Tu.getToken();return B===149?(B=p(),B===21&&(B=p(),(B===11||ie&&B===15)&&T()),!0):!1}function W(){let J=Tu.getToken();if(J===80&&Tu.getTokenValue()==="define"){if(J=p(),J!==21)return!0;if(J=p(),J===11||J===15)if(J=p(),J===28)J=p();else return!0;if(J!==23)return!0;for(J=p();J!==24&&J!==1;)(J===11||J===15)&&T(),J=p();return!0}return!1}function X(){for(Tu.setText(e),p();Tu.getToken()!==1;){if(Tu.getToken()===16){const J=[Tu.getToken()];e:for(;Ir(J);){const ie=Tu.scan();switch(ie){case 1:break e;case 102:D();break;case 16:J.push(ie);break;case 19:Ir(J)&&J.push(ie);break;case 20:Ir(J)&&(Mo(J)===16?Tu.reScanTemplateToken(!1)===18&&J.pop():J.pop());break}}p()}w()||D()||O()||r&&(z(!1,!0)||W())||p()}Tu.setText(void 0)}if(t&&X(),uU(i,e),_U(i,Ca),g){if(o)for(const J of o)s.push(J.ref);return{referencedFiles:i.referencedFiles,typeReferenceDirectives:i.typeReferenceDirectives,libReferenceDirectives:i.libReferenceDirectives,importedFiles:s,isLibFile:!!i.hasNoDefaultLib,ambientExternalModules:void 0}}else{let J;if(o)for(const ie of o)ie.depth===0?(J||(J=[]),J.push(ie.ref.fileName)):s.push(ie.ref);return{referencedFiles:i.referencedFiles,typeReferenceDirectives:i.typeReferenceDirectives,libReferenceDirectives:i.libReferenceDirectives,importedFiles:s,isLibFile:!!i.hasNoDefaultLib,ambientExternalModules:J}}}var Fje=Nt({"src/services/preProcess.ts"(){"use strict";zn()}});function Yoe(e){const t=tu(e.useCaseSensitiveFileNames()),r=e.getCurrentDirectory(),i=new Map,s=new Map;return{tryGetSourcePosition:u,tryGetGeneratedPosition:f,toLineColumnOffset:S,clearCache:T};function o(C){return fo(C,r,t)}function c(C,w){const D=o(C),O=s.get(D);if(O)return O;let z;if(e.getDocumentPositionMapper)z=e.getDocumentPositionMapper(C,w);else if(e.readFile){const W=y(C);z=W&&oG({getSourceFileLike:y,getCanonicalFileName:t,log:X=>e.log(X)},C,sV(W.text,Wg(W)),X=>!e.fileExists||e.fileExists(X)?e.readFile(X):void 0)}return s.set(D,z||MO),z||MO}function u(C){if(!Il(C.fileName)||!g(C.fileName))return;const D=c(C.fileName).getSourcePosition(C);return!D||D===C?void 0:u(D)||D}function f(C){if(Il(C.fileName))return;const w=g(C.fileName);if(!w)return;const D=e.getProgram();if(D.isSourceOfProjectReferenceRedirect(w.fileName))return;const O=D.getCompilerOptions(),z=to(O),W=z?Ou(z)+".d.ts":f5(C.fileName,D.getCompilerOptions(),r,D.getCommonSourceDirectory(),t);if(W===void 0)return;const X=c(W,C.fileName).getGeneratedPosition(C);return X===C?void 0:X}function g(C){const w=e.getProgram();if(!w)return;const D=o(C),O=w.getSourceFileByPath(D);return O&&O.resolvedPath===D?O:void 0}function p(C){const w=o(C),D=i.get(w);if(D!==void 0)return D||void 0;if(!e.readFile||e.fileExists&&!e.fileExists(w)){i.set(w,!1);return}const O=e.readFile(w),z=O?Oje(O):!1;return i.set(w,z),z||void 0}function y(C){return e.getSourceFileLike?e.getSourceFileLike(C):g(C)||p(C)}function S(C,w){return y(C).getLineAndCharacterOfPosition(w)}function T(){i.clear(),s.clear()}}function oG(e,t,r,i){let s=Bie(r);if(s){const u=tTe.exec(s);if(u){if(u[1]){const f=u[1];return eTe(e,jte(Bl,f),t)}s=void 0}}const o=[];s&&o.push(s),o.push(t+".map");const c=s&&is(s,qn(t));for(const u of o){const f=is(u,qn(t)),g=i(f,c);if(ns(g))return eTe(e,g,f);if(g!==void 0)return g||void 0}}function eTe(e,t,r){const i=aV(t);if(!(!i||!i.sources||!i.file||!i.mappings)&&!(i.sourcesContent&&i.sourcesContent.some(ns)))return Wie(e,i,r)}function Oje(e,t){return{text:e,lineMap:t,getLineAndCharacterOfPosition(r){return _k(Wg(this),r)}}}var tTe,Lje=Nt({"src/services/sourcemaps.ts"(){"use strict";zn(),tTe=/^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+/=]+)$)?/}});function cG(e,t,r){var i;t.getSemanticDiagnostics(e,r);const s=[],o=t.getTypeChecker();!(e.impliedNodeFormat===1||Jc(e.fileName,[".cts",".cjs"]))&&e.commonJsModuleIndicator&&(coe(t)||bH(t.getCompilerOptions()))&&Mje(e)&&s.push(mn(Jje(e.commonJsModuleIndicator),d.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module));const u=Iu(e);if(fG.clear(),f(e),vT(t.getCompilerOptions()))for(const g of e.imports){const p=G4(g),y=Rje(p);if(!y)continue;const S=(i=t.getResolvedModule(e,g.text,ld(e,g)))==null?void 0:i.resolvedModule,T=S&&t.getSourceFile(S.resolvedFileName);T&&T.externalModuleIndicator&&T.externalModuleIndicator!==!0&&cc(T.externalModuleIndicator)&&T.externalModuleIndicator.isExportEquals&&s.push(mn(y,d.Import_may_be_converted_to_a_default_import))}return Dn(s,e.bindSuggestionDiagnostics),Dn(s,t.getSuggestionDiagnostics(e,r)),s.sort((g,p)=>g.start-p.start);function f(g){if(u)Wje(g,o)&&s.push(mn(Ei(g.parent)?g.parent.name:g,d.This_constructor_function_may_be_converted_to_a_class_declaration));else{if(ec(g)&&g.parent===e&&g.declarationList.flags&2&&g.declarationList.declarations.length===1){const y=g.declarationList.declarations[0].initializer;y&&g_(y,!0)&&s.push(mn(y,d.require_call_may_be_converted_to_an_import))}const p=su.getJSDocTypedefNodes(g);for(const y of p)s.push(mn(y,d.JSDoc_typedef_may_be_converted_to_TypeScript_type));su.parameterShouldGetTypeFromJSDoc(g)&&s.push(mn(g.name||g,d.JSDoc_types_may_be_moved_to_TypeScript_types))}_G(g)&&jje(g,o,s),g.forEachChild(f)}}function Mje(e){return e.statements.some(t=>{switch(t.kind){case 243:return t.declarationList.declarations.some(r=>!!r.initializer&&g_(rTe(r.initializer),!0));case 244:{const{expression:r}=t;if(!Gr(r))return g_(r,!0);const i=ac(r);return i===1||i===2}default:return!1}})}function rTe(e){return bn(e)?rTe(e.expression):e}function Rje(e){switch(e.kind){case 272:const{importClause:t,moduleSpecifier:r}=e;return t&&!t.name&&t.namedBindings&&t.namedBindings.kind===274&&ra(r)?t.namedBindings.name:void 0;case 271:return e.name;default:return}}function jje(e,t,r){Bje(e,t)&&!fG.has(aTe(e))&&r.push(mn(!e.name&&Ei(e.parent)&&Ie(e.parent.name)?e.parent.name:e,d.This_may_be_converted_to_an_async_function))}function Bje(e,t){return!Z4(e)&&e.body&&Ss(e.body)&&zje(e.body,t)&&lG(e,t)}function lG(e,t){const r=t.getSignatureFromDeclaration(e),i=r?t.getReturnTypeOfSignature(r):void 0;return!!i&&!!t.getPromisedTypeOfPromise(i)}function Jje(e){return Gr(e)?e.left:e}function zje(e,t){return!!Ev(e,r=>CL(r,t))}function CL(e,t){return Bp(e)&&!!e.expression&&uG(e.expression,t)}function uG(e,t){if(!nTe(e)||!iTe(e)||!e.arguments.every(i=>sTe(i,t)))return!1;let r=e.expression.expression;for(;nTe(r)||bn(r);)if(Rs(r)){if(!iTe(r)||!r.arguments.every(i=>sTe(i,t)))return!1;r=r.expression.expression}else r=r.expression;return!0}function nTe(e){return Rs(e)&&(lA(e,"then")||lA(e,"catch")||lA(e,"finally"))}function iTe(e){const t=e.expression.name.text,r=t==="then"?2:t==="catch"||t==="finally"?1:0;return e.arguments.length>r?!1:e.arguments.lengthi.kind===106||Ie(i)&&i.text==="undefined")}function sTe(e,t){switch(e.kind){case 262:case 218:if(pl(e)&1)return!1;case 219:fG.set(aTe(e),!0);case 106:return!0;case 80:case 211:{const i=t.getSymbolAtLocation(e);return i?t.isUndefinedSymbol(i)||ut(yu(i,t).declarations,s=>ks(s)||J0(s)&&!!s.initializer&&ks(s.initializer)):!1}default:return!1}}function aTe(e){return`${e.pos.toString()}:${e.end.toString()}`}function Wje(e,t){var r,i,s,o;if(ro(e)){if(Ei(e.parent)&&((r=e.symbol.members)!=null&&r.size))return!0;const c=t.getSymbolOfExpando(e,!1);return!!(c&&((i=c.exports)!=null&&i.size||(s=c.members)!=null&&s.size))}return Zc(e)?!!((o=e.symbol.members)!=null&&o.size):!1}function _G(e){switch(e.kind){case 262:case 174:case 218:case 219:return!0;default:return!1}}var fG,Uje=Nt({"src/services/suggestionDiagnostics.ts"(){"use strict";zn(),fG=new Map}});function Zoe(e,t){const r=[],i=t.compilerOptions?pG(t.compilerOptions,r):{},s=GL();for(const S in s)Ya(s,S)&&i[S]===void 0&&(i[S]=s[S]);for(const S of IU)i.verbatimModuleSyntax&&cTe.has(S.name)||(i[S.name]=S.transpileOptionValue);i.suppressOutputPathCheck=!0,i.allowNonTsExtensions=!0;const o=zh(i),c={getSourceFile:S=>S===qs(u)?f:void 0,writeFile:(S,T)=>{Ho(S,".map")?(E.assertEqual(p,void 0,"Unexpected multiple source map outputs, file:",S),p=T):(E.assertEqual(g,void 0,"Unexpected multiple outputs, file:",S),g=T)},getDefaultLibFileName:()=>"lib.d.ts",useCaseSensitiveFileNames:()=>!1,getCanonicalFileName:S=>S,getCurrentDirectory:()=>"",getNewLine:()=>o,fileExists:S=>S===u,readFile:()=>"",directoryExists:()=>!0,getDirectories:()=>[]},u=t.fileName||(t.compilerOptions&&t.compilerOptions.jsx?"module.tsx":"module.ts"),f=vw(u,e,{languageVersion:Da(i),impliedNodeFormat:Kw(fo(u,"",c.getCanonicalFileName),void 0,c,i),setExternalModuleIndicator:P8(i),jsDocParsingMode:t.jsDocParsingMode??0});t.moduleName&&(f.moduleName=t.moduleName),t.renamedDependencies&&(f.renamedDependencies=new Map(Object.entries(t.renamedDependencies)));let g,p;const y=s9([u],i,c);return t.reportDiagnostics&&(Dn(r,y.getSyntacticDiagnostics(f)),Dn(r,y.getOptionsDiagnostics())),y.emit(void 0,void 0,void 0,void 0,t.transformers),g===void 0?E.fail("Output generation failed"):{outputText:g,diagnostics:r,sourceMapText:p}}function oTe(e,t,r,i,s){const o=Zoe(e,{compilerOptions:t,fileName:r,reportDiagnostics:!!i,moduleName:s});return Dn(i,o.diagnostics),o.outputText}function pG(e,t){Koe=Koe||wn(mg,r=>typeof r.type=="object"&&!zl(r.type,i=>typeof i!="number")),e=dH(e);for(const r of Koe){if(!Ya(e,r.name))continue;const i=e[r.name];ns(i)?e[r.name]=aO(r,i,t):zl(r.type,s=>s===i)||t.push(Une(r))}return e}var cTe,Koe,Vje=Nt({"src/services/transpile.ts"(){"use strict";zn(),cTe=new Set(["isolatedModules","preserveValueImports","importsNotUsedAsValues"])}});function lTe(e,t,r,i,s,o,c){const u=Woe(i);if(!u)return ze;const f=[],g=e.length===1?e[0]:void 0;for(const p of e)r.throwIfCancellationRequested(),!(o&&p.isDeclarationFile)&&(uTe(p,!!c,g)||p.getNamedDeclarations().forEach((y,S)=>{qje(u,S,y,t,p.fileName,!!c,g,f)}));return f.sort(Xje),(s===void 0?f:f.slice(0,s)).map(Qje)}function uTe(e,t,r){return e!==r&&t&&(wA(e.path)||e.hasNoDefaultLib)}function qje(e,t,r,i,s,o,c,u){const f=e.getMatchForLastSegmentOfPattern(t);if(f){for(const g of r)if(Hje(g,i,o,c))if(e.patternContainsDots){const p=e.getFullMatch($je(g),t);p&&u.push({name:t,fileName:s,matchKind:p.kind,isCaseSensitive:p.isCaseSensitive,declaration:g})}else u.push({name:t,fileName:s,matchKind:f.kind,isCaseSensitive:f.isCaseSensitive,declaration:g})}}function Hje(e,t,r,i){var s;switch(e.kind){case 273:case 276:case 271:const o=t.getSymbolAtLocation(e.name),c=t.getAliasedSymbol(o);return o.escapedName!==c.escapedName&&!((s=c.declarations)!=null&&s.every(u=>uTe(u.getSourceFile(),r,i)));default:return!0}}function Gje(e,t){const r=as(e);return!!r&&(_Te(r,t)||r.kind===167&&ece(r.expression,t))}function ece(e,t){return _Te(e,t)||bn(e)&&(t.push(e.name.text),!0)&&ece(e.expression,t)}function _Te(e,t){return wd(e)&&(t.push(cp(e)),!0)}function $je(e){const t=[],r=as(e);if(r&&r.kind===167&&!ece(r.expression,t))return ze;t.shift();let i=Ub(e);for(;i;){if(!Gje(i,t))return ze;i=Ub(i)}return t.reverse()}function Xje(e,t){return xo(e.matchKind,t.matchKind)||qD(e.name,t.name)}function Qje(e){const t=e.declaration,r=Ub(t),i=r&&as(r);return{name:e.name,kind:n2(t),kindModifiers:C3(t),matchKind:kL[e.matchKind],isCaseSensitive:e.isCaseSensitive,fileName:e.fileName,textSpan:l_(t),containerName:i?i.text:"",containerKind:i?n2(r):""}}var Yje=Nt({"src/services/navigateTo.ts"(){"use strict";zn()}}),tce={};jl(tce,{getNavigateToItems:()=>lTe});var fTe=Nt({"src/services/_namespaces/ts.NavigateTo.ts"(){"use strict";Yje()}});function pTe(e,t){hG=t,FA=e;try{return Yt(rBe(hTe(e)),nBe)}finally{mTe()}}function dTe(e,t){hG=t,FA=e;try{return ETe(hTe(e))}finally{mTe()}}function mTe(){FA=void 0,hG=void 0,OA=[],Kh=void 0,yG=[]}function EL(e){return R3(e.getText(FA))}function dG(e){return e.node.kind}function gTe(e,t){e.children?e.children.push(t):e.children=[t]}function hTe(e){E.assert(!OA.length);const t={node:e,name:void 0,additionalNodes:void 0,parent:void 0,children:void 0,indent:0};Kh=t;for(const r of e.statements)rx(r);return x1(),E.assert(!Kh&&!OA.length),t}function a2(e,t){gTe(Kh,rce(e,t))}function rce(e,t){return{node:e,name:t||(hu(e)||ct(e)?as(e):void 0),additionalNodes:void 0,parent:Kh,children:void 0,indent:Kh.indent+1}}function yTe(e){ZC||(ZC=new Map),ZC.set(e,!0)}function vTe(e){for(let t=0;t0;i--){const s=r[i];o2(e,s)}return[r.length-1,r[0]]}function o2(e,t){const r=rce(e,t);gTe(Kh,r),OA.push(Kh),uce.push(ZC),ZC=void 0,Kh=r}function x1(){Kh.children&&(mG(Kh.children,Kh),sce(Kh.children)),Kh=OA.pop(),ZC=uce.pop()}function k1(e,t,r){o2(e,r),rx(t),x1()}function STe(e){e.initializer&&sBe(e.initializer)?(o2(e),ds(e.initializer,rx),x1()):k1(e,e.initializer)}function nce(e){const t=as(e);if(t===void 0)return!1;if(xa(t)){const r=t.expression;return oc(r)||A_(r)||_f(r)}return!!t}function rx(e){if(hG.throwIfCancellationRequested(),!(!e||tT(e)))switch(e.kind){case 176:const t=e;k1(t,t.body);for(const c of t.parameters)E_(c,t)&&a2(c);break;case 174:case 177:case 178:case 173:nce(e)&&k1(e,e.body);break;case 172:nce(e)&&STe(e);break;case 171:nce(e)&&a2(e);break;case 273:const r=e;r.name&&a2(r.name);const{namedBindings:i}=r;if(i)if(i.kind===274)a2(i);else for(const c of i.elements)a2(c);break;case 304:k1(e,e.name);break;case 305:const{expression:s}=e;Ie(s)?a2(e,s):a2(e);break;case 208:case 303:case 260:{const c=e;As(c.name)?rx(c.name):STe(c);break}case 262:const o=e.name;o&&Ie(o)&&yTe(o.text),k1(e,e.body);break;case 219:case 218:k1(e,e.body);break;case 266:o2(e);for(const c of e.members)iBe(c)||a2(c);x1();break;case 263:case 231:case 264:o2(e);for(const c of e.members)rx(c);x1();break;case 267:k1(e,PTe(e).body);break;case 277:{const c=e.expression,u=ma(c)||Rs(c)?c:go(c)||ro(c)?c.body:void 0;u?(o2(e),rx(u),x1()):a2(e);break}case 281:case 271:case 181:case 179:case 180:case 265:a2(e);break;case 213:case 226:{const c=ac(e);switch(c){case 1:case 2:k1(e,e.right);return;case 6:case 3:{const u=e,f=u.left,g=c===3?f.expression:f;let p=0,y;Ie(g.expression)?(yTe(g.expression.text),y=g.expression):[p,y]=bTe(u,g.expression),c===6?ma(u.right)&&u.right.properties.length>0&&(o2(u,y),ds(u.right,rx),x1()):ro(u.right)||go(u.right)?k1(e,u.right,y):(o2(u,y),k1(e,u.right,f.name),x1()),vTe(p);return}case 7:case 9:{const u=e,f=c===7?u.arguments[0]:u.arguments[0].expression,g=u.arguments[1],[p,y]=bTe(e,f);o2(e,y),o2(e,tt(I.createIdentifier(g.text),g)),rx(e.arguments[2]),x1(),x1(),vTe(p);return}case 5:{const u=e,f=u.left,g=f.expression;if(Ie(g)&&Gg(f)!=="prototype"&&ZC&&ZC.has(g.text)){ro(u.right)||go(u.right)?k1(e,u.right,g):wv(f)&&(o2(u,g),k1(u.left,u.right,KP(f)),x1());return}break}case 4:case 0:case 8:break;default:E.assertNever(c)}}default:q_(e)&&Zt(e.jsDoc,c=>{Zt(c.tags,u=>{op(u)&&a2(u)})}),ds(e,rx)}}function mG(e,t){const r=new Map;lj(e,(i,s)=>{const o=i.name||as(i.node),c=o&&EL(o);if(!c)return!0;const u=r.get(c);if(!u)return r.set(c,i),!0;if(u instanceof Array){for(const f of u)if(TTe(f,i,s,t))return!1;return u.push(i),!0}else{const f=u;return TTe(f,i,s,t)?!1:(r.set(c,[f,i]),!0)}})}function Zje(e,t,r,i){function s(u){return ro(u)||Zc(u)||Ei(u)}const o=Gr(t.node)||Rs(t.node)?ac(t.node):0,c=Gr(e.node)||Rs(e.node)?ac(e.node):0;if(j3[o]&&j3[c]||s(e.node)&&j3[o]||s(t.node)&&j3[c]||Vc(e.node)&&ice(e.node)&&j3[o]||Vc(t.node)&&j3[c]||Vc(e.node)&&ice(e.node)&&s(t.node)||Vc(t.node)&&s(e.node)&&ice(e.node)){let u=e.additionalNodes&&Mo(e.additionalNodes)||e.node;if(!Vc(e.node)&&!Vc(t.node)||s(e.node)||s(t.node)){const g=s(e.node)?e.node:s(t.node)?t.node:void 0;if(g!==void 0){const p=tt(I.createConstructorDeclaration(void 0,[],void 0),g),y=rce(p);y.indent=e.indent+1,y.children=e.node===g?e.children:t.children,e.children=e.node===g?Xi([y],t.children||[t]):Xi(e.children||[{...e}],[y])}else(e.children||t.children)&&(e.children=Xi(e.children||[{...e}],t.children||[t]),e.children&&(mG(e.children,e),sce(e.children)));u=e.node=tt(I.createClassDeclaration(void 0,e.name||I.createIdentifier("__class__"),void 0,void 0,[]),e.node)}else e.children=Xi(e.children,t.children),e.children&&mG(e.children,e);const f=t.node;return i.children[r-1].node.end===u.end?tt(u,{pos:u.pos,end:f.end}):(e.additionalNodes||(e.additionalNodes=[]),e.additionalNodes.push(tt(I.createClassDeclaration(void 0,e.name||I.createIdentifier("__class__"),void 0,void 0,[]),t.node))),!0}return o!==0}function TTe(e,t,r,i){return Zje(e,t,r,i)?!0:Kje(e.node,t.node,i)?(eBe(e,t),!0):!1}function Kje(e,t,r){if(e.kind!==t.kind||e.parent!==t.parent&&!(xTe(e,r)&&xTe(t,r)))return!1;switch(e.kind){case 172:case 174:case 177:case 178:return Ls(e)===Ls(t);case 267:return kTe(e,t)&&cce(e)===cce(t);default:return!0}}function ice(e){return!!(e.flags&16)}function xTe(e,t){const r=Ld(e.parent)?e.parent.parent:e.parent;return r===t.node||_s(t.additionalNodes,r)}function kTe(e,t){return!e.body||!t.body?e.body===t.body:e.body.kind===t.body.kind&&(e.body.kind!==267||kTe(e.body,t.body))}function eBe(e,t){e.additionalNodes=e.additionalNodes||[],e.additionalNodes.push(t.node),t.additionalNodes&&e.additionalNodes.push(...t.additionalNodes),e.children=Xi(e.children,t.children),e.children&&(mG(e.children,e),sce(e.children))}function sce(e){e.sort(tBe)}function tBe(e,t){return qD(CTe(e.node),CTe(t.node))||xo(dG(e),dG(t))}function CTe(e){if(e.kind===267)return DTe(e);const t=as(e);if(t&&wc(t)){const r=gb(t);return r&&bi(r)}switch(e.kind){case 218:case 219:case 231:return ATe(e);default:return}}function ace(e,t){if(e.kind===267)return R3(DTe(e));if(t){const r=Ie(t)?t.text:mo(t)?`[${EL(t.argumentExpression)}]`:EL(t);if(r.length>0)return R3(r)}switch(e.kind){case 312:const r=e;return Nc(r)?`"${n1(Pc(Ou(qs(r.fileName))))}"`:"";case 277:return cc(e)&&e.isExportEquals?"export=":"default";case 219:case 262:case 218:case 263:case 231:return q0(e)&2048?"default":ATe(e);case 176:return"constructor";case 180:return"new()";case 179:return"()";case 181:return"[]";default:return""}}function rBe(e){const t=[];function r(s){if(i(s)&&(t.push(s),s.children))for(const o of s.children)r(o)}return r(e),t;function i(s){if(s.children)return!0;switch(dG(s)){case 263:case 231:case 266:case 264:case 267:case 312:case 265:case 353:case 345:return!0;case 219:case 262:case 218:return o(s);default:return!1}function o(c){if(!c.node.body)return!1;switch(dG(c.parent)){case 268:case 312:case 174:case 176:return!0;default:return!1}}}}function ETe(e){return{text:ace(e.node,e.name),kind:n2(e.node),kindModifiers:wTe(e.node),spans:oce(e),nameSpan:e.name&&lce(e.name),childItems:Yt(e.children,ETe)}}function nBe(e){return{text:ace(e.node,e.name),kind:n2(e.node),kindModifiers:wTe(e.node),spans:oce(e),childItems:Yt(e.children,t)||yG,indent:e.indent,bolded:!1,grayed:!1};function t(r){return{text:ace(r.node,r.name),kind:n2(r.node),kindModifiers:C3(r.node),spans:oce(r),childItems:yG,indent:0,bolded:!1,grayed:!1}}}function oce(e){const t=[lce(e.node)];if(e.additionalNodes)for(const r of e.additionalNodes)t.push(lce(r));return t}function DTe(e){return ru(e)?Wc(e.name):cce(e)}function cce(e){const t=[cp(e.name)];for(;e.body&&e.body.kind===267;)e=e.body,t.push(cp(e.name));return t.join(".")}function PTe(e){return e.body&&vc(e.body)?PTe(e.body):e}function iBe(e){return!e.name||e.name.kind===167}function lce(e){return e.kind===312?ry(e):l_(e,FA)}function wTe(e){return e.parent&&e.parent.kind===260&&(e=e.parent),C3(e)}function ATe(e){const{parent:t}=e;if(e.name&&IP(e.name)>0)return R3(eo(e.name));if(Ei(t))return R3(eo(t.name));if(Gr(t)&&t.operatorToken.kind===64)return EL(t.left).replace(ITe,"");if(Hc(t))return EL(t.name);if(q0(e)&2048)return"default";if(Qn(e))return"";if(Rs(t)){let r=NTe(t.expression);if(r!==void 0){if(r=R3(r),r.length>gG)return`${r} callback`;const i=R3(Ii(t.arguments,s=>Ja(s)?s.getText(FA):void 0).join(", "));return`${r}(${i}) callback`}}return""}function NTe(e){if(Ie(e))return e.text;if(bn(e)){const t=NTe(e.expression),r=e.name.text;return t===void 0?r:`${t}.${r}`}else return}function sBe(e){switch(e.kind){case 219:case 218:case 231:return!0;default:return!1}}function R3(e){return e=e.length>gG?e.substring(0,gG)+"...":e,e.replace(/\\?(\r?\n|\r|\u2028|\u2029)/g,"")}var ITe,gG,hG,FA,OA,Kh,uce,ZC,yG,j3,aBe=Nt({"src/services/navigationBar.ts"(){"use strict";zn(),ITe=/\s+/g,gG=150,OA=[],uce=[],yG=[],j3={5:!0,3:!0,7:!0,9:!0,0:!1,1:!1,2:!1,8:!1,6:!0,4:!1}}}),_ce={};jl(_ce,{getNavigationBarItems:()=>pTe,getNavigationTree:()=>dTe});var FTe=Nt({"src/services/_namespaces/ts.NavigationBar.ts"(){"use strict";aBe()}});function hg(e,t){vG.set(e,t)}function oBe(e,t){return fs(uj(vG.values(),r=>{var i;return e.cancellationToken&&e.cancellationToken.isCancellationRequested()||!((i=r.kinds)!=null&&i.some(s=>C1(s,e.kind)))?void 0:r.getAvailableActions(e,t)}))}function cBe(e,t,r,i){const s=vG.get(t);return s&&s.getEditsForAction(e,r,i)}var vG,OTe=Nt({"src/services/refactorProvider.ts"(){"use strict";zn(),Nm(),vG=new Map}});function LTe(e,t=!0){const{file:r,program:i}=e,s=tx(e),o=Ji(r,s.start),c=o.parent&&q0(o.parent)&32&&t?o.parent:TA(o,r,s);if(!c||!Ai(c.parent)&&!(Ld(c.parent)&&ru(c.parent.parent)))return{error:ls(d.Could_not_find_export_statement)};const u=i.getTypeChecker(),f=dBe(c.parent,u),g=q0(c)||(cc(c)&&!c.isExportEquals?2080:0),p=!!(g&2048);if(!(g&32)||!p&&f.exports.has("default"))return{error:ls(d.This_file_already_has_a_default_export)};const y=S=>Ie(S)&&u.getSymbolAtLocation(S)?void 0:{error:ls(d.Can_only_convert_named_export)};switch(c.kind){case 262:case 263:case 264:case 266:case 265:case 267:{const S=c;return S.name?y(S.name)||{exportNode:S,exportName:S.name,wasDefault:p,exportingModuleSymbol:f}:void 0}case 243:{const S=c;if(!(S.declarationList.flags&2)||S.declarationList.declarations.length!==1)return;const T=ba(S.declarationList.declarations);return T.initializer?(E.assert(!p,"Can't have a default flag here"),y(T.name)||{exportNode:S,exportName:T.name,wasDefault:p,exportingModuleSymbol:f}):void 0}case 277:{const S=c;return S.isExportEquals?void 0:y(S.expression)||{exportNode:S,exportName:S.expression,wasDefault:p,exportingModuleSymbol:f}}default:return}}function lBe(e,t,r,i,s){uBe(e,r,i,t.getTypeChecker()),_Be(t,r,i,s)}function uBe(e,{wasDefault:t,exportNode:r,exportName:i},s,o){if(t)if(cc(r)&&!r.isExportEquals){const c=r.expression,u=MTe(c.text,c.text);s.replaceNode(e,r,I.createExportDeclaration(void 0,!1,I.createNamedExports([u])))}else s.delete(e,E.checkDefined(GC(r,90),"Should find a default keyword in modifier list"));else{const c=E.checkDefined(GC(r,95),"Should find an export keyword in modifier list");switch(r.kind){case 262:case 263:case 264:s.insertNodeAfter(e,c,I.createToken(90));break;case 243:const u=ba(r.declarationList.declarations);if(!ho.Core.isSymbolReferencedInFile(i,o,e)&&!u.type){s.replaceNode(e,r,I.createExportDefault(E.checkDefined(u.initializer,"Initializer was previously known to be present")));break}case 266:case 265:case 267:s.deleteModifier(e,c),s.insertNodeAfter(e,r,I.createExportDefault(I.createIdentifier(i.text)));break;default:E.fail(`Unexpected exportNode kind ${r.kind}`)}}}function _Be(e,{wasDefault:t,exportName:r,exportingModuleSymbol:i},s,o){const c=e.getTypeChecker(),u=E.checkDefined(c.getSymbolAtLocation(r),"Export name should resolve to a symbol");ho.Core.eachExportReference(e.getSourceFiles(),c,o,u,i,r.text,t,f=>{if(r===f)return;const g=f.getSourceFile();t?fBe(g,f,s,r.text):pBe(g,f,s)})}function fBe(e,t,r,i){const{parent:s}=t;switch(s.kind){case 211:r.replaceNode(e,t,I.createIdentifier(i));break;case 276:case 281:{const c=s;r.replaceNode(e,c,fce(i,c.name.text));break}case 273:{const c=s;E.assert(c.name===t,"Import clause name should match provided ref");const u=fce(i,t.text),{namedBindings:f}=c;if(!f)r.replaceNode(e,t,I.createNamedImports([u]));else if(f.kind===274){r.deleteRange(e,{pos:t.getStart(e),end:f.getStart(e)});const g=ra(c.parent.moduleSpecifier)?TH(c.parent.moduleSpecifier,e):1,p=Yh(void 0,[fce(i,t.text)],c.parent.moduleSpecifier,g);r.insertNodeAfter(e,c.parent,p)}else r.delete(e,t),r.insertNodeAtEndOfList(e,f.elements,u);break}case 205:const o=s;r.replaceNode(e,s,I.createImportTypeNode(o.argument,o.attributes,I.createIdentifier(i),o.typeArguments,o.isTypeOf));break;default:E.failBadSyntaxKind(s)}}function pBe(e,t,r){const i=t.parent;switch(i.kind){case 211:r.replaceNode(e,t,I.createIdentifier("default"));break;case 276:{const s=I.createIdentifier(i.name.text);i.parent.elements.length===1?r.replaceNode(e,i.parent,s):(r.delete(e,i),r.insertNodeBefore(e,i.parent,s));break}case 281:{r.replaceNode(e,i,MTe("default",i.name.text));break}default:E.assertNever(i,`Unexpected parent kind ${i.kind}`)}}function fce(e,t){return I.createImportSpecifier(!1,e===t?void 0:I.createIdentifier(e),I.createIdentifier(t))}function MTe(e,t){return I.createExportSpecifier(!1,e===t?void 0:I.createIdentifier(e),I.createIdentifier(t))}function dBe(e,t){if(Ai(e))return e.symbol;const r=e.parent.symbol;return r.valueDeclaration&&xv(r.valueDeclaration)?t.getMergedSymbol(r):r}var bG,DL,PL,mBe=Nt({"src/services/refactors/convertExport.ts"(){"use strict";zn(),Nm(),bG="Convert export",DL={name:"Convert default export to named export",description:ls(d.Convert_default_export_to_named_export),kind:"refactor.rewrite.export.named"},PL={name:"Convert named export to default export",description:ls(d.Convert_named_export_to_default_export),kind:"refactor.rewrite.export.default"},hg(bG,{kinds:[DL.kind,PL.kind],getAvailableActions:function(t){const r=LTe(t,t.triggerReason==="invoked");if(!r)return ze;if(!nh(r)){const i=r.wasDefault?DL:PL;return[{name:bG,description:i.description,actions:[i]}]}return t.preferences.provideRefactorNotApplicableReason?[{name:bG,description:ls(d.Convert_default_export_to_named_export),actions:[{...DL,notApplicableReason:r.error},{...PL,notApplicableReason:r.error}]}]:ze},getEditsForAction:function(t,r){E.assert(r===DL.name||r===PL.name,"Unexpected action name");const i=LTe(t);return E.assert(i&&!nh(i),"Expected applicable refactor info"),{edits:Qr.ChangeTracker.with(t,o=>lBe(t.file,t.program,i,o,t.cancellationToken)),renameFilename:void 0,renameLocation:void 0}}})}});function RTe(e,t=!0){const{file:r}=e,i=tx(e),s=Ji(r,i.start),o=t?Ar(s,gl):TA(s,r,i);if(!o||!gl(o))return{error:"Selection is not an import declaration."};const c=i.start+i.length,u=i2(o,o.parent,r);if(u&&c>u.getStart())return;const{importClause:f}=o;return f?f.namedBindings?f.namedBindings.kind===274?{convertTo:0,import:f.namedBindings}:jTe(e.program,f)?{convertTo:1,import:f.namedBindings}:{convertTo:2,import:f.namedBindings}:{error:ls(d.Could_not_find_namespace_import_or_named_imports)}:{error:ls(d.Could_not_find_import_clause)}}function jTe(e,t){return vT(e.getCompilerOptions())&&vBe(t.parent.moduleSpecifier,e.getTypeChecker())}function gBe(e,t,r,i){const s=t.getTypeChecker();i.convertTo===0?hBe(e,s,r,i.import,vT(t.getCompilerOptions())):JTe(e,t,r,i.import,i.convertTo===1)}function hBe(e,t,r,i,s){let o=!1;const c=[],u=new Map;ho.Core.eachSymbolReferenceInFile(i.name,t,e,y=>{if(!see(y.parent))o=!0;else{const S=BTe(y.parent).text;t.resolveName(S,y,67108863,!0)&&u.set(S,!0),E.assert(yBe(y.parent)===y,"Parent expression should match id"),c.push(y.parent)}});const f=new Map;for(const y of c){const S=BTe(y).text;let T=f.get(S);T===void 0&&f.set(S,T=u.has(S)?Gb(S,e):S),r.replaceNode(e,y,I.createIdentifier(T))}const g=[];f.forEach((y,S)=>{g.push(I.createImportSpecifier(!1,y===S?void 0:I.createIdentifier(S),I.createIdentifier(y)))});const p=i.parent.parent;o&&!s?r.insertNodeAfter(e,p,pce(p,void 0,g)):r.replaceNode(e,p,pce(p,o?I.createIdentifier(i.name.text):void 0,g))}function BTe(e){return bn(e)?e.name:e.right}function yBe(e){return bn(e)?e.expression:e.left}function JTe(e,t,r,i,s=jTe(t,i.parent)){const o=t.getTypeChecker(),c=i.parent.parent,{moduleSpecifier:u}=c,f=new Set;i.elements.forEach(C=>{const w=o.getSymbolAtLocation(C.name);w&&f.add(w)});const g=u&&ra(u)?su.moduleSpecifierToValidIdentifier(u.text,99):"module";function p(C){return!!ho.Core.eachSymbolReferenceInFile(C.name,o,e,w=>{const D=o.resolveName(g,w,67108863,!0);return D?f.has(D)?vu(w.parent):!0:!1})}const S=i.elements.some(p)?Gb(g,e):g,T=new Set;for(const C of i.elements){const w=(C.propertyName||C.name).text;ho.Core.eachSymbolReferenceInFile(C.name,o,e,D=>{const O=I.createPropertyAccessExpression(I.createIdentifier(S),w);Y_(D.parent)?r.replaceNode(e,D.parent,I.createPropertyAssignment(D.text,O)):vu(D.parent)?T.add(C):r.replaceNode(e,D,O)})}if(r.replaceNode(e,i,s?I.createIdentifier(S):I.createNamespaceImport(I.createIdentifier(S))),T.size){const C=fs(T.values(),w=>I.createImportSpecifier(w.isTypeOnly,w.propertyName&&I.createIdentifier(w.propertyName.text),I.createIdentifier(w.name.text)));r.insertNodeAfter(e,i.parent.parent,pce(c,void 0,C))}}function vBe(e,t){const r=t.resolveExternalModuleName(e);if(!r)return!1;const i=t.resolveExternalModuleSymbol(r);return r!==i}function pce(e,t,r){return I.createImportDeclaration(void 0,I.createImportClause(!1,t,r&&r.length?I.createNamedImports(r):void 0),e.moduleSpecifier,void 0)}var SG,wL,bBe=Nt({"src/services/refactors/convertImport.ts"(){"use strict";zn(),Nm(),SG="Convert import",wL={0:{name:"Convert namespace import to named imports",description:ls(d.Convert_namespace_import_to_named_imports),kind:"refactor.rewrite.import.named"},2:{name:"Convert named imports to namespace import",description:ls(d.Convert_named_imports_to_namespace_import),kind:"refactor.rewrite.import.namespace"},1:{name:"Convert named imports to default import",description:ls(d.Convert_named_imports_to_default_import),kind:"refactor.rewrite.import.default"}},hg(SG,{kinds:GS(wL).map(e=>e.kind),getAvailableActions:function(t){const r=RTe(t,t.triggerReason==="invoked");if(!r)return ze;if(!nh(r)){const i=wL[r.convertTo];return[{name:SG,description:i.description,actions:[i]}]}return t.preferences.provideRefactorNotApplicableReason?GS(wL).map(i=>({name:SG,description:i.description,actions:[{...i,notApplicableReason:r.error}]})):ze},getEditsForAction:function(t,r){E.assert(ut(GS(wL),o=>o.name===r),"Unexpected action name");const i=RTe(t);return E.assert(i&&!nh(i),"Expected applicable refactor info"),{edits:Qr.ChangeTracker.with(t,o=>gBe(t.file,t.program,o,i)),renameFilename:void 0,renameLocation:void 0}}})}});function zTe(e,t=!0){const{file:r,startPosition:i}=e,s=Iu(r),o=Ji(r,i),c=H9(tx(e)),u=c.pos===c.end&&t,f=M9(o,r,c.pos,c.end),g=Ar(o,O=>O.parent&&Si(O)&&!c2(c,O.parent,r)&&(u||f));if(!g||!Si(g))return{error:ls(d.Selection_is_not_a_valid_type_node)};const p=e.program.getTypeChecker(),y=CBe(g,s);if(y===void 0)return{error:ls(d.No_type_could_be_extracted_from_this_type_node)};const S=EBe(g,y);if(!Si(S))return{error:ls(d.Selection_is_not_a_valid_type_node)};const T=[];(u1(S.parent)||_C(S.parent))&&c.end>g.end&&Dn(T,S.parent.types.filter(O=>M9(O,r,c.pos,c.end)));const C=T.length>1?T:S,w=SBe(p,C,y,r);if(!w)return{error:ls(d.No_type_could_be_extracted_from_this_type_node)};const D=TG(p,C);return{isJS:s,selection:C,enclosingNode:y,typeParameters:w,typeElements:D}}function TG(e,t){if(t){if(es(t)){const r=[];for(const i of t){const s=TG(e,i);if(!s)return;Dn(r,s)}return r}if(_C(t)){const r=[],i=new Map;for(const s of t.types){const o=TG(e,s);if(!o||!o.every(c=>c.name&&Rp(i,bA(c.name))))return;Dn(r,o)}return r}else{if(IT(t))return TG(e,t.type);if(X_(t))return t.members}}}function c2(e,t,r){return pA(e,la(r.text,t.pos),t.end)}function SBe(e,t,r,i){const s=[],o=$S(t),c={pos:o[0].pos,end:o[o.length-1].end};for(const f of o)if(u(f))return;return s;function u(f){if(mp(f)){if(Ie(f.typeName)){const g=f.typeName,p=e.resolveName(g.text,g,262144,!0);for(const y of p?.declarations||ze)if(Uo(y)&&y.getSourceFile()===i){if(y.name.escapedText===g.escapedText&&c2(y,c,i))return!0;if(c2(r,y,i)&&!c2(c,y,i)){tp(s,y);break}}}}else if(NT(f)){const g=Ar(f,p=>fC(p)&&c2(p.extendsType,f,i));if(!g||!c2(c,g,i))return!0}else if(RF(f)||BF(f)){const g=Ar(f.parent,ks);if(g&&g.type&&c2(g.type,f,i)&&!c2(c,g,i))return!0}else if(lC(f)){if(Ie(f.exprName)){const g=e.resolveName(f.exprName.text,f.exprName,111551,!1);if(g?.valueDeclaration&&c2(r,g.valueDeclaration,i)&&!c2(c,g.valueDeclaration,i))return!0}else if(Lv(f.exprName.left)&&!c2(c,f.parent,i))return!0}return i&&uC(f)&&qa(i,f.pos).line===qa(i,f.end).line&&Vr(f,1),ds(f,u)}}function TBe(e,t,r,i){const{enclosingNode:s,typeParameters:o}=i,{firstTypeNode:c,lastTypeNode:u,newTypeNode:f}=dce(i),g=I.createTypeAliasDeclaration(void 0,r,o.map(p=>I.updateTypeParameterDeclaration(p,p.modifiers,p.name,p.constraint,void 0)),f);e.insertNodeBefore(t,s,EW(g),!0),e.replaceNodeRange(t,c,u,I.createTypeReferenceNode(r,o.map(p=>I.createTypeReferenceNode(p.name,void 0))),{leadingTriviaOption:Qr.LeadingTriviaOption.Exclude,trailingTriviaOption:Qr.TrailingTriviaOption.ExcludeWhitespace})}function xBe(e,t,r,i){var s;const{enclosingNode:o,typeParameters:c,typeElements:u}=i,f=I.createInterfaceDeclaration(void 0,r,c,void 0,u);tt(f,(s=u[0])==null?void 0:s.parent),e.insertNodeBefore(t,o,EW(f),!0);const{firstTypeNode:g,lastTypeNode:p}=dce(i);e.replaceNodeRange(t,g,p,I.createTypeReferenceNode(r,c.map(y=>I.createTypeReferenceNode(y.name,void 0))),{leadingTriviaOption:Qr.LeadingTriviaOption.Exclude,trailingTriviaOption:Qr.TrailingTriviaOption.ExcludeWhitespace})}function kBe(e,t,r,i,s){var o;$S(s.selection).forEach(C=>{Vr(C,7168)});const{enclosingNode:c,typeParameters:u}=s,{firstTypeNode:f,lastTypeNode:g,newTypeNode:p}=dce(s),y=I.createJSDocTypedefTag(I.createIdentifier("typedef"),I.createJSDocTypeExpression(p),I.createIdentifier(i)),S=[];Zt(u,C=>{const w=gk(C),D=I.createTypeParameterDeclaration(void 0,C.name),O=I.createJSDocTemplateTag(I.createIdentifier("template"),w&&Ms(w,Fb),[D]);S.push(O)});const T=I.createJSDocComment(void 0,I.createNodeArray(Xi(S,[y])));if(zp(c)){const C=c.getStart(r),w=Zh(t.host,(o=t.formatContext)==null?void 0:o.options);e.insertNodeAt(r,c.getStart(r),T,{suffix:w+w+r.text.slice(nL(r.text,C-1),C)})}else e.insertNodeBefore(r,c,T,!0);e.replaceNodeRange(r,f,g,I.createTypeReferenceNode(i,u.map(C=>I.createTypeReferenceNode(C.name,void 0))))}function dce(e){return es(e.selection)?{firstTypeNode:e.selection[0],lastTypeNode:e.selection[e.selection.length-1],newTypeNode:u1(e.selection[0].parent)?I.createUnionTypeNode(e.selection):I.createIntersectionTypeNode(e.selection)}:{firstTypeNode:e.selection,lastTypeNode:e.selection,newTypeNode:e.selection}}function CBe(e,t){return Ar(e,Ci)||(t?Ar(e,zp):void 0)}function EBe(e,t){return Ar(e,r=>r===t?"quit":!!(u1(r.parent)||_C(r.parent)))??e}var xG,AL,NL,IL,DBe=Nt({"src/services/refactors/extractType.ts"(){"use strict";zn(),Nm(),xG="Extract type",AL={name:"Extract to type alias",description:ls(d.Extract_to_type_alias),kind:"refactor.extract.type"},NL={name:"Extract to interface",description:ls(d.Extract_to_interface),kind:"refactor.extract.interface"},IL={name:"Extract to typedef",description:ls(d.Extract_to_typedef),kind:"refactor.extract.typedef"},hg(xG,{kinds:[AL.kind,NL.kind,IL.kind],getAvailableActions:function(t){const r=zTe(t,t.triggerReason==="invoked");return r?nh(r)?t.preferences.provideRefactorNotApplicableReason?[{name:xG,description:ls(d.Extract_type),actions:[{...IL,notApplicableReason:r.error},{...AL,notApplicableReason:r.error},{...NL,notApplicableReason:r.error}]}]:ze:[{name:xG,description:ls(d.Extract_type),actions:r.isJS?[IL]:lr([AL],r.typeElements&&NL)}]:ze},getEditsForAction:function(t,r){const{file:i}=t,s=zTe(t);E.assert(s&&!nh(s),"Expected to find a range to extract");const o=Gb("NewType",i),c=Qr.ChangeTracker.with(t,g=>{switch(r){case AL.name:return E.assert(!s.isJS,"Invalid actionName/JS combo"),TBe(g,i,o,s);case IL.name:return E.assert(s.isJS,"Invalid actionName/JS combo"),kBe(g,t,i,o,s);case NL.name:return E.assert(!s.isJS&&!!s.typeElements,"Invalid actionName/JS combo"),xBe(g,i,o,s);default:E.fail("Unexpected action name")}}),u=i.fileName,f=CA(c,u,o,!1);return{edits:c,renameFilename:u,renameLocation:f}}})}});function nh(e){return e.error!==void 0}function C1(e,t){return t?e.substr(0,t.length)===t:!0}var PBe=Nt({"src/services/refactors/helpers.ts"(){"use strict"}});function WTe(e,t,r,i){var s,o;const c=i.getTypeChecker(),u=c_(e,t),f=u.parent;if(Ie(u)){if(E8(f)&&z4(f)&&Ie(f.name)){if(((s=c.getMergedSymbol(f.symbol).declarations)==null?void 0:s.length)!==1)return{error:ls(d.Variables_with_multiple_declarations_cannot_be_inlined)};if(UTe(f))return;const g=VTe(f,c,e);return g&&{references:g,declaration:f,replacement:f.initializer}}if(r){let g=c.resolveName(u.text,u,111551,!1);if(g=g&&c.getMergedSymbol(g),((o=g?.declarations)==null?void 0:o.length)!==1)return{error:ls(d.Variables_with_multiple_declarations_cannot_be_inlined)};const p=g.declarations[0];if(!E8(p)||!z4(p)||!Ie(p.name)||UTe(p))return;const y=VTe(p,c,e);return y&&{references:y,declaration:p,replacement:p.initializer}}return{error:ls(d.Could_not_find_variable_to_inline)}}}function UTe(e){const t=Ms(e.parent.parent,ec);return ut(t.modifiers,wT)}function VTe(e,t,r){const i=[],s=ho.Core.eachSymbolReferenceInFile(e.name,t,r,o=>{if(ho.isWriteAccessForReference(o)||vu(o.parent)||cc(o.parent)||lC(o.parent)||pP(e,o.pos))return!0;i.push(o)});return i.length===0||s?void 0:i}function wBe(e,t){t=wo(t);const{parent:r}=e;return ct(r)&&(tE(t){for(const y of c)p.replaceNode(r,y,wBe(y,f));p.delete(r,u)})}}})}});function NBe(e,t,r,i,s,o,c){const u=t.getTypeChecker(),f=LL(e,r.all,u),g=Cce(e,t,c,s);i.createNewFile(e,g,IBe(e,f,i,r,t,s,g,o)),mce(t,i,e.fileName,g,jh(s))}function IBe(e,t,r,i,s,o,c,u){const f=s.getTypeChecker(),g=I7(e.statements,Lp);if(e.externalModuleIndicator===void 0&&e.commonJsModuleIndicator===void 0&&t.oldImportsNeededByTargetFile.size===0)return FL(e,i.ranges,r),[...g,...i.all];const p=!qH(c,s,o,!!e.commonJsModuleIndicator),y=vf(e,u),S=vce(e,t.oldFileImportsFromTargetFile,c,s,o,p,y);S&&D3(r,e,S,!0,u),gce(e,i.all,r,t.unusedImportsFromOldFile,f),FL(e,i.ranges,r),hce(r,s,o,e,t.movedSymbols,c,y);const T=FBe(e,t.oldImportsNeededByTargetFile,t.targetFileImportsFromOldFile,r,f,s,o,p,y),C=bce(e,i.all,t.oldFileImportsFromTargetFile,p);return T.length&&C.length?[...g,...T,4,...C]:[...g,...T,...C]}function FBe(e,t,r,i,s,o,c,u,f){const g=[];for(const T of e.statements)jA(T,C=>{lr(g,BA(C,RA(C),w=>t.has(s.getSymbolAtLocation(w))))});let p;const y=[],S=KT();return r.forEach(T=>{if(T.declarations)for(const C of T.declarations){if(!ML(C))continue;const w=xce(C);if(!w)continue;const D=PG(C);S(D)&&kce(e,D,w,i,u),In(C,2048)?p=w:y.push(w.text)}}),lr(g,OL(e,p,y,Pc(e.fileName),o,c,u,f)),g}var MA,EG,DG,OBe=Nt({"src/services/refactors/moveToNewFile.ts"(){"use strict";zn(),Nm(),MA="Move to a new file",EG=ls(d.Move_to_a_new_file),DG={name:MA,description:EG,kind:"refactor.move.newFile"},hg(MA,{kinds:[DG.kind],getAvailableActions:function(t){const r=JA(t);return t.preferences.allowTextChangesInNewFiles&&r?[{name:MA,description:EG,actions:[DG]}]:t.preferences.provideRefactorNotApplicableReason?[{name:MA,description:EG,actions:[{...DG,notApplicableReason:ls(d.Selection_is_not_a_valid_statement_or_statements)}]}]:ze},getEditsForAction:function(t,r){E.assert(r===MA,"Wrong refactor invoked");const i=E.checkDefined(JA(t));return{edits:Qr.ChangeTracker.with(t,o=>NBe(t.file,t.program,i,o,t.host,t.preferences,t)),renameFilename:void 0,renameLocation:void 0}}})}});function qTe(e){return{edits:[],renameFilename:void 0,renameLocation:void 0,notApplicableReason:e}}function LBe(e,t,r,i,s,o,c,u){const f=i.getTypeChecker();if(!c.fileExists(r))o.createNewFile(t,r,HTe(t,r,LL(t,s.all,f),o,s,i,c,u)),mce(i,o,t.fileName,r,jh(c));else{const g=E.checkDefined(i.getSourceFile(r)),p=su.createImportAdder(g,e.program,e.preferences,e.host);HTe(t,g,LL(t,s.all,f,eJe(g,f)),o,s,i,c,u,p)}}function HTe(e,t,r,i,s,o,c,u,f){const g=o.getTypeChecker(),p=I7(e.statements,Lp);if(e.externalModuleIndicator===void 0&&e.commonJsModuleIndicator===void 0&&r.oldImportsNeededByTargetFile.size===0&&r.targetFileImportsFromOldFile.size===0&&typeof t=="string")return FL(e,s.ranges,i),[...p,...s.all];const y=typeof t=="string"?t:t.fileName,S=!qH(y,o,c,!!e.commonJsModuleIndicator),T=vf(e,u),C=vce(e,r.oldFileImportsFromTargetFile,y,o,c,S,T);C&&D3(i,e,C,!0,u),gce(e,s.all,i,r.unusedImportsFromOldFile,g),FL(e,s.ranges,i),hce(i,o,c,e,r.movedSymbols,y,T);const w=MBe(e,y,r.oldImportsNeededByTargetFile,r.targetFileImportsFromOldFile,i,g,o,c,S,T,f),D=bce(e,s.all,r.oldFileImportsFromTargetFile,S);return typeof t!="string"&&(t.statements.length>0?KBe(i,o,D,t,s):i.insertNodesAtEndOfFile(t,D,!1),w.length>0&&D3(i,t,w,!0,u)),f&&f.writeFixes(i,T),w.length&&D.length?[...p,...w,4,...D]:[...p,...w,...D]}function MBe(e,t,r,i,s,o,c,u,f,g,p){const y=[];if(p)r.forEach((D,O)=>{try{p.addImportFromExportedSymbol(yu(O,o),D)}catch{for(const z of e.statements)jA(z,W=>{lr(y,BA(W,I.createStringLiteral(RA(W).text),X=>r.has(o.getSymbolAtLocation(X))))})}});else{const D=c.getSourceFile(t);for(const O of e.statements)jA(O,z=>{var W;const X=RA(z),J=c.getResolvedModule(e,X.text,ld(e,X)),ie=(W=J?.resolvedModule)==null?void 0:W.resolvedFileName;if(ie&&D){const B=EO(c.getCompilerOptions(),D,D.path,ie,qb(c,u));lr(y,BA(z,ex(B,g),Y=>r.has(o.getSymbolAtLocation(Y))))}else lr(y,BA(z,I.createStringLiteral(RA(z).text),B=>r.has(o.getSymbolAtLocation(B))))})}const S=c.getSourceFile(t);let T;const C=[],w=KT();return i.forEach(D=>{if(D.declarations)for(const O of D.declarations){if(!ML(O))continue;const z=xce(O);if(!z)continue;const W=PG(O);w(W)&&kce(e,W,z,s,f),p&&o.isUnknownSymbol(D)?p.addImportFromExportedSymbol(yu(D,o)):In(O,2048)?T=z:C.push(z.text)}}),S?lr(y,OL(S,T,C,e.fileName,c,u,f,g)):lr(y,OL(e,T,C,e.fileName,c,u,f,g))}function mce(e,t,r,i,s){const o=e.getCompilerOptions().configFile;if(!o)return;const c=qs(Hn(r,"..",i)),u=iP(o.fileName,c,s),f=o.statements[0]&&Jn(o.statements[0].expression,ma),g=f&&kn(f.properties,p=>Hc(p)&&ra(p.name)&&p.name.text==="files");g&&Lu(g.initializer)&&t.insertNodeInListAfter(o,Sa(g.initializer.elements),I.createStringLiteral(u),g.initializer.elements)}function FL(e,t,r){for(const{first:i,afterLast:s}of t)r.deleteNodeRangeExcludingEnd(e,i,s)}function gce(e,t,r,i,s){for(const o of e.statements)_s(t,o)||jA(o,c=>Sce(e,c,r,u=>i.has(s.getSymbolAtLocation(u))))}function hce(e,t,r,i,s,o,c){const u=t.getTypeChecker();for(const f of t.getSourceFiles())if(f!==i)for(const g of f.statements)jA(g,p=>{if(u.getSymbolAtLocation(RA(p))!==i.symbol)return;const y=D=>{const O=Pa(D.parent)?K9(u,D.parent):yu(u.getSymbolAtLocation(D),u);return!!O&&s.has(O)};Sce(f,p,e,y);const S=I0(qn(i.path),o),T=EO(t.getCompilerOptions(),f,f.path,S,qb(t,r)),C=BA(p,ex(T,c),y);C&&e.insertNodeAfter(f,g,C);const w=RBe(p);w&&jBe(e,f,u,s,T,w,p,c)})}function RBe(e){switch(e.kind){case 272:return e.importClause&&e.importClause.namedBindings&&e.importClause.namedBindings.kind===274?e.importClause.namedBindings.name:void 0;case 271:return e.name;case 260:return Jn(e.name,Ie);default:return E.assertNever(e,`Unexpected node kind ${e.kind}`)}}function jBe(e,t,r,i,s,o,c,u){const f=su.moduleSpecifierToValidIdentifier(s,99);let g=!1;const p=[];if(ho.Core.eachSymbolReferenceInFile(o,r,t,y=>{bn(y.parent)&&(g=g||!!r.resolveName(f,y,67108863,!0),i.has(r.getSymbolAtLocation(y.parent.name))&&p.push(y))}),p.length){const y=g?Gb(f,t):f;for(const S of p)e.replaceNode(t,S,I.createIdentifier(y));e.insertNodeAfter(t,c,BBe(c,f,s,u))}}function BBe(e,t,r,i){const s=I.createIdentifier(t),o=ex(r,i);switch(e.kind){case 272:return I.createImportDeclaration(void 0,I.createImportClause(!1,void 0,I.createNamespaceImport(s)),o,void 0);case 271:return I.createImportEqualsDeclaration(void 0,!1,s,I.createExternalModuleReference(o));case 260:return I.createVariableDeclaration(s,void 0,void 0,yce(o));default:return E.assertNever(e,`Unexpected node kind ${e.kind}`)}}function yce(e){return I.createCallExpression(I.createIdentifier("require"),void 0,[e])}function RA(e){return e.kind===272?e.moduleSpecifier:e.kind===271?e.moduleReference.expression:e.initializer.arguments[0]}function jA(e,t){if(gl(e))ra(e.moduleSpecifier)&&t(e);else if(Hl(e))Pm(e.moduleReference)&&Ja(e.moduleReference.expression)&&t(e);else if(ec(e))for(const r of e.declarationList.declarations)r.initializer&&g_(r.initializer,!0)&&t(r)}function vce(e,t,r,i,s,o,c){let u;const f=[];return t.forEach(g=>{g.escapedName==="default"?u=I.createIdentifier(Q9(g)):f.push(g.name)}),OL(e,u,f,r,i,s,o,c)}function OL(e,t,r,i,s,o,c,u){const f=I0(qn(e.path),i),g=EO(s.getCompilerOptions(),e,e.path,f,qb(s,o));if(c){const p=r.map(y=>I.createImportSpecifier(!1,void 0,I.createIdentifier(y)));return loe(t,p,g,u)}else{E.assert(!t,"No default import should exist");const p=r.map(y=>I.createBindingElement(void 0,void 0,y));return p.length?GTe(I.createObjectBindingPattern(p),void 0,yce(ex(g,u))):void 0}}function GTe(e,t,r,i=2){return I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(e,void 0,t,r)],i))}function bce(e,t,r,i){return ta(t,s=>{if(XTe(s)&&!$Te(e,s,i)&&Ece(s,o=>{var c;return r.has(E.checkDefined((c=Jn(o,Ed))==null?void 0:c.symbol))})){const o=WBe(wo(s),i);if(o)return o}return wo(s)})}function $Te(e,t,r,i){var s;return r?!kl(t)&&In(t,32)||!!(i&&e.symbol&&((s=e.symbol.exports)!=null&&s.has(i.escapedText))):!!e.symbol&&!!e.symbol.exports&&Tce(t).some(o=>e.symbol.exports.has(zo(o)))}function Sce(e,t,r,i){switch(t.kind){case 272:JBe(e,t,r,i);break;case 271:i(t.name)&&r.delete(e,t);break;case 260:zBe(e,t,r,i);break;default:E.assertNever(t,`Unexpected import decl kind ${t.kind}`)}}function JBe(e,t,r,i){if(!t.importClause)return;const{name:s,namedBindings:o}=t.importClause,c=!s||i(s),u=!o||(o.kind===274?i(o.name):o.elements.length!==0&&o.elements.every(f=>i(f.name)));if(c&&u)r.delete(e,t);else if(s&&c&&r.delete(e,s),o){if(u)r.replaceNode(e,t.importClause,I.updateImportClause(t.importClause,t.importClause.isTypeOnly,s,void 0));else if(o.kind===275)for(const f of o.elements)i(f.name)&&r.delete(e,f)}}function zBe(e,t,r,i){const{name:s}=t;switch(s.kind){case 80:i(s)&&(t.initializer&&g_(t.initializer,!0)?r.delete(e,ml(t.parent)&&Ir(t.parent.declarations)===1?t.parent.parent:t):r.delete(e,s));break;case 207:break;case 206:if(s.elements.every(o=>Ie(o.name)&&i(o.name)))r.delete(e,ml(t.parent)&&t.parent.declarations.length===1?t.parent.parent:t);else for(const o of s.elements)Ie(o.name)&&i(o.name)&&r.delete(e,o.name);break}}function XTe(e){return E.assert(Ai(e.parent),"Node parent should be a SourceFile"),txe(e)||ec(e)}function WBe(e,t){return t?[UBe(e)]:VBe(e)}function UBe(e){const t=Wp(e)?Xi([I.createModifier(95)],hv(e)):void 0;switch(e.kind){case 262:return I.updateFunctionDeclaration(e,t,e.asteriskToken,e.name,e.typeParameters,e.parameters,e.type,e.body);case 263:const r=Lb(e)?O0(e):void 0;return I.updateClassDeclaration(e,Xi(r,t),e.name,e.typeParameters,e.heritageClauses,e.members);case 243:return I.updateVariableStatement(e,t,e.declarationList);case 267:return I.updateModuleDeclaration(e,t,e.name,e.body);case 266:return I.updateEnumDeclaration(e,t,e.name,e.members);case 265:return I.updateTypeAliasDeclaration(e,t,e.name,e.typeParameters,e.type);case 264:return I.updateInterfaceDeclaration(e,t,e.name,e.typeParameters,e.heritageClauses,e.members);case 271:return I.updateImportEqualsDeclaration(e,t,e.isTypeOnly,e.name,e.moduleReference);case 244:return E.fail();default:return E.assertNever(e,`Unexpected declaration kind ${e.kind}`)}}function VBe(e){return[e,...Tce(e).map(QTe)]}function QTe(e){return I.createExpressionStatement(I.createBinaryExpression(I.createPropertyAccessExpression(I.createIdentifier("exports"),I.createIdentifier(e)),64,I.createIdentifier(e)))}function Tce(e){switch(e.kind){case 262:case 263:return[e.name.text];case 243:return Ii(e.declarationList.declarations,t=>Ie(t.name)?t.name.text:void 0);case 267:case 266:case 265:case 264:case 271:return ze;case 244:return E.fail("Can't export an ExpressionStatement");default:return E.assertNever(e,`Unexpected decl kind ${e.kind}`)}}function BA(e,t,r){switch(e.kind){case 272:{const i=e.importClause;if(!i)return;const s=i.name&&r(i.name)?i.name:void 0,o=i.namedBindings&&qBe(i.namedBindings,r);return s||o?I.createImportDeclaration(void 0,I.createImportClause(i.isTypeOnly,s,o),wo(t),void 0):void 0}case 271:return r(e.name)?e:void 0;case 260:{const i=HBe(e.name,r);return i?GTe(i,e.type,yce(t),e.parent.flags):void 0}default:return E.assertNever(e,`Unexpected import kind ${e.kind}`)}}function qBe(e,t){if(e.kind===274)return t(e.name)?e:void 0;{const r=e.elements.filter(i=>t(i.name));return r.length?I.createNamedImports(r):void 0}}function HBe(e,t){switch(e.kind){case 80:return t(e)?e:void 0;case 207:return e;case 206:{const r=e.elements.filter(i=>i.propertyName||!Ie(i.name)||t(i.name));return r.length?I.createObjectBindingPattern(r):void 0}}}function xce(e){return kl(e)?Jn(e.expression.left.name,Ie):Jn(e.name,Ie)}function PG(e){switch(e.kind){case 260:return e.parent.parent;case 208:return PG(Ms(e.parent.parent,t=>Ei(t)||Pa(t)));default:return e}}function kce(e,t,r,i,s){if(!$Te(e,t,s,r))if(s)kl(t)||i.insertExportModifier(e,t);else{const o=Tce(t);o.length!==0&&i.insertNodesAfter(e,t,o.map(QTe))}}function Cce(e,t,r,i){const s=t.getTypeChecker(),o=JA(r);let c;if(o){c=LL(e,o.all,s);const u=qn(e.fileName),f=ST(e.fileName);return Hn(u,QBe(YBe(c.oldFileImportsFromTargetFile,c.movedSymbols),f,u,i))+f}return""}function GBe(e){const{file:t}=e,r=H9(tx(e)),{statements:i}=t;let s=Dc(i,g=>g.end>r.pos);if(s===-1)return;const o=i[s],c=rxe(t,o);c&&(s=c.start);let u=Dc(i,g=>g.end>=r.end,s);u!==-1&&r.end<=i[u].getStart()&&u--;const f=rxe(t,i[u]);return f&&(u=f.end),{toMove:i.slice(s,u===-1?i.length:u+1),afterLast:u===-1?void 0:i[u+1]}}function JA(e){const t=GBe(e);if(t===void 0)return;const r=[],i=[],{toMove:s,afterLast:o}=t;return pj(s,$Be,(c,u)=>{for(let f=c;f!!t.initializer&&g_(t.initializer,!0));default:return!1}}function LL(e,t,r,i=new Set){const s=new Set,o=new Map,c=new Set,u=kn(t,S=>!!(S.transformFlags&2)),f=y(u);f&&o.set(f,!1);for(const S of t)Ece(S,T=>{s.add(E.checkDefined(kl(T)?r.getSymbolAtLocation(T.expression.left):T.symbol,"Need a symbol here"))});const g=new Set;for(const S of t)YTe(S,r,(T,C)=>{if(T.declarations){if(i.has(yu(T,r))){g.add(T);return}for(const w of T.declarations)if(ZTe(w)){const D=o.get(T);o.set(T,(D===void 0||D)&&C)}else ML(w)&&ZBe(w)===e&&!s.has(T)&&c.add(T)}});for(const S of o.keys())g.add(S);const p=new Set;for(const S of e.statements)_s(t,S)||(f&&S.transformFlags&2&&g.delete(f),YTe(S,r,T=>{s.has(T)&&p.add(T),g.delete(T)}));return{movedSymbols:s,targetFileImportsFromOldFile:c,oldFileImportsFromTargetFile:p,oldImportsNeededByTargetFile:o,unusedImportsFromOldFile:g};function y(S){if(S===void 0)return;const T=r.getJsxNamespace(S),C=r.resolveName(T,S,1920,!0);return C&&ut(C.declarations,ZTe)?C:void 0}}function QBe(e,t,r,i){let s=e;for(let o=1;;o++){const c=Hn(r,s+t);if(!i.fileExists(c))return s;s=`${e}.${o}`}}function YBe(e,t){return ng(e,Q9)||ng(t,Q9)||"newFile"}function YTe(e,t,r){e.forEachChild(function i(s){if(Ie(s)&&!$g(s)){const o=t.getSymbolAtLocation(s);o&&r(o,o1(s))}else s.forEachChild(i)})}function Ece(e,t){switch(e.kind){case 262:case 263:case 267:case 266:case 265:case 264:case 271:return t(e);case 243:return ic(e.declarationList.declarations,r=>exe(r.name,t));case 244:{const{expression:r}=e;return Gr(r)&&ac(r)===1?t(e):void 0}}}function ZTe(e){switch(e.kind){case 271:case 276:case 273:case 274:return!0;case 260:return KTe(e);case 208:return Ei(e.parent.parent)&&KTe(e.parent.parent);default:return!1}}function KTe(e){return Ai(e.parent.parent.parent)&&!!e.initializer&&g_(e.initializer,!0)}function ML(e){return txe(e)&&Ai(e.parent)||Ei(e)&&Ai(e.parent.parent.parent)}function ZBe(e){return Ei(e)?e.parent.parent.parent:e.parent}function exe(e,t){switch(e.kind){case 80:return t(Ms(e.parent,r=>Ei(r)||Pa(r)));case 207:case 206:return ic(e.elements,r=>dl(r)?void 0:exe(r.name,t));default:return E.assertNever(e,`Unexpected name kind ${e.kind}`)}}function txe(e){switch(e.kind){case 262:case 263:case 267:case 266:case 265:case 264:case 271:return!0;default:return!1}}function KBe(e,t,r,i,s){var o;const c=new Set,u=(o=i.symbol)==null?void 0:o.exports;if(u){const g=t.getTypeChecker(),p=new Map;for(const y of s.all)XTe(y)&&In(y,32)&&Ece(y,S=>{var T;const C=Ed(S)?(T=u.get(S.symbol.escapedName))==null?void 0:T.declarations:void 0,w=ic(C,D=>qc(D)?D:vu(D)?Jn(D.parent.parent,qc):void 0);w&&w.moduleSpecifier&&p.set(w,(p.get(w)||new Set).add(S))});for(const[y,S]of fs(p))if(y.exportClause&&gp(y.exportClause)&&Ir(y.exportClause.elements)){const T=y.exportClause.elements,C=wn(T,w=>kn(yu(w.symbol,g).declarations,D=>ML(D)&&S.has(D))===void 0);if(Ir(C)===0){e.deleteNode(i,y),c.add(y);continue}Ir(C)qc(g)&&!!g.moduleSpecifier&&!c.has(g));f?e.insertNodesBefore(i,f,r,!0):e.insertNodesAfter(i,i.statements[i.statements.length-1],r)}function rxe(e,t){if(po(t)){const r=t.symbol.declarations;if(r===void 0||Ir(r)<=1||!_s(r,t))return;const i=r[0],s=r[Ir(r)-1],o=Ii(r,f=>Or(f)===e&&Ci(f)?f:void 0),c=Dc(e.statements,f=>f.end>=s.end),u=Dc(e.statements,f=>f.end>=i.end);return{toMove:o,start:u,end:c}}}function eJe(e,t){const r=new Set;for(const i of e.imports){const s=G4(i);if(gl(s)&&s.importClause&&s.importClause.namedBindings&&Kg(s.importClause.namedBindings))for(const o of s.importClause.namedBindings.elements){const c=t.getSymbolAtLocation(o.propertyName||o.name);c&&r.add(yu(c,t))}if(ZI(s.parent)&&jp(s.parent.name))for(const o of s.parent.name.elements){const c=t.getSymbolAtLocation(o.propertyName||o.name);c&&r.add(yu(c,t))}}return r}var RL,wG,AG,tJe=Nt({"src/services/refactors/moveToFile.ts"(){"use strict";S2e(),zn(),OTe(),RL="Move to file",wG=ls(d.Move_to_file),AG={name:"Move to file",description:wG,kind:"refactor.move.file"},hg(RL,{kinds:[AG.kind],getAvailableActions:function(t,r){const i=JA(t);return r?t.preferences.allowTextChangesInNewFiles&&i?[{name:RL,description:wG,actions:[AG]}]:t.preferences.provideRefactorNotApplicableReason?[{name:RL,description:wG,actions:[{...AG,notApplicableReason:ls(d.Selection_is_not_a_valid_statement_or_statements)}]}]:ze:ze},getEditsForAction:function(t,r,i){E.assert(r===RL,"Wrong refactor invoked");const s=E.checkDefined(JA(t)),{host:o,program:c}=t;E.assert(i,"No interactive refactor arguments available");const u=i.targetFile;return jv(u)||Tb(u)?o.fileExists(u)&&c.getSourceFile(u)===void 0?qTe(ls(d.Cannot_move_statements_to_the_selected_file)):{edits:Qr.ChangeTracker.with(t,g=>LBe(t,t.file,i.targetFile,t.program,s,g,t.host,t.preferences)),renameFilename:void 0,renameLocation:void 0}:qTe(ls(d.Cannot_move_to_file_selected_file_is_invalid))}})}});function rJe(e){const{file:t,startPosition:r,program:i}=e;return ixe(t,r,i)?[{name:NG,description:Dce,actions:[Pce]}]:ze}function nJe(e){const{file:t,startPosition:r,program:i}=e,s=ixe(t,r,i);if(!s)return;const o=i.getTypeChecker(),c=s[s.length-1];let u=c;switch(c.kind){case 173:{u=I.updateMethodSignature(c,c.modifiers,c.name,c.questionToken,c.typeParameters,g(s),c.type);break}case 174:{u=I.updateMethodDeclaration(c,c.modifiers,c.asteriskToken,c.name,c.questionToken,c.typeParameters,g(s),c.type,c.body);break}case 179:{u=I.updateCallSignature(c,c.typeParameters,g(s),c.type);break}case 176:{u=I.updateConstructorDeclaration(c,c.modifiers,g(s),c.body);break}case 180:{u=I.updateConstructSignature(c,c.typeParameters,g(s),c.type);break}case 262:{u=I.updateFunctionDeclaration(c,c.modifiers,c.asteriskToken,c.name,c.typeParameters,g(s),c.type,c.body);break}default:return E.failBadSyntaxKind(c,"Unhandled signature kind in overload list conversion refactoring")}if(u===c)return;return{renameFilename:void 0,renameLocation:void 0,edits:Qr.ChangeTracker.with(e,S=>{S.replaceNodeRange(t,s[0],s[s.length-1],u)})};function g(S){const T=S[S.length-1];return po(T)&&T.body&&(S=S.slice(0,S.length-1)),I.createNodeArray([I.createParameterDeclaration(void 0,I.createToken(26),"args",void 0,I.createUnionTypeNode(Yt(S,p)))])}function p(S){const T=Yt(S.parameters,y);return Vr(I.createTupleTypeNode(T),ut(T,C=>!!Ir(sC(C)))?0:1)}function y(S){E.assert(Ie(S.name));const T=tt(I.createNamedTupleMember(S.dotDotDotToken,S.name,S.questionToken,S.type||I.createKeywordTypeNode(133)),S),C=S.symbol&&S.symbol.getDocumentationComment(o);if(C){const w=GA(C);w.length&&l1(T,[{text:`* +${w.split(` +`).map(D=>` * ${D}`).join(` +`)} + `,kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}])}return T}}function nxe(e){switch(e.kind){case 173:case 174:case 179:case 176:case 180:case 262:return!0}return!1}function ixe(e,t,r){const i=Ji(e,t),s=Ar(i,nxe);if(!s||po(s)&&s.body&&_A(s.body,t))return;const o=r.getTypeChecker(),c=s.symbol;if(!c)return;const u=c.declarations;if(Ir(u)<=1||!qi(u,S=>Or(S)===e)||!nxe(u[0]))return;const f=u[0].kind;if(!qi(u,S=>S.kind===f))return;const g=u;if(ut(g,S=>!!S.typeParameters||ut(S.parameters,T=>!!T.modifiers||!Ie(T.name))))return;const p=Ii(g,S=>o.getSignatureFromDeclaration(S));if(Ir(p)!==Ir(u))return;const y=o.getReturnTypeOfSignature(p[0]);if(qi(p,S=>o.getReturnTypeOfSignature(S)===y))return g}var NG,Dce,Pce,iJe=Nt({"src/services/refactors/convertOverloadListToSingleSignature.ts"(){"use strict";zn(),Nm(),NG="Convert overload list to single signature",Dce=ls(d.Convert_overload_list_to_single_signature),Pce={name:NG,description:Dce,kind:"refactor.rewrite.function.overloadList"},hg(NG,{kinds:[Pce.kind],getEditsForAction:nJe,getAvailableActions:rJe})}});function sJe(e){const{file:t,startPosition:r,triggerReason:i}=e,s=sxe(t,r,i==="invoked");return s?nh(s)?e.preferences.provideRefactorNotApplicableReason?[{name:IG,description:wce,actions:[{...jL,notApplicableReason:s.error},{...zA,notApplicableReason:s.error}]}]:ze:[{name:IG,description:wce,actions:[s.addBraces?jL:zA]}]:ze}function aJe(e,t){const{file:r,startPosition:i}=e,s=sxe(r,i);E.assert(s&&!nh(s),"Expected applicable refactor info");const{expression:o,returnStatement:c,func:u}=s;let f;if(t===jL.name){const p=I.createReturnStatement(o);f=I.createBlock([p],!0),QC(o,p,r,3,!0)}else if(t===zA.name&&c){const p=o||I.createVoidZero();f=iL(p)?I.createParenthesizedExpression(p):p,EA(c,f,r,3,!1),QC(c,f,r,3,!1),N3(c,f,r,3,!1)}else E.fail("invalid action");return{renameFilename:void 0,renameLocation:void 0,edits:Qr.ChangeTracker.with(e,p=>{p.replaceNode(r,u.body,f)})}}function sxe(e,t,r=!0,i){const s=Ji(e,t),o=uf(s);if(!o)return{error:ls(d.Could_not_find_a_containing_arrow_function)};if(!go(o))return{error:ls(d.Containing_function_is_not_an_arrow_function)};if(!(!yf(o,s)||yf(o.body,s)&&!r)){if(C1(jL.kind,i)&&ct(o.body))return{func:o,addBraces:!0,expression:o.body};if(C1(zA.kind,i)&&Ss(o.body)&&o.body.statements.length===1){const c=ba(o.body.statements);if(Bp(c)){const u=c.expression&&ma(Yk(c.expression,!1))?I.createParenthesizedExpression(c.expression):c.expression;return{func:o,addBraces:!1,expression:u,returnStatement:c}}}}}var IG,wce,jL,zA,oJe=Nt({"src/services/refactors/addOrRemoveBracesToArrowFunction.ts"(){"use strict";zn(),Nm(),IG="Add or remove braces in an arrow function",wce=ls(d.Add_or_remove_braces_in_an_arrow_function),jL={name:"Add braces to arrow function",description:ls(d.Add_braces_to_arrow_function),kind:"refactor.rewrite.arrow.braces.add"},zA={name:"Remove braces from arrow function",description:ls(d.Remove_braces_from_arrow_function),kind:"refactor.rewrite.arrow.braces.remove"},hg(IG,{kinds:[zA.kind],getEditsForAction:aJe,getAvailableActions:sJe})}}),cJe={},lJe=Nt({"src/services/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.ts"(){"use strict";iJe(),oJe()}});function uJe(e){const{file:t,startPosition:r,program:i,kind:s}=e,o=oxe(t,r,i);if(!o)return ze;const{selectedVariableDeclaration:c,func:u}=o,f=[],g=[];if(C1(UA.kind,s)){const p=c||go(u)&&Ei(u.parent)?void 0:ls(d.Could_not_convert_to_named_function);p?g.push({...UA,notApplicableReason:p}):f.push(UA)}if(C1(WA.kind,s)){const p=!c&&go(u)?void 0:ls(d.Could_not_convert_to_anonymous_function);p?g.push({...WA,notApplicableReason:p}):f.push(WA)}if(C1(VA.kind,s)){const p=ro(u)?void 0:ls(d.Could_not_convert_to_arrow_function);p?g.push({...VA,notApplicableReason:p}):f.push(VA)}return[{name:Ace,description:uxe,actions:f.length===0&&e.preferences.provideRefactorNotApplicableReason?g:f}]}function _Je(e,t){const{file:r,startPosition:i,program:s}=e,o=oxe(r,i,s);if(!o)return;const{func:c}=o,u=[];switch(t){case WA.name:u.push(...mJe(e,c));break;case UA.name:const f=dJe(c);if(!f)return;u.push(...gJe(e,c,f));break;case VA.name:if(!ro(c))return;u.push(...hJe(e,c));break;default:return E.fail("invalid action")}return{renameFilename:void 0,renameLocation:void 0,edits:u}}function axe(e){let t=!1;return e.forEachChild(function r(i){if(qC(i)){t=!0;return}!Qn(i)&&!Zc(i)&&!ro(i)&&ds(i,r)}),t}function oxe(e,t,r){const i=Ji(e,t),s=r.getTypeChecker(),o=pJe(e,s,i.parent);if(o&&!axe(o.body)&&!s.containsArgumentsReference(o))return{selectedVariableDeclaration:!0,func:o};const c=uf(i);if(c&&(ro(c)||go(c))&&!yf(c.body,i)&&!axe(c.body)&&!s.containsArgumentsReference(c))return ro(c)&&lxe(e,s,c)?void 0:{selectedVariableDeclaration:!1,func:c}}function fJe(e){return Ei(e)||ml(e)&&e.declarations.length===1}function pJe(e,t,r){if(!fJe(r))return;const s=(Ei(r)?r:ba(r.declarations)).initializer;if(s&&(go(s)||ro(s)&&!lxe(e,t,s)))return s}function cxe(e){if(ct(e)){const t=I.createReturnStatement(e),r=e.getSourceFile();return tt(t,e),O_(t),EA(e,t,r,void 0,!0),I.createBlock([t],!0)}else return e}function dJe(e){const t=e.parent;if(!Ei(t)||!z4(t))return;const r=t.parent,i=r.parent;if(!(!ml(r)||!ec(i)||!Ie(t.name)))return{variableDeclaration:t,variableDeclarationList:r,statement:i,name:t.name}}function mJe(e,t){const{file:r}=e,i=cxe(t.body),s=I.createFunctionExpression(t.modifiers,t.asteriskToken,void 0,t.typeParameters,t.parameters,t.type,i);return Qr.ChangeTracker.with(e,o=>o.replaceNode(r,t,s))}function gJe(e,t,r){const{file:i}=e,s=cxe(t.body),{variableDeclaration:o,variableDeclarationList:c,statement:u,name:f}=r;FH(u);const g=gv(o)&32|Fu(t),p=I.createModifiersFromModifierFlags(g),y=I.createFunctionDeclaration(Ir(p)?p:void 0,t.asteriskToken,f,t.typeParameters,t.parameters,t.type,s);return c.declarations.length===1?Qr.ChangeTracker.with(e,S=>S.replaceNode(i,u,y)):Qr.ChangeTracker.with(e,S=>{S.delete(i,o),S.insertNodeAfter(i,u,y)})}function hJe(e,t){const{file:r}=e,s=t.body.statements[0];let o;yJe(t.body,s)?(o=s.expression,O_(o),Hb(s,o)):o=t.body;const c=I.createArrowFunction(t.modifiers,t.typeParameters,t.parameters,t.type,I.createToken(39),o);return Qr.ChangeTracker.with(e,u=>u.replaceNode(r,t,c))}function yJe(e,t){return e.statements.length===1&&Bp(t)&&!!t.expression}function lxe(e,t,r){return!!r.name&&ho.Core.isSymbolReferencedInFile(r.name,t,e)}var Ace,uxe,WA,UA,VA,vJe=Nt({"src/services/refactors/convertArrowFunctionOrFunctionExpression.ts"(){"use strict";zn(),Nm(),Ace="Convert arrow function or function expression",uxe=ls(d.Convert_arrow_function_or_function_expression),WA={name:"Convert to anonymous function",description:ls(d.Convert_to_anonymous_function),kind:"refactor.rewrite.function.anonymous"},UA={name:"Convert to named function",description:ls(d.Convert_to_named_function),kind:"refactor.rewrite.function.named"},VA={name:"Convert to arrow function",description:ls(d.Convert_to_arrow_function),kind:"refactor.rewrite.function.arrow"},hg(Ace,{kinds:[WA.kind,UA.kind,VA.kind],getEditsForAction:_Je,getAvailableActions:uJe})}}),bJe={},SJe=Nt({"src/services/_namespaces/ts.refactor.convertArrowFunctionOrFunctionExpression.ts"(){"use strict";vJe()}});function TJe(e){const{file:t,startPosition:r}=e;return Iu(t)||!pxe(t,r,e.program.getTypeChecker())?ze:[{name:JL,description:Oce,actions:[Lce]}]}function xJe(e,t){E.assert(t===JL,"Unexpected action name");const{file:r,startPosition:i,program:s,cancellationToken:o,host:c}=e,u=pxe(r,i,s.getTypeChecker());if(!u||!o)return;const f=CJe(u,s,o);return f.valid?{renameFilename:void 0,renameLocation:void 0,edits:Qr.ChangeTracker.with(e,p=>kJe(r,s,c,p,u,f))}:{edits:[]}}function kJe(e,t,r,i,s,o){const c=o.signature,u=Yt(hxe(s,t,r),p=>wo(p));if(c){const p=Yt(hxe(c,t,r),y=>wo(y));g(c,p)}g(s,u);const f=_4(o.functionCalls,(p,y)=>xo(p.pos,y.pos));for(const p of f)if(p.arguments&&p.arguments.length){const y=wo(LJe(s,p.arguments),!0);i.replaceNodeRange(Or(p),ba(p.arguments),Sa(p.arguments),y,{leadingTriviaOption:Qr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Qr.TrailingTriviaOption.Include})}function g(p,y){i.replaceNodeRangeWithNodes(e,ba(p.parameters),Sa(p.parameters),y,{joiner:", ",indentation:0,leadingTriviaOption:Qr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Qr.TrailingTriviaOption.Include})}}function CJe(e,t,r){const i=RJe(e),s=gc(e)?MJe(e):[],o=VS([...i,...s],w0),c=t.getTypeChecker(),u=ta(o,y=>ho.getReferenceEntriesForNode(-1,y,t,t.getSourceFiles(),r)),f=g(u);return qi(f.declarations,y=>_s(o,y))||(f.valid=!1),f;function g(y){const S={accessExpressions:[],typeUsages:[]},T={functionCalls:[],declarations:[],classReferences:S,valid:!0},C=Yt(i,p),w=Yt(s,p),D=gc(e),O=Yt(i,z=>Nce(z,c));for(const z of y){if(z.kind===ho.EntryKind.Span){T.valid=!1;continue}if(_s(O,p(z.node))){if(wJe(z.node.parent)){T.signature=z.node.parent;continue}const X=fxe(z);if(X){T.functionCalls.push(X);continue}}const W=Nce(z.node,c);if(W&&_s(O,W)){const X=Ice(z);if(X){T.declarations.push(X);continue}}if(_s(C,p(z.node))||T3(z.node)){if(_xe(z))continue;const J=Ice(z);if(J){T.declarations.push(J);continue}const ie=fxe(z);if(ie){T.functionCalls.push(ie);continue}}if(D&&_s(w,p(z.node))){if(_xe(z))continue;const J=Ice(z);if(J){T.declarations.push(J);continue}const ie=EJe(z);if(ie){S.accessExpressions.push(ie);continue}if(Vc(e.parent)){const B=DJe(z);if(B){S.typeUsages.push(B);continue}}}T.valid=!1}return T}function p(y){const S=c.getSymbolAtLocation(y);return S&&voe(S,c)}}function Nce(e,t){const r=$A(e);if(r){const i=t.getContextualTypeForObjectLiteralElement(r),s=i?.getSymbol();if(s&&!(Ko(s)&6))return s}}function _xe(e){const t=e.node;if(v_(t.parent)||Em(t.parent)||Hl(t.parent)||K0(t.parent)||vu(t.parent)||cc(t.parent))return t}function Ice(e){if(hu(e.node.parent))return e.node}function fxe(e){if(e.node.parent){const t=e.node,r=t.parent;switch(r.kind){case 213:case 214:const i=Jn(r,gm);if(i&&i.expression===t)return i;break;case 211:const s=Jn(r,bn);if(s&&s.parent&&s.name===t){const c=Jn(s.parent,gm);if(c&&c.expression===s)return c}break;case 212:const o=Jn(r,mo);if(o&&o.parent&&o.argumentExpression===t){const c=Jn(o.parent,gm);if(c&&c.expression===o)return c}break}}}function EJe(e){if(e.node.parent){const t=e.node,r=t.parent;switch(r.kind){case 211:const i=Jn(r,bn);if(i&&i.expression===t)return i;break;case 212:const s=Jn(r,mo);if(s&&s.expression===t)return s;break}}}function DJe(e){const t=e.node;if(Wb(t)===2||T8(t.parent))return t}function pxe(e,t,r){const i=k3(e,t),s=Xee(i);if(!PJe(i)&&s&&AJe(s,r)&&yf(s,i)&&!(s.body&&yf(s.body,i)))return s}function PJe(e){const t=Ar(e,Tk);if(t){const r=Ar(t,i=>!Tk(i));return!!r&&po(r)}return!1}function wJe(e){return fg(e)&&(Mu(e.parent)||X_(e.parent))}function AJe(e,t){var r;if(!NJe(e.parameters,t))return!1;switch(e.kind){case 262:return dxe(e)&&BL(e,t);case 174:if(ma(e.parent)){const i=Nce(e.name,t);return((r=i?.declarations)==null?void 0:r.length)===1&&BL(e,t)}return BL(e,t);case 176:return Vc(e.parent)?dxe(e.parent)&&BL(e,t):mxe(e.parent.parent)&&BL(e,t);case 218:case 219:return mxe(e.parent)}return!1}function BL(e,t){return!!e.body&&!t.isImplementationOfOverload(e)}function dxe(e){return e.name?!0:!!GC(e,90)}function NJe(e,t){return FJe(e)>=yxe&&qi(e,r=>IJe(r,t))}function IJe(e,t){if(rg(e)){const r=t.getTypeAtLocation(e);if(!t.isArrayType(r)&&!t.isTupleType(r))return!1}return!e.modifiers&&Ie(e.name)}function mxe(e){return Ei(e)&&wk(e)&&Ie(e.name)&&!e.type}function Fce(e){return e.length>0&&qC(e[0].name)}function FJe(e){return Fce(e)?e.length-1:e.length}function gxe(e){return Fce(e)&&(e=I.createNodeArray(e.slice(1),e.hasTrailingComma)),e}function OJe(e,t){return Ie(t)&&cp(t)===e?I.createShorthandPropertyAssignment(e):I.createPropertyAssignment(e,t)}function LJe(e,t){const r=gxe(e.parameters),i=rg(Sa(r)),s=i?t.slice(0,r.length-1):t,o=Yt(s,(u,f)=>{const g=FG(r[f]),p=OJe(g,u);return O_(p.name),Hc(p)&&O_(p.initializer),Hb(u,p),p});if(i&&t.length>=r.length){const u=t.slice(r.length-1),f=I.createPropertyAssignment(FG(Sa(r)),I.createArrayLiteralExpression(u));o.push(f)}return I.createObjectLiteralExpression(o,!1)}function hxe(e,t,r){const i=t.getTypeChecker(),s=gxe(e.parameters),o=Yt(s,p),c=I.createObjectBindingPattern(o),u=y(s);let f;qi(s,C)&&(f=I.createObjectLiteralExpression());const g=I.createParameterDeclaration(void 0,void 0,c,void 0,u,f);if(Fce(e.parameters)){const w=e.parameters[0],D=I.createParameterDeclaration(void 0,void 0,w.name,void 0,w.type);return O_(D.name),Hb(w.name,D.name),w.type&&(O_(D.type),Hb(w.type,D.type)),I.createNodeArray([D,g])}return I.createNodeArray([g]);function p(w){const D=I.createBindingElement(void 0,void 0,FG(w),rg(w)&&C(w)?I.createArrayLiteralExpression():w.initializer);return O_(D),w.initializer&&D.initializer&&Hb(w.initializer,D.initializer),D}function y(w){const D=Yt(w,S);return Cm(I.createTypeLiteralNode(D),1)}function S(w){let D=w.type;!D&&(w.initializer||rg(w))&&(D=T(w));const O=I.createPropertySignature(void 0,FG(w),C(w)?I.createToken(58):w.questionToken,D);return O_(O),Hb(w.name,O.name),w.type&&O.type&&Hb(w.type,O.type),O}function T(w){const D=i.getTypeAtLocation(w);return F3(D,w,t,r)}function C(w){if(rg(w)){const D=i.getTypeAtLocation(w);return!i.isTupleType(D)}return i.isOptionalParameter(w)}}function FG(e){return cp(e.name)}function MJe(e){switch(e.parent.kind){case 263:const t=e.parent;return t.name?[t.name]:[E.checkDefined(GC(t,90),"Nameless class declaration should be a default export")];case 231:const i=e.parent,s=e.parent.parent,o=i.name;return o?[o,s.name]:[s.name]}}function RJe(e){switch(e.kind){case 262:return e.name?[e.name]:[E.checkDefined(GC(e,90),"Nameless function declaration should be a default export")];case 174:return[e.name];case 176:const r=E.checkDefined(Ua(e,137,e.getSourceFile()),"Constructor declaration should have constructor keyword");return e.parent.kind===231?[e.parent.parent.name,r]:[r];case 219:return[e.parent.name];case 218:return e.name?[e.name,e.parent.name]:[e.parent.name];default:return E.assertNever(e,`Unexpected function declaration kind ${e.kind}`)}}var JL,yxe,Oce,Lce,jJe=Nt({"src/services/refactors/convertParamsToDestructuredObject.ts"(){"use strict";zn(),Nm(),JL="Convert parameters to destructured object",yxe=1,Oce=ls(d.Convert_parameters_to_destructured_object),Lce={name:JL,description:Oce,kind:"refactor.rewrite.parameters.toDestructured"},hg(JL,{kinds:[Lce.kind],getEditsForAction:xJe,getAvailableActions:TJe})}}),BJe={},JJe=Nt({"src/services/_namespaces/ts.refactor.convertParamsToDestructuredObject.ts"(){"use strict";jJe()}});function zJe(e){const{file:t,startPosition:r}=e,i=vxe(t,r),s=Mce(i),o=ra(s),c={name:OG,description:LG,actions:[]};return o&&e.triggerReason!=="invoked"?ze:sg(s)&&(o||Gr(s)&&Rce(s).isValidConcatenation)?(c.actions.push(MG),[c]):e.preferences.provideRefactorNotApplicableReason?(c.actions.push({...MG,notApplicableReason:ls(d.Can_only_convert_string_concatenations_and_string_literals)}),[c]):ze}function vxe(e,t){const r=Ji(e,t),i=Mce(r);return!Rce(i).isValidConcatenation&&y_(i.parent)&&Gr(i.parent.parent)?i.parent.parent:r}function WJe(e,t){const{file:r,startPosition:i}=e,s=vxe(r,i);switch(t){case LG:return{edits:UJe(e,s)};default:return E.fail("invalid action")}}function UJe(e,t){const r=Mce(t),i=e.file,s=HJe(Rce(r),i),o=Hy(i.text,r.end);if(o){const c=o[o.length-1],u={pos:o[0].pos,end:c.end};return Qr.ChangeTracker.with(e,f=>{f.deleteRange(i,u),f.replaceNode(i,r,s)})}else return Qr.ChangeTracker.with(e,c=>c.replaceNode(i,r,s))}function VJe(e){return!(e.operatorToken.kind===64||e.operatorToken.kind===65)}function Mce(e){return Ar(e.parent,r=>{switch(r.kind){case 211:case 212:return!1;case 228:case 226:return!(Gr(r.parent)&&VJe(r.parent));default:return"quit"}})||e}function Rce(e){const t=c=>{if(!Gr(c))return{nodes:[c],operators:[],validOperators:!0,hasString:ra(c)||PT(c)};const{nodes:u,operators:f,hasString:g,validOperators:p}=t(c.left);if(!(g||ra(c.right)||JF(c.right)))return{nodes:[c],operators:[],hasString:!1,validOperators:!0};const y=c.operatorToken.kind===40,S=p&&y;return u.push(c.right),f.push(c.operatorToken),{nodes:u,operators:f,hasString:!0,validOperators:S}},{nodes:r,operators:i,validOperators:s,hasString:o}=t(e);return{nodes:r,operators:i,isValidConcatenation:s&&o}}function qJe(e){return e.replace(/\\.|[$`]/g,t=>t[0]==="\\"?t:"\\"+t)}function bxe(e){const t=oC(e)||Gre(e)?-2:-1;return Wc(e).slice(1,t)}function Sxe(e,t){const r=[];let i="",s="";for(;e{Txe(W);const J=X===S.templateSpans.length-1,ie=W.literal.text+(J?C:""),B=bxe(W.literal)+(J?w:"");return I.createTemplateSpan(W.expression,O&&J?I.createTemplateTail(ie,B):I.createTemplateMiddle(ie,B))});g.push(...z)}else{const z=O?I.createTemplateTail(C,w):I.createTemplateMiddle(C,w);s(D,z),g.push(I.createTemplateSpan(S,z))}}return I.createTemplateExpression(p,g)}function Txe(e){const t=e.getSourceFile();N3(e,e.expression,t,3,!1),EA(e.expression,e.expression,t,3,!1)}function GJe(e){return y_(e)&&(Txe(e),e=e.expression),e}var OG,LG,MG,xxe,kxe,$Je=Nt({"src/services/refactors/convertStringOrTemplateLiteral.ts"(){"use strict";zn(),Nm(),OG="Convert to template string",LG=ls(d.Convert_to_template_string),MG={name:OG,description:LG,kind:"refactor.rewrite.string"},hg(OG,{kinds:[MG.kind],getEditsForAction:WJe,getAvailableActions:zJe}),xxe=(e,t)=>(r,i)=>{r(i,s)=>{for(;i.length>0;){const o=i.shift();N3(e[o],s,t,3,!1),r(o,s)}}}}),XJe={},QJe=Nt({"src/services/_namespaces/ts.refactor.convertStringOrTemplateLiteral.ts"(){"use strict";$Je()}});function YJe(e){const t=Cxe(e,e.triggerReason==="invoked");return t?nh(t)?e.preferences.provideRefactorNotApplicableReason?[{name:zL,description:BG,actions:[{...JG,notApplicableReason:t.error}]}]:ze:[{name:zL,description:BG,actions:[JG]}]:ze}function ZJe(e,t){const r=Cxe(e);return E.assert(r&&!nh(r),"Expected applicable refactor info"),{edits:Qr.ChangeTracker.with(e,s=>aze(e.file,e.program.getTypeChecker(),s,r,t)),renameFilename:void 0,renameLocation:void 0}}function RG(e){return Gr(e)||dC(e)}function KJe(e){return kl(e)||Bp(e)||ec(e)}function jG(e){return RG(e)||KJe(e)}function Cxe(e,t=!0){const{file:r,program:i}=e,s=tx(e),o=s.length===0;if(o&&!t)return;const c=Ji(r,s.start),u=z9(r,s.start+s.length),f=zc(c.pos,u&&u.end>=c.pos?u.getEnd():c.getEnd()),g=o?ize(c):nze(c,f),p=g&&jG(g)?sze(g):void 0;if(!p)return{error:ls(d.Could_not_find_convertible_access_expression)};const y=i.getTypeChecker();return dC(p)?eze(p,y):tze(p)}function eze(e,t){const r=e.condition,i=Bce(e.whenTrue);if(!i||t.isNullableType(t.getTypeAtLocation(i)))return{error:ls(d.Could_not_find_convertible_access_expression)};if((bn(r)||Ie(r))&&jce(r,i.expression))return{finalExpression:i,occurrences:[r],expression:e};if(Gr(r)){const s=Exe(i.expression,r);return s?{finalExpression:i,occurrences:s,expression:e}:{error:ls(d.Could_not_find_matching_access_expressions)}}}function tze(e){if(e.operatorToken.kind!==56)return{error:ls(d.Can_only_convert_logical_AND_access_chains)};const t=Bce(e.right);if(!t)return{error:ls(d.Could_not_find_convertible_access_expression)};const r=Exe(t.expression,e.left);return r?{finalExpression:t,occurrences:r,expression:e}:{error:ls(d.Could_not_find_matching_access_expressions)}}function Exe(e,t){const r=[];for(;Gr(t)&&t.operatorToken.kind===56;){const s=jce(Ha(e),Ha(t.right));if(!s)break;r.push(s),e=s,t=t.left}const i=jce(e,t);return i&&r.push(i),r.length>0?r:void 0}function jce(e,t){if(!(!Ie(t)&&!bn(t)&&!mo(t)))return rze(e,t)?t:void 0}function rze(e,t){for(;(Rs(e)||bn(e)||mo(e))&&qA(e)!==qA(t);)e=e.expression;for(;bn(e)&&bn(t)||mo(e)&&mo(t);){if(qA(e)!==qA(t))return!1;e=e.expression,t=t.expression}return Ie(e)&&Ie(t)&&e.getText()===t.getText()}function qA(e){if(Ie(e)||_f(e))return e.getText();if(bn(e))return qA(e.name);if(mo(e))return qA(e.argumentExpression)}function nze(e,t){for(;e.parent;){if(jG(e)&&t.length!==0&&e.end>=t.start+t.length)return e;e=e.parent}}function ize(e){for(;e.parent;){if(jG(e)&&!jG(e.parent))return e;e=e.parent}}function sze(e){if(RG(e))return e;if(ec(e)){const t=Jk(e),r=t?.initializer;return r&&RG(r)?r:void 0}return e.expression&&RG(e.expression)?e.expression:void 0}function Bce(e){if(e=Ha(e),Gr(e))return Bce(e.left);if((bn(e)||mo(e)||Rs(e))&&!gu(e))return e}function Dxe(e,t,r){if(bn(t)||mo(t)||Rs(t)){const i=Dxe(e,t.expression,r),s=r.length>0?r[r.length-1]:void 0,o=s?.getText()===t.expression.getText();if(o&&r.pop(),Rs(t))return o?I.createCallChain(i,I.createToken(29),t.typeArguments,t.arguments):I.createCallChain(i,t.questionDotToken,t.typeArguments,t.arguments);if(bn(t))return o?I.createPropertyAccessChain(i,I.createToken(29),t.name):I.createPropertyAccessChain(i,t.questionDotToken,t.name);if(mo(t))return o?I.createElementAccessChain(i,I.createToken(29),t.argumentExpression):I.createElementAccessChain(i,t.questionDotToken,t.argumentExpression)}return t}function aze(e,t,r,i,s){const{finalExpression:o,occurrences:c,expression:u}=i,f=c[c.length-1],g=Dxe(t,o,c);g&&(bn(g)||mo(g)||Rs(g))&&(Gr(u)?r.replaceNodeRange(e,f,o,g):dC(u)&&r.replaceNode(e,u,I.createBinaryExpression(g,I.createToken(61),u.whenFalse)))}var zL,BG,JG,oze=Nt({"src/services/refactors/convertToOptionalChainExpression.ts"(){"use strict";zn(),Nm(),zL="Convert to optional chain expression",BG=ls(d.Convert_to_optional_chain_expression),JG={name:zL,description:BG,kind:"refactor.rewrite.expression.optionalChain"},hg(zL,{kinds:[JG.kind],getEditsForAction:ZJe,getAvailableActions:YJe})}}),cze={},lze=Nt({"src/services/_namespaces/ts.refactor.convertToOptionalChainExpression.ts"(){"use strict";oze()}});function Pxe(e){const t=e.kind,r=Jce(e.file,tx(e),e.triggerReason==="invoked"),i=r.targetRange;if(i===void 0){if(!r.errors||r.errors.length===0||!e.preferences.provideRefactorNotApplicableReason)return ze;const C=[];return C1(t6.kind,t)&&C.push({name:KC,description:t6.description,actions:[{...t6,notApplicableReason:T(r.errors)}]}),C1(e6.kind,t)&&C.push({name:KC,description:e6.description,actions:[{...e6,notApplicableReason:T(r.errors)}]}),C}const s=mze(i,e);if(s===void 0)return ze;const o=[],c=new Map;let u;const f=[],g=new Map;let p,y=0;for(const{functionExtraction:C,constantExtraction:w}of s){if(C1(t6.kind,t)){const D=C.description;C.errors.length===0?c.has(D)||(c.set(D,!0),o.push({description:D,name:`function_scope_${y}`,kind:t6.kind})):u||(u={description:D,name:`function_scope_${y}`,notApplicableReason:T(C.errors),kind:t6.kind})}if(C1(e6.kind,t)){const D=w.description;w.errors.length===0?g.has(D)||(g.set(D,!0),f.push({description:D,name:`constant_scope_${y}`,kind:e6.kind})):p||(p={description:D,name:`constant_scope_${y}`,notApplicableReason:T(w.errors),kind:e6.kind})}y++}const S=[];return o.length?S.push({name:KC,description:ls(d.Extract_function),actions:o}):e.preferences.provideRefactorNotApplicableReason&&u&&S.push({name:KC,description:ls(d.Extract_function),actions:[u]}),f.length?S.push({name:KC,description:ls(d.Extract_constant),actions:f}):e.preferences.provideRefactorNotApplicableReason&&p&&S.push({name:KC,description:ls(d.Extract_constant),actions:[p]}),S.length?S:ze;function T(C){let w=C[0].messageText;return typeof w!="string"&&(w=w.messageText),w}}function wxe(e,t){const i=Jce(e.file,tx(e)).targetRange,s=/^function_scope_(\d+)$/.exec(t);if(s){const c=+s[1];return E.assert(isFinite(c),"Expected to parse a finite number from the function scope index"),pze(i,e,c)}const o=/^constant_scope_(\d+)$/.exec(t);if(o){const c=+o[1];return E.assert(isFinite(c),"Expected to parse a finite number from the constant scope index"),dze(i,e,c)}E.fail("Unrecognized action name")}function Jce(e,t,r=!0){const{length:i}=t;if(i===0&&!r)return{errors:[xl(e,t.start,i,Gl.cannotExtractEmpty)]};const s=i===0&&r,o=Xae(e,t.start),c=z9(e,yc(t)),u=o&&c&&r?uze(o,c,e):t,f=s?Lze(o):TA(o,e,u),g=s?f:TA(c,e,u);let p=0,y;if(!f||!g)return{errors:[xl(e,t.start,i,Gl.cannotExtractRange)]};if(f.flags&16777216)return{errors:[xl(e,t.start,i,Gl.cannotExtractJSDoc)]};if(f.parent!==g.parent)return{errors:[xl(e,t.start,i,Gl.cannotExtractRange)]};if(f!==g){if(!Nxe(f.parent))return{errors:[xl(e,t.start,i,Gl.cannotExtractRange)]};const z=[];for(const W of f.parent.statements){if(W===f||z.length){const X=O(W);if(X)return{errors:X};z.push(W)}if(W===g)break}return z.length?{targetRange:{range:z,facts:p,thisNode:y}}:{errors:[xl(e,t.start,i,Gl.cannotExtractRange)]}}if(Bp(f)&&!f.expression)return{errors:[xl(e,t.start,i,Gl.cannotExtractRange)]};const S=C(f),T=w(S)||O(S);if(T)return{errors:T};return{targetRange:{range:_ze(S),facts:p,thisNode:y}};function C(z){if(Bp(z)){if(z.expression)return z.expression}else if(ec(z)||ml(z)){const W=ec(z)?z.declarationList.declarations:z.declarations;let X=0,J;for(const ie of W)ie.initializer&&(X++,J=ie.initializer);if(X===1)return J}else if(Ei(z)&&z.initializer)return z.initializer;return z}function w(z){if(Ie(kl(z)?z.expression:z))return[mn(z,Gl.cannotExtractIdentifier)]}function D(z,W){let X=z;for(;X!==W;){if(X.kind===172){Ls(X)&&(p|=32);break}else if(X.kind===169){uf(X).kind===176&&(p|=32);break}else X.kind===174&&Ls(X)&&(p|=32);X=X.parent}}function O(z){let W;if((ae=>{ae[ae.None=0]="None",ae[ae.Break=1]="Break",ae[ae.Continue=2]="Continue",ae[ae.Return=4]="Return"})(W||(W={})),E.assert(z.pos<=z.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"),E.assert(!id(z.pos),"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"),!Ci(z)&&!(sg(z)&&Axe(z))&&!qce(z))return[mn(z,Gl.statementOrExpressionExpected)];if(z.flags&33554432)return[mn(z,Gl.cannotExtractAmbientBlock)];const X=wl(z);X&&D(z,X);let J,ie=4,B;if(Y(z),p&8){const ae=i_(z,!1,!1);(ae.kind===262||ae.kind===174&&ae.parent.kind===210||ae.kind===218)&&(p|=16)}return J;function Y(ae){if(J)return!0;if(hu(ae)){const $=ae.kind===260?ae.parent.parent:ae;if(In($,32))return(J||(J=[])).push(mn(ae,Gl.cannotExtractExportedEntity)),!0}switch(ae.kind){case 272:return(J||(J=[])).push(mn(ae,Gl.cannotExtractImport)),!0;case 277:return(J||(J=[])).push(mn(ae,Gl.cannotExtractExportedEntity)),!0;case 108:if(ae.parent.kind===213){const $=wl(ae);if($===void 0||$.pos=t.start+t.length)return(J||(J=[])).push(mn(ae,Gl.cannotExtractSuper)),!0}else p|=8,y=ae;break;case 219:ds(ae,function $(H){if(qC(H))p|=8,y=ae;else{if(Qn(H)||ks(H)&&!go(H))return!1;ds(H,$)}});case 263:case 262:Ai(ae.parent)&&ae.parent.externalModuleIndicator===void 0&&(J||(J=[])).push(mn(ae,Gl.functionWillNotBeVisibleInTheNewScope));case 231:case 218:case 174:case 176:case 177:case 178:return!1}const _e=ie;switch(ae.kind){case 245:ie&=-5;break;case 258:ie=0;break;case 241:ae.parent&&ae.parent.kind===258&&ae.parent.finallyBlock===ae&&(ie=4);break;case 297:case 296:ie|=1;break;default:j0(ae,!1)&&(ie|=3);break}switch(ae.kind){case 197:case 110:p|=8,y=ae;break;case 256:{const $=ae.label;(B||(B=[])).push($.escapedText),ds(ae,Y),B.pop();break}case 252:case 251:{const $=ae.label;$?_s(B,$.escapedText)||(J||(J=[])).push(mn(ae,Gl.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):ie&(ae.kind===252?1:2)||(J||(J=[])).push(mn(ae,Gl.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break}case 223:p|=4;break;case 229:p|=2;break;case 253:ie&4?p|=1:(J||(J=[])).push(mn(ae,Gl.cannotExtractRangeContainingConditionalReturnStatement));break;default:ds(ae,Y);break}ie=_e}}}function uze(e,t,r){const i=e.getStart(r);let s=t.getEnd();return r.text.charCodeAt(s)===59&&s++,{start:i,length:s-i}}function _ze(e){if(Ci(e))return[e];if(sg(e))return kl(e.parent)?[e.parent]:e;if(qce(e))return e}function zce(e){return go(e)?hJ(e.body):po(e)||Ai(e)||Ld(e)||Qn(e)}function fze(e){let t=e0(e.range)?ba(e.range):e.range;if(e.facts&8&&!(e.facts&16)){const i=wl(t);if(i){const s=Ar(t,po);return s?[s,i]:[i]}}const r=[];for(;;)if(t=t.parent,t.kind===169&&(t=Ar(t,i=>po(i)).parent),zce(t)&&(r.push(t),t.kind===312))return r}function pze(e,t,r){const{scopes:i,readsAndWrites:{target:s,usagesPerScope:o,functionErrorsPerScope:c,exposedVariableDeclarations:u}}=Wce(e,t);return E.assert(!c[r].length,"The extraction went missing? How?"),t.cancellationToken.throwIfCancellationRequested(),Sze(s,i[r],o[r],u,e,t)}function dze(e,t,r){const{scopes:i,readsAndWrites:{target:s,usagesPerScope:o,constantErrorsPerScope:c,exposedVariableDeclarations:u}}=Wce(e,t);E.assert(!c[r].length,"The extraction went missing? How?"),E.assert(u.length===0,"Extract constant accepted a range containing a variable declaration?"),t.cancellationToken.throwIfCancellationRequested();const f=ct(s)?s:s.statements[0].expression;return Tze(f,i[r],o[r],e.facts,t)}function mze(e,t){const{scopes:r,readsAndWrites:{functionErrorsPerScope:i,constantErrorsPerScope:s}}=Wce(e,t);return r.map((c,u)=>{const f=gze(c),g=hze(c),p=po(c)?yze(c):Qn(c)?vze(c):bze(c);let y,S;return p===1?(y=lg(ls(d.Extract_to_0_in_1_scope),[f,"global"]),S=lg(ls(d.Extract_to_0_in_1_scope),[g,"global"])):p===0?(y=lg(ls(d.Extract_to_0_in_1_scope),[f,"module"]),S=lg(ls(d.Extract_to_0_in_1_scope),[g,"module"])):(y=lg(ls(d.Extract_to_0_in_1),[f,p]),S=lg(ls(d.Extract_to_0_in_1),[g,p])),u===0&&!Qn(c)&&(S=lg(ls(d.Extract_to_0_in_enclosing_scope),[g])),{functionExtraction:{description:y,errors:i[u]},constantExtraction:{description:S,errors:s[u]}}})}function Wce(e,t){const{file:r}=t,i=fze(e),s=Fze(e,r),o=Oze(e,i,s,r,t.program.getTypeChecker(),t.cancellationToken);return{scopes:i,readsAndWrites:o}}function gze(e){return po(e)?"inner function":Qn(e)?"method":"function"}function hze(e){return Qn(e)?"readonly field":"constant"}function yze(e){switch(e.kind){case 176:return"constructor";case 218:case 262:return e.name?`function '${e.name.text}'`:bL;case 219:return"arrow function";case 174:return`method '${e.name.getText()}'`;case 177:return`'get ${e.name.getText()}'`;case 178:return`'set ${e.name.getText()}'`;default:E.assertNever(e,`Unexpected scope kind ${e.kind}`)}}function vze(e){return e.kind===263?e.name?`class '${e.name.text}'`:"anonymous class declaration":e.name?`class expression '${e.name.text}'`:"anonymous class expression"}function bze(e){return e.kind===268?`namespace '${e.parent.name.getText()}'`:e.externalModuleIndicator?0:1}function Sze(e,t,{usages:r,typeParameterUsages:i,substitutions:s},o,c,u){const f=u.program.getTypeChecker(),g=Da(u.program.getCompilerOptions()),p=su.createImportAdder(u.file,u.program,u.preferences,u.host),y=t.getSourceFile(),S=Gb(Qn(t)?"newMethod":"newFunction",y),T=Hr(t),C=I.createIdentifier(S);let w;const D=[],O=[];let z;r.forEach((he,be)=>{let lt;if(!T){let me=f.getTypeOfSymbolAtLocation(he.symbol,he.node);me=f.getBaseTypeOfLiteralType(me),lt=su.typeToAutoImportableTypeNode(f,p,me,t,g,1)}const pt=I.createParameterDeclaration(void 0,void 0,be,void 0,lt);D.push(pt),he.usage===2&&(z||(z=[])).push(he),O.push(I.createIdentifier(be))});const X=fs(i.values(),he=>({type:he,declaration:kze(he,u.startPosition)})).sort(Cze),J=X.length===0?void 0:Ii(X,({declaration:he})=>he),ie=J!==void 0?J.map(he=>I.createTypeReferenceNode(he.name,void 0)):void 0;if(ct(e)&&!T){const he=f.getContextualType(e);w=f.typeToTypeNode(he,t,1)}const{body:B,returnValueProperty:Y}=Dze(e,o,z,s,!!(c.facts&1));O_(B);let ae;const _e=!!(c.facts&16);if(Qn(t)){const he=T?[]:[I.createModifier(123)];c.facts&32&&he.push(I.createModifier(126)),c.facts&4&&he.push(I.createModifier(134)),ae=I.createMethodDeclaration(he.length?he:void 0,c.facts&2?I.createToken(42):void 0,C,void 0,J,D,w,B)}else _e&&D.unshift(I.createParameterDeclaration(void 0,void 0,"this",void 0,f.typeToTypeNode(f.getTypeAtLocation(c.thisNode),t,1),void 0)),ae=I.createFunctionDeclaration(c.facts&4?[I.createToken(134)]:void 0,c.facts&2?I.createToken(42):void 0,C,J,D,w,B);const $=Qr.ChangeTracker.fromContext(u),H=(e0(c.range)?Sa(c.range):c.range).end,K=Aze(H,t);K?$.insertNodeBefore(u.file,K,ae,!0):$.insertNodeAtEndOfScope(u.file,t,ae),p.writeFixes($);const oe=[],Se=Eze(t,c,S);_e&&O.unshift(I.createIdentifier("this"));let se=I.createCallExpression(_e?I.createPropertyAccessExpression(Se,"call"):Se,ie,O);if(c.facts&2&&(se=I.createYieldExpression(I.createToken(42),se)),c.facts&4&&(se=I.createAwaitExpression(se)),Vce(e)&&(se=I.createJsxExpression(void 0,se)),o.length&&!z)if(E.assert(!Y,"Expected no returnValueProperty"),E.assert(!(c.facts&1),"Expected RangeFacts.HasReturn flag to be unset"),o.length===1){const he=o[0];oe.push(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(wo(he.name),void 0,wo(he.type),se)],he.parent.flags)))}else{const he=[],be=[];let lt=o[0].parent.flags,pt=!1;for(const Oe of o){he.push(I.createBindingElement(void 0,void 0,wo(Oe.name)));const Xe=f.typeToTypeNode(f.getBaseTypeOfLiteralType(f.getTypeAtLocation(Oe)),t,1);be.push(I.createPropertySignature(void 0,Oe.symbol.name,void 0,Xe)),pt=pt||Oe.type!==void 0,lt=lt&Oe.parent.flags}const me=pt?I.createTypeLiteralNode(be):void 0;me&&Vr(me,1),oe.push(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(I.createObjectBindingPattern(he),void 0,me,se)],lt)))}else if(o.length||z){if(o.length)for(const be of o){let lt=be.parent.flags;lt&2&&(lt=lt&-3|1),oe.push(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(be.symbol.name,void 0,ke(be.type))],lt)))}Y&&oe.push(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(Y,void 0,ke(w))],1)));const he=Uce(o,z);Y&&he.unshift(I.createShorthandPropertyAssignment(Y)),he.length===1?(E.assert(!Y,"Shouldn't have returnValueProperty here"),oe.push(I.createExpressionStatement(I.createAssignment(he[0].name,se))),c.facts&1&&oe.push(I.createReturnStatement())):(oe.push(I.createExpressionStatement(I.createAssignment(I.createObjectLiteralExpression(he),se))),Y&&oe.push(I.createReturnStatement(I.createIdentifier(Y))))}else c.facts&1?oe.push(I.createReturnStatement(se)):e0(c.range)?oe.push(I.createExpressionStatement(se)):oe.push(se);e0(c.range)?$.replaceNodeRangeWithNodes(u.file,ba(c.range),Sa(c.range),oe):$.replaceNodeWithNodes(u.file,c.range,oe);const Z=$.getChanges(),Te=(e0(c.range)?ba(c.range):c.range).getSourceFile().fileName,Me=CA(Z,Te,S,!1);return{renameFilename:Te,renameLocation:Me,edits:Z};function ke(he){if(he===void 0)return;const be=wo(he);let lt=be;for(;IT(lt);)lt=lt.type;return u1(lt)&&kn(lt.types,pt=>pt.kind===157)?be:I.createUnionTypeNode([be,I.createKeywordTypeNode(157)])}}function Tze(e,t,{substitutions:r},i,s){const o=s.program.getTypeChecker(),c=t.getSourceFile(),u=bn(e)&&!Qn(t)&&!o.resolveName(e.name.text,e,111551,!1)&&!Ti(e.name)&&!Xy(e.name)?e.name.text:Gb(Qn(t)?"newProperty":"newLocal",c),f=Hr(t);let g=f||!o.isContextSensitive(e)?void 0:o.typeToTypeNode(o.getContextualType(e),t,1),p=Pze(Ha(e),r);({variableType:g,initializer:p}=w(g,p)),O_(p);const y=Qr.ChangeTracker.fromContext(s);if(Qn(t)){E.assert(!f,"Cannot extract to a JS class");const D=[];D.push(I.createModifier(123)),i&32&&D.push(I.createModifier(126)),D.push(I.createModifier(148));const O=I.createPropertyDeclaration(D,u,void 0,g,p);let z=I.createPropertyAccessExpression(i&32?I.createIdentifier(t.name.getText()):I.createThis(),I.createIdentifier(u));Vce(e)&&(z=I.createJsxExpression(void 0,z));const W=e.pos,X=Nze(W,t);y.insertNodeBefore(s.file,X,O,!0),y.replaceNode(s.file,e,z)}else{const D=I.createVariableDeclaration(u,void 0,g,p),O=xze(e,t);if(O){y.insertNodeBefore(s.file,O,D);const z=I.createIdentifier(u);y.replaceNode(s.file,e,z)}else if(e.parent.kind===244&&t===Ar(e,zce)){const z=I.createVariableStatement(void 0,I.createVariableDeclarationList([D],2));y.replaceNode(s.file,e.parent,z)}else{const z=I.createVariableStatement(void 0,I.createVariableDeclarationList([D],2)),W=Ize(e,t);if(W.pos===0?y.insertNodeAtTopOfFile(s.file,z,!1):y.insertNodeBefore(s.file,W,z,!1),e.parent.kind===244)y.delete(s.file,e.parent);else{let X=I.createIdentifier(u);Vce(e)&&(X=I.createJsxExpression(void 0,X)),y.replaceNode(s.file,e,X)}}}const S=y.getChanges(),T=e.getSourceFile().fileName,C=CA(S,T,u,!0);return{renameFilename:T,renameLocation:C,edits:S};function w(D,O){if(D===void 0)return{variableType:D,initializer:O};if(!ro(O)&&!go(O)||O.typeParameters)return{variableType:D,initializer:O};const z=o.getTypeAtLocation(e),W=lm(o.getSignaturesOfType(z,0));if(!W)return{variableType:D,initializer:O};if(W.getTypeParameters())return{variableType:D,initializer:O};const X=[];let J=!1;for(const ie of O.parameters)if(ie.type)X.push(ie);else{const B=o.getTypeAtLocation(ie);B===o.getAnyType()&&(J=!0),X.push(I.updateParameterDeclaration(ie,ie.modifiers,ie.dotDotDotToken,ie.name,ie.questionToken,ie.type||o.typeToTypeNode(B,t,1),ie.initializer))}if(J)return{variableType:D,initializer:O};if(D=void 0,go(O))O=I.updateArrowFunction(O,Wp(e)?hv(e):void 0,O.typeParameters,X,O.type||o.typeToTypeNode(W.getReturnType(),t,1),O.equalsGreaterThanToken,O.body);else{if(W&&W.thisParameter){const ie=bl(X);if(!ie||Ie(ie.name)&&ie.name.escapedText!=="this"){const B=o.getTypeOfSymbolAtLocation(W.thisParameter,e);X.splice(0,0,I.createParameterDeclaration(void 0,void 0,"this",void 0,o.typeToTypeNode(B,t,1)))}}O=I.updateFunctionExpression(O,Wp(e)?hv(e):void 0,O.asteriskToken,O.name,O.typeParameters,X,O.type||o.typeToTypeNode(W.getReturnType(),t,1),O.body)}return{variableType:D,initializer:O}}}function xze(e,t){let r;for(;e!==void 0&&e!==t;){if(Ei(e)&&e.initializer===r&&ml(e.parent)&&e.parent.declarations.length>1)return e;r=e,e=e.parent}}function kze(e,t){let r;const i=e.symbol;if(i&&i.declarations)for(const s of i.declarations)(r===void 0||s.pos0;if(Ss(e)&&!o&&i.size===0)return{body:I.createBlock(e.statements,!0),returnValueProperty:void 0};let c,u=!1;const f=I.createNodeArray(Ss(e)?e.statements.slice(0):[Ci(e)?e:I.createReturnStatement(Ha(e))]);if(o||i.size){const p=kr(f,g,Ci).slice();if(o&&!s&&Ci(e)){const y=Uce(t,r);y.length===1?p.push(I.createReturnStatement(y[0].name)):p.push(I.createReturnStatement(I.createObjectLiteralExpression(y)))}return{body:I.createBlock(p,!0),returnValueProperty:c}}else return{body:I.createBlock(f,!0),returnValueProperty:void 0};function g(p){if(!u&&Bp(p)&&o){const y=Uce(t,r);return p.expression&&(c||(c="__return"),y.unshift(I.createPropertyAssignment(c,He(p.expression,g,ct)))),y.length===1?I.createReturnStatement(y[0].name):I.createReturnStatement(I.createObjectLiteralExpression(y))}else{const y=u;u=u||po(p)||Qn(p);const S=i.get(Oa(p).toString()),T=S?wo(S):sr(p,g,cd);return u=y,T}}}function Pze(e,t){return t.size?r(e):e;function r(i){const s=t.get(Oa(i).toString());return s?wo(s):sr(i,r,cd)}}function wze(e){if(po(e)){const t=e.body;if(Ss(t))return t.statements}else{if(Ld(e)||Ai(e))return e.statements;if(Qn(e))return e.members;}return ze}function Aze(e,t){return kn(wze(t),r=>r.pos>=e&&po(r)&&!gc(r))}function Nze(e,t){const r=t.members;E.assert(r.length>0,"Found no members");let i,s=!0;for(const o of r){if(o.pos>e)return i||r[0];if(s&&!Es(o)){if(i!==void 0)return o;s=!1}i=o}return i===void 0?E.fail():i}function Ize(e,t){E.assert(!Qn(t));let r;for(let i=e;i!==t;i=i.parent)zce(i)&&(r=i);for(let i=(r||e).parent;;i=i.parent){if(Nxe(i)){let s;for(const o of i.statements){if(o.pos>e.pos)break;s=o}return!s&&mC(i)?(E.assert(sw(i.parent.parent),"Grandparent isn't a switch statement"),i.parent.parent):E.checkDefined(s,"prevStatement failed to get set")}E.assert(i!==t,"Didn't encounter a block-like before encountering scope")}}function Uce(e,t){const r=Yt(e,s=>I.createShorthandPropertyAssignment(s.symbol.name)),i=Yt(t,s=>I.createShorthandPropertyAssignment(s.symbol.name));return r===void 0?i:i===void 0?r:r.concat(i)}function e0(e){return es(e)}function Fze(e,t){return e0(e.range)?{pos:ba(e.range).getStart(t),end:Sa(e.range).getEnd()}:e.range}function Oze(e,t,r,i,s,o){const c=new Map,u=[],f=[],g=[],p=[],y=[],S=new Map,T=[];let C;const w=e0(e.range)?e.range.length===1&&kl(e.range[0])?e.range[0].expression:void 0:e.range;let D;if(w===void 0){const K=e.range,oe=ba(K).getStart(),Se=Sa(K).end;D=xl(i,oe,Se-oe,Gl.expressionExpected)}else s.getTypeAtLocation(w).flags&147456&&(D=mn(w,Gl.uselessConstantType));for(const K of t){u.push({usages:new Map,typeParameterUsages:new Map,substitutions:new Map}),f.push(new Map),g.push([]);const oe=[];D&&oe.push(D),Qn(K)&&Hr(K)&&oe.push(mn(K,Gl.cannotExtractToJSClass)),go(K)&&!Ss(K.body)&&oe.push(mn(K,Gl.cannotExtractToExpressionArrowFunction)),p.push(oe)}const O=new Map,z=e0(e.range)?I.createBlock(e.range):e.range,W=e0(e.range)?ba(e.range):e.range,X=J(W);if(B(z),X&&!e0(e.range)&&!Rd(e.range)){const K=s.getContextualType(e.range);ie(K)}if(c.size>0){const K=new Map;let oe=0;for(let Se=W;Se!==void 0&&oe{u[oe].typeParameterUsages.set(Z,se)}),oe++),MJ(Se))for(const se of L0(Se)){const Z=s.getTypeAtLocation(se);c.has(Z.id.toString())&&K.set(Z.id.toString(),Z)}E.assert(oe===t.length,"Should have iterated all scopes")}if(y.length){const K=LJ(t[0],t[0].parent)?t[0]:bm(t[0]);ds(K,_e)}for(let K=0;K0&&(oe.usages.size>0||oe.typeParameterUsages.size>0)){const Z=e0(e.range)?e.range[0]:e.range;p[K].push(mn(Z,Gl.cannotAccessVariablesFromNestedScopes))}e.facts&16&&Qn(t[K])&&g[K].push(mn(e.thisNode,Gl.cannotExtractFunctionsContainingThisToMethod));let Se=!1,se;if(u[K].usages.forEach(Z=>{Z.usage===2&&(Se=!0,Z.symbol.flags&106500&&Z.symbol.valueDeclaration&&w_(Z.symbol.valueDeclaration,8)&&(se=Z.symbol.valueDeclaration))}),E.assert(e0(e.range)||T.length===0,"No variable declarations expected if something was extracted"),Se&&!e0(e.range)){const Z=mn(e.range,Gl.cannotWriteInExpression);g[K].push(Z),p[K].push(Z)}else if(se&&K>0){const Z=mn(se,Gl.cannotExtractReadonlyPropertyInitializerOutsideConstructor);g[K].push(Z),p[K].push(Z)}else if(C){const Z=mn(C,Gl.cannotExtractExportedEntity);g[K].push(Z),p[K].push(Z)}}return{target:z,usagesPerScope:u,functionErrorsPerScope:g,constantErrorsPerScope:p,exposedVariableDeclarations:T};function J(K){return!!Ar(K,oe=>MJ(oe)&&L0(oe).length!==0)}function ie(K){const oe=s.getSymbolWalker(()=>(o.throwIfCancellationRequested(),!0)),{visitedTypes:Se}=oe.walkType(K);for(const se of Se)se.isTypeParameter()&&c.set(se.id.toString(),se)}function B(K,oe=1){if(X){const Se=s.getTypeAtLocation(K);ie(Se)}if(hu(K)&&K.symbol&&y.push(K),sl(K))B(K.left,2),B(K.right);else if(aee(K))B(K.operand,2);else if(bn(K)||mo(K))ds(K,B);else if(Ie(K)){if(!K.parent||h_(K.parent)&&K!==K.parent.left||bn(K.parent)&&K!==K.parent.expression)return;Y(K,oe,ig(K))}else ds(K,B)}function Y(K,oe,Se){const se=ae(K,oe,Se);if(se)for(let Z=0;Z=oe)return Z;if(O.set(Z,oe),ve){for(const ke of u)ke.usages.get(K.text)&&ke.usages.set(K.text,{usage:oe,symbol:se,node:K});return Z}const Te=se.getDeclarations(),Me=Te&&kn(Te,ke=>ke.getSourceFile()===i);if(Me&&!pA(r,Me.getStart(),Me.end)){if(e.facts&2&&oe===2){const ke=mn(K,Gl.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators);for(const he of g)he.push(ke);for(const he of p)he.push(ke)}for(let ke=0;kese.symbol===oe);if(Se)if(Ei(Se)){const se=Se.symbol.id.toString();S.has(se)||(T.push(Se),S.set(se,!0))}else C=C||Se}ds(K,_e)}function $(K){return K.parent&&Y_(K.parent)&&K.parent.name===K?s.getShorthandAssignmentValueSymbol(K.parent):s.getSymbolAtLocation(K)}function H(K,oe,Se){if(!K)return;const se=K.getDeclarations();if(se&&se.some(ve=>ve.parent===oe))return I.createIdentifier(K.name);const Z=H(K.parent,oe,Se);if(Z!==void 0)return Se?I.createQualifiedName(Z,I.createIdentifier(K.name)):I.createPropertyAccessExpression(Z,K.name)}}function Lze(e){return Ar(e,t=>t.parent&&Axe(t)&&!Gr(t.parent))}function Axe(e){const{parent:t}=e;switch(t.kind){case 306:return!1}switch(e.kind){case 11:return t.kind!==272&&t.kind!==276;case 230:case 206:case 208:return!1;case 80:return t.kind!==208&&t.kind!==276&&t.kind!==281}return!0}function Nxe(e){switch(e.kind){case 241:case 312:case 268:case 296:return!0;default:return!1}}function Vce(e){return qce(e)||(dg(e)||Nb(e)||qv(e))&&(dg(e.parent)||qv(e.parent))}function qce(e){return ra(e)&&e.parent&&Rd(e.parent)}var KC,e6,t6,Gl,Hce,Mze=Nt({"src/services/refactors/extractSymbol.ts"(){"use strict";zn(),Nm(),KC="Extract Symbol",e6={name:"Extract Constant",description:ls(d.Extract_constant),kind:"refactor.extract.constant"},t6={name:"Extract Function",description:ls(d.Extract_function),kind:"refactor.extract.function"},hg(KC,{kinds:[e6.kind,t6.kind],getEditsForAction:wxe,getAvailableActions:Pxe}),(e=>{function t(r){return{message:r,code:0,category:3,key:r}}e.cannotExtractRange=t("Cannot extract range."),e.cannotExtractImport=t("Cannot extract import statement."),e.cannotExtractSuper=t("Cannot extract super call."),e.cannotExtractJSDoc=t("Cannot extract JSDoc."),e.cannotExtractEmpty=t("Cannot extract empty range."),e.expressionExpected=t("expression expected."),e.uselessConstantType=t("No reason to extract constant of type."),e.statementOrExpressionExpected=t("Statement or expression expected."),e.cannotExtractRangeContainingConditionalBreakOrContinueStatements=t("Cannot extract range containing conditional break or continue statements."),e.cannotExtractRangeContainingConditionalReturnStatement=t("Cannot extract range containing conditional return statement."),e.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange=t("Cannot extract range containing labeled break or continue with target outside of the range."),e.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators=t("Cannot extract range containing writes to references located outside of the target range in generators."),e.typeWillNotBeVisibleInTheNewScope=t("Type will not visible in the new scope."),e.functionWillNotBeVisibleInTheNewScope=t("Function will not visible in the new scope."),e.cannotExtractIdentifier=t("Select more than a single identifier."),e.cannotExtractExportedEntity=t("Cannot extract exported declaration"),e.cannotWriteInExpression=t("Cannot write back side-effects when extracting an expression"),e.cannotExtractReadonlyPropertyInitializerOutsideConstructor=t("Cannot move initialization of read-only class property outside of the constructor"),e.cannotExtractAmbientBlock=t("Cannot extract code from ambient contexts"),e.cannotAccessVariablesFromNestedScopes=t("Cannot access variables from nested scopes"),e.cannotExtractToJSClass=t("Cannot extract constant to a class scope in JS"),e.cannotExtractToExpressionArrowFunction=t("Cannot extract constant to an arrow function without a block"),e.cannotExtractFunctionsContainingThisToMethod=t("Cannot extract functions containing this to method")})(Gl||(Gl={})),Hce=(e=>(e[e.None=0]="None",e[e.HasReturn=1]="HasReturn",e[e.IsGenerator=2]="IsGenerator",e[e.IsAsyncFunction=4]="IsAsyncFunction",e[e.UsesThis=8]="UsesThis",e[e.UsesThisInFunction=16]="UsesThisInFunction",e[e.InStaticRegion=32]="InStaticRegion",e))(Hce||{})}}),Ixe={};jl(Ixe,{Messages:()=>Gl,RangeFacts:()=>Hce,getRangeToExtract:()=>Jce,getRefactorActionsToExtractSymbol:()=>Pxe,getRefactorEditsToExtractSymbol:()=>wxe});var Rze=Nt({"src/services/_namespaces/ts.refactor.extractSymbol.ts"(){"use strict";Mze()}}),WL,zG,WG,jze=Nt({"src/services/refactors/generateGetAccessorAndSetAccessor.ts"(){"use strict";zn(),Nm(),WL="Generate 'get' and 'set' accessors",zG=ls(d.Generate_get_and_set_accessors),WG={name:WL,description:zG,kind:"refactor.rewrite.property.generateAccessors"},hg(WL,{kinds:[WG.kind],getEditsForAction:function(t,r){if(!t.endPosition)return;const i=su.getAccessorConvertiblePropertyAtPosition(t.file,t.program,t.startPosition,t.endPosition);E.assert(i&&!nh(i),"Expected applicable refactor info");const s=su.generateAccessorFromProperty(t.file,t.program,t.startPosition,t.endPosition,t,r);if(!s)return;const o=t.file.fileName,c=i.renameAccessor?i.accessorName:i.fieldName,f=(Ie(c)?0:-1)+CA(s,o,c.text,us(i.declaration));return{renameFilename:o,renameLocation:f,edits:s}},getAvailableActions(e){if(!e.endPosition)return ze;const t=su.getAccessorConvertiblePropertyAtPosition(e.file,e.program,e.startPosition,e.endPosition,e.triggerReason==="invoked");return t?nh(t)?e.preferences.provideRefactorNotApplicableReason?[{name:WL,description:zG,actions:[{...WG,notApplicableReason:t.error}]}]:ze:[{name:WL,description:zG,actions:[WG]}]:ze}})}}),Bze={},Jze=Nt({"src/services/_namespaces/ts.refactor.generateGetAccessorAndSetAccessor.ts"(){"use strict";jze()}});function zze(e){const t=Fxe(e);if(t&&!nh(t))return{renameFilename:void 0,renameLocation:void 0,edits:Qr.ChangeTracker.with(e,i=>Uze(e.file,i,t.declaration,t.returnTypeNode))}}function Wze(e){const t=Fxe(e);return t?nh(t)?e.preferences.provideRefactorNotApplicableReason?[{name:UL,description:UG,actions:[{...VL,notApplicableReason:t.error}]}]:ze:[{name:UL,description:UG,actions:[VL]}]:ze}function Uze(e,t,r,i){const s=Ua(r,22,e),o=go(r)&&s===void 0,c=o?ba(r.parameters):s;c&&(o&&(t.insertNodeBefore(e,c,I.createToken(21)),t.insertNodeAfter(e,c,I.createToken(22))),t.insertNodeAt(e,c.end,i,{prefix:": "}))}function Fxe(e){if(Hr(e.file)||!C1(VL.kind,e.kind))return;const t=c_(e.file,e.startPosition),r=Ar(t,c=>Ss(c)||c.parent&&go(c.parent)&&(c.kind===39||c.parent.body===c)?"quit":Vze(c));if(!r||!r.body||r.type)return{error:ls(d.Return_type_must_be_inferred_from_a_function)};const i=e.program.getTypeChecker(),s=qze(i,r);if(!s)return{error:ls(d.Could_not_determine_function_return_type)};const o=i.typeToTypeNode(s,r,1);if(o)return{declaration:r,returnTypeNode:o}}function Vze(e){switch(e.kind){case 262:case 218:case 219:case 174:return!0;default:return!1}}function qze(e,t){if(e.isImplementationOfOverload(t)){const i=e.getTypeAtLocation(t).getCallSignatures();if(i.length>1)return e.getUnionType(Ii(i,s=>s.getReturnType()))}const r=e.getSignatureFromDeclaration(t);if(r)return e.getReturnTypeOfSignature(r)}var UL,UG,VL,Hze=Nt({"src/services/refactors/inferFunctionReturnType.ts"(){"use strict";zn(),Nm(),UL="Infer function return type",UG=ls(d.Infer_function_return_type),VL={name:UL,description:UG,kind:"refactor.rewrite.function.returnType"},hg(UL,{kinds:[VL.kind],getEditsForAction:zze,getAvailableActions:Wze})}}),Gze={},$ze=Nt({"src/services/_namespaces/ts.refactor.inferFunctionReturnType.ts"(){"use strict";Hze()}}),nx={};jl(nx,{addExportToChanges:()=>kce,addExports:()=>bce,addNewFileToTsconfig:()=>mce,addOrRemoveBracesToArrowFunction:()=>cJe,convertArrowFunctionOrFunctionExpression:()=>bJe,convertParamsToDestructuredObject:()=>BJe,convertStringOrTemplateLiteral:()=>XJe,convertToOptionalChainExpression:()=>cze,createNewFileName:()=>Cce,createOldFileImportsFromTargetFile:()=>vce,deleteMovedStatements:()=>FL,deleteUnusedImports:()=>Sce,deleteUnusedOldImports:()=>gce,doChangeNamedToNamespaceOrDefault:()=>JTe,extractSymbol:()=>Ixe,filterImport:()=>BA,forEachImportInStatement:()=>jA,generateGetAccessorAndSetAccessor:()=>Bze,getApplicableRefactors:()=>oBe,getEditsForRefactor:()=>cBe,getStatementsToMove:()=>JA,getTopLevelDeclarationStatement:()=>PG,getUsageInfo:()=>LL,inferFunctionReturnType:()=>Gze,isRefactorErrorInfo:()=>nh,isTopLevelDeclaration:()=>ML,makeImportOrRequire:()=>OL,moduleSpecifierFromImport:()=>RA,nameOfTopLevelDeclaration:()=>xce,refactorKindBeginsWith:()=>C1,registerRefactor:()=>hg,updateImportsInOtherFiles:()=>hce});var Nm=Nt({"src/services/_namespaces/ts.refactor.ts"(){"use strict";OTe(),mBe(),bBe(),DBe(),PBe(),ABe(),OBe(),tJe(),lJe(),SJe(),JJe(),QJe(),lze(),Rze(),Jze(),$ze()}});function Oxe(e,t,r,i){const s=Gce(e,t,r,i);E.assert(s.spans.length%3===0);const o=s.spans,c=[];for(let u=0;u{s.push(c.getStart(t),c.getWidth(t),(u+1<<8)+f)},i),s}function Qze(e,t,r,i,s){const o=e.getTypeChecker();let c=!1;function u(f){switch(f.kind){case 267:case 263:case 264:case 262:case 231:case 218:case 219:s.throwIfCancellationRequested()}if(!f||!oI(r,f.pos,f.getFullWidth())||f.getFullWidth()===0)return;const g=c;if((dg(f)||Nb(f))&&(c=!0),UE(f)&&(c=!1),Ie(f)&&!c&&!eWe(f)&&!kE(f.escapedText)){let p=o.getSymbolAtLocation(f);if(p){p.flags&2097152&&(p=o.getAliasedSymbol(p));let y=Yze(p,Wb(f));if(y!==void 0){let S=0;f.parent&&(Pa(f.parent)||Yce.get(f.parent.kind)===y)&&f.parent.name===f&&(S=1),y===6&&Mxe(f)&&(y=9),y=Zze(o,f,y);const T=p.valueDeclaration;if(T){const C=gv(T),w=Fh(T);C&256&&(S|=2),C&1024&&(S|=4),y!==0&&y!==2&&(C&8||w&2||p.getFlags()&8)&&(S|=8),(y===7||y===10)&&Kze(T,t)&&(S|=32),e.isSourceFileDefaultLibrary(T.getSourceFile())&&(S|=16)}else p.declarations&&p.declarations.some(C=>e.isSourceFileDefaultLibrary(C.getSourceFile()))&&(S|=16);i(f,y,S)}}}ds(f,u),c=g}u(t)}function Yze(e,t){const r=e.getFlags();if(r&32)return 0;if(r&384)return 1;if(r&524288)return 5;if(r&64){if(t&2)return 2}else if(r&262144)return 4;let i=e.valueDeclaration||e.declarations&&e.declarations[0];return i&&Pa(i)&&(i=Lxe(i)),i&&Yce.get(i.kind)}function Zze(e,t,r){if(r===7||r===9||r===6){const i=e.getTypeAtLocation(t);if(i){const s=o=>o(i)||i.isUnion()&&i.types.some(o);if(r!==6&&s(o=>o.getConstructSignatures().length>0))return 0;if(s(o=>o.getCallSignatures().length>0)&&!s(o=>o.getProperties().length>0)||tWe(t))return r===9?11:10}}return r}function Kze(e,t){return Pa(e)&&(e=Lxe(e)),Ei(e)?(!Ai(e.parent.parent.parent)||Gv(e.parent))&&e.getSourceFile()===t:Zc(e)?!Ai(e.parent)&&e.getSourceFile()===t:!1}function Lxe(e){for(;;)if(Pa(e.parent.parent))e=e.parent.parent;else return e.parent.parent}function eWe(e){const t=e.parent;return t&&(Em(t)||v_(t)||K0(t))}function tWe(e){for(;Mxe(e);)e=e.parent;return Rs(e.parent)&&e.parent.expression===e}function Mxe(e){return h_(e.parent)&&e.parent.right===e||bn(e.parent)&&e.parent.name===e}var $ce,Xce,Qce,Yce,Rxe=Nt({"src/services/classifier2020.ts"(){"use strict";zn(),$ce=(e=>(e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask",e))($ce||{}),Xce=(e=>(e[e.class=0]="class",e[e.enum=1]="enum",e[e.interface=2]="interface",e[e.namespace=3]="namespace",e[e.typeParameter=4]="typeParameter",e[e.type=5]="type",e[e.parameter=6]="parameter",e[e.variable=7]="variable",e[e.enumMember=8]="enumMember",e[e.property=9]="property",e[e.function=10]="function",e[e.member=11]="member",e))(Xce||{}),Qce=(e=>(e[e.declaration=0]="declaration",e[e.static=1]="static",e[e.async=2]="async",e[e.readonly=3]="readonly",e[e.defaultLibrary=4]="defaultLibrary",e[e.local=5]="local",e))(Qce||{}),Yce=new Map([[260,7],[169,6],[172,9],[267,3],[266,1],[306,8],[263,0],[174,11],[262,10],[218,10],[173,11],[177,9],[178,9],[171,9],[264,2],[265,5],[168,4],[303,9],[304,9]])}});function jxe(e,t,r,i){const s=SP(e)?new $G(e,t,r):e===80?new QG(80,t,r):e===81?new YG(81,t,r):new tle(e,t,r);return s.parent=i,s.flags=i.flags&101441536,s}function rWe(e,t){if(!SP(e.kind))return ze;const r=[];if(TI(e))return e.forEachChild(c=>{r.push(c)}),r;Tu.setText((t||e.getSourceFile()).text);let i=e.pos;const s=c=>{qL(r,i,c.pos,e),r.push(c),i=c.end},o=c=>{qL(r,i,c.pos,e),r.push(nWe(c,e)),i=c.end};return Zt(e.jsDoc,s),i=e.pos,e.forEachChild(s,o),qL(r,i,e.end,e),Tu.setText(void 0),r}function qL(e,t,r,i){for(Tu.resetTokenState(t);tt.tagName.text==="inheritDoc"||t.tagName.text==="inheritdoc")}function VG(e,t){if(!e)return ze;let r=D1.getJsDocTagsFromDeclarations(e,t);if(t&&(r.length===0||e.some(Bxe))){const i=new Set;for(const s of e){const o=Jxe(t,s,c=>{var u;if(!i.has(c))return i.add(c),s.kind===177||s.kind===178?c.getContextualJsDocTags(s,t):((u=c.declarations)==null?void 0:u.length)===1?c.getJsDocTags():void 0});o&&(r=[...o,...r])}}return r}function HL(e,t){if(!e)return ze;let r=D1.getJsDocCommentsFromDeclarations(e,t);if(t&&(r.length===0||e.some(Bxe))){const i=new Set;for(const s of e){const o=Jxe(t,s,c=>{if(!i.has(c))return i.add(c),s.kind===177||s.kind===178?c.getContextualDocumentationComment(s,t):c.getDocumentationComment(t)});o&&(r=r.length===0?o.slice():o.concat(XC(),r))}}return r}function Jxe(e,t,r){var i;const s=((i=t.parent)==null?void 0:i.kind)===176?t.parent.parent:t.parent;if(!s)return;const o=Uc(t);return ic(Q4(s),c=>{const u=e.getTypeAtLocation(c),f=o&&u.symbol?e.getTypeOfSymbol(u.symbol):u,g=e.getPropertyOfType(f,t.symbol.name);return g?r(g):void 0})}function iWe(){return{getNodeConstructor:()=>$G,getTokenConstructor:()=>tle,getIdentifierConstructor:()=>QG,getPrivateIdentifierConstructor:()=>YG,getSourceFileConstructor:()=>Hxe,getSymbolConstructor:()=>Uxe,getTypeConstructor:()=>Vxe,getSignatureConstructor:()=>qxe,getSourceMapSourceConstructor:()=>Gxe}}function HA(e){let t=!0;for(const i in e)if(Ya(e,i)&&!zxe(i)){t=!1;break}if(t)return e;const r={};for(const i in e)if(Ya(e,i)){const s=zxe(i)?i:i.charAt(0).toLowerCase()+i.substr(1);r[s]=e[i]}return r}function zxe(e){return!e.length||e.charAt(0)===e.charAt(0).toLowerCase()}function GA(e){return e?Yt(e,t=>t.text).join(""):""}function GL(){return{target:1,jsx:1}}function qG(){return su.getSupportedErrorCodes()}function Wxe(e,t,r){e.version=r,e.scriptSnapshot=t}function $L(e,t,r,i,s,o){const c=vw(e,HC(t),r,s,o);return Wxe(c,t,i),c}function HG(e,t,r,i,s){if(i&&r!==e.version){let c;const u=i.span.start!==0?e.text.substr(0,i.span.start):"",f=yc(i.span)!==e.text.length?e.text.substr(yc(i.span)):"";if(i.newLength===0)c=u&&f?u+f:u||f;else{const p=t.getText(i.span.start,i.span.start+i.newLength);c=u&&f?u+p+f:u?u+p:p+f}const g=lU(e,c,i,s);return Wxe(g,t,r),g.nameTable=void 0,e!==g&&e.scriptSnapshot&&(e.scriptSnapshot.dispose&&e.scriptSnapshot.dispose(),e.scriptSnapshot=void 0),g}const o={languageVersion:e.languageVersion,impliedNodeFormat:e.impliedNodeFormat,setExternalModuleIndicator:e.setExternalModuleIndicator,jsDocParsingMode:e.jsDocParsingMode};return $L(e.fileName,t,o,r,!0,e.scriptKind)}function Zce(e,t=Roe(e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames(),e.getCurrentDirectory()),r){var i;let s;r===void 0?s=0:typeof r=="boolean"?s=r?2:0:s=r;const o=new $xe(e);let c,u,f=0;const g=e.getCancellationToken?new Qxe(e.getCancellationToken()):Xxe,p=e.getCurrentDirectory();Kte((i=e.getLocalizedDiagnosticMessages)==null?void 0:i.bind(e));function y(ce){e.log&&e.log(ce)}const S=y8(e),T=tu(S),C=Yoe({useCaseSensitiveFileNames:()=>S,getCurrentDirectory:()=>p,getProgram:O,fileExists:Os(e,e.fileExists),readFile:Os(e,e.readFile),getDocumentPositionMapper:Os(e,e.getDocumentPositionMapper),getSourceFileLike:Os(e,e.getSourceFileLike),log:y});function w(ce){const ee=c.getSourceFile(ce);if(!ee){const ue=new Error(`Could not find source file: '${ce}'.`);throw ue.ProgramFiles=c.getSourceFiles().map(M=>M.fileName),ue}return ee}function D(){var ce,ee,ue;if(E.assert(s!==2),e.getProjectVersion){const os=e.getProjectVersion();if(os){if(u===os&&!((ce=e.hasChangedAutomaticTypeDirectiveNames)!=null&&ce.call(e)))return;u=os}}const M=e.getTypeRootsVersion?e.getTypeRootsVersion():0;f!==M&&(y("TypeRoots version has changed; provide new program"),c=void 0,f=M);const De=e.getScriptFileNames().slice(),Ve=e.getCompilationSettings()||GL(),Fe=e.hasInvalidatedResolutions||Kp,vt=Os(e,e.hasInvalidatedLibResolutions)||Kp,Lt=Os(e,e.hasChangedAutomaticTypeDirectiveNames),Wt=(ee=e.getProjectReferences)==null?void 0:ee.call(e);let Lr,Zr={getSourceFile:Cr,getSourceFileByPath:Tc,getCancellationToken:()=>g,getCanonicalFileName:T,useCaseSensitiveFileNames:()=>S,getNewLine:()=>zh(Ve),getDefaultLibFileName:os=>e.getDefaultLibFileName(os),writeFile:Ca,getCurrentDirectory:()=>p,fileExists:os=>e.fileExists(os),readFile:os=>e.readFile&&e.readFile(os),getSymlinkCache:Os(e,e.getSymlinkCache),realpath:Os(e,e.realpath),directoryExists:os=>td(os,e),getDirectories:os=>e.getDirectories?e.getDirectories(os):[],readDirectory:(os,Ga,rc,Vo,cl)=>(E.checkDefined(e.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),e.readDirectory(os,Ga,rc,Vo,cl)),onReleaseOldSourceFile:Is,onReleaseParsedCommandLine:ia,hasInvalidatedResolutions:Fe,hasInvalidatedLibResolutions:vt,hasChangedAutomaticTypeDirectiveNames:Lt,trace:Os(e,e.trace),resolveModuleNames:Os(e,e.resolveModuleNames),getModuleResolutionCache:Os(e,e.getModuleResolutionCache),createHash:Os(e,e.createHash),resolveTypeReferenceDirectives:Os(e,e.resolveTypeReferenceDirectives),resolveModuleNameLiterals:Os(e,e.resolveModuleNameLiterals),resolveTypeReferenceDirectiveReferences:Os(e,e.resolveTypeReferenceDirectiveReferences),resolveLibrary:Os(e,e.resolveLibrary),useSourceOfProjectReferenceRedirect:Os(e,e.useSourceOfProjectReferenceRedirect),getParsedCommandLine:wr,jsDocParsingMode:e.jsDocParsingMode};const gn=Zr.getSourceFile,{getSourceFileWithCache:On}=Yw(Zr,os=>fo(os,p,T),(...os)=>gn.call(Zr,...os));Zr.getSourceFile=On,(ue=e.setCompilerHost)==null||ue.call(e,Zr);const Ln={useCaseSensitiveFileNames:S,fileExists:os=>Zr.fileExists(os),readFile:os=>Zr.readFile(os),directoryExists:os=>Zr.directoryExists(os),getDirectories:os=>Zr.getDirectories(os),realpath:Zr.realpath,readDirectory:(...os)=>Zr.readDirectory(...os),trace:Zr.trace,getCurrentDirectory:Zr.getCurrentDirectory,onUnRecoverableConfigFileDiagnostic:Ca},Ni=t.getKeyForCompilationSettings(Ve);let Cn=new Set;if(HV(c,De,Ve,(os,Ga)=>e.getScriptVersion(Ga),os=>Zr.fileExists(os),Fe,vt,Lt,wr,Wt)){Zr=void 0,Lr=void 0,Cn=void 0;return}c=s9({rootNames:De,options:Ve,host:Zr,oldProgram:c,projectReferences:Wt}),Zr=void 0,Lr=void 0,Cn=void 0,C.clearCache(),c.getTypeChecker();return;function wr(os){const Ga=fo(os,p,T),rc=Lr?.get(Ga);if(rc!==void 0)return rc||void 0;const Vo=e.getParsedCommandLine?e.getParsedCommandLine(os):_i(os);return(Lr||(Lr=new Map)).set(Ga,Vo||!1),Vo}function _i(os){const Ga=Cr(os,100);if(Ga)return Ga.path=fo(os,p,T),Ga.resolvedPath=Ga.path,Ga.originalFileName=Ga.fileName,kw(Ga,Ln,is(qn(os),p),void 0,is(os,p))}function ia(os,Ga,rc){var Vo;e.getParsedCommandLine?(Vo=e.onReleaseParsedCommandLine)==null||Vo.call(e,os,Ga,rc):Ga&&Is(Ga.sourceFile,rc)}function Is(os,Ga){const rc=t.getKeyForCompilationSettings(Ga);t.releaseDocumentWithKey(os.resolvedPath,rc,os.scriptKind,os.impliedNodeFormat)}function Cr(os,Ga,rc,Vo){return Tc(os,fo(os,p,T),Ga,rc,Vo)}function Tc(os,Ga,rc,Vo,cl){E.assert(Zr,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");const Ro=e.getScriptSnapshot(os);if(!Ro)return;const hs=NH(os,e),Ws=e.getScriptVersion(os);if(!cl){const el=c&&c.getSourceFileByPath(Ga);if(el){if(hs===el.scriptKind||Cn.has(el.resolvedPath))return t.updateDocumentWithKey(os,Ga,e,Ni,Ro,Ws,hs,rc);t.releaseDocumentWithKey(el.resolvedPath,t.getKeyForCompilationSettings(c.getCompilerOptions()),el.scriptKind,el.impliedNodeFormat),Cn.add(el.resolvedPath)}}return t.acquireDocumentWithKey(os,Ga,e,Ni,Ro,Ws,hs,rc)}}function O(){if(s===2){E.assert(c===void 0);return}return D(),c}function z(){var ce;return(ce=e.getPackageJsonAutoImportProvider)==null?void 0:ce.call(e)}function W(ce,ee){const ue=c.getTypeChecker(),M=De();if(!M)return!1;for(const Fe of ce)for(const vt of Fe.references){const Lt=Ve(vt);if(E.assertIsDefined(Lt),ee.has(vt)||ho.isDeclarationOfSymbol(Lt,M)){ee.add(vt),vt.isDefinition=!0;const Wt=tL(vt,C,Os(e,e.fileExists));Wt&&ee.add(Wt)}else vt.isDefinition=!1}return!0;function De(){for(const Fe of ce)for(const vt of Fe.references){if(ee.has(vt)){const Wt=Ve(vt);return E.assertIsDefined(Wt),ue.getSymbolAtLocation(Wt)}const Lt=tL(vt,C,Os(e,e.fileExists));if(Lt&&ee.has(Lt)){const Wt=Ve(Lt);if(Wt)return ue.getSymbolAtLocation(Wt)}}}function Ve(Fe){const vt=c.getSourceFile(Fe.fileName);if(!vt)return;const Lt=c_(vt,Fe.textSpan.start);return ho.Core.getAdjustedNode(Lt,{use:ho.FindReferencesUse.References})}}function X(){if(c){const ce=t.getKeyForCompilationSettings(c.getCompilerOptions());Zt(c.getSourceFiles(),ee=>t.releaseDocumentWithKey(ee.resolvedPath,ce,ee.scriptKind,ee.impliedNodeFormat)),c=void 0}}function J(){X(),e=void 0}function ie(ce){return D(),c.getSyntacticDiagnostics(w(ce),g).slice()}function B(ce){D();const ee=w(ce),ue=c.getSemanticDiagnostics(ee,g);if(!Rf(c.getCompilerOptions()))return ue.slice();const M=c.getDeclarationDiagnostics(ee,g);return[...ue,...M]}function Y(ce){return D(),cG(w(ce),c,g)}function ae(){return D(),[...c.getOptionsDiagnostics(g),...c.getGlobalDiagnostics(g)]}function _e(ce,ee,ue=jf,M){const De={...ue,includeCompletionsForModuleExports:ue.includeCompletionsForModuleExports||ue.includeExternalModuleExports,includeCompletionsWithInsertText:ue.includeCompletionsWithInsertText||ue.includeInsertTextCompletions};return D(),lx.getCompletionsAtPosition(e,c,y,w(ce),ee,De,ue.triggerCharacter,ue.triggerKind,g,M&&ol.getFormatContext(M,e),ue.includeSymbol)}function $(ce,ee,ue,M,De,Ve=jf,Fe){return D(),lx.getCompletionEntryDetails(c,y,w(ce),ee,{name:ue,source:De,data:Fe},e,M&&ol.getFormatContext(M,e),Ve,g)}function H(ce,ee,ue,M,De=jf){return D(),lx.getCompletionEntrySymbol(c,y,w(ce),ee,{name:ue,source:M},e,De)}function K(ce,ee){D();const ue=w(ce),M=c_(ue,ee);if(M===ue)return;const De=c.getTypeChecker(),Ve=oe(M),Fe=cWe(Ve,De);if(!Fe||De.isUnknownSymbol(Fe)){const Zr=Se(ue,Ve,ee)?De.getTypeAtLocation(Ve):void 0;return Zr&&{kind:"",kindModifiers:"",textSpan:l_(Ve,ue),displayParts:De.runWithCancellationToken(g,gn=>xA(gn,Zr,Ub(Ve))),documentation:Zr.symbol?Zr.symbol.getDocumentationComment(De):void 0,tags:Zr.symbol?Zr.symbol.getJsDocTags(De):void 0}}const{symbolKind:vt,displayParts:Lt,documentation:Wt,tags:Lr}=De.runWithCancellationToken(g,Zr=>t0.getSymbolDisplayPartsDocumentationAndSymbolKind(Zr,Fe,ue,Ub(Ve),Ve));return{kind:vt,kindModifiers:t0.getSymbolModifiers(De,Fe),textSpan:l_(Ve,ue),displayParts:Lt,documentation:Wt,tags:Lr}}function oe(ce){return Wv(ce.parent)&&ce.pos===ce.parent.pos?ce.parent.expression:RE(ce.parent)&&ce.pos===ce.parent.pos||Ak(ce.parent)&&ce.parent.name===ce||sd(ce.parent)?ce.parent:ce}function Se(ce,ee,ue){switch(ee.kind){case 80:return!eH(ee)&&!tH(ee)&&!Vg(ee.parent);case 211:case 166:return!Xh(ce,ue);case 110:case 197:case 108:case 202:return!0;case 236:return Ak(ee);default:return!1}}function se(ce,ee,ue,M){return D(),c6.getDefinitionAtPosition(c,w(ce),ee,ue,M)}function Z(ce,ee){return D(),c6.getDefinitionAndBoundSpan(c,w(ce),ee)}function ve(ce,ee){return D(),c6.getTypeDefinitionAtPosition(c.getTypeChecker(),w(ce),ee)}function Te(ce,ee){return D(),ho.getImplementationsAtPosition(c,g,c.getSourceFiles(),w(ce),ee)}function Me(ce,ee,ue){const M=qs(ce);E.assert(ue.some(Fe=>qs(Fe)===M)),D();const De=Ii(ue,Fe=>c.getSourceFile(Fe)),Ve=w(ce);return xL.getDocumentHighlights(c,g,Ve,ee,De)}function ke(ce,ee,ue,M,De){D();const Ve=w(ce),Fe=J9(c_(Ve,ee));if(vM.nodeIsEligibleForRename(Fe))if(Ie(Fe)&&(Md(Fe.parent)||Vv(Fe.parent))&&Hk(Fe.escapedText)){const{openingElement:vt,closingElement:Lt}=Fe.parent.parent;return[vt,Lt].map(Wt=>{const Lr=l_(Wt.tagName,Ve);return{fileName:Ve.fileName,textSpan:Lr,...ho.toContextSpan(Lr,Ve,Wt.parent)}})}else{const vt=vf(Ve,De??jf),Lt=typeof De=="boolean"?De:De?.providePrefixAndSuffixTextForRename;return be(Fe,ee,{findInStrings:ue,findInComments:M,providePrefixAndSuffixTextForRename:Lt,use:ho.FindReferencesUse.Rename},(Wt,Lr,Zr)=>ho.toRenameLocation(Wt,Lr,Zr,Lt||!1,vt))}}function he(ce,ee){return D(),be(c_(w(ce),ee),ee,{use:ho.FindReferencesUse.References},ho.toReferenceEntry)}function be(ce,ee,ue,M){D();const De=ue&&ue.use===ho.FindReferencesUse.Rename?c.getSourceFiles().filter(Ve=>!c.isSourceFileDefaultLibrary(Ve)):c.getSourceFiles();return ho.findReferenceOrRenameEntries(c,g,De,ce,ee,ue,M)}function lt(ce,ee){return D(),ho.findReferencedSymbols(c,g,c.getSourceFiles(),w(ce),ee)}function pt(ce){return D(),ho.Core.getReferencesForFileName(ce,c,c.getSourceFiles()).map(ho.toReferenceEntry)}function me(ce,ee,ue,M=!1,De=!1){D();const Ve=ue?[w(ue)]:c.getSourceFiles();return lTe(Ve,c.getTypeChecker(),g,ce,ee,M,De)}function Oe(ce,ee,ue){D();const M=w(ce),De=e.getCustomTransformers&&e.getCustomTransformers();return zse(c,M,!!ee,g,De,ue)}function Xe(ce,ee,{triggerReason:ue}=jf){D();const M=w(ce);return lN.getSignatureHelpItems(c,M,ee,ue,g)}function it(ce){return o.getCurrentSourceFile(ce)}function mt(ce,ee,ue){const M=o.getCurrentSourceFile(ce),De=c_(M,ee);if(De===M)return;switch(De.kind){case 211:case 166:case 11:case 97:case 112:case 106:case 108:case 110:case 197:case 80:break;default:return}let Ve=De;for(;;)if(VC(Ve)||qae(Ve))Ve=Ve.parent;else if(nH(Ve))if(Ve.parent.parent.kind===267&&Ve.parent.parent.body===Ve.parent)Ve=Ve.parent.parent.name;else break;else break;return zc(Ve.getStart(),De.getEnd())}function Je(ce,ee){const ue=o.getCurrentSourceFile(ce);return KG.spanInSourceFileAtLocation(ue,ee)}function ot(ce){return pTe(o.getCurrentSourceFile(ce),g)}function Bt(ce){return dTe(o.getCurrentSourceFile(ce),g)}function Ht(ce,ee,ue){return D(),(ue||"original")==="2020"?Oxe(c,g,w(ce),ee):Loe(c.getTypeChecker(),g,w(ce),c.getClassifiableNames(),ee)}function br(ce,ee,ue){return D(),(ue||"original")==="original"?tG(c.getTypeChecker(),g,w(ce),c.getClassifiableNames(),ee):Gce(c,g,w(ce),ee)}function zr(ce,ee){return Moe(g,o.getCurrentSourceFile(ce),ee)}function ar(ce,ee){return rG(g,o.getCurrentSourceFile(ce),ee)}function Jt(ce){const ee=o.getCurrentSourceFile(ce);return $X.collectElements(ee,g)}const It=new Map(Object.entries({19:20,21:22,23:24,32:30}));It.forEach((ce,ee)=>It.set(ce.toString(),Number(ee)));function Nn(ce,ee){const ue=o.getCurrentSourceFile(ce),M=k3(ue,ee),De=M.getStart(ue)===ee?It.get(M.kind.toString()):void 0,Ve=De&&Ua(M.parent,De,ue);return Ve?[l_(M,ue),l_(Ve,ue)].sort((Fe,vt)=>Fe.start-vt.start):ze}function Fi(ce,ee,ue){let M=_o();const De=HA(ue),Ve=o.getCurrentSourceFile(ce);y("getIndentationAtPosition: getCurrentSourceFile: "+(_o()-M)),M=_o();const Fe=ol.SmartIndenter.getIndentation(ee,Ve,De);return y("getIndentationAtPosition: computeIndentation : "+(_o()-M)),Fe}function ei(ce,ee,ue,M){const De=o.getCurrentSourceFile(ce);return ol.formatSelection(ee,ue,De,ol.getFormatContext(HA(M),e))}function zi(ce,ee){return ol.formatDocument(o.getCurrentSourceFile(ce),ol.getFormatContext(HA(ee),e))}function Qe(ce,ee,ue,M){const De=o.getCurrentSourceFile(ce),Ve=ol.getFormatContext(HA(M),e);if(!Xh(De,ee))switch(ue){case"{":return ol.formatOnOpeningCurly(ee,De,Ve);case"}":return ol.formatOnClosingCurly(ee,De,Ve);case";":return ol.formatOnSemicolon(ee,De,Ve);case` +`:return ol.formatOnEnter(ee,De,Ve)}return[]}function ur(ce,ee,ue,M,De,Ve=jf){D();const Fe=w(ce),vt=zc(ee,ue),Lt=ol.getFormatContext(De,e);return ta(VS(M,w0,xo),Wt=>(g.throwIfCancellationRequested(),su.getFixes({errorCode:Wt,sourceFile:Fe,span:vt,program:c,host:e,cancellationToken:g,formatContext:Lt,preferences:Ve})))}function Dr(ce,ee,ue,M=jf){D(),E.assert(ce.type==="file");const De=w(ce.fileName),Ve=ol.getFormatContext(ue,e);return su.getAllFixes({fixId:ee,sourceFile:De,program:c,host:e,cancellationToken:g,formatContext:Ve,preferences:M})}function Ft(ce,ee,ue=jf){D(),E.assert(ce.type==="file");const M=w(ce.fileName),De=ol.getFormatContext(ee,e),Ve=ce.mode??(ce.skipDestructiveCodeActions?"SortAndCombine":"All");return qp.organizeImports(M,De,e,c,ue,Ve)}function yr(ce,ee,ue,M=jf){return Boe(O(),ce,ee,e,ol.getFormatContext(ue,e),M,C)}function Tr(ce,ee){const ue=typeof ce=="string"?ee:ce;return es(ue)?Promise.all(ue.map(M=>Xr(M))):Xr(ue)}function Xr(ce){const ee=ue=>fo(ue,p,T);return E.assertEqual(ce.type,"install package"),e.installPackage?e.installPackage({fileName:ee(ce.file),packageName:ce.packageName}):Promise.reject("Host does not implement `installPackage`")}function Pi(ce,ee,ue,M){const De=M?ol.getFormatContext(M,e).options:void 0;return D1.getDocCommentTemplateAtPosition(Zh(e,De),o.getCurrentSourceFile(ce),ee,ue)}function ji(ce,ee,ue){if(ue===60)return!1;const M=o.getCurrentSourceFile(ce);if(Vb(M,ee))return!1;if(Zae(M,ee))return ue===123;if(lH(M,ee))return!1;switch(ue){case 39:case 34:case 96:return!Xh(M,ee)}return!0}function Di(ce,ee){const ue=o.getCurrentSourceFile(ce),M=Kc(ee,ue);if(!M)return;const De=M.kind===32&&Md(M.parent)?M.parent.parent:DT(M)&&dg(M.parent)?M.parent:void 0;if(De&&ft(De))return{newText:``};const Ve=M.kind===32&&jT(M.parent)?M.parent.parent:DT(M)&&qv(M.parent)?M.parent:void 0;if(Ve&&dt(Ve))return{newText:""}}function $i(ce,ee){const ue=o.getCurrentSourceFile(ce),M=Kc(ee,ue);if(!M||M.parent.kind===312)return;const De="[a-zA-Z0-9:\\-\\._$]*";if(qv(M.parent.parent)){const Ve=M.parent.parent.openingFragment,Fe=M.parent.parent.closingFragment;if(Ck(Ve)||Ck(Fe))return;const vt=Ve.getStart(ue)+1,Lt=Fe.getStart(ue)+2;return ee!==vt&&ee!==Lt?void 0:{ranges:[{start:vt,length:0},{start:Lt,length:0}],wordPattern:De}}else{const Ve=Ar(M.parent,On=>!!(Md(On)||Vv(On)));if(!Ve)return;E.assert(Md(Ve)||Vv(Ve),"tag should be opening or closing element");const Fe=Ve.parent.openingElement,vt=Ve.parent.closingElement,Lt=Fe.tagName.getStart(ue),Wt=Fe.tagName.end,Lr=vt.tagName.getStart(ue),Zr=vt.tagName.end;return!(Lt<=ee&&ee<=Wt||Lr<=ee&&ee<=Zr)||Fe.tagName.getText(ue)!==vt.tagName.getText(ue)?void 0:{ranges:[{start:Lt,length:Wt-Lt},{start:Lr,length:Zr-Lr}],wordPattern:De}}}function Qs(ce,ee){return{lineStarts:ce.getLineStarts(),firstLine:ce.getLineAndCharacterOfPosition(ee.pos).line,lastLine:ce.getLineAndCharacterOfPosition(ee.end).line}}function Ds(ce,ee,ue){const M=o.getCurrentSourceFile(ce),De=[],{lineStarts:Ve,firstLine:Fe,lastLine:vt}=Qs(M,ee);let Lt=ue||!1,Wt=Number.MAX_VALUE;const Lr=new Map,Zr=new RegExp(/\S/),gn=U9(M,Ve[Fe]),On=gn?"{/*":"//";for(let Ln=Fe;Ln<=vt;Ln++){const Ni=M.text.substring(Ve[Ln],M.getLineEndOfPosition(Ve[Ln])),Cn=Zr.exec(Ni);Cn&&(Wt=Math.min(Wt,Cn.index),Lr.set(Ln.toString(),Cn.index),Ni.substr(Cn.index,On.length)!==On&&(Lt=ue===void 0||ue))}for(let Ln=Fe;Ln<=vt;Ln++){if(Fe!==vt&&Ve[Ln]===ee.end)continue;const Ni=Lr.get(Ln.toString());Ni!==void 0&&(gn?De.push(...Ce(ce,{pos:Ve[Ln]+Wt,end:M.getLineEndOfPosition(Ve[Ln])},Lt,gn)):Lt?De.push({newText:On,span:{length:0,start:Ve[Ln]+Wt}}):M.text.substr(Ve[Ln]+Ni,On.length)===On&&De.push({newText:"",span:{length:On.length,start:Ve[Ln]+Ni}}))}return De}function Ce(ce,ee,ue,M){var De;const Ve=o.getCurrentSourceFile(ce),Fe=[],{text:vt}=Ve;let Lt=!1,Wt=ue||!1;const Lr=[];let{pos:Zr}=ee;const gn=M!==void 0?M:U9(Ve,Zr),On=gn?"{/*":"/*",Ln=gn?"*/}":"*/",Ni=gn?"\\{\\/\\*":"\\/\\*",Cn=gn?"\\*\\/\\}":"\\*\\/";for(;Zr<=ee.end;){const Ki=vt.substr(Zr,On.length)===On?On.length:0,wr=Xh(Ve,Zr+Ki);if(wr)gn&&(wr.pos--,wr.end++),Lr.push(wr.pos),wr.kind===3&&Lr.push(wr.end),Lt=!0,Zr=wr.end+1;else{const _i=vt.substring(Zr,ee.end).search(`(${Ni})|(${Cn})`);Wt=ue!==void 0?ue:Wt||!uoe(vt,Zr,_i===-1?ee.end:Zr+_i),Zr=_i===-1?ee.end+1:Zr+_i+Ln.length}}if(Wt||!Lt){((De=Xh(Ve,ee.pos))==null?void 0:De.kind)!==2&&P0(Lr,ee.pos,xo),P0(Lr,ee.end,xo);const Ki=Lr[0];vt.substr(Ki,On.length)!==On&&Fe.push({newText:On,span:{length:0,start:Ki}});for(let wr=1;wr0?Ki-Ln.length:0,_i=vt.substr(wr,Ln.length)===Ln?Ln.length:0;Fe.push({newText:"",span:{length:On.length,start:Ki-_i}})}return Fe}function Ue(ce,ee){const ue=o.getCurrentSourceFile(ce),{firstLine:M,lastLine:De}=Qs(ue,ee);return M===De&&ee.pos!==ee.end?Ce(ce,ee,!0):Ds(ce,ee,!0)}function rt(ce,ee){const ue=o.getCurrentSourceFile(ce),M=[],{pos:De}=ee;let{end:Ve}=ee;De===Ve&&(Ve+=U9(ue,De)?2:1);for(let Fe=De;Fe<=Ve;Fe++){const vt=Xh(ue,Fe);if(vt){switch(vt.kind){case 2:M.push(...Ds(ce,{end:vt.end,pos:vt.pos+1},!1));break;case 3:M.push(...Ce(ce,{end:vt.end,pos:vt.pos+1},!1))}Fe=vt.end+1}}return M}function ft({openingElement:ce,closingElement:ee,parent:ue}){return!h1(ce.tagName,ee.tagName)||dg(ue)&&h1(ce.tagName,ue.openingElement.tagName)&&ft(ue)}function dt({closingFragment:ce,parent:ee}){return!!(ce.flags&262144)||qv(ee)&&dt(ee)}function fe(ce,ee,ue){const M=o.getCurrentSourceFile(ce),De=ol.getRangeOfEnclosingComment(M,ee);return De&&(!ue||De.kind===3)?ry(De):void 0}function we(ce,ee){D();const ue=w(ce);g.throwIfCancellationRequested();const M=ue.text,De=[];if(ee.length>0&&!Lt(ue.fileName)){const Wt=Fe();let Lr;for(;Lr=Wt.exec(M);){g.throwIfCancellationRequested();const Zr=3;E.assert(Lr.length===ee.length+Zr);const gn=Lr[1],On=Lr.index+gn.length;if(!Xh(ue,On))continue;let Ln;for(let Cn=0;Cn"("+Ve(wr.text)+")").join("|")+")",Ln=/(?:$|\*\/)/.source,Ni=/(?:.*?)/.source,Cn="("+On+Ni+")",Ki=gn+Cn+Ln;return new RegExp(Ki,"gim")}function vt(Wt){return Wt>=97&&Wt<=122||Wt>=65&&Wt<=90||Wt>=48&&Wt<=57}function Lt(Wt){return Wt.includes("/node_modules/")}}function Be(ce,ee,ue){return D(),vM.getRenameInfo(c,w(ce),ee,ue||{})}function gt(ce,ee,ue,M,De,Ve){const[Fe,vt]=typeof ee=="number"?[ee,void 0]:[ee.pos,ee.end];return{file:ce,startPosition:Fe,endPosition:vt,program:O(),host:e,formatContext:ol.getFormatContext(M,e),cancellationToken:g,preferences:ue,triggerReason:De,kind:Ve}}function G(ce,ee,ue){return{file:ce,program:O(),host:e,span:ee,preferences:ue,cancellationToken:g}}function ht(ce,ee){return YX.getSmartSelectionRange(ee,o.getCurrentSourceFile(ce))}function Dt(ce,ee,ue=jf,M,De,Ve){D();const Fe=w(ce);return nx.getApplicableRefactors(gt(Fe,ee,ue,jf,M,De),Ve)}function Re(ce,ee,ue=jf){D();const M=w(ce),De=E.checkDefined(c.getSourceFiles()),Ve=ST(ce),Fe=Ii(De,Lt=>!c?.isSourceFileFromExternalLibrary(M)&&!(M===w(Lt.fileName)||Ve===".ts"&&ST(Lt.fileName)===".d.ts"||Ve===".d.ts"&&Qi(Pc(Lt.fileName),"lib.")&&ST(Lt.fileName)===".d.ts")&&Ve===ST(Lt.fileName)?Lt.fileName:void 0);return{newFileName:Cce(M,c,gt(M,ee,ue,jf),e),files:Fe}}function st(ce,ee,ue,M,De,Ve=jf,Fe){D();const vt=w(ce);return nx.getEditsForRefactor(gt(vt,ue,Ve,ee),M,De,Fe)}function Ct(ce,ee){return ee===0?{line:0,character:0}:C.toLineColumnOffset(ce,ee)}function Qt(ce,ee){D();const ue=ix.resolveCallHierarchyDeclaration(c,c_(w(ce),ee));return ue&&zH(ue,M=>ix.createCallHierarchyItem(c,M))}function er(ce,ee){D();const ue=w(ce),M=WH(ix.resolveCallHierarchyDeclaration(c,ee===0?ue:c_(ue,ee)));return M?ix.getIncomingCalls(c,M,g):[]}function or(ce,ee){D();const ue=w(ce),M=WH(ix.resolveCallHierarchyDeclaration(c,ee===0?ue:c_(ue,ee)));return M?ix.getOutgoingCalls(c,M):[]}function U(ce,ee,ue=jf){D();const M=w(ce);return VX.provideInlayHints(G(M,ee,ue))}const j={dispose:J,cleanupSemanticCache:X,getSyntacticDiagnostics:ie,getSemanticDiagnostics:B,getSuggestionDiagnostics:Y,getCompilerOptionsDiagnostics:ae,getSyntacticClassifications:zr,getSemanticClassifications:Ht,getEncodedSyntacticClassifications:ar,getEncodedSemanticClassifications:br,getCompletionsAtPosition:_e,getCompletionEntryDetails:$,getCompletionEntrySymbol:H,getSignatureHelpItems:Xe,getQuickInfoAtPosition:K,getDefinitionAtPosition:se,getDefinitionAndBoundSpan:Z,getImplementationAtPosition:Te,getTypeDefinitionAtPosition:ve,getReferencesAtPosition:he,findReferences:lt,getFileReferences:pt,getDocumentHighlights:Me,getNameOrDottedNameSpan:mt,getBreakpointStatementAtPosition:Je,getNavigateToItems:me,getRenameInfo:Be,getSmartSelectionRange:ht,findRenameLocations:ke,getNavigationBarItems:ot,getNavigationTree:Bt,getOutliningSpans:Jt,getTodoComments:we,getBraceMatchingAtPosition:Nn,getIndentationAtPosition:Fi,getFormattingEditsForRange:ei,getFormattingEditsForDocument:zi,getFormattingEditsAfterKeystroke:Qe,getDocCommentTemplateAtPosition:Pi,isValidBraceCompletionAtPosition:ji,getJsxClosingTagAtPosition:Di,getLinkedEditingRangeAtPosition:$i,getSpanOfEnclosingComment:fe,getCodeFixesAtPosition:ur,getCombinedCodeFix:Dr,applyCodeActionCommand:Tr,organizeImports:Ft,getEditsForFileRename:yr,getEmitOutput:Oe,getNonBoundSourceFile:it,getProgram:O,getCurrentProgram:()=>c,getAutoImportProvider:z,updateIsDefinitionOfReferencedSymbols:W,getApplicableRefactors:Dt,getEditsForRefactor:st,getMoveToRefactoringFileSuggestions:Re,toLineColumnOffset:Ct,getSourceMapper:()=>C,clearSourceMapperCache:()=>C.clearCache(),prepareCallHierarchy:Qt,provideCallHierarchyIncomingCalls:er,provideCallHierarchyOutgoingCalls:or,toggleLineComment:Ds,toggleMultilineComment:Ce,commentSelection:Ue,uncommentSelection:rt,provideInlayHints:U,getSupportedCodeFixes:qG};switch(s){case 0:break;case 1:rle.forEach(ce=>j[ce]=()=>{throw new Error(`LanguageService Operation: ${ce} not allowed in LanguageServiceMode.PartialSemantic`)});break;case 2:Yxe.forEach(ce=>j[ce]=()=>{throw new Error(`LanguageService Operation: ${ce} not allowed in LanguageServiceMode.Syntactic`)});break;default:E.assertNever(s)}return j}function GG(e){return e.nameTable||sWe(e),e.nameTable}function sWe(e){const t=e.nameTable=new Map;e.forEachChild(function r(i){if(Ie(i)&&!tH(i)&&i.escapedText||_f(i)&&aWe(i)){const s=K4(i);t.set(s,t.get(s)===void 0?i.pos:-1)}else if(Ti(i)){const s=i.escapedText;t.set(s,t.get(s)===void 0?i.pos:-1)}if(ds(i,r),q_(i))for(const s of i.jsDoc)ds(s,r)})}function aWe(e){return $g(e)||e.parent.kind===283||lWe(e)||l8(e)}function $A(e){const t=oWe(e);return t&&(ma(t.parent)||Hv(t.parent))?t:void 0}function oWe(e){switch(e.kind){case 11:case 15:case 9:if(e.parent.kind===167)return vJ(e.parent.parent)?e.parent.parent:void 0;case 80:return vJ(e.parent)&&(e.parent.parent.kind===210||e.parent.parent.kind===292)&&e.parent.name===e?e.parent:void 0}}function cWe(e,t){const r=$A(e);if(r){const i=t.getContextualType(r.parent),s=i&&XL(r,t,i,!1);if(s&&s.length===1)return ba(s)}return t.getSymbolAtLocation(e)}function XL(e,t,r,i){const s=bA(e.name);if(!s)return ze;if(!r.isUnion()){const c=r.getProperty(s);return c?[c]:ze}const o=Ii(r.types,c=>(ma(e.parent)||Hv(e.parent))&&t.isTypeInvalidDueToUnionDiscriminant(c,e.parent)?void 0:c.getProperty(s));if(i&&(o.length===0||o.length===r.types.length)){const c=r.getProperty(s);if(c)return[c]}return o.length===0?Ii(r.types,c=>c.getProperty(s)):o}function lWe(e){return e&&e.parent&&e.parent.kind===212&&e.parent.argumentExpression===e}function Kce(e){if(Bl)return Hn(qn(qs(Bl.getExecutingFilePath())),fP(e));throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. ")}var ele,$G,XG,Uxe,tle,QG,YG,Vxe,qxe,Hxe,Gxe,$xe,Xxe,Qxe,ZG,rle,Yxe,uWe=Nt({"src/services/services.ts"(){"use strict";zn(),fTe(),FTe(),Nm(),WSe(),Rxe(),ele="0.8",$G=class{constructor(e,t,r){this.pos=t,this.end=r,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.kind=e}assertHasRealPosition(e){E.assert(!id(this.pos)&&!id(this.end),e||"Node must have a real position for this operation")}getSourceFile(){return Or(this)}getStart(e,t){return this.assertHasRealPosition(),cb(this,e,t)}getFullStart(){return this.assertHasRealPosition(),this.pos}getEnd(){return this.assertHasRealPosition(),this.end}getWidth(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)}getFullWidth(){return this.assertHasRealPosition(),this.end-this.pos}getLeadingTriviaWidth(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos}getFullText(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(e){return this.getChildren(e).length}getChildAt(e,t){return this.getChildren(t)[e]}getChildren(e){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),this._children||(this._children=rWe(this,e))}getFirstToken(e){this.assertHasRealPosition();const t=this.getChildren(e);if(!t.length)return;const r=kn(t,i=>i.kind<316||i.kind>357);return r.kind<166?r:r.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();const t=this.getChildren(e),r=Mo(t);if(r)return r.kind<166?r:r.getLastToken(e)}forEachChild(e,t){return ds(this,e,t)}},XG=class{constructor(e,t){this.pos=e,this.end=t,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0}getSourceFile(){return Or(this)}getStart(e,t){return cb(this,e,t)}getFullStart(){return this.pos}getEnd(){return this.end}getWidth(e){return this.getEnd()-this.getStart(e)}getFullWidth(){return this.end-this.pos}getLeadingTriviaWidth(e){return this.getStart(e)-this.pos}getFullText(e){return(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(){return this.getChildren().length}getChildAt(e){return this.getChildren()[e]}getChildren(){return this.kind===1&&this.jsDoc||ze}getFirstToken(){}getLastToken(){}forEachChild(){}},Uxe=class{constructor(e,t){this.id=0,this.mergeId=0,this.flags=e,this.escapedName=t}getFlags(){return this.flags}get name(){return pc(this)}getEscapedName(){return this.escapedName}getName(){return this.name}getDeclarations(){return this.declarations}getDocumentationComment(e){if(!this.documentationComment)if(this.documentationComment=ze,!this.declarations&&ym(this)&&this.links.target&&ym(this.links.target)&&this.links.target.links.tupleLabelDeclaration){const t=this.links.target.links.tupleLabelDeclaration;this.documentationComment=HL([t],e)}else this.documentationComment=HL(this.declarations,e);return this.documentationComment}getContextualDocumentationComment(e,t){if(e){if(B0(e)&&(this.contextualGetAccessorDocumentationComment||(this.contextualGetAccessorDocumentationComment=HL(wn(this.declarations,B0),t)),Ir(this.contextualGetAccessorDocumentationComment)))return this.contextualGetAccessorDocumentationComment;if(Lh(e)&&(this.contextualSetAccessorDocumentationComment||(this.contextualSetAccessorDocumentationComment=HL(wn(this.declarations,Lh),t)),Ir(this.contextualSetAccessorDocumentationComment)))return this.contextualSetAccessorDocumentationComment}return this.getDocumentationComment(t)}getJsDocTags(e){return this.tags===void 0&&(this.tags=VG(this.declarations,e)),this.tags}getContextualJsDocTags(e,t){if(e){if(B0(e)&&(this.contextualGetAccessorTags||(this.contextualGetAccessorTags=VG(wn(this.declarations,B0),t)),Ir(this.contextualGetAccessorTags)))return this.contextualGetAccessorTags;if(Lh(e)&&(this.contextualSetAccessorTags||(this.contextualSetAccessorTags=VG(wn(this.declarations,Lh),t)),Ir(this.contextualSetAccessorTags)))return this.contextualSetAccessorTags}return this.getJsDocTags(t)}},tle=class extends XG{constructor(e,t,r){super(t,r),this.kind=e}},QG=class extends XG{constructor(e,t,r){super(t,r),this.kind=80}get text(){return an(this)}},QG.prototype.kind=80,YG=class extends XG{constructor(e,t,r){super(t,r),this.kind=81}get text(){return an(this)}},YG.prototype.kind=81,Vxe=class{constructor(e,t){this.checker=e,this.flags=t}getFlags(){return this.flags}getSymbol(){return this.symbol}getProperties(){return this.checker.getPropertiesOfType(this)}getProperty(e){return this.checker.getPropertyOfType(this,e)}getApparentProperties(){return this.checker.getAugmentedPropertiesOfType(this)}getCallSignatures(){return this.checker.getSignaturesOfType(this,0)}getConstructSignatures(){return this.checker.getSignaturesOfType(this,1)}getStringIndexType(){return this.checker.getIndexTypeOfType(this,0)}getNumberIndexType(){return this.checker.getIndexTypeOfType(this,1)}getBaseTypes(){return this.isClassOrInterface()?this.checker.getBaseTypes(this):void 0}isNullableType(){return this.checker.isNullableType(this)}getNonNullableType(){return this.checker.getNonNullableType(this)}getNonOptionalType(){return this.checker.getNonOptionalType(this)}getConstraint(){return this.checker.getBaseConstraintOfType(this)}getDefault(){return this.checker.getDefaultFromTypeParameter(this)}isUnion(){return!!(this.flags&1048576)}isIntersection(){return!!(this.flags&2097152)}isUnionOrIntersection(){return!!(this.flags&3145728)}isLiteral(){return!!(this.flags&2432)}isStringLiteral(){return!!(this.flags&128)}isNumberLiteral(){return!!(this.flags&256)}isTypeParameter(){return!!(this.flags&262144)}isClassOrInterface(){return!!(Pn(this)&3)}isClass(){return!!(Pn(this)&1)}isIndexType(){return!!(this.flags&4194304)}get typeArguments(){if(Pn(this)&4)return this.checker.getTypeArguments(this)}},qxe=class{constructor(e,t){this.checker=e,this.flags=t}getDeclaration(){return this.declaration}getTypeParameters(){return this.typeParameters}getParameters(){return this.parameters}getReturnType(){return this.checker.getReturnTypeOfSignature(this)}getTypeParameterAtPosition(e){const t=this.checker.getParameterType(this,e);if(t.isIndexType()&&CE(t.type)){const r=t.type.getConstraint();if(r)return this.checker.getIndexType(r)}return t}getDocumentationComment(){return this.documentationComment||(this.documentationComment=HL(Q2(this.declaration),this.checker))}getJsDocTags(){return this.jsDocTags||(this.jsDocTags=VG(Q2(this.declaration),this.checker))}},Hxe=class extends $G{constructor(e,t,r){super(e,t,r),this.kind=312}update(e,t){return lU(this,e,t)}getLineAndCharacterOfPosition(e){return qa(this,e)}getLineStarts(){return Wg(this)}getPositionOfLineAndCharacter(e,t,r){return nI(Wg(this),e,t,this.text,r)}getLineEndOfPosition(e){const{line:t}=this.getLineAndCharacterOfPosition(e),r=this.getLineStarts();let i;t+1>=r.length&&(i=this.getEnd()),i||(i=r[t+1]-1);const s=this.getFullText();return s[i]===` +`&&s[i-1]==="\r"?i-1:i}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){const e=of();return this.forEachChild(s),e;function t(o){const c=i(o);c&&e.add(c,o)}function r(o){let c=e.get(o);return c||e.set(o,c=[]),c}function i(o){const c=cI(o);return c&&(xa(c)&&bn(c.expression)?c.expression.name.text:wc(c)?bA(c):void 0)}function s(o){switch(o.kind){case 262:case 218:case 174:case 173:const c=o,u=i(c);if(u){const p=r(u),y=Mo(p);y&&c.parent===y.parent&&c.symbol===y.symbol?c.body&&!y.body&&(p[p.length-1]=c):p.push(c)}ds(o,s);break;case 263:case 231:case 264:case 265:case 266:case 267:case 271:case 281:case 276:case 273:case 274:case 177:case 178:case 187:t(o),ds(o,s);break;case 169:if(!In(o,31))break;case 260:case 208:{const p=o;if(As(p.name)){ds(p.name,s);break}p.initializer&&s(p.initializer)}case 306:case 172:case 171:t(o);break;case 278:const f=o;f.exportClause&&(gp(f.exportClause)?Zt(f.exportClause.elements,s):s(f.exportClause.name));break;case 272:const g=o.importClause;g&&(g.name&&t(g.name),g.namedBindings&&(g.namedBindings.kind===274?t(g.namedBindings):Zt(g.namedBindings.elements,s)));break;case 226:ac(o)!==0&&t(o);default:ds(o,s)}}}},Gxe=class{constructor(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r}getLineAndCharacterOfPosition(e){return qa(this,e)}},$xe=class{constructor(e){this.host=e}getCurrentSourceFile(e){var t,r,i,s,o,c,u,f;const g=this.host.getScriptSnapshot(e);if(!g)throw new Error("Could not find file: '"+e+"'.");const p=NH(e,this.host),y=this.host.getScriptVersion(e);let S;if(this.currentFileName!==e){const T={languageVersion:99,impliedNodeFormat:Kw(fo(e,this.host.getCurrentDirectory(),((i=(r=(t=this.host).getCompilerHost)==null?void 0:r.call(t))==null?void 0:i.getCanonicalFileName)||jh(this.host)),(f=(u=(c=(o=(s=this.host).getCompilerHost)==null?void 0:o.call(s))==null?void 0:c.getModuleResolutionCache)==null?void 0:u.call(c))==null?void 0:f.getPackageJsonInfoCache(),this.host,this.host.getCompilationSettings()),setExternalModuleIndicator:P8(this.host.getCompilationSettings()),jsDocParsingMode:0};S=$L(e,g,T,y,!0,p)}else if(this.currentFileVersion!==y){const T=g.getChangeRange(this.currentFileScriptSnapshot);S=HG(this.currentSourceFile,g,y,T)}return S&&(this.currentFileVersion=y,this.currentFileName=e,this.currentFileScriptSnapshot=g,this.currentSourceFile=S),this.currentSourceFile}},Xxe={isCancellationRequested:Kp,throwIfCancellationRequested:Ca},Qxe=class{constructor(e){this.cancellationToken=e}isCancellationRequested(){return this.cancellationToken.isCancellationRequested()}throwIfCancellationRequested(){var e;if(this.isCancellationRequested())throw(e=Jr)==null||e.instant(Jr.Phase.Session,"cancellationThrown",{kind:"CancellationTokenObject"}),new lk}},ZG=class{constructor(e,t=20){this.hostCancellationToken=e,this.throttleWaitMilliseconds=t,this.lastCancellationCheckTime=0}isCancellationRequested(){const e=_o();return Math.abs(e-this.lastCancellationCheckTime)>=this.throttleWaitMilliseconds?(this.lastCancellationCheckTime=e,this.hostCancellationToken.isCancellationRequested()):!1}throwIfCancellationRequested(){var e;if(this.isCancellationRequested())throw(e=Jr)==null||e.instant(Jr.Phase.Session,"cancellationThrown",{kind:"ThrottledCancellationToken"}),new lk}},rle=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes"],Yxe=[...rle,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors"],Yte(iWe())}});function Zxe(e,t,r){const i=[];r=pG(r,i);const s=es(e)?e:[e],o=qw(void 0,void 0,I,r,s,t,!0);return o.diagnostics=Xi(o.diagnostics,i),o}var _We=Nt({"src/services/transform.ts"(){"use strict";zn()}});function fWe(e,t){if(e.isDeclarationFile)return;let r=Ji(e,t);const i=e.getLineAndCharacterOfPosition(t).line;if(e.getLineAndCharacterOfPosition(r.getStart(e)).line>i){const y=Kc(r.pos,e);if(!y||e.getLineAndCharacterOfPosition(y.getEnd()).line!==i)return;r=y}if(r.flags&33554432)return;return p(r);function s(y,S){const T=Lb(y)?US(y.modifiers,ql):void 0,C=T?la(e.text,T.end):y.getStart(e);return zc(C,(S||y).getEnd())}function o(y,S){return s(y,i2(S,S.parent,e))}function c(y,S){return y&&i===e.getLineAndCharacterOfPosition(y.getStart(e)).line?p(y):p(S)}function u(y,S,T){if(y){const C=y.indexOf(S);if(C>=0){let w=C,D=C+1;for(;w>0&&T(y[w-1]);)w--;for(;D0)return p(ve.declarations[0])}else return p(Z.initializer)}function J(Z){if(Z.initializer)return X(Z);if(Z.condition)return s(Z.condition);if(Z.incrementor)return s(Z.incrementor)}function ie(Z){const ve=Zt(Z.elements,Te=>Te.kind!==232?Te:void 0);return ve?p(ve):Z.parent.kind===208?s(Z.parent):S(Z.parent)}function B(Z){E.assert(Z.kind!==207&&Z.kind!==206);const ve=Z.kind===209?Z.elements:Z.properties,Te=Zt(ve,Me=>Me.kind!==232?Me:void 0);return Te?p(Te):s(Z.parent.kind===226?Z.parent:Z)}function Y(Z){switch(Z.parent.kind){case 266:const ve=Z.parent;return c(Kc(Z.pos,e,Z.parent),ve.members.length?ve.members[0]:ve.getLastToken(e));case 263:const Te=Z.parent;return c(Kc(Z.pos,e,Z.parent),Te.members.length?Te.members[0]:Te.getLastToken(e));case 269:return c(Z.parent.parent,Z.parent.clauses[0])}return p(Z.parent)}function ae(Z){switch(Z.parent.kind){case 268:if(rh(Z.parent.parent)!==1)return;case 266:case 263:return s(Z);case 241:if(Dv(Z.parent))return s(Z);case 299:return p(Mo(Z.parent.statements));case 269:const ve=Z.parent,Te=Mo(ve.clauses);return Te?p(Mo(Te.statements)):void 0;case 206:const Me=Z.parent;return p(Mo(Me.elements)||Me);default:if(Qh(Z.parent)){const ke=Z.parent;return s(Mo(ke.properties)||ke)}return p(Z.parent)}}function _e(Z){switch(Z.parent.kind){case 207:const ve=Z.parent;return s(Mo(ve.elements)||ve);default:if(Qh(Z.parent)){const Te=Z.parent;return s(Mo(Te.elements)||Te)}return p(Z.parent)}}function $(Z){return Z.parent.kind===246||Z.parent.kind===213||Z.parent.kind===214?f(Z):Z.parent.kind===217?g(Z):p(Z.parent)}function H(Z){switch(Z.parent.kind){case 218:case 262:case 219:case 174:case 173:case 177:case 178:case 176:case 247:case 246:case 248:case 250:case 213:case 214:case 217:return f(Z);default:return p(Z.parent)}}function K(Z){return ks(Z.parent)||Z.parent.kind===303||Z.parent.kind===169?f(Z):p(Z.parent)}function oe(Z){return Z.parent.kind===216?g(Z):p(Z.parent)}function Se(Z){return Z.parent.kind===246?o(Z,Z.parent.expression):p(Z.parent)}function se(Z){return Z.parent.kind===250?g(Z):p(Z.parent)}}}var pWe=Nt({"src/services/breakpoints.ts"(){"use strict";zn()}}),KG={};jl(KG,{spanInSourceFileAtLocation:()=>fWe});var dWe=Nt({"src/services/_namespaces/ts.BreakpointResolver.ts"(){"use strict";pWe()}});function mWe(e){return(ro(e)||Nl(e))&&Au(e)}function XA(e){return(ro(e)||go(e)||Nl(e))&&Ei(e.parent)&&e===e.parent.initializer&&Ie(e.parent.name)&&!!(Fh(e.parent)&2)}function Kxe(e){return Ai(e)||vc(e)||Zc(e)||ro(e)||Vc(e)||Nl(e)||Go(e)||mc(e)||fg(e)||pf(e)||N_(e)}function r6(e){return Ai(e)||vc(e)&&Ie(e.name)||Zc(e)||Vc(e)||Go(e)||mc(e)||fg(e)||pf(e)||N_(e)||mWe(e)||XA(e)}function eke(e){return Ai(e)?e:Au(e)?e.name:XA(e)?e.parent.name:E.checkDefined(e.modifiers&&kn(e.modifiers,tke))}function tke(e){return e.kind===90}function rke(e,t){const r=eke(t);return r&&e.getSymbolAtLocation(r)}function gWe(e,t){if(Ai(t))return{text:t.fileName,pos:0,end:0};if((Zc(t)||Vc(t))&&!Au(t)){const s=t.modifiers&&kn(t.modifiers,tke);if(s)return{text:"default",pos:s.getStart(),end:s.getEnd()}}if(Go(t)){const s=t.getSourceFile(),o=la(s.text,Id(t).pos),c=o+6,u=e.getTypeChecker(),f=u.getSymbolAtLocation(t.parent);return{text:`${f?`${u.symbolToString(f,t.parent)} `:""}static {}`,pos:o,end:c}}const r=XA(t)?t.parent.name:E.checkDefined(as(t),"Expected call hierarchy item to have a name");let i=Ie(r)?an(r):_f(r)?r.text:xa(r)&&_f(r.expression)?r.expression.text:void 0;if(i===void 0){const s=e.getTypeChecker(),o=s.getSymbolAtLocation(r);o&&(i=s.symbolToString(o,t))}if(i===void 0){const s=Gw();i=R4(o=>s.writeNode(4,t,t.getSourceFile(),o))}return{text:i,pos:r.getStart(),end:r.getEnd()}}function hWe(e){var t,r;if(XA(e))return Ld(e.parent.parent.parent.parent)&&Ie(e.parent.parent.parent.parent.parent.name)?e.parent.parent.parent.parent.parent.name.getText():void 0;switch(e.kind){case 177:case 178:case 174:return e.parent.kind===210?(t=ZB(e.parent))==null?void 0:t.getText():(r=as(e.parent))==null?void 0:r.getText();case 262:case 263:case 267:if(Ld(e.parent)&&Ie(e.parent.parent.name))return e.parent.parent.name.getText()}}function nke(e,t){if(t.body)return t;if(gc(t))return cg(t.parent);if(Zc(t)||mc(t)){const r=rke(e,t);return r&&r.valueDeclaration&&po(r.valueDeclaration)&&r.valueDeclaration.body?r.valueDeclaration:void 0}return t}function ike(e,t){const r=rke(e,t);let i;if(r&&r.declarations){const s=WD(r.declarations),o=Yt(r.declarations,f=>({file:f.getSourceFile().fileName,pos:f.pos}));s.sort((f,g)=>Du(o[f].file,o[g].file)||o[f].pos-o[g].pos);const c=Yt(s,f=>r.declarations[f]);let u;for(const f of c)r6(f)&&((!u||u.parent!==f.parent||u.end!==f.pos)&&(i=lr(i,f)),u=f)}return i}function e$(e,t){return Go(t)?t:po(t)?nke(e,t)??ike(e,t)??t:ike(e,t)??t}function ske(e,t){const r=e.getTypeChecker();let i=!1;for(;;){if(r6(t))return e$(r,t);if(Kxe(t)){const s=Ar(t,r6);return s&&e$(r,s)}if($g(t)){if(r6(t.parent))return e$(r,t.parent);if(Kxe(t.parent)){const s=Ar(t.parent,r6);return s&&e$(r,s)}return Ei(t.parent)&&t.parent.initializer&&XA(t.parent.initializer)?t.parent.initializer:void 0}if(gc(t))return r6(t.parent)?t.parent:void 0;if(t.kind===126&&Go(t.parent)){t=t.parent;continue}if(Ei(t)&&t.initializer&&XA(t.initializer))return t.initializer;if(!i){let s=r.getSymbolAtLocation(t);if(s&&(s.flags&2097152&&(s=r.getAliasedSymbol(s)),s.valueDeclaration)){i=!0,t=s.valueDeclaration;continue}}return}}function nle(e,t){const r=t.getSourceFile(),i=gWe(e,t),s=hWe(t),o=n2(t),c=C3(t),u=zc(la(r.text,t.getFullStart(),!1,!0),t.getEnd()),f=zc(i.pos,i.end);return{file:r.fileName,kind:o,kindModifiers:c,name:i.text,containerName:s,span:u,selectionSpan:f}}function yWe(e){return e!==void 0}function vWe(e){if(e.kind===ho.EntryKind.Node){const{node:t}=e;if(Yq(t,!0,!0)||zae(t,!0,!0)||Wae(t,!0,!0)||Uae(t,!0,!0)||VC(t)||rH(t)){const r=t.getSourceFile();return{declaration:Ar(t,r6)||r,range:hH(t,r)}}}}function ake(e){return Oa(e.declaration)}function bWe(e,t){return{from:e,fromSpans:t}}function SWe(e,t){return bWe(nle(e,t[0].declaration),Yt(t,r=>ry(r.range)))}function TWe(e,t,r){if(Ai(t)||vc(t)||Go(t))return[];const i=eke(t),s=wn(ho.findReferenceOrRenameEntries(e,r,e.getSourceFiles(),i,0,{use:ho.FindReferencesUse.References},vWe),yWe);return s?p4(s,ake,o=>SWe(e,o)):[]}function xWe(e,t){function r(s){const o=Db(s)?s.tag:qu(s)?s.tagName:co(s)||Go(s)?s:s.expression,c=ske(e,o);if(c){const u=hH(o,s.getSourceFile());if(es(c))for(const f of c)t.push({declaration:f,range:u});else t.push({declaration:c,range:u})}}function i(s){if(s&&!(s.flags&33554432)){if(r6(s)){if(Qn(s))for(const o of s.members)o.name&&xa(o.name)&&i(o.name.expression);return}switch(s.kind){case 80:case 271:case 272:case 278:case 264:case 265:return;case 175:r(s);return;case 216:case 234:i(s.expression);return;case 260:case 169:i(s.name),i(s.initializer);return;case 213:r(s),i(s.expression),Zt(s.arguments,i);return;case 214:r(s),i(s.expression),Zt(s.arguments,i);return;case 215:r(s),i(s.tag),i(s.template);return;case 286:case 285:r(s),i(s.tagName),i(s.attributes);return;case 170:r(s),i(s.expression);return;case 211:case 212:r(s),ds(s,i);break;case 238:i(s.expression);return}ig(s)||ds(s,i)}}return i}function kWe(e,t){Zt(e.statements,t)}function CWe(e,t){!In(e,128)&&e.body&&Ld(e.body)&&Zt(e.body.statements,t)}function EWe(e,t,r){const i=nke(e,t);i&&(Zt(i.parameters,r),r(i.body))}function DWe(e,t){t(e.body)}function PWe(e,t){Zt(e.modifiers,t);const r=Nv(e);r&&t(r.expression);for(const i of e.members)Wp(i)&&Zt(i.modifiers,t),Es(i)?t(i.initializer):gc(i)&&i.body?(Zt(i.parameters,t),t(i.body)):Go(i)&&t(i)}function wWe(e,t){const r=[],i=xWe(e,r);switch(t.kind){case 312:kWe(t,i);break;case 267:CWe(t,i);break;case 262:case 218:case 219:case 174:case 177:case 178:EWe(e.getTypeChecker(),t,i);break;case 263:case 231:PWe(t,i);break;case 175:DWe(t,i);break;default:E.assertNever(t)}return r}function AWe(e,t){return{to:e,fromSpans:t}}function NWe(e,t){return AWe(nle(e,t[0].declaration),Yt(t,r=>ry(r.range)))}function IWe(e,t){return t.flags&33554432||fg(t)?[]:p4(wWe(e,t),ake,r=>NWe(e,r))}var FWe=Nt({"src/services/callHierarchy.ts"(){"use strict";zn()}}),ix={};jl(ix,{createCallHierarchyItem:()=>nle,getIncomingCalls:()=>TWe,getOutgoingCalls:()=>IWe,resolveCallHierarchyDeclaration:()=>ske});var OWe=Nt({"src/services/_namespaces/ts.CallHierarchy.ts"(){"use strict";FWe()}}),oke={};jl(oke,{TokenEncodingConsts:()=>$ce,TokenModifier:()=>Qce,TokenType:()=>Xce,getEncodedSemanticClassifications:()=>Gce,getSemanticClassifications:()=>Oxe});var LWe=Nt({"src/services/_namespaces/ts.classifier.v2020.ts"(){"use strict";Rxe()}}),ile={};jl(ile,{v2020:()=>oke});var MWe=Nt({"src/services/_namespaces/ts.classifier.ts"(){"use strict";LWe()}});function _d(e,t,r){return ale(e,$b(r),t,void 0,void 0)}function Bs(e,t,r,i,s,o){return ale(e,$b(r),t,i,$b(s),o)}function sle(e,t,r,i,s,o){return ale(e,$b(r),t,i,s&&$b(s),o)}function ale(e,t,r,i,s,o){return{fixName:e,description:t,changes:r,fixId:i,fixAllDescription:s,commands:o?[o]:void 0}}function Zs(e){for(const t of e.errorCodes)ole=void 0,t$.add(String(t),e);if(e.fixIds)for(const t of e.fixIds)E.assert(!r$.has(t)),r$.set(t,e)}function RWe(){return ole??(ole=fs(t$.keys()))}function jWe(e,t){const{errorCodes:r}=e;let i=0;for(const o of t)if(_s(r,o.code)&&i++,i>1)break;const s=i<2;return({fixId:o,fixAllDescription:c,...u})=>s?u:{...u,fixId:o,fixAllDescription:c}}function BWe(e){const t=lke(e),r=t$.get(String(e.errorCode));return ta(r,i=>Yt(i.getCodeActions(e),jWe(i,t)))}function JWe(e){return r$.get(Ms(e.fixId,ns)).getAllCodeActions(e)}function n6(e,t){return{changes:e,commands:t}}function cke(e,t){return{fileName:e,textChanges:t}}function $a(e,t,r){const i=[],s=Qr.ChangeTracker.with(e,o=>i6(e,t,c=>r(o,c,i)));return n6(s,i.length===0?void 0:i)}function i6(e,t,r){for(const i of lke(e))_s(t,i.code)&&r(i)}function lke({program:e,sourceFile:t,cancellationToken:r}){return[...e.getSemanticDiagnostics(t,r),...e.getSyntacticDiagnostics(t,r),...cG(t,e,r)]}var t$,r$,ole,zWe=Nt({"src/services/codeFixProvider.ts"(){"use strict";zn(),t$=of(),r$=new Map}});function uke(e,t,r){const i=nw(r)?I.createAsExpression(r.expression,I.createKeywordTypeNode(159)):I.createTypeAssertion(I.createKeywordTypeNode(159),r.expression);e.replaceNode(t,r.expression,i)}function _ke(e,t){if(!Hr(e))return Ar(Ji(e,t),r=>nw(r)||ine(r))}var n$,cle,WWe=Nt({"src/services/codefixes/addConvertToUnknownForNonOverlappingTypes.ts"(){"use strict";zn(),na(),n$="addConvertToUnknownForNonOverlappingTypes",cle=[d.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code],Zs({errorCodes:cle,getCodeActions:function(t){const r=_ke(t.sourceFile,t.span.start);if(r===void 0)return;const i=Qr.ChangeTracker.with(t,s=>uke(s,t.sourceFile,r));return[Bs(n$,i,d.Add_unknown_conversion_for_non_overlapping_types,n$,d.Add_unknown_to_all_conversions_of_non_overlapping_types)]},fixIds:[n$],getAllCodeActions:e=>$a(e,cle,(t,r)=>{const i=_ke(r.file,r.start);i&&uke(t,r.file,i)})})}}),UWe=Nt({"src/services/codefixes/addEmptyExportDeclaration.ts"(){"use strict";zn(),na(),Zs({errorCodes:[d.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,d.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,d.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function(t){const{sourceFile:r}=t,i=Qr.ChangeTracker.with(t,s=>{const o=I.createExportDeclaration(void 0,!1,I.createNamedExports([]),void 0);s.insertNodeAtEndOfScope(r,r,o)});return[_d("addEmptyExportDeclaration",i,d.Add_export_to_make_this_file_into_a_module)]}})}});function fke(e,t,r,i){const s=r(o=>VWe(o,e.sourceFile,t,i));return Bs(i$,s,d.Add_async_modifier_to_containing_function,i$,d.Add_all_missing_async_modifiers)}function VWe(e,t,r,i){if(i&&i.has(Oa(r)))return;i?.add(Oa(r));const s=I.replaceModifiers(wo(r,!0),I.createNodeArray(I.createModifiersFromModifierFlags(q0(r)|1024)));e.replaceNode(t,r,s)}function pke(e,t){if(!t)return;const r=Ji(e,t.start);return Ar(r,s=>s.getStart(e)yc(t)?"quit":(go(s)||mc(s)||ro(s)||Zc(s))&&$C(t,l_(s,e)))}function qWe(e,t){return({start:r,length:i,relatedInformation:s,code:o})=>wh(r)&&wh(i)&&$C({start:r,length:i},e)&&o===t&&!!s&&ut(s,c=>c.code===d.Did_you_mean_to_mark_this_function_as_async.code)}var i$,lle,HWe=Nt({"src/services/codefixes/addMissingAsync.ts"(){"use strict";zn(),na(),i$="addMissingAsync",lle=[d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,d.Type_0_is_not_assignable_to_type_1.code,d.Type_0_is_not_comparable_to_type_1.code],Zs({fixIds:[i$],errorCodes:lle,getCodeActions:function(t){const{sourceFile:r,errorCode:i,cancellationToken:s,program:o,span:c}=t,u=kn(o.getTypeChecker().getDiagnostics(r,s),qWe(c,i)),f=u&&u.relatedInformation&&kn(u.relatedInformation,y=>y.code===d.Did_you_mean_to_mark_this_function_as_async.code),g=pke(r,f);return g?[fke(t,g,y=>Qr.ChangeTracker.with(t,y))]:void 0},getAllCodeActions:e=>{const{sourceFile:t}=e,r=new Set;return $a(e,lle,(i,s)=>{const o=s.relatedInformation&&kn(s.relatedInformation,f=>f.code===d.Did_you_mean_to_mark_this_function_as_async.code),c=pke(t,o);return c?fke(e,c,f=>(f(i),[]),r):void 0})}})}});function dke(e,t,r,i,s){const o=JH(e,r);return o&&GWe(e,t,r,i,s)&&hke(o)?o:void 0}function mke(e,t,r,i,s,o){const{sourceFile:c,program:u,cancellationToken:f}=e,g=$We(t,c,f,u,i);if(g){const p=s(y=>{Zt(g.initializers,({expression:S})=>ule(y,r,c,i,S,o)),o&&g.needsSecondPassForFixAll&&ule(y,r,c,i,t,o)});return _d("addMissingAwaitToInitializer",p,g.initializers.length===1?[d.Add_await_to_initializer_for_0,g.initializers[0].declarationSymbol.name]:d.Add_await_to_initializers)}}function gke(e,t,r,i,s,o){const c=s(u=>ule(u,r,e.sourceFile,i,t,o));return Bs(s$,c,d.Add_await,s$,d.Fix_all_expressions_possibly_missing_await)}function GWe(e,t,r,i,s){const c=s.getTypeChecker().getDiagnostics(e,i);return ut(c,({start:u,length:f,relatedInformation:g,code:p})=>wh(u)&&wh(f)&&$C({start:u,length:f},r)&&p===t&&!!g&&ut(g,y=>y.code===d.Did_you_forget_to_use_await.code))}function $We(e,t,r,i,s){const o=XWe(e,s);if(!o)return;let c=o.isCompleteFix,u;for(const f of o.identifiers){const g=s.getSymbolAtLocation(f);if(!g)continue;const p=Jn(g.valueDeclaration,Ei),y=p&&Jn(p.name,Ie),S=r1(p,243);if(!p||!S||p.type||!p.initializer||S.getSourceFile()!==t||In(S,32)||!y||!hke(p.initializer)){c=!1;continue}const T=i.getSemanticDiagnostics(t,r);if(ho.Core.eachSymbolReferenceInFile(y,s,t,w=>f!==w&&!QWe(w,T,t,s))){c=!1;continue}(u||(u=[])).push({expression:p.initializer,declarationSymbol:g})}return u&&{initializers:u,needsSecondPassForFixAll:!c}}function XWe(e,t){if(bn(e.parent)&&Ie(e.parent.expression))return{identifiers:[e.parent.expression],isCompleteFix:!0};if(Ie(e))return{identifiers:[e],isCompleteFix:!0};if(Gr(e)){let r,i=!0;for(const s of[e.left,e.right]){const o=t.getTypeAtLocation(s);if(t.getPromisedTypeOfPromise(o)){if(!Ie(s)){i=!1;continue}(r||(r=[])).push(s)}}return r&&{identifiers:r,isCompleteFix:i}}}function QWe(e,t,r,i){const s=bn(e.parent)?e.parent.name:Gr(e.parent)?e.parent:e,o=kn(t,c=>c.start===s.getStart(r)&&c.start+c.length===s.getEnd());return o&&_s(a$,o.code)||i.getTypeAtLocation(s).flags&1}function hke(e){return e.flags&65536||!!Ar(e,t=>t.parent&&go(t.parent)&&t.parent.body===t||Ss(t)&&(t.parent.kind===262||t.parent.kind===218||t.parent.kind===219||t.parent.kind===174))}function ule(e,t,r,i,s,o){if(iw(s.parent)&&!s.parent.awaitModifier){const c=i.getTypeAtLocation(s),u=i.getAsyncIterableType();if(u&&i.isTypeAssignableTo(c,u)){const f=s.parent;e.replaceNode(r,f,I.updateForOfStatement(f,I.createToken(135),f.initializer,f.expression,f.statement));return}}if(Gr(s))for(const c of[s.left,s.right]){if(o&&Ie(c)){const g=i.getSymbolAtLocation(c);if(g&&o.has(Xs(g)))continue}const u=i.getTypeAtLocation(c),f=i.getPromisedTypeOfPromise(u)?I.createAwaitExpression(c):c;e.replaceNode(r,c,f)}else if(t===_le&&bn(s.parent)){if(o&&Ie(s.parent.expression)){const c=i.getSymbolAtLocation(s.parent.expression);if(c&&o.has(Xs(c)))return}e.replaceNode(r,s.parent.expression,I.createParenthesizedExpression(I.createAwaitExpression(s.parent.expression))),yke(e,s.parent.expression,r)}else if(_s(fle,t)&&gm(s.parent)){if(o&&Ie(s)){const c=i.getSymbolAtLocation(s);if(c&&o.has(Xs(c)))return}e.replaceNode(r,s,I.createParenthesizedExpression(I.createAwaitExpression(s))),yke(e,s,r)}else{if(o&&Ei(s.parent)&&Ie(s.parent.name)){const c=i.getSymbolAtLocation(s.parent.name);if(c&&!zy(o,Xs(c)))return}e.replaceNode(r,s,I.createAwaitExpression(s))}}function yke(e,t,r){const i=Kc(t.pos,r);i&&cL(i.end,i.parent,r)&&e.insertText(r,t.getStart(r),";")}var s$,_le,fle,a$,YWe=Nt({"src/services/codefixes/addMissingAwait.ts"(){"use strict";zn(),na(),s$="addMissingAwait",_le=d.Property_0_does_not_exist_on_type_1.code,fle=[d.This_expression_is_not_callable.code,d.This_expression_is_not_constructable.code],a$=[d.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,d.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,d.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,d.Operator_0_cannot_be_applied_to_type_1.code,d.Operator_0_cannot_be_applied_to_types_1_and_2.code,d.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code,d.This_condition_will_always_return_true_since_this_0_is_always_defined.code,d.Type_0_is_not_an_array_type.code,d.Type_0_is_not_an_array_type_or_a_string_type.code,d.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,d.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,d.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,d.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,d.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,_le,...fle],Zs({fixIds:[s$],errorCodes:a$,getCodeActions:function(t){const{sourceFile:r,errorCode:i,span:s,cancellationToken:o,program:c}=t,u=dke(r,i,s,o,c);if(!u)return;const f=t.program.getTypeChecker(),g=p=>Qr.ChangeTracker.with(t,p);return UD([mke(t,u,i,f,g),gke(t,u,i,f,g)])},getAllCodeActions:e=>{const{sourceFile:t,program:r,cancellationToken:i}=e,s=e.program.getTypeChecker(),o=new Set;return $a(e,a$,(c,u)=>{const f=dke(t,u.code,u,i,r);if(!f)return;const g=p=>(p(c),[]);return mke(e,f,u.code,s,g,o)||gke(e,f,u.code,s,g,o)})}})}});function vke(e,t,r,i,s){const o=Ji(t,r),c=Ar(o,g=>Sk(g.parent)?g.parent.initializer===g:ZWe(g)?!1:"quit");if(c)return o$(e,c,t,s);const u=o.parent;if(Gr(u)&&u.operatorToken.kind===64&&kl(u.parent))return o$(e,o,t,s);if(Lu(u)){const g=i.getTypeChecker();return qi(u.elements,p=>KWe(p,g))?o$(e,u,t,s):void 0}const f=Ar(o,g=>kl(g.parent)?!0:eUe(g)?!1:"quit");if(f){const g=i.getTypeChecker();return bke(f,g)?o$(e,f,t,s):void 0}}function o$(e,t,r,i){(!i||zy(i,t))&&e.insertModifierBefore(r,87,t)}function ZWe(e){switch(e.kind){case 80:case 209:case 210:case 303:case 304:return!0;default:return!1}}function KWe(e,t){const r=Ie(e)?e:sl(e,!0)&&Ie(e.left)?e.left:void 0;return!!r&&!t.getSymbolAtLocation(r)}function eUe(e){switch(e.kind){case 80:case 226:case 28:return!0;default:return!1}}function bke(e,t){return Gr(e)?e.operatorToken.kind===28?qi([e.left,e.right],r=>bke(r,t)):e.operatorToken.kind===64&&Ie(e.left)&&!t.getSymbolAtLocation(e.left):!1}var c$,ple,tUe=Nt({"src/services/codefixes/addMissingConst.ts"(){"use strict";zn(),na(),c$="addMissingConst",ple=[d.Cannot_find_name_0.code,d.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code],Zs({errorCodes:ple,getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>vke(i,t.sourceFile,t.span.start,t.program));if(r.length>0)return[Bs(c$,r,d.Add_const_to_unresolved_variable,c$,d.Add_const_to_all_unresolved_variables)]},fixIds:[c$],getAllCodeActions:e=>{const t=new Set;return $a(e,ple,(r,i)=>vke(r,i.file,i.start,e.program,t))}})}});function Ske(e,t,r,i){const s=Ji(t,r);if(!Ie(s))return;const o=s.parent;o.kind===172&&(!i||zy(i,o))&&e.insertModifierBefore(t,138,o)}var l$,dle,rUe=Nt({"src/services/codefixes/addMissingDeclareProperty.ts"(){"use strict";zn(),na(),l$="addMissingDeclareProperty",dle=[d.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code],Zs({errorCodes:dle,getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>Ske(i,t.sourceFile,t.span.start));if(r.length>0)return[Bs(l$,r,d.Prefix_with_declare,l$,d.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[l$],getAllCodeActions:e=>{const t=new Set;return $a(e,dle,(r,i)=>Ske(r,i.file,i.start,t))}})}});function Tke(e,t,r){const i=Ji(t,r),s=Ar(i,ql);E.assert(!!s,"Expected position to be owned by a decorator.");const o=I.createCallExpression(s.expression,void 0,void 0);e.replaceNode(t,s.expression,o)}var u$,mle,nUe=Nt({"src/services/codefixes/addMissingInvocationForDecorator.ts"(){"use strict";zn(),na(),u$="addMissingInvocationForDecorator",mle=[d._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code],Zs({errorCodes:mle,getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>Tke(i,t.sourceFile,t.span.start));return[Bs(u$,r,d.Call_decorator_expression,u$,d.Add_to_all_uncalled_decorators)]},fixIds:[u$],getAllCodeActions:e=>$a(e,mle,(t,r)=>Tke(t,r.file,r.start))})}});function xke(e,t,r){const i=Ji(t,r),s=i.parent;if(!us(s))return E.fail("Tried to add a parameter name to a non-parameter: "+E.formatSyntaxKind(i.kind));const o=s.parent.parameters.indexOf(s);E.assert(!s.type,"Tried to add a parameter name to a parameter that already had one."),E.assert(o>-1,"Parameter not found in parent parameter list.");let c=s.name.getEnd(),u=I.createTypeReferenceNode(s.name,void 0),f=kke(t,s);for(;f;)u=I.createArrayTypeNode(u),c=f.getEnd(),f=kke(t,f);const g=I.createParameterDeclaration(s.modifiers,s.dotDotDotToken,"arg"+o,s.questionToken,s.dotDotDotToken&&!jF(u)?I.createArrayTypeNode(u):u,s.initializer);e.replaceRange(t,Lf(s.getStart(t),c),g)}function kke(e,t){const r=i2(t.name,t.parent,e);if(r&&r.kind===23&&Eb(r.parent)&&us(r.parent.parent))return r.parent.parent}var _$,gle,iUe=Nt({"src/services/codefixes/addNameToNamelessParameter.ts"(){"use strict";zn(),na(),_$="addNameToNamelessParameter",gle=[d.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code],Zs({errorCodes:gle,getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>xke(i,t.sourceFile,t.span.start));return[Bs(_$,r,d.Add_parameter_name,_$,d.Add_names_to_all_parameters_without_names)]},fixIds:[_$],getAllCodeActions:e=>$a(e,gle,(t,r)=>xke(t,r.file,r.start))})}});function sUe(e,t,r){var i,s;const o=Cke(JH(e,t),r);if(!o)return ze;const{source:c,target:u}=o,f=aUe(c,u,r)?r.getTypeAtLocation(u.expression):r.getTypeAtLocation(u);return(s=(i=f.symbol)==null?void 0:i.declarations)!=null&&s.some(g=>Or(g).fileName.match(/\.d\.ts$/))?ze:r.getExactOptionalProperties(f)}function aUe(e,t,r){return bn(t)&&!!r.getExactOptionalProperties(r.getTypeAtLocation(t.expression)).length&&r.getTypeAtLocation(e)===r.getUndefinedType()}function Cke(e,t){var r;if(e){if(Gr(e.parent)&&e.parent.operatorToken.kind===64)return{source:e.parent.right,target:e.parent.left};if(Ei(e.parent)&&e.parent.initializer)return{source:e.parent.initializer,target:e.parent.name};if(Rs(e.parent)){const i=t.getSymbolAtLocation(e.parent.expression);if(!i?.valueDeclaration||!nT(i.valueDeclaration.kind)||!ct(e))return;const s=e.parent.arguments.indexOf(e);if(s===-1)return;const o=i.valueDeclaration.parameters[s].name;if(Ie(o))return{source:e,target:o}}else if(Hc(e.parent)&&Ie(e.parent.name)||Y_(e.parent)){const i=Cke(e.parent.parent,t);if(!i)return;const s=t.getPropertyOfType(t.getTypeAtLocation(i.target),e.parent.name.text),o=(r=s?.declarations)==null?void 0:r[0];return o?{source:Hc(e.parent)?e.parent.initializer:e.parent.name,target:o}:void 0}}else return}function oUe(e,t){for(const r of t){const i=r.valueDeclaration;if(i&&(ff(i)||Es(i))&&i.type){const s=I.createUnionTypeNode([...i.type.kind===192?i.type.types:[i.type],I.createTypeReferenceNode("undefined")]);e.replaceNode(i.getSourceFile(),i.type,s)}}}var hle,Eke,cUe=Nt({"src/services/codefixes/addOptionalPropertyUndefined.ts"(){"use strict";zn(),na(),hle="addOptionalPropertyUndefined",Eke=[d.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,d.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code],Zs({errorCodes:Eke,getCodeActions(e){const t=e.program.getTypeChecker(),r=sUe(e.sourceFile,e.span,t);if(!r.length)return;const i=Qr.ChangeTracker.with(e,s=>oUe(s,r));return[_d(hle,i,d.Add_undefined_to_optional_property_type)]},fixIds:[hle]})}});function Dke(e,t){const r=Ji(e,t);return Jn(us(r.parent)?r.parent.parent:r.parent,Pke)}function Pke(e){return lUe(e)&&wke(e)}function wke(e){return po(e)?e.parameters.some(wke)||!e.type&&!!hP(e):!e.type&&!!Yy(e)}function Ake(e,t,r){if(po(r)&&(hP(r)||r.parameters.some(i=>!!Yy(i)))){if(!r.typeParameters){const s=g5(r);s.length&&e.insertTypeParameters(t,r,s)}const i=go(r)&&!Ua(r,21,t);i&&e.insertNodeBefore(t,ba(r.parameters),I.createToken(21));for(const s of r.parameters)if(!s.type){const o=Yy(s);o&&e.tryInsertTypeAnnotation(t,s,He(o,l2,Si))}if(i&&e.insertNodeAfter(t,Sa(r.parameters),I.createToken(22)),!r.type){const s=hP(r);s&&e.tryInsertTypeAnnotation(t,r,He(s,l2,Si))}}else{const i=E.checkDefined(Yy(r),"A JSDocType for this declaration should exist");E.assert(!r.type,"The JSDocType decl should have a type"),e.tryInsertTypeAnnotation(t,r,He(i,l2,Si))}}function lUe(e){return po(e)||e.kind===260||e.kind===171||e.kind===172}function l2(e){switch(e.kind){case 319:case 320:return I.createTypeReferenceNode("any",ze);case 323:return _Ue(e);case 322:return l2(e.type);case 321:return fUe(e);case 325:return pUe(e);case 324:return dUe(e);case 183:return gUe(e);case 329:return uUe(e);default:const t=sr(e,l2,cd);return Vr(t,1),t}}function uUe(e){const t=I.createTypeLiteralNode(Yt(e.jsDocPropertyTags,r=>I.createPropertySignature(void 0,Ie(r.name)?r.name:r.name.right,M8(r)?I.createToken(58):void 0,r.typeExpression&&He(r.typeExpression.type,l2,Si)||I.createKeywordTypeNode(133))));return Vr(t,1),t}function _Ue(e){return I.createUnionTypeNode([He(e.type,l2,Si),I.createTypeReferenceNode("undefined",ze)])}function fUe(e){return I.createUnionTypeNode([He(e.type,l2,Si),I.createTypeReferenceNode("null",ze)])}function pUe(e){return I.createArrayTypeNode(He(e.type,l2,Si))}function dUe(e){return I.createFunctionTypeNode(ze,e.parameters.map(mUe),e.type??I.createKeywordTypeNode(133))}function mUe(e){const t=e.parent.parameters.indexOf(e),r=e.type.kind===325&&t===e.parent.parameters.length-1,i=e.name||(r?"rest":"arg"+t),s=r?I.createToken(26):e.dotDotDotToken;return I.createParameterDeclaration(e.modifiers,s,i,e.questionToken,He(e.type,l2,Si),e.initializer)}function gUe(e){let t=e.typeName,r=e.typeArguments;if(Ie(e.typeName)){if(YI(e))return hUe(e);let i=e.typeName.text;switch(e.typeName.text){case"String":case"Boolean":case"Object":case"Number":i=i.toLowerCase();break;case"array":case"date":case"promise":i=i[0].toUpperCase()+i.slice(1);break}t=I.createIdentifier(i),(i==="Array"||i==="Promise")&&!e.typeArguments?r=I.createNodeArray([I.createTypeReferenceNode("any",ze)]):r=kr(e.typeArguments,l2,Si)}return I.createTypeReferenceNode(t,r)}function hUe(e){const t=I.createParameterDeclaration(void 0,void 0,e.typeArguments[0].kind===150?"n":"s",void 0,I.createTypeReferenceNode(e.typeArguments[0].kind===150?"number":"string",[]),void 0),r=I.createTypeLiteralNode([I.createIndexSignature(void 0,[t],e.typeArguments[1])]);return Vr(r,1),r}var f$,yle,yUe=Nt({"src/services/codefixes/annotateWithTypeFromJSDoc.ts"(){"use strict";zn(),na(),f$="annotateWithTypeFromJSDoc",yle=[d.JSDoc_types_may_be_moved_to_TypeScript_types.code],Zs({errorCodes:yle,getCodeActions(e){const t=Dke(e.sourceFile,e.span.start);if(!t)return;const r=Qr.ChangeTracker.with(e,i=>Ake(i,e.sourceFile,t));return[Bs(f$,r,d.Annotate_with_type_from_JSDoc,f$,d.Annotate_everything_with_types_from_JSDoc)]},fixIds:[f$],getAllCodeActions:e=>$a(e,yle,(t,r)=>{const i=Dke(r.file,r.start);i&&Ake(t,r.file,i)})})}});function Nke(e,t,r,i,s,o){const c=i.getSymbolAtLocation(Ji(t,r));if(!c||!c.valueDeclaration||!(c.flags&19))return;const u=c.valueDeclaration;if(Zc(u)||ro(u))e.replaceNode(t,u,p(u));else if(Ei(u)){const y=g(u);if(!y)return;const S=u.parent.parent;ml(u.parent)&&u.parent.declarations.length>1?(e.delete(t,u),e.insertNodeAfter(t,S,y)):e.replaceNode(t,S,y)}function f(y){const S=[];return y.exports&&y.exports.forEach(w=>{if(w.name==="prototype"&&w.declarations){const D=w.declarations[0];if(w.declarations.length===1&&bn(D)&&Gr(D.parent)&&D.parent.operatorToken.kind===64&&ma(D.parent.right)){const O=D.parent.right;C(O.symbol,void 0,S)}}else C(w,[I.createToken(126)],S)}),y.members&&y.members.forEach((w,D)=>{var O,z,W,X;if(D==="constructor"&&w.valueDeclaration){const J=(X=(W=(z=(O=y.exports)==null?void 0:O.get("prototype"))==null?void 0:z.declarations)==null?void 0:W[0])==null?void 0:X.parent;J&&Gr(J)&&ma(J.right)&&ut(J.right.properties,d$)||e.delete(t,w.valueDeclaration.parent);return}C(w,void 0,S)}),S;function T(w,D){return co(w)?bn(w)&&d$(w)?!0:ks(D):qi(w.properties,O=>!!(mc(O)||uI(O)||Hc(O)&&ro(O.initializer)&&O.name||d$(O)))}function C(w,D,O){if(!(w.flags&8192)&&!(w.flags&4096))return;const z=w.valueDeclaration,W=z.parent,X=W.right;if(!T(z,X)||ut(O,ae=>{const _e=as(ae);return!!(_e&&Ie(_e)&&an(_e)===pc(w))}))return;const J=W.parent&&W.parent.kind===244?W.parent:W;if(e.delete(t,J),!X){O.push(I.createPropertyDeclaration(D,w.name,void 0,void 0,void 0));return}if(co(z)&&(ro(X)||go(X))){const ae=vf(t,s),_e=vUe(z,o,ae);_e&&ie(O,X,_e);return}else if(ma(X)){Zt(X.properties,ae=>{(mc(ae)||uI(ae))&&O.push(ae),Hc(ae)&&ro(ae.initializer)&&ie(O,ae.initializer,ae.name),d$(ae)});return}else{if(Iu(t)||!bn(z))return;const ae=I.createPropertyDeclaration(D,z.name,void 0,void 0,X);QC(W.parent,ae,t),O.push(ae);return}function ie(ae,_e,$){return ro(_e)?B(ae,_e,$):Y(ae,_e,$)}function B(ae,_e,$){const H=Xi(D,p$(_e,134)),K=I.createMethodDeclaration(H,void 0,$,void 0,void 0,_e.parameters,void 0,_e.body);QC(W,K,t),ae.push(K)}function Y(ae,_e,$){const H=_e.body;let K;H.kind===241?K=H:K=I.createBlock([I.createReturnStatement(H)]);const oe=Xi(D,p$(_e,134)),Se=I.createMethodDeclaration(oe,void 0,$,void 0,void 0,_e.parameters,void 0,K);QC(W,Se,t),ae.push(Se)}}}function g(y){const S=y.initializer;if(!S||!ro(S)||!Ie(y.name))return;const T=f(y.symbol);S.body&&T.unshift(I.createConstructorDeclaration(void 0,S.parameters,S.body));const C=p$(y.parent.parent,95);return I.createClassDeclaration(C,y.name,void 0,void 0,T)}function p(y){const S=f(c);y.body&&S.unshift(I.createConstructorDeclaration(void 0,y.parameters,y.body));const T=p$(y,95);return I.createClassDeclaration(T,y.name,void 0,void 0,S)}}function p$(e,t){return Wp(e)?wn(e.modifiers,r=>r.kind===t):void 0}function d$(e){return e.name?!!(Ie(e.name)&&e.name.text==="constructor"):!1}function vUe(e,t,r){if(bn(e))return e.name;const i=e.argumentExpression;if(A_(i))return i;if(Ja(i))return lf(i.text,Da(t))?I.createIdentifier(i.text):PT(i)?I.createStringLiteral(i.text,r===0):i}var m$,vle,bUe=Nt({"src/services/codefixes/convertFunctionToEs6Class.ts"(){"use strict";zn(),na(),m$="convertFunctionToEs6Class",vle=[d.This_constructor_function_may_be_converted_to_a_class_declaration.code],Zs({errorCodes:vle,getCodeActions(e){const t=Qr.ChangeTracker.with(e,r=>Nke(r,e.sourceFile,e.span.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions()));return[Bs(m$,t,d.Convert_function_to_an_ES2015_class,m$,d.Convert_all_constructor_functions_to_classes)]},fixIds:[m$],getAllCodeActions:e=>$a(e,vle,(t,r)=>Nke(t,r.file,r.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions()))})}});function Ike(e,t,r,i){const s=Ji(t,r);let o;if(Ie(s)&&Ei(s.parent)&&s.parent.initializer&&po(s.parent.initializer)?o=s.parent.initializer:o=Jn(uf(Ji(t,r)),_G),!o)return;const c=new Map,u=Hr(o),f=TUe(o,i),g=xUe(o,i,c);if(!lG(g,i))return;const p=g.body&&Ss(g.body)?SUe(g.body,i):ze,y={checker:i,synthNamesMap:c,setOfExpressionsToReturn:f,isInJSFile:u};if(!p.length)return;const S=la(t.text,Id(o).pos);e.insertModifierAt(t,S,134,{suffix:" "});for(const T of p)if(ds(T,function C(w){if(Rs(w)){const D=s6(w,w,y,!1);if(sx())return!0;e.replaceNodeWithNodes(t,T,D)}else if(!ks(w)&&(ds(w,C),sx()))return!0}),sx())return}function SUe(e,t){const r=[];return Ev(e,i=>{CL(i,t)&&r.push(i)}),r}function TUe(e,t){if(!e.body)return new Set;const r=new Set;return ds(e.body,function i(s){QA(s,t,"then")?(r.add(Oa(s)),Zt(s.arguments,i)):QA(s,t,"catch")||QA(s,t,"finally")?(r.add(Oa(s)),ds(s,i)):Oke(s,t)?r.add(Oa(s)):ds(s,i)}),r}function QA(e,t,r){if(!Rs(e))return!1;const s=lA(e,r)&&t.getTypeAtLocation(e);return!!(s&&t.getPromisedTypeOfPromise(s))}function Fke(e,t){return(Pn(e)&4)!==0&&e.target===t}function g$(e,t,r){if(e.expression.name.escapedText==="finally")return;const i=r.getTypeAtLocation(e.expression.expression);if(Fke(i,r.getPromiseType())||Fke(i,r.getPromiseLikeType()))if(e.expression.name.escapedText==="then"){if(t===Ah(e.arguments,0))return Ah(e.typeArguments,0);if(t===Ah(e.arguments,1))return Ah(e.typeArguments,1)}else return Ah(e.typeArguments,0)}function Oke(e,t){return ct(e)?!!t.getPromisedTypeOfPromise(t.getTypeAtLocation(e)):!1}function xUe(e,t,r){const i=new Map,s=of();return ds(e,function o(c){if(!Ie(c)){ds(c,o);return}const u=t.getSymbolAtLocation(c);if(u){const f=t.getTypeAtLocation(c),g=Jke(f,t),p=Xs(u).toString();if(g&&!us(c.parent)&&!po(c.parent)&&!r.has(p)){const y=bl(g.parameters),S=y?.valueDeclaration&&us(y.valueDeclaration)&&Jn(y.valueDeclaration.name,Ie)||I.createUniqueName("result",16),T=Lke(S,s);r.set(p,T),s.add(S.text,u)}else if(c.parent&&(us(c.parent)||Ei(c.parent)||Pa(c.parent))){const y=c.text,S=s.get(y);if(S&&S.some(T=>T!==u)){const T=Lke(c,s);i.set(p,T.identifier),r.set(p,T),s.add(y,u)}else{const T=wo(c);r.set(p,B3(T)),s.add(y,u)}}}}),kA(e,!0,o=>{if(Pa(o)&&Ie(o.name)&&jp(o.parent)){const c=t.getSymbolAtLocation(o.name),u=c&&i.get(String(Xs(c)));if(u&&u.text!==(o.name||o.propertyName).getText())return I.createBindingElement(o.dotDotDotToken,o.propertyName||o.name,u,o.initializer)}else if(Ie(o)){const c=t.getSymbolAtLocation(o),u=c&&i.get(String(Xs(c)));if(u)return I.createIdentifier(u.text)}})}function Lke(e,t){const r=(t.get(e.text)||ze).length,i=r===0?e:I.createIdentifier(e.text+"_"+r);return B3(i)}function sx(){return!YL}function E1(){return YL=!1,ze}function s6(e,t,r,i,s){if(QA(t,r.checker,"then"))return EUe(t,Ah(t.arguments,0),Ah(t.arguments,1),r,i,s);if(QA(t,r.checker,"catch"))return jke(t,Ah(t.arguments,0),r,i,s);if(QA(t,r.checker,"finally"))return CUe(t,Ah(t.arguments,0),r,i,s);if(bn(t))return s6(e,t.expression,r,i,s);const o=r.checker.getTypeAtLocation(t);return o&&r.checker.getPromisedTypeOfPromise(o)?(E.assertNode(Zo(t).parent,bn),DUe(e,t,r,i,s)):E1()}function h$({checker:e},t){if(t.kind===106)return!0;if(Ie(t)&&!Eo(t)&&an(t)==="undefined"){const r=e.getSymbolAtLocation(t);return!r||e.isUndefinedSymbol(r)}return!1}function kUe(e){const t=I.createUniqueName(e.identifier.text,16);return B3(t)}function Mke(e,t,r){let i;return r&&!ZA(e,t)&&(YA(r)?(i=r,t.synthNamesMap.forEach((s,o)=>{if(s.identifier.text===r.identifier.text){const c=kUe(r);t.synthNamesMap.set(o,c)}})):i=B3(I.createUniqueName("result",16),r.types),xle(i)),i}function Rke(e,t,r,i,s){const o=[];let c;if(i&&!ZA(e,t)){c=wo(xle(i));const u=i.types,f=t.checker.getUnionType(u,2),g=t.isInJSFile?void 0:t.checker.typeToTypeNode(f,void 0,void 0),p=[I.createVariableDeclaration(c,void 0,g)],y=I.createVariableStatement(void 0,I.createVariableDeclarationList(p,1));o.push(y)}return o.push(r),s&&c&&AUe(s)&&o.push(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(wo(Vke(s)),void 0,void 0,c)],2))),o}function CUe(e,t,r,i,s){if(!t||h$(r,t))return s6(e,e.expression.expression,r,i,s);const o=Mke(e,r,s),c=s6(e,e.expression.expression,r,!0,o);if(sx())return E1();const u=Sle(t,i,void 0,void 0,e,r);if(sx())return E1();const f=I.createBlock(c),g=I.createBlock(u),p=I.createTryStatement(f,void 0,g);return Rke(e,r,p,o,s)}function jke(e,t,r,i,s){if(!t||h$(r,t))return s6(e,e.expression.expression,r,i,s);const o=Wke(t,r),c=Mke(e,r,s),u=s6(e,e.expression.expression,r,!0,c);if(sx())return E1();const f=Sle(t,i,c,o,e,r);if(sx())return E1();const g=I.createBlock(u),p=I.createCatchClause(o&&wo(QL(o)),I.createBlock(f)),y=I.createTryStatement(g,p,void 0);return Rke(e,r,y,c,s)}function EUe(e,t,r,i,s,o){if(!t||h$(i,t))return jke(e,r,i,s,o);if(r&&!h$(i,r))return E1();const c=Wke(t,i),u=s6(e.expression.expression,e.expression.expression,i,!0,c);if(sx())return E1();const f=Sle(t,s,o,c,e,i);return sx()?E1():Xi(u,f)}function DUe(e,t,r,i,s){if(ZA(e,r)){let o=wo(t);return i&&(o=I.createAwaitExpression(o)),[I.createReturnStatement(o)]}return y$(s,I.createAwaitExpression(t),void 0)}function y$(e,t,r){return!e||Uke(e)?[I.createExpressionStatement(t)]:YA(e)&&e.hasBeenDeclared?[I.createExpressionStatement(I.createAssignment(wo(Tle(e)),t))]:[I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(wo(QL(e)),void 0,r,t)],2))]}function ble(e,t){if(t&&e){const r=I.createUniqueName("result",16);return[...y$(B3(r),e,t),I.createReturnStatement(r)]}return[I.createReturnStatement(e)]}function Sle(e,t,r,i,s,o){var c;switch(e.kind){case 106:break;case 211:case 80:if(!i)break;const u=I.createCallExpression(wo(e),void 0,YA(i)?[Tle(i)]:[]);if(ZA(s,o))return ble(u,g$(s,e,o.checker));const f=o.checker.getTypeAtLocation(e),g=o.checker.getSignaturesOfType(f,0);if(!g.length)return E1();const p=g[0].getReturnType(),y=y$(r,I.createAwaitExpression(u),g$(s,e,o.checker));return r&&r.types.push(o.checker.getAwaitedType(p)||p),y;case 218:case 219:{const S=e.body,T=(c=Jke(o.checker.getTypeAtLocation(e),o.checker))==null?void 0:c.getReturnType();if(Ss(S)){let C=[],w=!1;for(const D of S.statements)if(Bp(D))if(w=!0,CL(D,o.checker))C=C.concat(zke(o,D,t,r));else{const O=T&&D.expression?Bke(o.checker,T,D.expression):D.expression;C.push(...ble(O,g$(s,e,o.checker)))}else{if(t&&Ev(D,zg))return E1();C.push(D)}return ZA(s,o)?C.map(D=>wo(D)):PUe(C,r,o,w)}else{const C=uG(S,o.checker)?zke(o,I.createReturnStatement(S),t,r):ze;if(C.length>0)return C;if(T){const w=Bke(o.checker,T,S);if(ZA(s,o))return ble(w,g$(s,e,o.checker));{const D=y$(r,w,void 0);return r&&r.types.push(o.checker.getAwaitedType(T)||T),D}}else return E1()}}default:return E1()}return ze}function Bke(e,t,r){const i=wo(r);return e.getPromisedTypeOfPromise(t)?I.createAwaitExpression(i):i}function Jke(e,t){const r=t.getSignaturesOfType(e,0);return Mo(r)}function PUe(e,t,r,i){const s=[];for(const o of e)if(Bp(o)){if(o.expression){const c=Oke(o.expression,r.checker)?I.createAwaitExpression(o.expression):o.expression;t===void 0?s.push(I.createExpressionStatement(c)):YA(t)&&t.hasBeenDeclared?s.push(I.createExpressionStatement(I.createAssignment(Tle(t),c))):s.push(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(QL(t),void 0,void 0,c)],2)))}}else s.push(wo(o));return!i&&t!==void 0&&s.push(I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(QL(t),void 0,void 0,I.createIdentifier("undefined"))],2))),s}function zke(e,t,r,i){let s=[];return ds(t,function o(c){if(Rs(c)){const u=s6(c,c,e,r,i);if(s=s.concat(u),s.length>0)return}else ks(c)||ds(c,o)}),s}function Wke(e,t){const r=[];let i;if(po(e)){if(e.parameters.length>0){const f=e.parameters[0].name;i=s(f)}}else Ie(e)?i=o(e):bn(e)&&Ie(e.name)&&(i=o(e.name));if(!i||"identifier"in i&&i.identifier.text==="undefined")return;return i;function s(f){if(Ie(f))return o(f);const g=ta(f.elements,p=>dl(p)?[]:[s(p.name)]);return wUe(f,g)}function o(f){const g=u(f),p=c(g);return p&&t.synthNamesMap.get(Xs(p).toString())||B3(f,r)}function c(f){var g;return((g=Jn(f,Ed))==null?void 0:g.symbol)??t.checker.getSymbolAtLocation(f)}function u(f){return f.original?f.original:f}}function Uke(e){return e?YA(e)?!e.identifier.text:qi(e.elements,Uke):!0}function B3(e,t=[]){return{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function wUe(e,t=ze,r=[]){return{kind:1,bindingPattern:e,elements:t,types:r}}function Tle(e){return e.hasBeenReferenced=!0,e.identifier}function QL(e){return YA(e)?xle(e):Vke(e)}function Vke(e){for(const t of e.elements)QL(t);return e.bindingPattern}function xle(e){return e.hasBeenDeclared=!0,e.identifier}function YA(e){return e.kind===0}function AUe(e){return e.kind===1}function ZA(e,t){return!!e.original&&t.setOfExpressionsToReturn.has(Oa(e.original))}var v$,kle,YL,NUe=Nt({"src/services/codefixes/convertToAsyncFunction.ts"(){"use strict";zn(),na(),v$="convertToAsyncFunction",kle=[d.This_may_be_converted_to_an_async_function.code],YL=!0,Zs({errorCodes:kle,getCodeActions(e){YL=!0;const t=Qr.ChangeTracker.with(e,r=>Ike(r,e.sourceFile,e.span.start,e.program.getTypeChecker()));return YL?[Bs(v$,t,d.Convert_to_async_function,v$,d.Convert_all_to_async_functions)]:[]},fixIds:[v$],getAllCodeActions:e=>$a(e,kle,(t,r)=>Ike(t,r.file,r.start,e.program.getTypeChecker()))})}});function IUe(e,t,r,i,s){var o;for(const c of e.imports){const u=(o=r.getResolvedModule(e,c.text,ld(e,c)))==null?void 0:o.resolvedModule;if(!u||u.resolvedFileName!==t.fileName)continue;const f=G4(c);switch(f.kind){case 271:i.replaceNode(e,f,Yh(f.name,void 0,c,s));break;case 213:g_(f,!1)&&i.replaceNode(e,f,I.createPropertyAccessExpression(wo(f),"default"));break}}}function FUe(e,t,r,i,s){const o={original:HUe(e),additional:new Set},c=OUe(e,t,o);LUe(e,c,r);let u=!1,f;for(const g of wn(e.statements,ec)){const p=Hke(e,g,r,t,o,i,s);p&&EI(p,f??(f=new Map))}for(const g of wn(e.statements,p=>!ec(p))){const p=MUe(e,g,t,r,o,i,c,f,s);u=u||p}return f?.forEach((g,p)=>{r.replaceNode(e,p,g)}),u}function OUe(e,t,r){const i=new Map;return qke(e,s=>{const{text:o}=s.name;!i.has(o)&&(o5(s.name)||t.resolveName(o,s,111551,!0))&&i.set(o,b$(`_${o}`,r))}),i}function LUe(e,t,r){qke(e,(i,s)=>{if(s)return;const{text:o}=i.name;r.replaceNode(e,i,I.createIdentifier(t.get(o)||o))})}function qke(e,t){e.forEachChild(function r(i){if(bn(i)&&Yv(e,i.expression)&&Ie(i.name)){const{parent:s}=i;t(i,Gr(s)&&s.left===i&&s.operatorToken.kind===64)}i.forEachChild(r)})}function MUe(e,t,r,i,s,o,c,u,f){switch(t.kind){case 243:return Hke(e,t,i,r,s,o,f),!1;case 244:{const{expression:g}=t;switch(g.kind){case 213:return g_(g,!0)&&i.replaceNode(e,t,Yh(void 0,void 0,g.arguments[0],f)),!1;case 226:{const{operatorToken:p}=g;return p.kind===64&&jUe(e,r,g,i,c,u)}}}default:return!1}}function Hke(e,t,r,i,s,o,c){const{declarationList:u}=t;let f=!1;const g=Yt(u.declarations,p=>{const{name:y,initializer:S}=p;if(S){if(Yv(e,S))return f=!0,J3([]);if(g_(S,!0))return f=!0,VUe(y,S.arguments[0],i,s,o,c);if(bn(S)&&g_(S.expression,!0))return f=!0,RUe(y,S.name.text,S.expression.arguments[0],s,c)}return J3([I.createVariableStatement(void 0,I.createVariableDeclarationList([p],u.flags))])});if(f){r.replaceNodeWithNodes(e,t,ta(g,y=>y.newImports));let p;return Zt(g,y=>{y.useSitesToUnqualify&&EI(y.useSitesToUnqualify,p??(p=new Map))}),p}}function RUe(e,t,r,i,s){switch(e.kind){case 206:case 207:{const o=b$(t,i);return J3([Qke(o,t,r,s),S$(void 0,e,I.createIdentifier(o))])}case 80:return J3([Qke(e.text,t,r,s)]);default:return E.assertNever(e,`Convert to ES module got invalid syntax form ${e.kind}`)}}function jUe(e,t,r,i,s,o){const{left:c,right:u}=r;if(!bn(c))return!1;if(Yv(e,c))if(Yv(e,u))i.delete(e,r.parent);else{const f=ma(u)?BUe(u,o):g_(u,!0)?zUe(u.arguments[0],t):void 0;return f?(i.replaceNodeWithNodes(e,r.parent,f[0]),f[1]):(i.replaceRangeWithText(e,Lf(c.getStart(e),u.pos),"export default"),!0)}else Yv(e,c.expression)&&JUe(e,r,i,s);return!1}function BUe(e,t){const r=_j(e.properties,i=>{switch(i.kind){case 177:case 178:case 304:case 305:return;case 303:return Ie(i.name)?UUe(i.name.text,i.initializer,t):void 0;case 174:return Ie(i.name)?Xke(i.name.text,[I.createToken(95)],i,t):void 0;default:E.assertNever(i,`Convert to ES6 got invalid prop kind ${i.kind}`)}});return r&&[r,!1]}function JUe(e,t,r,i){const{text:s}=t.left.name,o=i.get(s);if(o!==void 0){const c=[S$(void 0,o,t.right),Dle([I.createExportSpecifier(!1,o,s)])];r.replaceNodeWithNodes(e,t.parent,c)}else WUe(t,e,r)}function zUe(e,t){const r=e.text,i=t.getSymbolAtLocation(e),s=i?i.exports:F7;return s.has("export=")?[[Cle(r)],!0]:s.has("default")?s.size>1?[[Gke(r),Cle(r)],!0]:[[Cle(r)],!0]:[[Gke(r)],!1]}function Gke(e){return Dle(void 0,e)}function Cle(e){return Dle([I.createExportSpecifier(!1,void 0,"default")],e)}function WUe({left:e,right:t,parent:r},i,s){const o=e.name.text;if((ro(t)||go(t)||Nl(t))&&(!t.name||t.name.text===o)){s.replaceRange(i,{pos:e.getStart(i),end:t.getStart(i)},I.createToken(95),{suffix:" "}),t.name||s.insertName(i,t,o);const c=Ua(r,27,i);c&&s.delete(i,c)}else s.replaceNodeRangeWithNodes(i,e.expression,Ua(e,25,i),[I.createToken(95),I.createToken(87)],{joiner:" ",suffix:" "})}function UUe(e,t,r){const i=[I.createToken(95)];switch(t.kind){case 218:{const{name:o}=t;if(o&&o.text!==e)return s()}case 219:return Xke(e,i,t,r);case 231:return $Ue(e,i,t,r);default:return s()}function s(){return S$(i,I.createIdentifier(e),Ele(t,r))}}function Ele(e,t){if(!t||!ut(fs(t.keys()),i=>yf(e,i)))return e;return es(e)?IH(e,!0,r):kA(e,!0,r);function r(i){if(i.kind===211){const s=t.get(i);return t.delete(i),s}}}function VUe(e,t,r,i,s,o){switch(e.kind){case 206:{const c=_j(e.elements,u=>u.dotDotDotToken||u.initializer||u.propertyName&&!Ie(u.propertyName)||!Ie(u.name)?void 0:Yke(u.propertyName&&u.propertyName.text,u.name.text));if(c)return J3([Yh(void 0,c,t,o)])}case 207:{const c=b$(Jle(t.text,s),i);return J3([Yh(I.createIdentifier(c),void 0,t,o),S$(void 0,wo(e),I.createIdentifier(c))])}case 80:return qUe(e,t,r,i,o);default:return E.assertNever(e,`Convert to ES module got invalid name kind ${e.kind}`)}}function qUe(e,t,r,i,s){const o=r.getSymbolAtLocation(e),c=new Map;let u=!1,f;for(const p of i.original.get(e.text)){if(r.getSymbolAtLocation(p)!==o||p===e)continue;const{parent:y}=p;if(bn(y)){const{name:{text:S}}=y;if(S==="default"){u=!0;const T=p.getText();(f??(f=new Map)).set(y,I.createIdentifier(T))}else{E.assert(y.expression===p,"Didn't expect expression === use");let T=c.get(S);T===void 0&&(T=b$(S,i),c.set(S,T)),(f??(f=new Map)).set(y,I.createIdentifier(T))}}else u=!0}const g=c.size===0?void 0:fs(c4(c.entries(),([p,y])=>I.createImportSpecifier(!1,p===y?void 0:I.createIdentifier(p),I.createIdentifier(y))));return g||(u=!0),J3([Yh(u?wo(e):void 0,g,t,s)],f)}function b$(e,t){for(;t.original.has(e)||t.additional.has(e);)e=`_${e}`;return t.additional.add(e),e}function HUe(e){const t=of();return $ke(e,r=>t.add(r.text,r)),t}function $ke(e,t){Ie(e)&&GUe(e)&&t(e),e.forEachChild(r=>$ke(r,t))}function GUe(e){const{parent:t}=e;switch(t.kind){case 211:return t.name!==e;case 208:return t.propertyName!==e;case 276:return t.propertyName!==e;default:return!0}}function Xke(e,t,r,i){return I.createFunctionDeclaration(Xi(t,s2(r.modifiers)),wo(r.asteriskToken),e,s2(r.typeParameters),s2(r.parameters),wo(r.type),I.converters.convertToFunctionBlock(Ele(r.body,i)))}function $Ue(e,t,r,i){return I.createClassDeclaration(Xi(t,s2(r.modifiers)),e,s2(r.typeParameters),s2(r.heritageClauses),Ele(r.members,i))}function Qke(e,t,r,i){return t==="default"?Yh(I.createIdentifier(e),void 0,r,i):Yh(void 0,[Yke(t,e)],r,i)}function Yke(e,t){return I.createImportSpecifier(!1,e!==void 0&&e!==t?I.createIdentifier(e):void 0,I.createIdentifier(t))}function S$(e,t,r){return I.createVariableStatement(e,I.createVariableDeclarationList([I.createVariableDeclaration(t,void 0,void 0,r)],2))}function Dle(e,t){return I.createExportDeclaration(void 0,!1,e&&I.createNamedExports(e),t===void 0?void 0:I.createStringLiteral(t))}function J3(e,t){return{newImports:e,useSitesToUnqualify:t}}var XUe=Nt({"src/services/codefixes/convertToEsModule.ts"(){"use strict";zn(),na(),Zs({errorCodes:[d.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions(e){const{sourceFile:t,program:r,preferences:i}=e,s=Qr.ChangeTracker.with(e,o=>{if(FUe(t,r.getTypeChecker(),o,Da(r.getCompilerOptions()),vf(t,i)))for(const u of r.getSourceFiles())IUe(u,t,r,o,vf(u,i))});return[_d("convertToEsModule",s,d.Convert_to_ES_module)]}})}});function Zke(e,t){const r=Ar(Ji(e,t),h_);return E.assert(!!r,"Expected position to be owned by a qualified name."),Ie(r.left)?r:void 0}function Kke(e,t,r){const i=r.right.text,s=I.createIndexedAccessTypeNode(I.createTypeReferenceNode(r.left,void 0),I.createLiteralTypeNode(I.createStringLiteral(i)));e.replaceNode(t,r,s)}var T$,Ple,QUe=Nt({"src/services/codefixes/correctQualifiedNameToIndexedAccessType.ts"(){"use strict";zn(),na(),T$="correctQualifiedNameToIndexedAccessType",Ple=[d.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code],Zs({errorCodes:Ple,getCodeActions(e){const t=Zke(e.sourceFile,e.span.start);if(!t)return;const r=Qr.ChangeTracker.with(e,s=>Kke(s,e.sourceFile,t)),i=`${t.left.text}["${t.right.text}"]`;return[Bs(T$,r,[d.Rewrite_as_the_indexed_access_type_0,i],T$,d.Rewrite_all_as_indexed_access_types)]},fixIds:[T$],getAllCodeActions:e=>$a(e,Ple,(t,r)=>{const i=Zke(r.file,r.start);i&&Kke(t,r.file,i)})})}});function eCe(e,t){return Jn(Ji(t,e.start).parent,vu)}function tCe(e,t,r){if(!t)return;const i=t.parent,s=i.parent,o=YUe(t,r);if(o.length===i.elements.length)e.insertModifierBefore(r.sourceFile,156,i);else{const c=I.updateExportDeclaration(s,s.modifiers,!1,I.updateNamedExports(i,wn(i.elements,f=>!_s(o,f))),s.moduleSpecifier,void 0),u=I.createExportDeclaration(void 0,!0,I.createNamedExports(o),s.moduleSpecifier,void 0);e.replaceNode(r.sourceFile,s,c,{leadingTriviaOption:Qr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Qr.TrailingTriviaOption.Exclude}),e.insertNodeAfter(r.sourceFile,s,u)}}function YUe(e,t){const r=e.parent;if(r.elements.length===1)return r.elements;const i=Aoe(l_(r),t.program.getSemanticDiagnostics(t.sourceFile,t.cancellationToken));return wn(r.elements,s=>{var o;return s===e||((o=woe(s,i))==null?void 0:o.code)===x$[0]})}var x$,k$,ZUe=Nt({"src/services/codefixes/convertToTypeOnlyExport.ts"(){"use strict";zn(),na(),x$=[d.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code],k$="convertToTypeOnlyExport",Zs({errorCodes:x$,getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>tCe(i,eCe(t.span,t.sourceFile),t));if(r.length)return[Bs(k$,r,d.Convert_to_type_only_export,k$,d.Convert_all_re_exported_types_to_type_only_exports)]},fixIds:[k$],getAllCodeActions:function(t){const r=new Map;return $a(t,x$,(i,s)=>{const o=eCe(s,t.sourceFile);o&&Rp(r,Oa(o.parent.parent))&&tCe(i,o,t)})}})}});function rCe(e,t){const{parent:r}=Ji(e,t);return v_(r)||gl(r)&&r.importClause?r:void 0}function nCe(e,t,r){if(e.parent.parent.name)return!1;const i=e.parent.elements.filter(o=>!o.isTypeOnly);if(i.length===1)return!0;const s=r.getTypeChecker();for(const o of i)if(ho.Core.eachSymbolReferenceInFile(o.name,s,t,u=>!o1(u)))return!1;return!0}function ZL(e,t,r){var i;if(v_(r))e.replaceNode(t,r,I.updateImportSpecifier(r,!0,r.propertyName,r.name));else{const s=r.importClause;if(s.name&&s.namedBindings)e.replaceNodeWithNodes(t,r,[I.createImportDeclaration(s2(r.modifiers,!0),I.createImportClause(!0,wo(s.name,!0),void 0),wo(r.moduleSpecifier,!0),wo(r.attributes,!0)),I.createImportDeclaration(s2(r.modifiers,!0),I.createImportClause(!0,void 0,wo(s.namedBindings,!0)),wo(r.moduleSpecifier,!0),wo(r.attributes,!0))]);else{const o=((i=s.namedBindings)==null?void 0:i.kind)===275?I.updateNamedImports(s.namedBindings,Yc(s.namedBindings.elements,u=>I.updateImportSpecifier(u,!1,u.propertyName,u.name))):s.namedBindings,c=I.updateImportDeclaration(r,r.modifiers,I.updateImportClause(s,!0,s.name,o),r.moduleSpecifier,r.attributes);e.replaceNode(t,r,c)}}}var wle,KL,KUe=Nt({"src/services/codefixes/convertToTypeOnlyImport.ts"(){"use strict";zn(),na(),wle=[d.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code,d._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code],KL="convertToTypeOnlyImport",Zs({errorCodes:wle,getCodeActions:function(t){var r;const i=rCe(t.sourceFile,t.span.start);if(i){const s=Qr.ChangeTracker.with(t,u=>ZL(u,t.sourceFile,i)),o=i.kind===276&&nCe(i,t.sourceFile,t.program)?Qr.ChangeTracker.with(t,u=>ZL(u,t.sourceFile,i.parent.parent.parent)):void 0,c=Bs(KL,s,i.kind===276?[d.Use_type_0,((r=i.propertyName)==null?void 0:r.text)??i.name.text]:d.Use_import_type,KL,d.Fix_all_with_type_only_imports);return ut(o)?[_d(KL,o,d.Use_import_type),c]:[c]}},fixIds:[KL],getAllCodeActions:function(t){const r=new Set;return $a(t,wle,(i,s)=>{const o=rCe(s.file,s.start);o?.kind===272&&!r.has(o)?(ZL(i,s.file,o),r.add(o)):o?.kind===276&&!r.has(o.parent.parent.parent)&&nCe(o,s.file,t.program)?(ZL(i,s.file,o.parent.parent.parent),r.add(o.parent.parent.parent)):o?.kind===276&&ZL(i,s.file,o)})}})}});function iCe(e,t,r,i,s=!1){if(!bC(t))return;const o=tVe(t);if(!o)return;const c=t.parent,{leftSibling:u,rightSibling:f}=eVe(t);let g=c.getStart(),p="";!u&&c.comment&&(g=sCe(c,c.getStart(),t.getStart()),p=`${i} */${i}`),u&&(s&&bC(u)?(g=t.getStart(),p=""):(g=sCe(c,u.getStart(),t.getStart()),p=`${i} */${i}`));let y=c.getEnd(),S="";f&&(s&&bC(f)?(y=f.getStart(),S=`${i}${i}`):(y=f.getStart(),S=`${i}/**${i} * `)),e.replaceRange(r,{pos:g,end:y},o,{prefix:p,suffix:S})}function eVe(e){const t=e.parent,r=t.getChildCount()-1,i=t.getChildren().findIndex(c=>c.getStart()===e.getStart()&&c.getEnd()===e.getEnd()),s=i>0?t.getChildAt(i-1):void 0,o=i0;s--)if(!/[*/\s]/g.test(i.substring(s-1,s)))return t+s;return r}function tVe(e){var t;const{typeExpression:r}=e;if(!r)return;const i=(t=e.name)==null?void 0:t.getText();if(i){if(r.kind===329)return rVe(i,r);if(r.kind===316)return nVe(i,r)}}function rVe(e,t){const r=aCe(t);if(ut(r))return I.createInterfaceDeclaration(void 0,e,void 0,void 0,r)}function nVe(e,t){const r=wo(t.type);if(r)return I.createTypeAliasDeclaration(void 0,I.createIdentifier(e),void 0,r)}function aCe(e){const t=e.jsDocPropertyTags;return ut(t)?Ii(t,i=>{var s;const o=iVe(i),c=(s=i.typeExpression)==null?void 0:s.type,u=i.isBracketed;let f;if(c&&JT(c)){const g=aCe(c);f=I.createTypeLiteralNode(g)}else c&&(f=wo(c));if(f&&o){const g=u?I.createToken(58):void 0;return I.createPropertySignature(void 0,o,g,f)}}):void 0}function iVe(e){return e.name.kind===80?e.name.text:e.name.right.text}function sVe(e){return q_(e)?ta(e.jsDoc,t=>{var r;return(r=t.tags)==null?void 0:r.filter(i=>bC(i))}):[]}var C$,Ale,aVe=Nt({"src/services/codefixes/convertTypedefToType.ts"(){"use strict";zn(),na(),C$="convertTypedefToType",Ale=[d.JSDoc_typedef_may_be_converted_to_TypeScript_type.code],Zs({fixIds:[C$],errorCodes:Ale,getCodeActions(e){const t=Zh(e.host,e.formatContext.options),r=Ji(e.sourceFile,e.span.start);if(!r)return;const i=Qr.ChangeTracker.with(e,s=>iCe(s,r,e.sourceFile,t));if(i.length>0)return[Bs(C$,i,d.Convert_typedef_to_TypeScript_type,C$,d.Convert_all_typedef_to_TypeScript_types)]},getAllCodeActions:e=>$a(e,Ale,(t,r)=>{const i=Zh(e.host,e.formatContext.options),s=Ji(r.file,r.start);s&&iCe(t,s,r.file,i,!0)})})}});function oCe(e,t){const r=Ji(e,t);if(Ie(r)){const i=Ms(r.parent.parent,ff),s=r.getText(e);return{container:Ms(i.parent,X_),typeNode:i.type,constraint:s,name:s==="K"?"P":"K"}}}function cCe(e,t,{container:r,typeNode:i,constraint:s,name:o}){e.replaceNode(t,r,I.createMappedTypeNode(void 0,I.createTypeParameterDeclaration(void 0,o,I.createTypeReferenceNode(s)),void 0,void 0,i,void 0))}var E$,Nle,oVe=Nt({"src/services/codefixes/convertLiteralTypeToMappedType.ts"(){"use strict";zn(),na(),E$="convertLiteralTypeToMappedType",Nle=[d._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code],Zs({errorCodes:Nle,getCodeActions:function(t){const{sourceFile:r,span:i}=t,s=oCe(r,i.start);if(!s)return;const{name:o,constraint:c}=s,u=Qr.ChangeTracker.with(t,f=>cCe(f,r,s));return[Bs(E$,u,[d.Convert_0_to_1_in_0,c,o],E$,d.Convert_all_type_literals_to_mapped_type)]},fixIds:[E$],getAllCodeActions:e=>$a(e,Nle,(t,r)=>{const i=oCe(r.file,r.start);i&&cCe(t,r.file,i)})})}});function lCe(e,t){return E.checkDefined(wl(Ji(e,t)),"There should be a containing class")}function uCe(e){return!e.valueDeclaration||!(Fu(e.valueDeclaration)&2)}function _Ce(e,t,r,i,s,o){const c=e.program.getTypeChecker(),u=cVe(i,c),f=c.getTypeAtLocation(t),p=c.getPropertiesOfType(f).filter(w7(uCe,D=>!u.has(D.escapedName))),y=c.getTypeAtLocation(i),S=kn(i.members,D=>gc(D));y.getNumberIndexType()||C(f,1),y.getStringIndexType()||C(f,0);const T=ax(r,e.program,o,e.host);jue(i,p,r,e,o,T,D=>w(r,i,D)),T.writeFixes(s);function C(D,O){const z=c.getIndexInfoOfType(D,O);z&&w(r,i,c.indexInfoToIndexSignatureDeclaration(z,i,void 0,a6(e)))}function w(D,O,z){S?s.insertNodeAfter(D,S,z):s.insertMemberAtStart(D,O,z)}}function cVe(e,t){const r=Pd(e);if(!r)return zs();const i=t.getTypeAtLocation(r),s=t.getPropertiesOfType(i);return zs(s.filter(uCe))}var Ile,D$,lVe=Nt({"src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts"(){"use strict";zn(),na(),Ile=[d.Class_0_incorrectly_implements_interface_1.code,d.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code],D$="fixClassIncorrectlyImplementsInterface",Zs({errorCodes:Ile,getCodeActions(e){const{sourceFile:t,span:r}=e,i=lCe(t,r.start);return Ii(Wk(i),s=>{const o=Qr.ChangeTracker.with(e,c=>_Ce(e,s,t,i,c,e.preferences));return o.length===0?void 0:Bs(D$,o,[d.Implement_interface_0,s.getText(t)],D$,d.Implement_all_unimplemented_interfaces)})},fixIds:[D$],getAllCodeActions(e){const t=new Map;return $a(e,Ile,(r,i)=>{const s=lCe(i.file,i.start);if(Rp(t,Oa(s)))for(const o of Wk(s))_Ce(e,o,i.file,s,r,e.preferences)})}})}});function ax(e,t,r,i,s){return fCe(e,t,!1,r,i,s)}function fCe(e,t,r,i,s,o){const c=t.getCompilerOptions(),u=[],f=[],g=new Map,p=new Map;return{addImportFromDiagnostic:y,addImportFromExportedSymbol:S,writeFixes:C,hasFixes:w};function y(D,O){const z=yCe(O,D.code,D.start,r);!z||!z.length||T(ba(z))}function S(D,O){const z=E.checkDefined(D.parent),W=dL(D,Da(c)),X=t.getTypeChecker(),J=X.getMergedSymbol(yu(D,X)),ie=mCe(e,J,W,z,!1,t,s,i,o),B=w$(e,t),Y=pCe(e,E.checkDefined(ie),t,void 0,!!O,B,s,i);Y&&T({fix:Y,symbolName:W,errorIdentifierText:void 0})}function T(D){var O,z;const{fix:W,symbolName:X}=D;switch(W.kind){case 0:u.push(W);break;case 1:f.push(W);break;case 2:{const{importClauseOrBindingPattern:Y,importKind:ae,addAsTypeOnly:_e}=W,$=String(Oa(Y));let H=g.get($);if(H||g.set($,H={importClauseOrBindingPattern:Y,defaultImport:void 0,namedImports:new Map}),ae===0){const K=H?.namedImports.get(X);H.namedImports.set(X,J(K,_e))}else E.assert(H.defaultImport===void 0||H.defaultImport.name===X,"(Add to Existing) Default import should be missing or match symbolName"),H.defaultImport={name:X,addAsTypeOnly:J((O=H.defaultImport)==null?void 0:O.addAsTypeOnly,_e)};break}case 3:{const{moduleSpecifier:Y,importKind:ae,useRequire:_e,addAsTypeOnly:$}=W,H=ie(Y,ae,_e,$);switch(E.assert(H.useRequire===_e,"(Add new) Tried to add an `import` and a `require` for the same module"),ae){case 1:E.assert(H.defaultImport===void 0||H.defaultImport.name===X,"(Add new) Default import should be missing or match symbolName"),H.defaultImport={name:X,addAsTypeOnly:J((z=H.defaultImport)==null?void 0:z.addAsTypeOnly,$)};break;case 0:const K=(H.namedImports||(H.namedImports=new Map)).get(X);H.namedImports.set(X,J(K,$));break;case 3:case 2:E.assert(H.namespaceLikeImport===void 0||H.namespaceLikeImport.name===X,"Namespacelike import shoudl be missing or match symbolName"),H.namespaceLikeImport={importKind:ae,name:X,addAsTypeOnly:$};break}break}case 4:break;default:E.assertNever(W,`fix wasn't never - got kind ${W.kind}`)}function J(Y,ae){return Math.max(Y??0,ae)}function ie(Y,ae,_e,$){const H=B(Y,!0),K=B(Y,!1),oe=p.get(H),Se=p.get(K),se={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:_e};return ae===1&&$===2?oe||(p.set(H,se),se):$===1&&(oe||Se)?oe||Se:Se||(p.set(K,se),se)}function B(Y,ae){return`${ae?1:0}|${Y}`}}function C(D,O){let z;e.imports.length===0&&O!==void 0?z=O:z=vf(e,i);for(const X of u)Rle(D,e,X);for(const X of f)CCe(D,e,X,z);g.forEach(({importClauseOrBindingPattern:X,defaultImport:J,namedImports:ie})=>{kCe(D,e,X,J,fs(ie.entries(),([B,Y])=>({addAsTypeOnly:Y,name:B})),i)});let W;p.forEach(({useRequire:X,defaultImport:J,namedImports:ie,namespaceLikeImport:B},Y)=>{const ae=Y.slice(2),$=(X?PCe:DCe)(ae,z,J,ie&&fs(ie.entries(),([H,K])=>({addAsTypeOnly:K,name:H})),B,c,i);W=ik(W,$)}),W&&D3(D,e,W,!0,i)}function w(){return u.length>0||f.length>0||g.size>0||p.size>0}}function uVe(e,t,r,i){const s=O3(e,i,r),o=gCe(t.getTypeChecker(),e,t.getCompilerOptions());return{getModuleSpecifierForBestExportInfo:c};function c(u,f,g,p){const{fixes:y,computedWithoutCacheCount:S}=P$(u,f,g,!1,t,e,r,i,o,p),T=vCe(y,e,t,s,r);return T&&{...T,computedWithoutCacheCount:S}}}function _Ve(e,t,r,i,s,o,c,u,f,g,p,y){let S;r?(S=NA(i,c,u,p,y).get(i.path,r),E.assertIsDefined(S,"Some exportInfo should match the specified exportMapKey")):(S=zB(lp(t.name))?[pVe(e,s,t,u,c)]:mCe(i,e,s,t,o,u,c,p,y),E.assertIsDefined(S,"Some exportInfo should match the specified symbol / moduleSymbol"));const T=w$(i,u),C=o1(Ji(i,g)),w=E.checkDefined(pCe(i,S,u,g,C,T,c,p));return{moduleSpecifier:w.moduleSpecifier,codeAction:dCe(Mle({host:c,formatContext:f,preferences:p},i,s,w,!1,u,p))}}function fVe(e,t,r,i,s,o){const c=r.getCompilerOptions(),u=yj(Lle(e,r.getTypeChecker(),t,c)),f=TCe(e,t,u,r),g=u!==t.text;return f&&dCe(Mle({host:i,formatContext:s,preferences:o},e,u,f,g,r,o))}function pCe(e,t,r,i,s,o,c,u){const f=O3(e,u,c);return vCe(P$(t,i,s,o,r,e,c,u).fixes,e,r,f,c)}function dCe({description:e,changes:t,commands:r}){return{description:e,changes:t,commands:r}}function mCe(e,t,r,i,s,o,c,u,f){const g=hCe(o,c);return NA(e,c,o,u,f).search(e.path,s,p=>p===r,p=>{if(yu(p[0].symbol,g(p[0].isFromPackageJson))===t&&p.some(y=>y.moduleSymbol===i||y.symbol.parent===i))return p})}function pVe(e,t,r,i,s){var o,c;const u=i.getCompilerOptions(),f=p(i.getTypeChecker(),!1);if(f)return f;const g=(c=(o=s.getPackageJsonAutoImportProvider)==null?void 0:o.call(s))==null?void 0:c.getTypeChecker();return E.checkDefined(g&&p(g,!0),"Could not find symbol in specified module for code actions");function p(y,S){const T=SL(r,y,u);if(T&&yu(T.symbol,y)===e)return{symbol:T.symbol,moduleSymbol:r,moduleFileName:void 0,exportKind:T.exportKind,targetFlags:yu(e,y).flags,isFromPackageJson:S};const C=y.tryGetMemberInModuleExportsAndProperties(t,r);if(C&&yu(C,y)===e)return{symbol:C,moduleSymbol:r,moduleFileName:void 0,exportKind:0,targetFlags:yu(e,y).flags,isFromPackageJson:S}}}function P$(e,t,r,i,s,o,c,u,f=gCe(s.getTypeChecker(),o,s.getCompilerOptions()),g){const p=s.getTypeChecker(),y=ta(e,f.getImportsForExportInfo),S=t!==void 0&&dVe(y,t),T=gVe(y,r,p,s.getCompilerOptions());if(T)return{computedWithoutCacheCount:0,fixes:[...S?[S]:ze,T]};const{fixes:C,computedWithoutCacheCount:w=0}=yVe(e,y,s,o,t,r,i,c,u,g);return{computedWithoutCacheCount:w,fixes:[...S?[S]:ze,...C]}}function dVe(e,t){return ic(e,({declaration:r,importKind:i})=>{var s;if(i!==0)return;const o=mVe(r),c=o&&((s=Mk(r))==null?void 0:s.text);if(c)return{kind:0,namespacePrefix:o,usagePosition:t,moduleSpecifier:c}})}function mVe(e){var t,r,i;switch(e.kind){case 260:return(t=Jn(e.name,Ie))==null?void 0:t.text;case 271:return e.name.text;case 272:return(i=Jn((r=e.importClause)==null?void 0:r.namedBindings,K0))==null?void 0:i.name.text;default:return E.assertNever(e)}}function Fle(e,t,r,i,s,o){return e?t&&o.importsNotUsedAsValues===2||Mz(o)&&(!(i&111551)||s.getTypeOnlyAliasDeclaration(r))?2:1:4}function gVe(e,t,r,i){let s;for(const c of e){const u=o(c);if(!u)continue;const f=mI(u.importClauseOrBindingPattern);if(u.addAsTypeOnly!==4&&f||u.addAsTypeOnly===4&&!f)return u;s??(s=u)}return s;function o({declaration:c,importKind:u,symbol:f,targetFlags:g}){if(u===3||u===2||c.kind===271)return;if(c.kind===260)return(u===0||u===1)&&c.name.kind===206?{kind:2,importClauseOrBindingPattern:c.name,importKind:u,moduleSpecifier:c.initializer.arguments[0].text,addAsTypeOnly:4}:void 0;const{importClause:p}=c;if(!p||!Ja(c.moduleSpecifier))return;const{name:y,namedBindings:S}=p;if(p.isTypeOnly&&!(u===0&&S))return;const T=Fle(t,!1,f,g,r,i);if(!(u===1&&(y||T===2&&S))&&!(u===0&&S?.kind===274))return{kind:2,importClauseOrBindingPattern:p,importKind:u,moduleSpecifier:c.moduleSpecifier.text,addAsTypeOnly:T}}}function gCe(e,t,r){let i;for(const s of t.imports){const o=G4(s);if(ZI(o.parent)){const c=e.resolveExternalModuleName(s);c&&(i||(i=of())).add(Xs(c),o.parent)}else if(o.kind===272||o.kind===271){const c=e.getSymbolAtLocation(s);c&&(i||(i=of())).add(Xs(c),o)}}return{getImportsForExportInfo:({moduleSymbol:s,exportKind:o,targetFlags:c,symbol:u})=>{if(!(c&111551)&&Iu(t))return ze;const f=i?.get(Xs(s));if(!f)return ze;const g=Ole(t,o,r);return f.map(p=>({declaration:p,importKind:g,symbol:u,targetFlags:c}))}}}function w$(e,t){if(!Iu(e))return!1;if(e.commonJsModuleIndicator&&!e.externalModuleIndicator)return!0;if(e.externalModuleIndicator&&!e.commonJsModuleIndicator)return!1;const r=t.getCompilerOptions();if(r.configFile)return Ul(r)<5;if(e.impliedNodeFormat===1)return!0;if(e.impliedNodeFormat===99)return!1;for(const i of t.getSourceFiles())if(!(i===e||!Iu(i)||t.isSourceFileFromExternalLibrary(i))){if(i.commonJsModuleIndicator&&!i.externalModuleIndicator)return!0;if(i.externalModuleIndicator&&!i.commonJsModuleIndicator)return!1}return!0}function hCe(e,t){return _m(r=>r?t.getPackageJsonAutoImportProvider().getTypeChecker():e.getTypeChecker())}function hVe(e,t,r,i,s,o,c,u,f){const g=Iu(t),p=e.getCompilerOptions(),y=qb(e,c),S=hCe(e,c),T=Vl(p),C=X9(T),w=f?z=>({moduleSpecifiers:Zv.tryGetModuleSpecifiersFromCache(z,t,y,u),computedWithoutCache:!1}):(z,W)=>Zv.getModuleSpecifiersWithCacheInfo(z,W,p,t,y,u,void 0,!0);let D=0;const O=ta(o,(z,W)=>{const X=S(z.isFromPackageJson),{computedWithoutCache:J,moduleSpecifiers:ie}=w(z.moduleSymbol,X),B=!!(z.targetFlags&111551),Y=Fle(i,!0,z.symbol,z.targetFlags,X,p);return D+=J?1:0,Ii(ie,ae=>{var _e;if(C&&HT(ae))return;if(!B&&g&&r!==void 0)return{kind:1,moduleSpecifier:ae,usagePosition:r,exportInfo:z,isReExport:W>0};const $=Ole(t,z.exportKind,p);let H;if(r!==void 0&&$===3&&z.exportKind===0){const K=X.resolveExternalModuleSymbol(z.moduleSymbol);let oe;K!==z.moduleSymbol&&(oe=(_e=TL(K,X,p))==null?void 0:_e.name),oe||(oe=Ble(z.moduleSymbol,Da(p),!1)),H={namespacePrefix:oe,usagePosition:r}}return{kind:3,moduleSpecifier:ae,importKind:$,useRequire:s,addAsTypeOnly:Y,exportInfo:z,isReExport:W>0,qualification:H}})});return{computedWithoutCacheCount:D,fixes:O}}function yVe(e,t,r,i,s,o,c,u,f,g){const p=ic(t,y=>vVe(y,o,c,r.getTypeChecker(),r.getCompilerOptions()));return p?{fixes:[p]}:hVe(r,i,s,o,c,e,u,f,g)}function vVe({declaration:e,importKind:t,symbol:r,targetFlags:i},s,o,c,u){var f;const g=(f=Mk(e))==null?void 0:f.text;if(g){const p=o?4:Fle(s,!0,r,i,c,u);return{kind:3,moduleSpecifier:g,importKind:t,addAsTypeOnly:p,useRequire:o}}}function yCe(e,t,r,i){const s=Ji(e.sourceFile,r);let o;if(t===d._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code)o=xVe(e,s);else if(Ie(s))if(t===d._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code){const u=yj(Lle(e.sourceFile,e.program.getTypeChecker(),s,e.program.getCompilerOptions())),f=TCe(e.sourceFile,s,u,e.program);return f&&[{fix:f,symbolName:u,errorIdentifierText:s.text}]}else o=EVe(e,s,i);else return;const c=O3(e.sourceFile,e.preferences,e.host);return o&&bVe(o,e.sourceFile,e.program,c,e.host)}function bVe(e,t,r,i,s){const o=c=>fo(c,s.getCurrentDirectory(),jh(s));return qS(e,(c,u)=>pv(!!c.isJsxNamespaceFix,!!u.isJsxNamespaceFix)||xo(c.fix.kind,u.fix.kind)||bCe(c.fix,u.fix,t,r,i.allowsImportingSpecifier,o))}function vCe(e,t,r,i,s){if(ut(e))return e[0].kind===0||e[0].kind===2?e[0]:e.reduce((o,c)=>bCe(c,o,t,r,i.allowsImportingSpecifier,u=>fo(u,s.getCurrentDirectory(),jh(s)))===-1?c:o)}function bCe(e,t,r,i,s,o){return e.kind!==0&&t.kind!==0?pv(s(t.moduleSpecifier),s(e.moduleSpecifier))||TVe(e.moduleSpecifier,t.moduleSpecifier,r,i)||pv(SCe(e,r,i.getCompilerOptions(),o),SCe(t,r,i.getCompilerOptions(),o))||I8(e.moduleSpecifier,t.moduleSpecifier):0}function SCe(e,t,r,i){var s;if(e.isReExport&&((s=e.exportInfo)!=null&&s.moduleFileName)&&Vl(r)===2&&SVe(e.exportInfo.moduleFileName)){const o=i(qn(e.exportInfo.moduleFileName));return Qi(t.path,o)}return!1}function SVe(e){return Pc(e,[".js",".jsx",".d.ts",".ts",".tsx"],!0)==="index"}function TVe(e,t,r,i){return Qi(e,"node:")&&!Qi(t,"node:")?gL(r,i)?-1:1:Qi(t,"node:")&&!Qi(e,"node:")?gL(r,i)?1:-1:0}function xVe({sourceFile:e,program:t,host:r,preferences:i},s){const o=t.getTypeChecker(),c=kVe(s,o);if(!c)return;const u=o.getAliasedSymbol(c),f=c.name,g=[{symbol:c,moduleSymbol:u,moduleFileName:void 0,exportKind:3,targetFlags:u.flags,isFromPackageJson:!1}],p=w$(e,t);return P$(g,void 0,!1,p,t,e,r,i).fixes.map(S=>{var T;return{fix:S,symbolName:f,errorIdentifierText:(T=Jn(s,Ie))==null?void 0:T.text}})}function kVe(e,t){const r=Ie(e)?t.getSymbolAtLocation(e):void 0;if(k5(r))return r;const{parent:i}=e;if(qu(i)&&i.tagName===e||jT(i)){const s=t.resolveName(t.getJsxNamespace(i),qu(i)?e:i,111551,!1);if(k5(s))return s}}function Ole(e,t,r,i){if(r.verbatimModuleSyntax&&(Ul(r)===1||e.impliedNodeFormat===1))return 3;switch(t){case 0:return 0;case 1:return 1;case 2:return wVe(e,r,!!i);case 3:return CVe(e,r,!!i);default:return E.assertNever(t)}}function CVe(e,t,r){if(vT(t))return 1;const i=Ul(t);switch(i){case 2:case 1:case 3:return Hr(e)&&(Nc(e)||r)?2:3;case 4:case 5:case 6:case 7:case 99:case 0:return 2;case 100:case 199:return e.impliedNodeFormat===99?2:3;default:return E.assertNever(i,`Unexpected moduleKind ${i}`)}}function EVe({sourceFile:e,program:t,cancellationToken:r,host:i,preferences:s},o,c){const u=t.getTypeChecker(),f=t.getCompilerOptions();return ta(Lle(e,u,o,f),g=>{if(g==="default")return;const p=o1(o),y=w$(e,t),S=PVe(g,Fk(o),Wb(o),r,e,t,c,i,s);return fs(uj(S.values(),T=>P$(T,o.getStart(e),p,y,t,e,i,s).fixes),T=>({fix:T,symbolName:g,errorIdentifierText:o.text,isJsxNamespaceFix:g!==o.text}))})}function TCe(e,t,r,i){const s=i.getTypeChecker(),o=s.resolveName(r,t,111551,!0);if(!o)return;const c=s.getTypeOnlyAliasDeclaration(o);if(!(!c||Or(c)!==e))return{kind:4,typeOnlyAliasDeclaration:c}}function Lle(e,t,r,i){const s=r.parent;if((qu(s)||Vv(s))&&s.tagName===r&&VH(i.jsx)){const o=t.getJsxNamespace(e);if(DVe(o,r,t))return!Hk(r.text)&&!t.resolveName(r.text,r,111551,!1)?[r.text,o]:[o]}return[r.text]}function DVe(e,t,r){if(Hk(t.text))return!0;const i=r.resolveName(e,t,111551,!0);return!i||ut(i.declarations,bv)&&!(i.flags&111551)}function PVe(e,t,r,i,s,o,c,u,f){var g;const p=of(),y=O3(s,f,u),S=(g=u.getModuleSpecifierCache)==null?void 0:g.call(u),T=_m(w=>qb(w?u.getPackageJsonAutoImportProvider():o,u));function C(w,D,O,z,W,X){const J=T(X);if(D&&YH(W,s,D,f,y,J,S)||!D&&y.allowsImportingAmbientModule(w,J)){const ie=W.getTypeChecker();p.add(boe(O,ie).toString(),{symbol:O,moduleSymbol:w,moduleFileName:D?.fileName,exportKind:z,targetFlags:yu(O,ie).flags,isFromPackageJson:X})}}return ZH(o,u,f,c,(w,D,O,z)=>{const W=O.getTypeChecker();i.throwIfCancellationRequested();const X=O.getCompilerOptions(),J=SL(w,W,X);J&&(J.name===e||Ble(w,Da(X),t)===e)&&ACe(J.resolvedSymbol,r)&&C(w,D,J.symbol,J.exportKind,O,z);const ie=W.tryGetMemberInModuleExportsAndProperties(e,w);ie&&ACe(ie,r)&&C(w,D,ie,0,O,z)}),p}function wVe(e,t,r){const i=vT(t),s=Hr(e);if(!s&&Ul(t)>=5)return i?1:2;if(s)return Nc(e)||r?i?1:2:3;for(const o of e.statements)if(Hl(o)&&!sc(o.moduleReference))return 3;return i?1:3}function Mle(e,t,r,i,s,o,c){let u;const f=Qr.ChangeTracker.with(e,g=>{u=AVe(g,t,r,i,s,o,c)});return Bs(zle,f,u,Wle,d.Add_all_missing_imports)}function AVe(e,t,r,i,s,o,c){const u=vf(t,c);switch(i.kind){case 0:return Rle(e,t,i),[d.Change_0_to_1,r,`${i.namespacePrefix}.${r}`];case 1:return CCe(e,t,i,u),[d.Change_0_to_1,r,ECe(i.moduleSpecifier,u)+r];case 2:{const{importClauseOrBindingPattern:f,importKind:g,addAsTypeOnly:p,moduleSpecifier:y}=i;kCe(e,t,f,g===1?{name:r,addAsTypeOnly:p}:void 0,g===0?[{name:r,addAsTypeOnly:p}]:ze,c);const S=lp(y);return s?[d.Import_0_from_1,r,S]:[d.Update_import_from_0,S]}case 3:{const{importKind:f,moduleSpecifier:g,addAsTypeOnly:p,useRequire:y,qualification:S}=i,T=y?PCe:DCe,C=f===1?{name:r,addAsTypeOnly:p}:void 0,w=f===0?[{name:r,addAsTypeOnly:p}]:void 0,D=f===2||f===3?{importKind:f,name:S?.namespacePrefix||r,addAsTypeOnly:p}:void 0;return D3(e,t,T(g,u,C,w,D,o.getCompilerOptions(),c),!0,c),S&&Rle(e,t,S),s?[d.Import_0_from_1,r,g]:[d.Add_import_from_0,g]}case 4:{const{typeOnlyAliasDeclaration:f}=i,g=NVe(e,f,o,t,c);return g.kind===276?[d.Remove_type_from_import_of_0_from_1,r,xCe(g.parent.parent)]:[d.Remove_type_from_import_declaration_from_0,xCe(g)]}default:return E.assertNever(i,`Unexpected fix kind ${i.kind}`)}}function xCe(e){var t,r;return e.kind===271?((r=Jn((t=Jn(e.moduleReference,Pm))==null?void 0:t.expression,Ja))==null?void 0:r.text)||e.moduleReference.getText():Ms(e.parent.moduleSpecifier,ra).text}function NVe(e,t,r,i,s){const o=r.getCompilerOptions(),c=Mz(o);switch(t.kind){case 276:if(t.isTypeOnly){const f=qp.detectImportSpecifierSorting(t.parent.elements,s);if(t.parent.elements.length>1&&f){const g=I.updateImportSpecifier(t,!1,t.propertyName,t.name),p=qp.getOrganizeImportsComparer(s,f===2),y=qp.getImportSpecifierInsertionIndex(t.parent.elements,g,p);if(t.parent.elements.indexOf(t)!==y)return e.delete(i,t),e.insertImportSpecifierAtIndex(i,g,t.parent,y),t}return e.deleteRange(i,t.getFirstToken()),t}else return E.assert(t.parent.parent.isTypeOnly),u(t.parent.parent),t.parent.parent;case 273:return u(t),t;case 274:return u(t.parent),t.parent;case 271:return e.deleteRange(i,t.getChildAt(1)),t;default:E.failBadSyntaxKind(t)}function u(f){var g;if(e.delete(i,kH(f,i)),!o.allowImportingTsExtensions){const p=Mk(f.parent),y=p&&((g=r.getResolvedModule(i,p.text,ld(i,p)))==null?void 0:g.resolvedModule);if(y?.resolvedUsingTsExtension){const S=nP(p.text,HO(p.text,o));e.replaceNode(i,p,I.createStringLiteral(S))}}if(c){const p=Jn(f.namedBindings,Kg);if(p&&p.elements.length>1){qp.detectImportSpecifierSorting(p.elements,s)&&t.kind===276&&p.elements.indexOf(t)!==0&&(e.delete(i,t),e.insertImportSpecifierAtIndex(i,t,p,0));for(const y of p.elements)y!==t&&!y.isTypeOnly&&e.insertModifierBefore(i,156,y)}}}}function kCe(e,t,r,i,s,o){var c;if(r.kind===206){i&&g(r,i.name,"default");for(const p of s)g(r,p.name,void 0);return}const u=r.isTypeOnly&&ut([i,...s],p=>p?.addAsTypeOnly===4),f=r.namedBindings&&((c=Jn(r.namedBindings,Kg))==null?void 0:c.elements);if(i&&(E.assert(!r.name,"Cannot add a default import to an import clause that already has one"),e.insertNodeAt(t,r.getStart(t),I.createIdentifier(i.name),{suffix:", "})),s.length){let p;if(typeof o.organizeImportsIgnoreCase=="boolean")p=o.organizeImportsIgnoreCase;else if(f){const C=qp.detectImportSpecifierSorting(f,o);C!==3&&(p=C===2)}p===void 0&&(p=qp.detectSorting(t,o)===2);const y=qp.getOrganizeImportsComparer(o,p),S=Eh(s.map(C=>I.createImportSpecifier((!r.isTypeOnly||u)&&A$(C,o),void 0,I.createIdentifier(C.name))),(C,w)=>qp.compareImportOrExportSpecifiers(C,w,y)),T=f?.length&&qp.detectImportSpecifierSorting(f,o);if(T&&!(p&&T===1))for(const C of S){const w=u&&!C.isTypeOnly?0:qp.getImportSpecifierInsertionIndex(f,C,y);e.insertImportSpecifierAtIndex(t,C,r.namedBindings,w)}else if(f?.length)for(const C of S)e.insertNodeInListAfter(t,Sa(f),C,f);else if(S.length){const C=I.createNamedImports(S);r.namedBindings?e.replaceNode(t,r.namedBindings,C):e.insertNodeAfter(t,E.checkDefined(r.name,"Import clause must have either named imports or a default import"),C)}}if(u&&(e.delete(t,kH(r,t)),f))for(const p of f)e.insertModifierBefore(t,156,p);function g(p,y,S){const T=I.createBindingElement(void 0,S,y);p.elements.length?e.insertNodeInListAfter(t,Sa(p.elements),T):e.replaceNode(t,p,I.createObjectBindingPattern([T]))}}function Rle(e,t,{namespacePrefix:r,usagePosition:i}){e.insertText(t,i,r+".")}function CCe(e,t,{moduleSpecifier:r,usagePosition:i},s){e.insertText(t,i,ECe(r,s))}function ECe(e,t){const r=xH(t);return`import(${r}${e}${r}).`}function jle({addAsTypeOnly:e}){return e===2}function A$(e,t){return jle(e)||!!t.preferTypeOnlyAutoImports&&e.addAsTypeOnly!==4}function DCe(e,t,r,i,s,o,c){const u=ex(e,t);let f;if(r!==void 0||i?.length){const g=(!r||jle(r))&&qi(i,jle)||(o.verbatimModuleSyntax||c.preferTypeOnlyAutoImports)&&r?.addAsTypeOnly!==4&&!ut(i,p=>p.addAsTypeOnly===4);f=ik(f,Yh(r&&I.createIdentifier(r.name),i?.map(p=>I.createImportSpecifier(!g&&A$(p,c),void 0,I.createIdentifier(p.name))),e,t,g))}if(s){const g=s.importKind===3?I.createImportEqualsDeclaration(void 0,A$(s,c),I.createIdentifier(s.name),I.createExternalModuleReference(u)):I.createImportDeclaration(void 0,I.createImportClause(A$(s,c),void 0,I.createNamespaceImport(I.createIdentifier(s.name))),u,void 0);f=ik(f,g)}return E.checkDefined(f)}function PCe(e,t,r,i,s){const o=ex(e,t);let c;if(r||i?.length){const u=i?.map(({name:g})=>I.createBindingElement(void 0,void 0,g))||[];r&&u.unshift(I.createBindingElement(void 0,"default",r.name));const f=wCe(I.createObjectBindingPattern(u),o);c=ik(c,f)}if(s){const u=wCe(s.name,o);c=ik(c,u)}return E.checkDefined(c)}function wCe(e,t){return I.createVariableStatement(void 0,I.createVariableDeclarationList([I.createVariableDeclaration(typeof e=="string"?I.createIdentifier(e):e,void 0,void 0,I.createCallExpression(I.createIdentifier("require"),void 0,[t]))],2))}function ACe({declarations:e},t){return ut(e,r=>!!(oA(r)&t))}function Ble(e,t,r){return Jle(Ou(lp(e.name)),t,r)}function Jle(e,t,r){const i=Pc(sk(e,"/index"));let s="",o=!0;const c=i.charCodeAt(0);eg(c,t)?(s+=String.fromCharCode(c),r&&(s=s.toUpperCase())):o=!1;for(let u=1;uMle(e,i,f,u,f!==g,o,r))},fixIds:[Wle],getAllCodeActions:e=>{const{sourceFile:t,program:r,preferences:i,host:s,cancellationToken:o}=e,c=fCe(t,r,!0,i,s,o);return i6(e,Ule,u=>c.addImportFromDiagnostic(u,e)),n6(Qr.ChangeTracker.with(e,c.writeFixes))}})}});function NCe(e,t,r){const i=kn(e.getSemanticDiagnostics(t),c=>c.start===r.start&&c.length===r.length);if(i===void 0||i.relatedInformation===void 0)return;const s=kn(i.relatedInformation,c=>c.code===d.This_type_parameter_might_need_an_extends_0_constraint.code);if(s===void 0||s.file===void 0||s.start===void 0||s.length===void 0)return;let o=que(s.file,Jl(s.start,s.length));if(o!==void 0&&(Ie(o)&&Uo(o.parent)&&(o=o.parent),Uo(o))){if(jE(o.parent))return;const c=Ji(t,r.start),u=e.getTypeChecker();return{constraint:OVe(u,c)||FVe(s.messageText),declaration:o,token:c}}}function ICe(e,t,r,i,s,o){const{declaration:c,constraint:u}=o,f=t.getTypeChecker();if(ns(u))e.insertText(s,c.name.end,` extends ${u}`);else{const g=Da(t.getCompilerOptions()),p=a6({program:t,host:i}),y=ax(s,t,r,i),S=pX(f,y,u,void 0,g,void 0,p);S&&(e.replaceNode(s,c,I.updateTypeParameterDeclaration(c,void 0,c.name,S,c.default)),y.writeFixes(e))}}function FVe(e){const[t,r]=Bd(e,` +`,0).match(/`extends (.*)`/)||[];return r}function OVe(e,t){return Si(t.parent)?e.getTypeArgumentConstraint(t.parent):(ct(t)?e.getContextualType(t):void 0)||e.getTypeAtLocation(t)}var N$,Vle,LVe=Nt({"src/services/codefixes/fixAddMissingConstraint.ts"(){"use strict";zn(),na(),N$="addMissingConstraint",Vle=[d.Type_0_is_not_comparable_to_type_1.code,d.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,d.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,d.Type_0_is_not_assignable_to_type_1.code,d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,d.Property_0_is_incompatible_with_index_signature.code,d.Property_0_in_type_1_is_not_assignable_to_type_2.code,d.Type_0_does_not_satisfy_the_constraint_1.code],Zs({errorCodes:Vle,getCodeActions(e){const{sourceFile:t,span:r,program:i,preferences:s,host:o}=e,c=NCe(i,t,r);if(c===void 0)return;const u=Qr.ChangeTracker.with(e,f=>ICe(f,i,s,o,t,c));return[Bs(N$,u,d.Add_extends_constraint,N$,d.Add_extends_constraint_to_all_type_parameters)]},fixIds:[N$],getAllCodeActions:e=>{const{program:t,preferences:r,host:i}=e,s=new Map;return n6(Qr.ChangeTracker.with(e,o=>{i6(e,Vle,c=>{const u=NCe(t,c.file,Jl(c.start,c.length));if(u&&Rp(s,Oa(u.declaration)))return ICe(o,t,r,i,c.file,u)})}))}})}});function FCe(e,t,r,i){switch(r){case d.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:case d.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:case d.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:case d.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:case d.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:return MVe(e,t.sourceFile,i);case d.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:case d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code:case d.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:case d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code:return RVe(e,t.sourceFile,i);default:E.fail("Unexpected error code: "+r)}}function MVe(e,t,r){const i=LCe(t,r);if(Iu(t)){e.addJSDocTags(t,i,[I.createJSDocOverrideTag(I.createIdentifier("override"))]);return}const s=i.modifiers||ze,o=kn(s,AT),c=kn(s,Kre),u=kn(s,y=>pH(y.kind)),f=US(s,ql),g=c?c.end:o?o.end:u?u.end:f?la(t.text,f.end):i.getStart(t),p=u||o||c?{prefix:" "}:{suffix:" "};e.insertModifierAt(t,g,164,p)}function RVe(e,t,r){const i=LCe(t,r);if(Iu(t)){e.filterJSDocTags(t,i,A7(GF));return}const s=kn(i.modifiers,ene);E.assertIsDefined(s),e.deleteModifier(t,s)}function OCe(e){switch(e.kind){case 176:case 172:case 174:case 177:case 178:return!0;case 169:return E_(e,e.parent);default:return!1}}function LCe(e,t){const r=Ji(e,t),i=Ar(r,s=>Qn(s)?"quit":OCe(s));return E.assert(i&&OCe(i)),i}var qle,z3,KA,Hle,Gle,jVe=Nt({"src/services/codefixes/fixOverrideModifier.ts"(){"use strict";zn(),na(),qle="fixOverrideModifier",z3="fixAddOverrideModifier",KA="fixRemoveOverrideModifier",Hle=[d.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,d.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,d.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,d.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,d.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code,d.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code,d.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code],Gle={[d.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:d.Add_override_modifier,fixId:z3,fixAllDescriptions:d.Add_all_missing_override_modifiers},[d.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:d.Add_override_modifier,fixId:z3,fixAllDescriptions:d.Add_all_missing_override_modifiers},[d.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:d.Remove_override_modifier,fixId:KA,fixAllDescriptions:d.Remove_all_unnecessary_override_modifiers},[d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:d.Remove_override_modifier,fixId:KA,fixAllDescriptions:d.Remove_override_modifier},[d.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]:{descriptions:d.Add_override_modifier,fixId:z3,fixAllDescriptions:d.Add_all_missing_override_modifiers},[d.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:d.Add_override_modifier,fixId:z3,fixAllDescriptions:d.Add_all_missing_override_modifiers},[d.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]:{descriptions:d.Add_override_modifier,fixId:z3,fixAllDescriptions:d.Remove_all_unnecessary_override_modifiers},[d.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:d.Remove_override_modifier,fixId:KA,fixAllDescriptions:d.Remove_all_unnecessary_override_modifiers},[d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:d.Remove_override_modifier,fixId:KA,fixAllDescriptions:d.Remove_all_unnecessary_override_modifiers}},Zs({errorCodes:Hle,getCodeActions:function(t){const{errorCode:r,span:i}=t,s=Gle[r];if(!s)return ze;const{descriptions:o,fixId:c,fixAllDescriptions:u}=s,f=Qr.ChangeTracker.with(t,g=>FCe(g,t,r,i.start));return[sle(qle,f,o,c,u)]},fixIds:[qle,z3,KA],getAllCodeActions:e=>$a(e,Hle,(t,r)=>{const{code:i,start:s}=r,o=Gle[i];!o||o.fixId!==e.fixId||FCe(t,e,i,s)})})}});function MCe(e,t,r,i){const s=vf(t,i),o=I.createStringLiteral(r.name.text,s===0);e.replaceNode(t,r,_I(r)?I.createElementAccessChain(r.expression,r.questionDotToken,o):I.createElementAccessExpression(r.expression,o))}function RCe(e,t){return Ms(Ji(e,t).parent,bn)}var I$,$le,BVe=Nt({"src/services/codefixes/fixNoPropertyAccessFromIndexSignature.ts"(){"use strict";zn(),na(),I$="fixNoPropertyAccessFromIndexSignature",$le=[d.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code],Zs({errorCodes:$le,fixIds:[I$],getCodeActions(e){const{sourceFile:t,span:r,preferences:i}=e,s=RCe(t,r.start),o=Qr.ChangeTracker.with(e,c=>MCe(c,e.sourceFile,s,i));return[Bs(I$,o,[d.Use_element_access_for_0,s.name.text],I$,d.Use_element_access_for_all_undeclared_properties)]},getAllCodeActions:e=>$a(e,$le,(t,r)=>MCe(t,r.file,RCe(r.file,r.start),e.preferences))})}});function jCe(e,t,r,i){const s=Ji(t,r);if(!qC(s))return;const o=i_(s,!1,!1);if(!(!Zc(o)&&!ro(o))&&!Ai(i_(o,!1,!1))){const c=E.checkDefined(Ua(o,100,t)),{name:u}=o,f=E.checkDefined(o.body);return ro(o)?u&&ho.Core.isSymbolReferencedInFile(u,i,t,f)?void 0:(e.delete(t,c),u&&e.delete(t,u),e.insertText(t,f.pos," =>"),[d.Convert_function_expression_0_to_arrow_function,u?u.text:bL]):(e.replaceNode(t,c,I.createToken(87)),e.insertText(t,u.end," = "),e.insertText(t,f.pos," =>"),[d.Convert_function_declaration_0_to_arrow_function,u.text])}}var F$,Xle,JVe=Nt({"src/services/codefixes/fixImplicitThis.ts"(){"use strict";zn(),na(),F$="fixImplicitThis",Xle=[d.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code],Zs({errorCodes:Xle,getCodeActions:function(t){const{sourceFile:r,program:i,span:s}=t;let o;const c=Qr.ChangeTracker.with(t,u=>{o=jCe(u,r,s.start,i.getTypeChecker())});return o?[Bs(F$,c,o,F$,d.Fix_all_implicit_this_errors)]:ze},fixIds:[F$],getAllCodeActions:e=>$a(e,Xle,(t,r)=>{jCe(t,r.file,r.start,e.program.getTypeChecker())})})}});function BCe(e,t,r){var i,s;const o=Ji(e,t);if(Ie(o)){const c=Ar(o,gl);if(c===void 0)return;const u=ra(c.moduleSpecifier)?c.moduleSpecifier.text:void 0;if(u===void 0)return;const f=(i=r.getResolvedModule(e,u,void 0))==null?void 0:i.resolvedModule;if(f===void 0)return;const g=r.getSourceFile(f.resolvedFileName);if(g===void 0||L3(r,g))return;const p=g.symbol,y=(s=Jn(p.valueDeclaration,hm))==null?void 0:s.locals;if(y===void 0)return;const S=y.get(o.escapedText);if(S===void 0)return;const T=WVe(S);return T===void 0?void 0:{exportName:{node:o,isTypeOnly:rC(T)},node:T,moduleSourceFile:g,moduleSpecifier:u}}}function zVe(e,t,{exportName:r,node:i,moduleSourceFile:s}){const o=O$(s,r.isTypeOnly);o?JCe(e,t,s,o,[r]):L8(i)?e.insertExportModifier(s,i):zCe(e,t,s,[r])}function Qle(e,t,r,i,s){Ir(i)&&(s?JCe(e,t,r,s,i):zCe(e,t,r,i))}function O$(e,t){const r=i=>qc(i)&&(t&&i.isTypeOnly||!i.isTypeOnly);return US(e.statements,r)}function JCe(e,t,r,i,s){const o=i.exportClause&&gp(i.exportClause)?i.exportClause.elements:I.createNodeArray([]),c=!i.isTypeOnly&&!!(nd(t.getCompilerOptions())||kn(o,u=>u.isTypeOnly));e.replaceNode(r,i,I.updateExportDeclaration(i,i.modifiers,i.isTypeOnly,I.createNamedExports(I.createNodeArray([...o,...WCe(s,c)],o.hasTrailingComma)),i.moduleSpecifier,i.attributes))}function zCe(e,t,r,i){e.insertNodeAtEndOfScope(r,r,I.createExportDeclaration(void 0,!1,I.createNamedExports(WCe(i,nd(t.getCompilerOptions()))),void 0,void 0))}function WCe(e,t){return I.createNodeArray(Yt(e,r=>I.createExportSpecifier(t&&r.isTypeOnly,void 0,r.node)))}function WVe(e){if(e.valueDeclaration===void 0)return bl(e.declarations);const t=e.valueDeclaration,r=Ei(t)?Jn(t.parent.parent,ec):void 0;return r&&Ir(r.declarationList.declarations)===1?r:t}var L$,Yle,UVe=Nt({"src/services/codefixes/fixImportNonExportedMember.ts"(){"use strict";zn(),na(),L$="fixImportNonExportedMember",Yle=[d.Module_0_declares_1_locally_but_it_is_not_exported.code],Zs({errorCodes:Yle,fixIds:[L$],getCodeActions(e){const{sourceFile:t,span:r,program:i}=e,s=BCe(t,r.start,i);if(s===void 0)return;const o=Qr.ChangeTracker.with(e,c=>zVe(c,i,s));return[Bs(L$,o,[d.Export_0_from_module_1,s.exportName.node.text,s.moduleSpecifier],L$,d.Export_all_referenced_locals)]},getAllCodeActions(e){const{program:t}=e;return n6(Qr.ChangeTracker.with(e,r=>{const i=new Map;i6(e,Yle,s=>{const o=BCe(s.file,s.start,t);if(o===void 0)return;const{exportName:c,node:u,moduleSourceFile:f}=o;if(O$(f,c.isTypeOnly)===void 0&&L8(u))r.insertExportModifier(f,u);else{const g=i.get(f)||{typeOnlyExports:[],exports:[]};c.isTypeOnly?g.typeOnlyExports.push(c):g.exports.push(c),i.set(f,g)}}),i.forEach((s,o)=>{const c=O$(o,!0);c&&c.isTypeOnly?(Qle(r,t,o,s.typeOnlyExports,c),Qle(r,t,o,s.exports,O$(o,!1))):Qle(r,t,o,[...s.exports,...s.typeOnlyExports],c)})}))}})}});function VVe(e,t){const r=Ji(e,t);return Ar(r,i=>i.kind===202)}function qVe(e,t,r){if(!r)return;let i=r.type,s=!1,o=!1;for(;i.kind===190||i.kind===191||i.kind===196;)i.kind===190?s=!0:i.kind===191&&(o=!0),i=i.type;const c=I.updateNamedTupleMember(r,r.dotDotDotToken||(o?I.createToken(26):void 0),r.name,r.questionToken||(s?I.createToken(58):void 0),i);c!==r&&e.replaceNode(t,r,c)}var M$,UCe,HVe=Nt({"src/services/codefixes/fixIncorrectNamedTupleSyntax.ts"(){"use strict";zn(),na(),M$="fixIncorrectNamedTupleSyntax",UCe=[d.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,d.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code],Zs({errorCodes:UCe,getCodeActions:function(t){const{sourceFile:r,span:i}=t,s=VVe(r,i.start),o=Qr.ChangeTracker.with(t,c=>qVe(c,r,s));return[Bs(M$,o,d.Move_labeled_tuple_element_modifiers_to_labels,M$,d.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[M$]})}});function VCe(e,t,r,i){const s=Ji(e,t),o=s.parent;if((i===d.No_overload_matches_this_call.code||i===d.Type_0_is_not_assignable_to_type_1.code)&&!Rd(o))return;const c=r.program.getTypeChecker();let u;if(bn(o)&&o.name===s){E.assert(tg(s),"Expected an identifier for spelling (property access)");let f=c.getTypeAtLocation(o.expression);o.flags&64&&(f=c.getNonNullableType(f)),u=c.getSuggestedSymbolForNonexistentProperty(s,f)}else if(Gr(o)&&o.operatorToken.kind===103&&o.left===s&&Ti(s)){const f=c.getTypeAtLocation(o.right);u=c.getSuggestedSymbolForNonexistentProperty(s,f)}else if(h_(o)&&o.right===s){const f=c.getSymbolAtLocation(o.left);f&&f.flags&1536&&(u=c.getSuggestedSymbolForNonexistentModule(o.right,f))}else if(v_(o)&&o.name===s){E.assertNode(s,Ie,"Expected an identifier for spelling (import)");const f=Ar(s,gl),g=$Ve(e,r,f);g&&g.symbol&&(u=c.getSuggestedSymbolForNonexistentModule(s,g.symbol))}else if(Rd(o)&&o.name===s){E.assertNode(s,Ie,"Expected an identifier for JSX attribute");const f=Ar(s,qu),g=c.getContextualTypeForArgumentAtIndex(f,0);u=c.getSuggestedSymbolForNonexistentJSXAttribute(s,g)}else if(y5(o)&&Pl(o)&&o.name===s){const f=Ar(s,Qn),g=f?Pd(f):void 0,p=g?c.getTypeAtLocation(g):void 0;p&&(u=c.getSuggestedSymbolForNonexistentClassMember(Wc(s),p))}else{const f=Wb(s),g=Wc(s);E.assert(g!==void 0,"name should be defined"),u=c.getSuggestedSymbolForNonexistentSymbol(s,g,GVe(f))}return u===void 0?void 0:{node:s,suggestedSymbol:u}}function qCe(e,t,r,i,s){const o=pc(i);if(!lf(o,s)&&bn(r.parent)){const c=i.valueDeclaration;c&&Au(c)&&Ti(c.name)?e.replaceNode(t,r,I.createIdentifier(o)):e.replaceNode(t,r.parent,I.createElementAccessExpression(r.parent.expression,I.createStringLiteral(o)))}else e.replaceNode(t,r,I.createIdentifier(o))}function GVe(e){let t=0;return e&4&&(t|=1920),e&2&&(t|=788968),e&1&&(t|=111551),t}function $Ve(e,t,r){var i;if(!r||!Ja(r.moduleSpecifier))return;const s=(i=t.program.getResolvedModule(e,r.moduleSpecifier.text,ld(e,r.moduleSpecifier)))==null?void 0:i.resolvedModule;if(s)return t.program.getSourceFile(s.resolvedFileName)}var Zle,Kle,XVe=Nt({"src/services/codefixes/fixSpelling.ts"(){"use strict";zn(),na(),Zle="fixSpelling",Kle=[d.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,d.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,d.Cannot_find_name_0_Did_you_mean_1.code,d.Could_not_find_name_0_Did_you_mean_1.code,d.Cannot_find_namespace_0_Did_you_mean_1.code,d.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,d.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,d._0_has_no_exported_member_named_1_Did_you_mean_2.code,d.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,d.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,d.No_overload_matches_this_call.code,d.Type_0_is_not_assignable_to_type_1.code],Zs({errorCodes:Kle,getCodeActions(e){const{sourceFile:t,errorCode:r}=e,i=VCe(t,e.span.start,e,r);if(!i)return;const{node:s,suggestedSymbol:o}=i,c=Da(e.host.getCompilationSettings()),u=Qr.ChangeTracker.with(e,f=>qCe(f,t,s,o,c));return[Bs("spelling",u,[d.Change_spelling_to_0,pc(o)],Zle,d.Fix_all_detected_spelling_errors)]},fixIds:[Zle],getAllCodeActions:e=>$a(e,Kle,(t,r)=>{const i=VCe(r.file,r.start,e,r.code),s=Da(e.host.getCompilationSettings());i&&qCe(t,e.sourceFile,i.node,i.suggestedSymbol,s)})})}});function HCe(e,t,r){const i=e.createSymbol(4,t.escapedText);i.links.type=e.getTypeAtLocation(r);const s=zs([i]);return e.createAnonymousType(void 0,s,[],[],[])}function eue(e,t,r,i){if(!t.body||!Ss(t.body)||Ir(t.body.statements)!==1)return;const s=ba(t.body.statements);if(kl(s)&&tue(e,t,e.getTypeAtLocation(s.expression),r,i))return{declaration:t,kind:0,expression:s.expression,statement:s,commentSource:s.expression};if(Uv(s)&&kl(s.statement)){const o=I.createObjectLiteralExpression([I.createPropertyAssignment(s.label,s.statement.expression)]),c=HCe(e,s.label,s.statement.expression);if(tue(e,t,c,r,i))return go(t)?{declaration:t,kind:1,expression:o,statement:s,commentSource:s.statement.expression}:{declaration:t,kind:0,expression:o,statement:s,commentSource:s.statement.expression}}else if(Ss(s)&&Ir(s.statements)===1){const o=ba(s.statements);if(Uv(o)&&kl(o.statement)){const c=I.createObjectLiteralExpression([I.createPropertyAssignment(o.label,o.statement.expression)]),u=HCe(e,o.label,o.statement.expression);if(tue(e,t,u,r,i))return{declaration:t,kind:0,expression:c,statement:s,commentSource:o}}}}function tue(e,t,r,i,s){if(s){const o=e.getSignatureFromDeclaration(t);if(o){In(t,1024)&&(r=e.createPromiseType(r));const c=e.createSignature(t,o.typeParameters,o.thisParameter,o.parameters,r,void 0,o.minArgumentCount,o.flags);r=e.createAnonymousType(void 0,zs(),[c],[],[])}else r=e.getAnyType()}return e.isTypeAssignableTo(r,i)}function GCe(e,t,r,i){const s=Ji(t,r);if(!s.parent)return;const o=Ar(s.parent,po);switch(i){case d.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code:return!o||!o.body||!o.type||!yf(o.type,s)?void 0:eue(e,o,e.getTypeFromTypeNode(o.type),!1);case d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!Rs(o.parent)||!o.body)return;const c=o.parent.arguments.indexOf(o);if(c===-1)return;const u=e.getContextualTypeForArgumentAtIndex(o.parent,c);return u?eue(e,o,u,!0):void 0;case d.Type_0_is_not_assignable_to_type_1.code:if(!$g(s)||!Nk(s.parent)&&!Rd(s.parent))return;const f=QVe(s.parent);return!f||!po(f)||!f.body?void 0:eue(e,f,e.getTypeAtLocation(s.parent),!0)}}function QVe(e){switch(e.kind){case 260:case 169:case 208:case 172:case 303:return e.initializer;case 291:return e.initializer&&(UE(e.initializer)?e.initializer.expression:void 0);case 304:case 171:case 306:case 355:case 348:return}}function $Ce(e,t,r,i){O_(r);const s=DA(t);e.replaceNode(t,i,I.createReturnStatement(r),{leadingTriviaOption:Qr.LeadingTriviaOption.Exclude,trailingTriviaOption:Qr.TrailingTriviaOption.Exclude,suffix:s?";":void 0})}function XCe(e,t,r,i,s,o){const c=o||iL(i)?I.createParenthesizedExpression(i):i;O_(s),Hb(s,c),e.replaceNode(t,r.body,c)}function QCe(e,t,r,i){e.replaceNode(t,r.body,I.createParenthesizedExpression(i))}function YVe(e,t,r){const i=Qr.ChangeTracker.with(e,s=>$Ce(s,e.sourceFile,t,r));return Bs(R$,i,d.Add_a_return_statement,j$,d.Add_all_missing_return_statement)}function ZVe(e,t,r,i){const s=Qr.ChangeTracker.with(e,o=>XCe(o,e.sourceFile,t,r,i,!1));return Bs(R$,s,d.Remove_braces_from_arrow_function_body,B$,d.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}function KVe(e,t,r){const i=Qr.ChangeTracker.with(e,s=>QCe(s,e.sourceFile,t,r));return Bs(R$,i,d.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,J$,d.Wrap_all_object_literal_with_parentheses)}var R$,j$,B$,J$,rue,eqe=Nt({"src/services/codefixes/returnValueCorrect.ts"(){"use strict";zn(),na(),R$="returnValueCorrect",j$="fixAddReturnStatement",B$="fixRemoveBracesFromArrowFunctionBody",J$="fixWrapTheBlockWithParen",rue=[d.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code,d.Type_0_is_not_assignable_to_type_1.code,d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code],Zs({errorCodes:rue,fixIds:[j$,B$,J$],getCodeActions:function(t){const{program:r,sourceFile:i,span:{start:s},errorCode:o}=t,c=GCe(r.getTypeChecker(),i,s,o);if(c)return c.kind===0?lr([YVe(t,c.expression,c.statement)],go(c.declaration)?ZVe(t,c.declaration,c.expression,c.commentSource):void 0):[KVe(t,c.declaration,c.expression)]},getAllCodeActions:e=>$a(e,rue,(t,r)=>{const i=GCe(e.program.getTypeChecker(),r.file,r.start,r.code);if(i)switch(e.fixId){case j$:$Ce(t,r.file,i.expression,i.statement);break;case B$:if(!go(i.declaration))return;XCe(t,r.file,i.declaration,i.expression,i.commentSource,!1);break;case J$:if(!go(i.declaration))return;QCe(t,r.file,i.declaration,i.expression);break;default:E.fail(JSON.stringify(e.fixId))}})})}});function YCe(e,t,r,i,s){var o;const c=Ji(e,t),u=c.parent;if(r===d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(!(c.kind===19&&ma(u)&&Rs(u.parent)))return;const T=Dc(u.parent.arguments,O=>O===u);if(T<0)return;const C=i.getResolvedSignature(u.parent);if(!(C&&C.declaration&&C.parameters[T]))return;const w=C.parameters[T].valueDeclaration;if(!(w&&us(w)&&Ie(w.name)))return;const D=fs(i.getUnmatchedProperties(i.getTypeAtLocation(u),i.getParameterType(C,T),!1,!1));return Ir(D)?{kind:3,token:w.name,properties:D,parentDeclaration:u}:void 0}if(!tg(c))return;if(Ie(c)&&J0(u)&&u.initializer&&ma(u.initializer)){const T=i.getContextualType(c)||i.getTypeAtLocation(c),C=fs(i.getUnmatchedProperties(i.getTypeAtLocation(u.initializer),T,!1,!1));return Ir(C)?{kind:3,token:c,properties:C,parentDeclaration:u.initializer}:void 0}if(Ie(c)&&qu(c.parent)){const T=Da(s.getCompilerOptions()),C=oqe(i,T,c.parent);return Ir(C)?{kind:4,token:c,attributes:C,parentDeclaration:c.parent}:void 0}if(Ie(c)){const T=(o=i.getContextualType(c))==null?void 0:o.getNonNullableType();if(T&&Pn(T)&16){const C=bl(i.getSignaturesOfType(T,0));return C===void 0?void 0:{kind:5,token:c,signature:C,sourceFile:e,parentDeclaration:c6e(c)}}if(Rs(u)&&u.expression===c)return{kind:2,token:c,call:u,sourceFile:e,modifierFlags:0,parentDeclaration:c6e(c)}}if(!bn(u))return;const f=vH(i.getTypeAtLocation(u.expression)),g=f.symbol;if(!g||!g.declarations)return;if(Ie(c)&&Rs(u.parent)){const T=kn(g.declarations,vc),C=T?.getSourceFile();if(T&&C&&!L3(s,C))return{kind:2,token:c,call:u.parent,sourceFile:e,modifierFlags:32,parentDeclaration:T};const w=kn(g.declarations,Ai);if(e.commonJsModuleIndicator)return;if(w&&!L3(s,w))return{kind:2,token:c,call:u.parent,sourceFile:w,modifierFlags:32,parentDeclaration:w}}const p=kn(g.declarations,Qn);if(!p&&Ti(c))return;const y=p||kn(g.declarations,T=>Mu(T)||X_(T));if(y&&!L3(s,y.getSourceFile())){const T=!X_(y)&&(f.target||f)!==i.getDeclaredTypeOfSymbol(g);if(T&&(Ti(c)||Mu(y)))return;const C=y.getSourceFile(),w=X_(y)?0:(T?256:0)|(UH(c.text)?2:0),D=Iu(C),O=Jn(u.parent,Rs);return{kind:0,token:c,call:O,modifierFlags:w,parentDeclaration:y,declSourceFile:C,isJSFile:D}}const S=kn(g.declarations,p1);if(S&&!(f.flags&1056)&&!Ti(c)&&!L3(s,S.getSourceFile()))return{kind:1,token:c,parentDeclaration:S}}function tqe(e,t){return t.isJSFile?Q2(rqe(e,t)):nqe(e,t)}function rqe(e,{parentDeclaration:t,declSourceFile:r,modifierFlags:i,token:s}){if(Mu(t)||X_(t))return;const o=Qr.ChangeTracker.with(e,u=>ZCe(u,r,t,s,!!(i&256)));if(o.length===0)return;const c=i&256?d.Initialize_static_property_0:Ti(s)?d.Declare_a_private_field_named_0:d.Initialize_property_0_in_the_constructor;return Bs(iy,o,[c,s.text],iy,d.Add_all_missing_members)}function ZCe(e,t,r,i,s){const o=i.text;if(s){if(r.kind===231)return;const c=r.name.getText(),u=KCe(I.createIdentifier(c),o);e.insertNodeAfter(t,r,u)}else if(Ti(i)){const c=I.createPropertyDeclaration(void 0,o,void 0,void 0,void 0),u=r6e(r);u?e.insertNodeAfter(t,u,c):e.insertMemberAtStart(t,r,c)}else{const c=cg(r);if(!c)return;const u=KCe(I.createThis(),o);e.insertNodeAtConstructorEnd(t,c,u)}}function KCe(e,t){return I.createExpressionStatement(I.createAssignment(I.createPropertyAccessExpression(e,t),ox()))}function nqe(e,{parentDeclaration:t,declSourceFile:r,modifierFlags:i,token:s}){const o=s.text,c=i&256,u=e6e(e.program.getTypeChecker(),t,s),f=p=>Qr.ChangeTracker.with(e,y=>t6e(y,r,t,o,u,p)),g=[Bs(iy,f(i&256),[c?d.Declare_static_property_0:d.Declare_property_0,o],iy,d.Add_all_missing_members)];return c||Ti(s)||(i&2&&g.unshift(_d(iy,f(2),[d.Declare_private_property_0,o])),g.push(iqe(e,r,t,s.text,u))),g}function e6e(e,t,r){let i;if(r.parent.parent.kind===226){const s=r.parent.parent,o=r.parent===s.left?s.right:s.left,c=e.getWidenedType(e.getBaseTypeOfLiteralType(e.getTypeAtLocation(o)));i=e.typeToTypeNode(c,t,1)}else{const s=e.getContextualType(r.parent);i=s?e.typeToTypeNode(s,void 0,1):void 0}return i||I.createKeywordTypeNode(133)}function t6e(e,t,r,i,s,o){const c=o?I.createNodeArray(I.createModifiersFromModifierFlags(o)):void 0,u=Qn(r)?I.createPropertyDeclaration(c,i,void 0,s,void 0):I.createPropertySignature(void 0,i,void 0,s),f=r6e(r);f?e.insertNodeAfter(t,f,u):e.insertMemberAtStart(t,r,u)}function r6e(e){let t;for(const r of e.members){if(!Es(r))break;t=r}return t}function iqe(e,t,r,i,s){const o=I.createKeywordTypeNode(154),c=I.createParameterDeclaration(void 0,void 0,"x",void 0,o,void 0),u=I.createIndexSignature(void 0,[c],s),f=Qr.ChangeTracker.with(e,g=>g.insertMemberAtStart(t,r,u));return _d(iy,f,[d.Add_index_signature_for_property_0,i])}function sqe(e,t){const{parentDeclaration:r,declSourceFile:i,modifierFlags:s,token:o,call:c}=t;if(c===void 0)return;const u=o.text,f=p=>Qr.ChangeTracker.with(e,y=>n6e(e,y,c,o,p,r,i)),g=[Bs(iy,f(s&256),[s&256?d.Declare_static_method_0:d.Declare_method_0,u],iy,d.Add_all_missing_members)];return s&2&&g.unshift(_d(iy,f(2),[d.Declare_private_method_0,u])),g}function n6e(e,t,r,i,s,o,c){const u=ax(c,e.program,e.preferences,e.host),f=Qn(o)?174:173,g=Bue(f,e,u,r,i,s,o),p=cqe(o,r);p?t.insertNodeAfter(c,p,g):t.insertMemberAtStart(c,o,g),u.writeFixes(t)}function i6e(e,t,{token:r,parentDeclaration:i}){const s=ut(i.members,c=>{const u=t.getTypeAtLocation(c);return!!(u&&u.flags&402653316)}),o=I.createEnumMember(r,s?I.createStringLiteral(r.text):void 0);e.replaceNode(i.getSourceFile(),i,I.updateEnumDeclaration(i,i.modifiers,i.name,Xi(i.members,Q2(o))),{leadingTriviaOption:Qr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Qr.TrailingTriviaOption.Exclude})}function s6e(e,t,r){const i=vf(t.sourceFile,t.preferences),s=ax(t.sourceFile,t.program,t.preferences,t.host),o=r.kind===2?Bue(262,t,s,r.call,an(r.token),r.modifierFlags,r.parentDeclaration):fX(262,t,i,r.signature,aM(d.Function_not_implemented.message,i),r.token,void 0,void 0,void 0,s);o===void 0&&E.fail("fixMissingFunctionDeclaration codefix got unexpected error."),Bp(r.parentDeclaration)?e.insertNodeBefore(r.sourceFile,r.parentDeclaration,o,!0):e.insertNodeAtEndOfScope(r.sourceFile,r.parentDeclaration,o),s.writeFixes(e)}function a6e(e,t,r){const i=ax(t.sourceFile,t.program,t.preferences,t.host),s=vf(t.sourceFile,t.preferences),o=t.program.getTypeChecker(),c=r.parentDeclaration.attributes,u=ut(c.properties,BT),f=Yt(r.attributes,y=>{const S=z$(t,o,i,s,o.getTypeOfSymbol(y),r.parentDeclaration),T=I.createIdentifier(y.name),C=I.createJsxAttribute(T,I.createJsxExpression(void 0,S));return ga(T,C),C}),g=I.createJsxAttributes(u?[...f,...c.properties]:[...c.properties,...f]),p={prefix:c.pos===c.end?" ":void 0};e.replaceNode(t.sourceFile,c,g,p),i.writeFixes(e)}function o6e(e,t,r){const i=ax(t.sourceFile,t.program,t.preferences,t.host),s=vf(t.sourceFile,t.preferences),o=Da(t.program.getCompilerOptions()),c=t.program.getTypeChecker(),u=Yt(r.properties,g=>{const p=z$(t,c,i,s,c.getTypeOfSymbol(g),r.parentDeclaration);return I.createPropertyAssignment(lqe(g,o,s,c),p)}),f={leadingTriviaOption:Qr.LeadingTriviaOption.Exclude,trailingTriviaOption:Qr.TrailingTriviaOption.Exclude,indentation:r.indentation};e.replaceNode(t.sourceFile,r.parentDeclaration,I.createObjectLiteralExpression([...r.parentDeclaration.properties,...u],!0),f),i.writeFixes(e)}function z$(e,t,r,i,s,o){if(s.flags&3)return ox();if(s.flags&134217732)return I.createStringLiteral("",i===0);if(s.flags&8)return I.createNumericLiteral(0);if(s.flags&64)return I.createBigIntLiteral("0n");if(s.flags&16)return I.createFalse();if(s.flags&1056){const c=s.symbol.exports?T7(s.symbol.exports.values()):s.symbol,u=t.symbolToExpression(s.symbol.parent?s.symbol.parent:s.symbol,111551,void 0,void 0);return c===void 0||u===void 0?I.createNumericLiteral(0):I.createPropertyAccessExpression(u,t.symbolToString(c))}if(s.flags&256)return I.createNumericLiteral(s.value);if(s.flags&2048)return I.createBigIntLiteral(s.value);if(s.flags&128)return I.createStringLiteral(s.value,i===0);if(s.flags&512)return s===t.getFalseType()||s===t.getFalseType(!0)?I.createFalse():I.createTrue();if(s.flags&65536)return I.createNull();if(s.flags&1048576)return ic(s.types,u=>z$(e,t,r,i,u,o))??ox();if(t.isArrayLikeType(s))return I.createArrayLiteralExpression();if(aqe(s)){const c=Yt(t.getPropertiesOfType(s),u=>{const f=z$(e,t,r,i,t.getTypeOfSymbol(u),o);return I.createPropertyAssignment(u.name,f)});return I.createObjectLiteralExpression(c,!0)}if(Pn(s)&16){if(kn(s.symbol.declarations||ze,ed(pg,fg,mc))===void 0)return ox();const u=t.getSignaturesOfType(s,0);return u===void 0?ox():fX(218,e,i,u[0],aM(d.Function_not_implemented.message,i),void 0,void 0,void 0,o,r)??ox()}if(Pn(s)&1){const c=Qg(s.symbol);if(c===void 0||Mv(c))return ox();const u=cg(c);return u&&Ir(u.parameters)?ox():I.createNewExpression(I.createIdentifier(s.symbol.name),void 0,void 0)}return ox()}function ox(){return I.createIdentifier("undefined")}function aqe(e){return e.flags&524288&&(Pn(e)&128||e.symbol&&Jn(lm(e.symbol.declarations),X_))}function oqe(e,t,r){const i=e.getContextualType(r.attributes);if(i===void 0)return ze;const s=i.getProperties();if(!Ir(s))return ze;const o=new Set;for(const c of r.attributes.properties)if(Rd(c)&&o.add(DE(c.name)),BT(c)){const u=e.getTypeAtLocation(c.expression);for(const f of u.getProperties())o.add(f.escapedName)}return wn(s,c=>lf(c.name,t,1)&&!(c.flags&16777216||Ko(c)&48||o.has(c.escapedName)))}function cqe(e,t){if(X_(e))return;const r=Ar(t,i=>mc(i)||gc(i));return r&&r.parent===e?r:void 0}function lqe(e,t,r,i){if(ym(e)){const s=i.symbolToNode(e,111551,void 0,1073741824);if(s&&xa(s))return s}return q5(e.name,t,r===0,!1,!1)}function c6e(e){if(Ar(e,UE)){const t=Ar(e.parent,Bp);if(t)return t}return Or(e)}var iy,eM,tM,rM,nue,uqe=Nt({"src/services/codefixes/fixAddMissingMember.ts"(){"use strict";zn(),na(),iy="fixMissingMember",eM="fixMissingProperties",tM="fixMissingAttributes",rM="fixMissingFunctionDeclaration",nue=[d.Property_0_does_not_exist_on_type_1.code,d.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,d.Property_0_is_missing_in_type_1_but_required_in_type_2.code,d.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,d.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,d.Cannot_find_name_0.code],Zs({errorCodes:nue,getCodeActions(e){const t=e.program.getTypeChecker(),r=YCe(e.sourceFile,e.span.start,e.errorCode,t,e.program);if(r){if(r.kind===3){const i=Qr.ChangeTracker.with(e,s=>o6e(s,e,r));return[Bs(eM,i,d.Add_missing_properties,eM,d.Add_all_missing_properties)]}if(r.kind===4){const i=Qr.ChangeTracker.with(e,s=>a6e(s,e,r));return[Bs(tM,i,d.Add_missing_attributes,tM,d.Add_all_missing_attributes)]}if(r.kind===2||r.kind===5){const i=Qr.ChangeTracker.with(e,s=>s6e(s,e,r));return[Bs(rM,i,[d.Add_missing_function_declaration_0,r.token.text],rM,d.Add_all_missing_function_declarations)]}if(r.kind===1){const i=Qr.ChangeTracker.with(e,s=>i6e(s,e.program.getTypeChecker(),r));return[Bs(iy,i,[d.Add_missing_enum_member_0,r.token.text],iy,d.Add_all_missing_members)]}return Xi(sqe(e,r),tqe(e,r))}},fixIds:[iy,rM,eM,tM],getAllCodeActions:e=>{const{program:t,fixId:r}=e,i=t.getTypeChecker(),s=new Map,o=new Map;return n6(Qr.ChangeTracker.with(e,c=>{i6(e,nue,u=>{const f=YCe(u.file,u.start,u.code,i,e.program);if(!(!f||!Rp(s,Oa(f.parentDeclaration)+"#"+f.token.text))){if(r===rM&&(f.kind===2||f.kind===5))s6e(c,e,f);else if(r===eM&&f.kind===3)o6e(c,e,f);else if(r===tM&&f.kind===4)a6e(c,e,f);else if(f.kind===1&&i6e(c,i,f),f.kind===0){const{parentDeclaration:g,token:p}=f,y=u4(o,g,()=>[]);y.some(S=>S.token.text===p.text)||y.push(f)}}}),o.forEach((u,f)=>{const g=X_(f)?void 0:Gue(f,i);for(const p of u){if(g?.some(O=>{const z=o.get(O);return!!z&&z.some(({token:W})=>W.text===p.token.text)}))continue;const{parentDeclaration:y,declSourceFile:S,modifierFlags:T,token:C,call:w,isJSFile:D}=p;if(w&&!Ti(C))n6e(e,c,w,C,T&256,y,S);else if(D&&!Mu(y)&&!X_(y))ZCe(c,S,y,C,!!(T&256));else{const O=e6e(i,y,C);t6e(c,S,y,C.text,O,T&256)}}})}))}})}});function l6e(e,t,r){const i=Ms(_qe(t,r),Rs),s=I.createNewExpression(i.expression,i.typeArguments,i.arguments);e.replaceNode(t,i,s)}function _qe(e,t){let r=Ji(e,t.start);const i=yc(t);for(;r.endl6e(s,t,r));return[Bs(W$,i,d.Add_missing_new_operator_to_call,W$,d.Add_missing_new_operator_to_all_calls)]},fixIds:[W$],getAllCodeActions:e=>$a(e,iue,(t,r)=>l6e(t,e.sourceFile,r))})}});function u6e(e,t){return{type:"install package",file:e,packageName:t}}function _6e(e,t){const r=Jn(Ji(e,t),ra);if(!r)return;const i=r.text,{packageName:s}=Rw(i);return Tl(s)?void 0:s}function f6e(e,t,r){var i;return r===sue?gg.nodeCoreModules.has(e)?"@types/node":void 0:(i=t.isKnownTypesPackageName)!=null&&i.call(t,e)?kO(e):void 0}var p6e,U$,sue,aue,pqe=Nt({"src/services/codefixes/fixCannotFindModule.ts"(){"use strict";zn(),na(),p6e="fixCannotFindModule",U$="installTypesPackage",sue=d.Cannot_find_module_0_or_its_corresponding_type_declarations.code,aue=[sue,d.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code],Zs({errorCodes:aue,getCodeActions:function(t){const{host:r,sourceFile:i,span:{start:s}}=t,o=_6e(i,s);if(o===void 0)return;const c=f6e(o,r,t.errorCode);return c===void 0?[]:[Bs(p6e,[],[d.Install_0,c],U$,d.Install_all_missing_types_packages,u6e(i.fileName,c))]},fixIds:[U$],getAllCodeActions:e=>$a(e,aue,(t,r,i)=>{const s=_6e(r.file,r.start);if(s!==void 0)switch(e.fixId){case U$:{const o=f6e(s,e.host,r.code);o&&i.push(u6e(r.file.fileName,o));break}default:E.fail(`Bad fixId: ${e.fixId}`)}})})}});function d6e(e,t){const r=Ji(e,t);return Ms(r.parent,Qn)}function m6e(e,t,r,i,s){const o=Pd(e),c=r.program.getTypeChecker(),u=c.getTypeAtLocation(o),f=c.getPropertiesOfType(u).filter(dqe),g=ax(t,r.program,s,r.host);jue(e,f,t,r,s,g,p=>i.insertMemberAtStart(t,e,p)),g.writeFixes(i)}function dqe(e){const t=q0(ba(e.getDeclarations()));return!(t&2)&&!!(t&64)}var oue,V$,mqe=Nt({"src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts"(){"use strict";zn(),na(),oue=[d.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code],V$="fixClassDoesntImplementInheritedAbstractMember",Zs({errorCodes:oue,getCodeActions:function(t){const{sourceFile:r,span:i}=t,s=Qr.ChangeTracker.with(t,o=>m6e(d6e(r,i.start),r,t,o,t.preferences));return s.length===0?void 0:[Bs(V$,s,d.Implement_inherited_abstract_class,V$,d.Implement_all_inherited_abstract_classes)]},fixIds:[V$],getAllCodeActions:function(t){const r=new Map;return $a(t,oue,(i,s)=>{const o=d6e(s.file,s.start);Rp(r,Oa(o))&&m6e(o,t.sourceFile,t,i,t.preferences)})}})}});function g6e(e,t,r,i){e.insertNodeAtConstructorStart(t,r,i),e.delete(t,i)}function h6e(e,t){const r=Ji(e,t);if(r.kind!==110)return;const i=uf(r),s=y6e(i.body);return s&&!s.expression.arguments.some(o=>bn(o)&&o.expression===r)?{constructor:i,superCall:s}:void 0}function y6e(e){return kl(e)&&ub(e.expression)?e:ks(e)?void 0:ds(e,y6e)}var q$,cue,gqe=Nt({"src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts"(){"use strict";zn(),na(),q$="classSuperMustPrecedeThisAccess",cue=[d.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code],Zs({errorCodes:cue,getCodeActions(e){const{sourceFile:t,span:r}=e,i=h6e(t,r.start);if(!i)return;const{constructor:s,superCall:o}=i,c=Qr.ChangeTracker.with(e,u=>g6e(u,t,s,o));return[Bs(q$,c,d.Make_super_call_the_first_statement_in_the_constructor,q$,d.Make_all_super_calls_the_first_statement_in_their_constructor)]},fixIds:[q$],getAllCodeActions(e){const{sourceFile:t}=e,r=new Map;return $a(e,cue,(i,s)=>{const o=h6e(s.file,s.start);if(!o)return;const{constructor:c,superCall:u}=o;Rp(r,Oa(c.parent))&&g6e(i,t,c,u)})}})}});function v6e(e,t){const r=Ji(e,t);return E.assert(gc(r.parent),"token should be at the constructor declaration"),r.parent}function b6e(e,t,r){const i=I.createExpressionStatement(I.createCallExpression(I.createSuper(),void 0,ze));e.insertNodeAtConstructorStart(t,r,i)}var H$,lue,hqe=Nt({"src/services/codefixes/fixConstructorForDerivedNeedSuperCall.ts"(){"use strict";zn(),na(),H$="constructorForDerivedNeedSuperCall",lue=[d.Constructors_for_derived_classes_must_contain_a_super_call.code],Zs({errorCodes:lue,getCodeActions(e){const{sourceFile:t,span:r}=e,i=v6e(t,r.start),s=Qr.ChangeTracker.with(e,o=>b6e(o,t,i));return[Bs(H$,s,d.Add_missing_super_call,H$,d.Add_all_missing_super_calls)]},fixIds:[H$],getAllCodeActions:e=>$a(e,lue,(t,r)=>b6e(t,e.sourceFile,v6e(r.file,r.start)))})}});function S6e(e,t){Uue(e,t,"jsx",I.createStringLiteral("react"))}var uue,_ue,yqe=Nt({"src/services/codefixes/fixEnableJsxFlag.ts"(){"use strict";zn(),na(),uue="fixEnableJsxFlag",_ue=[d.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code],Zs({errorCodes:_ue,getCodeActions:function(t){const{configFile:r}=t.program.getCompilerOptions();if(r===void 0)return;const i=Qr.ChangeTracker.with(t,s=>S6e(s,r));return[_d(uue,i,d.Enable_the_jsx_flag_in_your_configuration_file)]},fixIds:[uue],getAllCodeActions:e=>$a(e,_ue,t=>{const{configFile:r}=e.program.getCompilerOptions();r!==void 0&&S6e(t,r)})})}});function T6e(e,t,r){const i=kn(e.getSemanticDiagnostics(t),c=>c.start===r.start&&c.length===r.length);if(i===void 0||i.relatedInformation===void 0)return;const s=kn(i.relatedInformation,c=>c.code===d.Did_you_mean_0.code);if(s===void 0||s.file===void 0||s.start===void 0||s.length===void 0)return;const o=que(s.file,Jl(s.start,s.length));if(o!==void 0&&ct(o)&&Gr(o.parent))return{suggestion:vqe(s.messageText),expression:o.parent,arg:o}}function x6e(e,t,r,i){const s=I.createCallExpression(I.createPropertyAccessExpression(I.createIdentifier("Number"),I.createIdentifier("isNaN")),void 0,[r]),o=i.operatorToken.kind;e.replaceNode(t,i,o===38||o===36?I.createPrefixUnaryExpression(54,s):s)}function vqe(e){const[t,r]=Bd(e,` +`,0).match(/'(.*)'/)||[];return r}var G$,fue,bqe=Nt({"src/services/codefixes/fixNaNEquality.ts"(){"use strict";zn(),na(),G$="fixNaNEquality",fue=[d.This_condition_will_always_return_0.code],Zs({errorCodes:fue,getCodeActions(e){const{sourceFile:t,span:r,program:i}=e,s=T6e(i,t,r);if(s===void 0)return;const{suggestion:o,expression:c,arg:u}=s,f=Qr.ChangeTracker.with(e,g=>x6e(g,t,u,c));return[Bs(G$,f,[d.Use_0,o],G$,d.Use_Number_isNaN_in_all_conditions)]},fixIds:[G$],getAllCodeActions:e=>$a(e,fue,(t,r)=>{const i=T6e(e.program,r.file,Jl(r.start,r.length));i&&x6e(t,r.file,i.arg,i.expression)})})}}),Sqe=Nt({"src/services/codefixes/fixModuleAndTargetOptions.ts"(){"use strict";zn(),na(),Zs({errorCodes:[d.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,d.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,d.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code],getCodeActions:function(t){const r=t.program.getCompilerOptions(),{configFile:i}=r;if(i===void 0)return;const s=[],o=Ul(r);if(o>=5&&o<99){const g=Qr.ChangeTracker.with(t,p=>{Uue(p,i,"module",I.createStringLiteral("esnext"))});s.push(_d("fixModuleOption",g,[d.Set_the_module_option_in_your_configuration_file_to_0,"esnext"]))}const u=Da(r);if(u<4||u>99){const g=Qr.ChangeTracker.with(t,p=>{if(!W4(i))return;const S=[["target",I.createStringLiteral("es2017")]];o===1&&S.push(["module",I.createStringLiteral("commonjs")]),Wue(p,i,S)});s.push(_d("fixTargetOption",g,[d.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))}return s.length?s:void 0}})}});function k6e(e,t,r){e.replaceNode(t,r,I.createPropertyAssignment(r.name,r.objectAssignmentInitializer))}function C6e(e,t){return Ms(Ji(e,t).parent,Y_)}var $$,pue,Tqe=Nt({"src/services/codefixes/fixPropertyAssignment.ts"(){"use strict";zn(),na(),$$="fixPropertyAssignment",pue=[d.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code],Zs({errorCodes:pue,fixIds:[$$],getCodeActions(e){const{sourceFile:t,span:r}=e,i=C6e(t,r.start),s=Qr.ChangeTracker.with(e,o=>k6e(o,e.sourceFile,i));return[Bs($$,s,[d.Change_0_to_1,"=",":"],$$,[d.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:e=>$a(e,pue,(t,r)=>k6e(t,r.file,C6e(r.file,r.start)))})}});function E6e(e,t){const r=Ji(e,t),i=wl(r).heritageClauses,s=i[0].getFirstToken();return s.kind===96?{extendsToken:s,heritageClauses:i}:void 0}function D6e(e,t,r,i){if(e.replaceNode(t,r,I.createToken(119)),i.length===2&&i[0].token===96&&i[1].token===119){const s=i[1].getFirstToken(),o=s.getFullStart();e.replaceRange(t,{pos:o,end:o},I.createToken(28));const c=t.text;let u=s.end;for(;uD6e(c,t,i,s));return[Bs(X$,o,d.Change_extends_to_implements,X$,d.Change_all_extended_interfaces_to_implements)]},fixIds:[X$],getAllCodeActions:e=>$a(e,due,(t,r)=>{const i=E6e(r.file,r.start);i&&D6e(t,r.file,i.extendsToken,i.heritageClauses)})})}});function P6e(e,t,r){const i=Ji(e,t);if(Ie(i)||Ti(i))return{node:i,className:r===mue?wl(i).name.text:void 0}}function w6e(e,t,{node:r,className:i}){O_(r),e.replaceNode(t,r,I.createPropertyAccessExpression(i?I.createIdentifier(i):I.createThis(),r))}var Q$,mue,gue,kqe=Nt({"src/services/codefixes/fixForgottenThisPropertyAccess.ts"(){"use strict";zn(),na(),Q$="forgottenThisPropertyAccess",mue=d.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,gue=[d.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,d.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,mue],Zs({errorCodes:gue,getCodeActions(e){const{sourceFile:t}=e,r=P6e(t,e.span.start,e.errorCode);if(!r)return;const i=Qr.ChangeTracker.with(e,s=>w6e(s,t,r));return[Bs(Q$,i,[d.Add_0_to_unresolved_variable,r.className||"this"],Q$,d.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]},fixIds:[Q$],getAllCodeActions:e=>$a(e,gue,(t,r)=>{const i=P6e(r.file,r.start,r.code);i&&w6e(t,e.sourceFile,i)})})}});function Cqe(e){return Ya(vue,e)}function hue(e,t,r,i,s){const o=r.getText()[i];if(!Cqe(o))return;const c=s?vue[o]:`{${I3(r,t,o)}}`;e.replaceRangeWithText(r,{pos:i,end:i+1},c)}var Y$,nM,yue,vue,Eqe=Nt({"src/services/codefixes/fixInvalidJsxCharacters.ts"(){"use strict";zn(),na(),Y$="fixInvalidJsxCharacters_expression",nM="fixInvalidJsxCharacters_htmlEntity",yue=[d.Unexpected_token_Did_you_mean_or_gt.code,d.Unexpected_token_Did_you_mean_or_rbrace.code],Zs({errorCodes:yue,fixIds:[Y$,nM],getCodeActions(e){const{sourceFile:t,preferences:r,span:i}=e,s=Qr.ChangeTracker.with(e,c=>hue(c,r,t,i.start,!1)),o=Qr.ChangeTracker.with(e,c=>hue(c,r,t,i.start,!0));return[Bs(Y$,s,d.Wrap_invalid_character_in_an_expression_container,Y$,d.Wrap_all_invalid_characters_in_an_expression_container),Bs(nM,o,d.Convert_invalid_character_to_its_html_entity_code,nM,d.Convert_all_invalid_characters_to_HTML_entity_code)]},getAllCodeActions(e){return $a(e,yue,(t,r)=>hue(t,e.preferences,r.file,r.start,e.fixId===nM))}}),vue={">":">","}":"}"}}});function Dqe(e,{name:t,jsDocHost:r,jsDocParameterTag:i}){const s=Qr.ChangeTracker.with(e,o=>o.filterJSDocTags(e.sourceFile,r,c=>c!==i));return Bs(iM,s,[d.Delete_unused_param_tag_0,t.getText(e.sourceFile)],iM,d.Delete_all_unused_param_tags)}function Pqe(e,{name:t,jsDocHost:r,signature:i,jsDocParameterTag:s}){if(!Ir(i.parameters))return;const o=e.sourceFile,c=Zy(i),u=new Set;for(const y of c)ad(y)&&Ie(y.name)&&u.add(y.name.escapedText);const f=ic(i.parameters,y=>Ie(y.name)&&!u.has(y.name.escapedText)?y.name.getText(o):void 0);if(f===void 0)return;const g=I.updateJSDocParameterTag(s,s.tagName,I.createIdentifier(f),s.isBracketed,s.typeExpression,s.isNameFirst,s.comment),p=Qr.ChangeTracker.with(e,y=>y.replaceJSDocComment(o,r,Yt(c,S=>S===s?g:S)));return _d(bue,p,[d.Rename_param_tag_name_0_to_1,t.getText(o),f])}function A6e(e,t){const r=Ji(e,t);if(r.parent&&ad(r.parent)&&Ie(r.parent.name)){const i=r.parent,s=lT(i),o=t1(i);if(s&&o)return{jsDocHost:s,signature:o,name:r.parent.name,jsDocParameterTag:i}}}var iM,bue,Sue,wqe=Nt({"src/services/codefixes/fixUnmatchedParameter.ts"(){"use strict";zn(),na(),iM="deleteUnmatchedParameter",bue="renameUnmatchedParameter",Sue=[d.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code],Zs({fixIds:[iM,bue],errorCodes:Sue,getCodeActions:function(t){const{sourceFile:r,span:i}=t,s=[],o=A6e(r,i.start);if(o)return lr(s,Dqe(t,o)),lr(s,Pqe(t,o)),s},getAllCodeActions:function(t){const r=new Map;return n6(Qr.ChangeTracker.with(t,i=>{i6(t,Sue,({file:s,start:o})=>{const c=A6e(s,o);c&&r.set(c.signature,lr(r.get(c.signature),c.jsDocParameterTag))}),r.forEach((s,o)=>{if(t.fixId===iM){const c=new Set(s);i.filterJSDocTags(o.getSourceFile(),o,u=>!c.has(u))}})}))}})}});function Aqe(e,t,r){const i=Jn(Ji(e,r),Ie);if(!i||i.parent.kind!==183)return;const o=t.getTypeChecker().getSymbolAtLocation(i);return kn(o?.declarations||ze,ed(Em,v_,Hl))}function Nqe(e,t,r,i){if(r.kind===271){e.insertModifierBefore(t,156,r.name);return}const s=r.kind===273?r:r.parent.parent;if(s.name&&s.namedBindings)return;const o=i.getTypeChecker();n5(s,u=>{if(yu(u.symbol,o).flags&111551)return!0})||e.insertModifierBefore(t,156,s)}function Iqe(e,t,r,i){nx.doChangeNamedToNamespaceOrDefault(t,i,e,r.parent)}var Z$,N6e,Fqe=Nt({"src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts"(){"use strict";zn(),na(),Z$="fixUnreferenceableDecoratorMetadata",N6e=[d.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code],Zs({errorCodes:N6e,getCodeActions:e=>{const t=Aqe(e.sourceFile,e.program,e.span.start);if(!t)return;const r=Qr.ChangeTracker.with(e,o=>t.kind===276&&Iqe(o,e.sourceFile,t,e.program)),i=Qr.ChangeTracker.with(e,o=>Nqe(o,e.sourceFile,t,e.program));let s;return r.length&&(s=lr(s,_d(Z$,r,d.Convert_named_imports_to_namespace_import))),i.length&&(s=lr(s,_d(Z$,i,d.Use_import_type))),s},fixIds:[Z$]})}});function I6e(e,t,r){e.replaceNode(t,r.parent,I.createKeywordTypeNode(159))}function eN(e,t){return Bs(tN,e,t,tX,d.Delete_all_unused_declarations)}function F6e(e,t,r){e.delete(t,E.checkDefined(Ms(r.parent,RJ).typeParameters,"The type parameter to delete should exist"))}function Tue(e){return e.kind===102||e.kind===80&&(e.parent.kind===276||e.parent.kind===273)}function O6e(e){return e.kind===102?Jn(e.parent,gl):void 0}function L6e(e,t){return ml(t.parent)&&ba(t.parent.getChildren(e))===t}function M6e(e,t,r){e.delete(t,r.parent.kind===243?r.parent:r)}function Oqe(e,t,r){Zt(r.elements,i=>e.delete(t,i))}function Lqe(e,t,r,{parent:i}){if(Ei(i)&&i.initializer&&Sv(i.initializer))if(ml(i.parent)&&Ir(i.parent.declarations)>1){const s=i.parent.parent,o=s.getStart(r),c=s.end;t.delete(r,i),t.insertNodeAt(r,c,i.initializer,{prefix:Zh(e.host,e.formatContext.options)+r.text.slice(nL(r.text,o-1),o),suffix:DA(r)?";":""})}else t.replaceNode(r,i.parent,i.initializer);else t.delete(r,i)}function R6e(e,t,r,i){t!==d.Property_0_is_declared_but_its_value_is_never_read.code&&(i.kind===140&&(i=Ms(i.parent,NT).typeParameter.name),Ie(i)&&Mqe(i)&&(e.replaceNode(r,i,I.createIdentifier(`_${i.text}`)),us(i.parent)&&mk(i.parent).forEach(s=>{Ie(s.name)&&e.replaceNode(r,s.name,I.createIdentifier(`_${s.name.text}`))})))}function Mqe(e){switch(e.parent.kind){case 169:case 168:return!0;case 260:switch(e.parent.parent.parent.kind){case 250:case 249:return!0}}return!1}function K$(e,t,r,i,s,o,c,u){Rqe(t,r,e,i,s,o,c,u),Ie(t)&&ho.Core.eachSymbolReferenceInFile(t,i,e,f=>{bn(f.parent)&&f.parent.name===f&&(f=f.parent),!u&&zqe(f)&&r.delete(e,f.parent.parent)})}function Rqe(e,t,r,i,s,o,c,u){const{parent:f}=e;if(us(f))jqe(t,r,f,i,s,o,c,u);else if(!(u&&Ie(e)&&ho.Core.isSymbolReferencedInFile(e,i,r))){const g=Em(f)?e:xa(f)?f.parent:f;E.assert(g!==r,"should not delete whole source file"),t.delete(r,g)}}function jqe(e,t,r,i,s,o,c,u=!1){if(Bqe(i,t,r,s,o,c,u))if(r.modifiers&&r.modifiers.length>0&&(!Ie(r.name)||ho.Core.isSymbolReferencedInFile(r.name,i,t)))for(const f of r.modifiers)Ys(f)&&e.deleteModifier(t,f);else!r.initializer&&j6e(r,i,s)&&e.delete(t,r)}function j6e(e,t,r){const i=e.parent.parameters.indexOf(e);return!ho.Core.someSignatureUsage(e.parent,r,t,(s,o)=>!o||o.arguments.length>i)}function Bqe(e,t,r,i,s,o,c){const{parent:u}=r;switch(u.kind){case 174:case 176:const f=u.parameters.indexOf(r),g=mc(u)?u.name:u,p=ho.Core.getReferencedSymbolsForNode(u.pos,g,s,i,o);if(p){for(const y of p)for(const S of y.references)if(S.kind===ho.EntryKind.Node){const T=OE(S.node)&&Rs(S.node.parent)&&S.node.parent.arguments.length>f,C=bn(S.node.parent)&&OE(S.node.parent.expression)&&Rs(S.node.parent.parent)&&S.node.parent.parent.arguments.length>f,w=(mc(S.node.parent)||fg(S.node.parent))&&S.node.parent!==r.parent&&S.node.parent.parameters.length>f;if(T||C||w)return!1}}return!0;case 262:return u.name&&Jqe(e,t,u.name)?B6e(u,r,c):!0;case 218:case 219:return B6e(u,r,c);case 178:return!1;case 177:return!0;default:return E.failBadSyntaxKind(u)}}function Jqe(e,t,r){return!!ho.Core.eachSymbolReferenceInFile(r,e,t,i=>Ie(i)&&Rs(i.parent)&&i.parent.arguments.includes(i))}function B6e(e,t,r){const i=e.parameters,s=i.indexOf(t);return E.assert(s!==-1,"The parameter should already be in the list"),r?i.slice(s+1).every(o=>Ie(o.name)&&!o.symbol.isReferenced):s===i.length-1}function zqe(e){return(Gr(e.parent)&&e.parent.left===e||(RW(e.parent)||f1(e.parent))&&e.parent.operand===e)&&kl(e.parent.parent)}var tN,eX,tX,sM,rX,xue,Wqe=Nt({"src/services/codefixes/fixUnusedIdentifier.ts"(){"use strict";zn(),na(),tN="unusedIdentifier",eX="unusedIdentifier_prefix",tX="unusedIdentifier_delete",sM="unusedIdentifier_deleteImports",rX="unusedIdentifier_infer",xue=[d._0_is_declared_but_its_value_is_never_read.code,d._0_is_declared_but_never_used.code,d.Property_0_is_declared_but_its_value_is_never_read.code,d.All_imports_in_import_declaration_are_unused.code,d.All_destructured_elements_are_unused.code,d.All_variables_are_unused.code,d.All_type_parameters_are_unused.code],Zs({errorCodes:xue,getCodeActions(e){const{errorCode:t,sourceFile:r,program:i,cancellationToken:s}=e,o=i.getTypeChecker(),c=i.getSourceFiles(),u=Ji(r,e.span.start);if(od(u))return[eN(Qr.ChangeTracker.with(e,y=>y.delete(r,u)),d.Remove_template_tag)];if(u.kind===30){const y=Qr.ChangeTracker.with(e,S=>F6e(S,r,u));return[eN(y,d.Remove_type_parameters)]}const f=O6e(u);if(f){const y=Qr.ChangeTracker.with(e,S=>S.delete(r,f));return[Bs(tN,y,[d.Remove_import_from_0,qte(f)],sM,d.Delete_all_unused_imports)]}else if(Tue(u)){const y=Qr.ChangeTracker.with(e,S=>K$(r,u,S,o,c,i,s,!1));if(y.length)return[Bs(tN,y,[d.Remove_unused_declaration_for_Colon_0,u.getText(r)],sM,d.Delete_all_unused_imports)]}if(jp(u.parent)||Eb(u.parent)){if(us(u.parent.parent)){const y=u.parent.elements,S=[y.length>1?d.Remove_unused_declarations_for_Colon_0:d.Remove_unused_declaration_for_Colon_0,Yt(y,T=>T.getText(r)).join(", ")];return[eN(Qr.ChangeTracker.with(e,T=>Oqe(T,r,u.parent)),S)]}return[eN(Qr.ChangeTracker.with(e,y=>Lqe(e,y,r,u.parent)),d.Remove_unused_destructuring_declaration)]}if(L6e(r,u))return[eN(Qr.ChangeTracker.with(e,y=>M6e(y,r,u.parent)),d.Remove_variable_statement)];const g=[];if(u.kind===140){const y=Qr.ChangeTracker.with(e,T=>I6e(T,r,u)),S=Ms(u.parent,NT).typeParameter.name.text;g.push(Bs(tN,y,[d.Replace_infer_0_with_unknown,S],rX,d.Replace_all_unused_infer_with_unknown))}else{const y=Qr.ChangeTracker.with(e,S=>K$(r,u,S,o,c,i,s,!1));if(y.length){const S=xa(u.parent)?u.parent:u;g.push(eN(y,[d.Remove_unused_declaration_for_Colon_0,S.getText(r)]))}}const p=Qr.ChangeTracker.with(e,y=>R6e(y,t,r,u));return p.length&&g.push(Bs(tN,p,[d.Prefix_0_with_an_underscore,u.getText(r)],eX,d.Prefix_all_unused_declarations_with_where_possible)),g},fixIds:[eX,tX,sM,rX],getAllCodeActions:e=>{const{sourceFile:t,program:r,cancellationToken:i}=e,s=r.getTypeChecker(),o=r.getSourceFiles();return $a(e,xue,(c,u)=>{const f=Ji(t,u.start);switch(e.fixId){case eX:R6e(c,u.code,t,f);break;case sM:{const g=O6e(f);g?c.delete(t,g):Tue(f)&&K$(t,f,c,s,o,r,i,!0);break}case tX:{if(f.kind===140||Tue(f))break;if(od(f))c.delete(t,f);else if(f.kind===30)F6e(c,t,f);else if(jp(f.parent)){if(f.parent.parent.initializer)break;(!us(f.parent.parent)||j6e(f.parent.parent,s,o))&&c.delete(t,f.parent.parent)}else{if(Eb(f.parent.parent)&&f.parent.parent.parent.initializer)break;L6e(t,f)?M6e(c,t,f.parent):K$(t,f,c,s,o,r,i,!0)}break}case rX:f.kind===140&&I6e(c,t,f);break;default:E.fail(JSON.stringify(e.fixId))}})}})}});function J6e(e,t,r,i,s){const o=Ji(t,r),c=Ar(o,Ci);if(c.getStart(t)!==o.getStart(t)){const f=JSON.stringify({statementKind:E.formatSyntaxKind(c.kind),tokenKind:E.formatSyntaxKind(o.kind),errorCode:s,start:r,length:i});E.fail("Token and statement should start at the same point. "+f)}const u=(Ss(c.parent)?c.parent:c).parent;if(!Ss(c.parent)||c===ba(c.parent.statements))switch(u.kind){case 245:if(u.elseStatement){if(Ss(c.parent))break;e.replaceNode(t,c,I.createBlock(ze));return}case 247:case 248:e.delete(t,u);return}if(Ss(c.parent)){const f=r+i,g=E.checkDefined(Uqe(Hz(c.parent.statements,c),p=>p.posJ6e(i,e.sourceFile,e.span.start,e.span.length,e.errorCode));return[Bs(nX,r,d.Remove_unreachable_code,nX,d.Remove_all_unreachable_code)]},fixIds:[nX],getAllCodeActions:e=>$a(e,kue,(t,r)=>J6e(t,r.file,r.start,r.length,r.code))})}});function z6e(e,t,r){const i=Ji(t,r),s=Ms(i.parent,Uv),o=i.getStart(t),c=s.statement.getStart(t),u=_p(o,c,t)?c:la(t.text,Ua(s,59,t).end,!0);e.deleteRange(t,{pos:o,end:u})}var iX,Cue,qqe=Nt({"src/services/codefixes/fixUnusedLabel.ts"(){"use strict";zn(),na(),iX="fixUnusedLabel",Cue=[d.Unused_label.code],Zs({errorCodes:Cue,getCodeActions(e){const t=Qr.ChangeTracker.with(e,r=>z6e(r,e.sourceFile,e.span.start));return[Bs(iX,t,d.Remove_unused_label,iX,d.Remove_all_unused_labels)]},fixIds:[iX],getAllCodeActions:e=>$a(e,Cue,(t,r)=>z6e(t,r.file,r.start))})}});function W6e(e,t,r,i,s){e.replaceNode(t,r,s.typeToTypeNode(i,r,void 0))}function U6e(e,t,r){const i=Ar(Ji(e,t),Hqe),s=i&&i.type;return s&&{typeNode:s,type:Gqe(r,s)}}function Hqe(e){switch(e.kind){case 234:case 179:case 180:case 262:case 177:case 181:case 200:case 174:case 173:case 169:case 172:case 171:case 178:case 265:case 216:case 260:return!0;default:return!1}}function Gqe(e,t){if(gC(t)){const r=e.getTypeFromTypeNode(t.type);return r===e.getNeverType()||r===e.getVoidType()?r:e.getUnionType(lr([r,e.getUndefinedType()],t.postfix?void 0:e.getNullType()))}return e.getTypeFromTypeNode(t)}var Eue,sX,Due,$qe=Nt({"src/services/codefixes/fixJSDocTypes.ts"(){"use strict";zn(),na(),Eue="fixJSDocTypes_plain",sX="fixJSDocTypes_nullable",Due=[d.JSDoc_types_can_only_be_used_inside_documentation_comments.code,d._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code,d._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code],Zs({errorCodes:Due,getCodeActions(e){const{sourceFile:t}=e,r=e.program.getTypeChecker(),i=U6e(t,e.span.start,r);if(!i)return;const{typeNode:s,type:o}=i,c=s.getText(t),u=[f(o,Eue,d.Change_all_jsdoc_style_types_to_TypeScript)];return s.kind===321&&u.push(f(o,sX,d.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)),u;function f(g,p,y){const S=Qr.ChangeTracker.with(e,T=>W6e(T,t,s,g,r));return Bs("jdocTypes",S,[d.Change_0_to_1,c,r.typeToString(g)],p,y)}},fixIds:[Eue,sX],getAllCodeActions(e){const{fixId:t,program:r,sourceFile:i}=e,s=r.getTypeChecker();return $a(e,Due,(o,c)=>{const u=U6e(c.file,c.start,s);if(!u)return;const{typeNode:f,type:g}=u,p=f.kind===321&&t===sX?s.getNullableType(g,32768):g;W6e(o,i,f,p,s)})}})}});function V6e(e,t,r){e.replaceNodeWithText(t,r,`${r.text}()`)}function q6e(e,t){const r=Ji(e,t);if(bn(r.parent)){let i=r.parent;for(;bn(i.parent);)i=i.parent;return i.name}if(Ie(r))return r}var aX,Pue,Xqe=Nt({"src/services/codefixes/fixMissingCallParentheses.ts"(){"use strict";zn(),na(),aX="fixMissingCallParentheses",Pue=[d.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code],Zs({errorCodes:Pue,fixIds:[aX],getCodeActions(e){const{sourceFile:t,span:r}=e,i=q6e(t,r.start);if(!i)return;const s=Qr.ChangeTracker.with(e,o=>V6e(o,e.sourceFile,i));return[Bs(aX,s,d.Add_missing_call_parentheses,aX,d.Add_all_missing_call_parentheses)]},getAllCodeActions:e=>$a(e,Pue,(t,r)=>{const i=q6e(r.file,r.start);i&&V6e(t,r.file,i)})})}});function Qqe(e){if(e.type)return e.type;if(Ei(e.parent)&&e.parent.type&&pg(e.parent.type))return e.parent.type.type}function H6e(e,t){const r=Ji(e,t),i=uf(r);if(!i)return;let s;switch(i.kind){case 174:s=i.name;break;case 262:case 218:s=Ua(i,100,e);break;case 219:const o=i.typeParameters?30:21;s=Ua(i,o,e)||ba(i.parameters);break;default:return}return s&&{insertBefore:s,returnType:Qqe(i)}}function G6e(e,t,{insertBefore:r,returnType:i}){if(i){const s=qP(i);(!s||s.kind!==80||s.text!=="Promise")&&e.replaceNode(t,i,I.createTypeReferenceNode("Promise",I.createNodeArray([i])))}e.insertModifierBefore(t,134,r)}var oX,wue,Yqe=Nt({"src/services/codefixes/fixAwaitInSyncFunction.ts"(){"use strict";zn(),na(),oX="fixAwaitInSyncFunction",wue=[d.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,d.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,d.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,d.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code],Zs({errorCodes:wue,getCodeActions(e){const{sourceFile:t,span:r}=e,i=H6e(t,r.start);if(!i)return;const s=Qr.ChangeTracker.with(e,o=>G6e(o,t,i));return[Bs(oX,s,d.Add_async_modifier_to_containing_function,oX,d.Add_all_missing_async_modifiers)]},fixIds:[oX],getAllCodeActions:function(t){const r=new Map;return $a(t,wue,(i,s)=>{const o=H6e(s.file,s.start);!o||!Rp(r,Oa(o.insertBefore))||G6e(i,t.sourceFile,o)})}})}});function $6e(e,t,r,i,s){let o,c;if(i===d._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code)o=t,c=t+r;else if(i===d._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code){const u=s.program.getTypeChecker(),f=Ji(e,t).parent;E.assert(R0(f),"error span of fixPropertyOverrideAccessor should only be on an accessor");const g=f.parent;E.assert(Qn(g),"erroneous accessors should only be inside classes");const p=lm(Gue(g,u));if(!p)return[];const y=bi(Dk(f.name)),S=u.getPropertyOfType(u.getTypeAtLocation(p),y);if(!S||!S.valueDeclaration)return[];o=S.valueDeclaration.pos,c=S.valueDeclaration.end,e=Or(S.valueDeclaration)}else E.fail("fixPropertyOverrideAccessor codefix got unexpected error code "+i);return l4e(e,s.program,o,c,s,d.Generate_get_and_set_accessors.message)}var Aue,cX,Zqe=Nt({"src/services/codefixes/fixPropertyOverrideAccessor.ts"(){"use strict";zn(),na(),Aue=[d._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,d._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code],cX="fixPropertyOverrideAccessor",Zs({errorCodes:Aue,getCodeActions(e){const t=$6e(e.sourceFile,e.span.start,e.span.length,e.errorCode,e);if(t)return[Bs(cX,t,d.Generate_get_and_set_accessors,cX,d.Generate_get_and_set_accessors_for_all_overriding_properties)]},fixIds:[cX],getAllCodeActions:e=>$a(e,Aue,(t,r)=>{const i=$6e(r.file,r.start,r.length,r.code,e);if(i)for(const s of i)t.pushRaw(e.sourceFile,s)})})}});function Kqe(e,t){switch(e){case d.Parameter_0_implicitly_has_an_1_type.code:case d.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return N_(uf(t))?d.Infer_type_of_0_from_usage:d.Infer_parameter_types_from_usage;case d.Rest_parameter_0_implicitly_has_an_any_type.code:case d.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return d.Infer_parameter_types_from_usage;case d.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:return d.Infer_this_type_of_0_from_usage;default:return d.Infer_type_of_0_from_usage}}function eHe(e){switch(e){case d.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:return d.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;case d.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return d.Variable_0_implicitly_has_an_1_type.code;case d.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return d.Parameter_0_implicitly_has_an_1_type.code;case d.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return d.Rest_parameter_0_implicitly_has_an_any_type.code;case d.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:return d.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;case d._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:return d._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;case d.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:return d.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;case d.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return d.Member_0_implicitly_has_an_1_type.code}return e}function X6e(e,t,r,i,s,o,c,u,f){if(!F4(r.kind)&&r.kind!==80&&r.kind!==26&&r.kind!==110)return;const{parent:g}=r,p=ax(t,s,f,u);switch(i=eHe(i),i){case d.Member_0_implicitly_has_an_1_type.code:case d.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:if(Ei(g)&&c(g)||Es(g)||ff(g))return Q6e(e,p,t,g,s,u,o),p.writeFixes(e),g;if(bn(g)){const T=rN(g.name,s,o),C=F3(T,g,s,u);if(C){const w=I.createJSDocTypeTag(void 0,I.createJSDocTypeExpression(C),void 0);e.addJSDocTags(t,Ms(g.parent.parent,kl),[w])}return p.writeFixes(e),g}return;case d.Variable_0_implicitly_has_an_1_type.code:{const T=s.getTypeChecker().getSymbolAtLocation(r);return T&&T.valueDeclaration&&Ei(T.valueDeclaration)&&c(T.valueDeclaration)?(Q6e(e,p,Or(T.valueDeclaration),T.valueDeclaration,s,u,o),p.writeFixes(e),T.valueDeclaration):void 0}}const y=uf(r);if(y===void 0)return;let S;switch(i){case d.Parameter_0_implicitly_has_an_1_type.code:if(N_(y)){Y6e(e,p,t,y,s,u,o),S=y;break}case d.Rest_parameter_0_implicitly_has_an_any_type.code:if(c(y)){const T=Ms(g,us);tHe(e,p,t,T,y,s,u,o),S=T}break;case d.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:case d._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:pf(y)&&Ie(y.name)&&(lX(e,p,t,y,rN(y.name,s,o),s,u),S=y);break;case d.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:N_(y)&&(Y6e(e,p,t,y,s,u,o),S=y);break;case d.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:Qr.isThisTypeAnnotatable(y)&&c(y)&&(rHe(e,t,y,s,u,o),S=y);break;default:return E.fail(String(i))}return p.writeFixes(e),S}function Q6e(e,t,r,i,s,o,c){Ie(i.name)&&lX(e,t,r,i,rN(i.name,s,c),s,o)}function tHe(e,t,r,i,s,o,c,u){if(!Ie(i.name))return;const f=sHe(s,r,o,u);if(E.assert(s.parameters.length===f.length,"Parameter count and inference count should match"),Hr(s))Z6e(e,r,f,o,c);else{const g=go(s)&&!Ua(s,21,r);g&&e.insertNodeBefore(r,ba(s.parameters),I.createToken(21));for(const{declaration:p,type:y}of f)p&&!p.type&&!p.initializer&&lX(e,t,r,p,y,o,c);g&&e.insertNodeAfter(r,Sa(s.parameters),I.createToken(22))}}function rHe(e,t,r,i,s,o){const c=K6e(r,t,i,o);if(!c||!c.length)return;const u=Iue(i,c,o).thisParameter(),f=F3(u,r,i,s);f&&(Hr(r)?nHe(e,t,r,f):e.tryInsertThisTypeAnnotation(t,r,f))}function nHe(e,t,r,i){e.addJSDocTags(t,r,[I.createJSDocThisTag(void 0,I.createJSDocTypeExpression(i))])}function Y6e(e,t,r,i,s,o,c){const u=bl(i.parameters);if(u&&Ie(i.name)&&Ie(u.name)){let f=rN(i.name,s,c);f===s.getTypeChecker().getAnyType()&&(f=rN(u.name,s,c)),Hr(i)?Z6e(e,r,[{declaration:u,type:f}],s,o):lX(e,t,r,u,f,s,o)}}function lX(e,t,r,i,s,o,c){const u=F3(s,i,o,c);if(u)if(Hr(r)&&i.kind!==171){const f=Ei(i)?Jn(i.parent.parent,ec):i;if(!f)return;const g=I.createJSDocTypeExpression(u),p=pf(i)?I.createJSDocReturnTag(void 0,g,void 0):I.createJSDocTypeTag(void 0,g,void 0);e.addJSDocTags(r,f,[p])}else iHe(u,i,r,e,t,Da(o.getCompilerOptions()))||e.tryInsertTypeAnnotation(r,i,u)}function iHe(e,t,r,i,s,o){const c=cx(e,o);return c&&i.tryInsertTypeAnnotation(r,t,c.typeNode)?(Zt(c.symbols,u=>s.addImportFromExportedSymbol(u,!0)),!0):!1}function Z6e(e,t,r,i,s){const o=r.length&&r[0].declaration.parent;if(!o)return;const c=Ii(r,u=>{const f=u.declaration;if(f.initializer||Yy(f)||!Ie(f.name))return;const g=u.type&&F3(u.type,f,i,s);if(g){const p=I.cloneNode(f.name);return Vr(p,7168),{name:I.cloneNode(f.name),param:f,isOptional:!!u.isOptional,typeNode:g}}});if(c.length)if(go(o)||ro(o)){const u=go(o)&&!Ua(o,21,t);u&&e.insertNodeBefore(t,ba(o.parameters),I.createToken(21)),Zt(c,({typeNode:f,param:g})=>{const p=I.createJSDocTypeTag(void 0,I.createJSDocTypeExpression(f)),y=I.createJSDocComment(void 0,[p]);e.insertNodeAt(t,g.getStart(t),y,{suffix:" "})}),u&&e.insertNodeAfter(t,Sa(o.parameters),I.createToken(22))}else{const u=Yt(c,({name:f,typeNode:g,isOptional:p})=>I.createJSDocParameterTag(void 0,f,!!p,I.createJSDocTypeExpression(g),!1,void 0));e.addJSDocTags(t,o,u)}}function Nue(e,t,r){return Ii(ho.getReferenceEntriesForNode(-1,e,t,t.getSourceFiles(),r),i=>i.kind!==ho.EntryKind.Span?Jn(i.node,Ie):void 0)}function rN(e,t,r){const i=Nue(e,t,r);return Iue(t,i,r).single()}function sHe(e,t,r,i){const s=K6e(e,t,r,i);return s&&Iue(r,s,i).parameters(e)||e.parameters.map(o=>({declaration:o,type:Ie(o.name)?rN(o.name,r,i):r.getTypeChecker().getAnyType()}))}function K6e(e,t,r,i){let s;switch(e.kind){case 176:s=Ua(e,137,t);break;case 219:case 218:const o=e.parent;s=(Ei(o)||Es(o))&&Ie(o.name)?o.name:e.name;break;case 262:case 174:case 173:s=e.name;break}if(s)return Nue(s,r,i)}function Iue(e,t,r){const i=e.getTypeChecker(),s={string:()=>i.getStringType(),number:()=>i.getNumberType(),Array:he=>i.createArrayType(he),Promise:he=>i.createPromiseType(he)},o=[i.getStringType(),i.getNumberType(),i.createArrayType(i.getAnyType()),i.createPromiseType(i.getAnyType())];return{single:f,parameters:g,thisParameter:p};function c(){return{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0}}function u(he){const be=new Map;for(const pt of he)pt.properties&&pt.properties.forEach((me,Oe)=>{be.has(Oe)||be.set(Oe,[]),be.get(Oe).push(me)});const lt=new Map;return be.forEach((pt,me)=>{lt.set(me,u(pt))}),{isNumber:he.some(pt=>pt.isNumber),isString:he.some(pt=>pt.isString),isNumberOrString:he.some(pt=>pt.isNumberOrString),candidateTypes:ta(he,pt=>pt.candidateTypes),properties:lt,calls:ta(he,pt=>pt.calls),constructs:ta(he,pt=>pt.constructs),numberIndex:Zt(he,pt=>pt.numberIndex),stringIndex:Zt(he,pt=>pt.stringIndex),candidateThisTypes:ta(he,pt=>pt.candidateThisTypes),inferredTypes:void 0}}function f(){return ae(y(t))}function g(he){if(t.length===0||!he.parameters)return;const be=c();for(const pt of t)r.throwIfCancellationRequested(),S(pt,be);const lt=[...be.constructs||[],...be.calls||[]];return he.parameters.map((pt,me)=>{const Oe=[],Xe=rg(pt);let it=!1;for(const Je of lt)if(Je.argumentTypes.length<=me)it=Hr(he),Oe.push(i.getUndefinedType());else if(Xe)for(let ot=me;otlt.every(me=>!me(pt)))}function Y(he){return ae($(he))}function ae(he){if(!he.length)return i.getAnyType();const be=i.getUnionType([i.getStringType(),i.getNumberType()]);let pt=B(he,[{high:Oe=>Oe===i.getStringType()||Oe===i.getNumberType(),low:Oe=>Oe===be},{high:Oe=>!(Oe.flags&16385),low:Oe=>!!(Oe.flags&16385)},{high:Oe=>!(Oe.flags&114689)&&!(Pn(Oe)&16),low:Oe=>!!(Pn(Oe)&16)}]);const me=pt.filter(Oe=>Pn(Oe)&16);return me.length&&(pt=pt.filter(Oe=>!(Pn(Oe)&16)),pt.push(_e(me))),i.getWidenedType(i.getUnionType(pt.map(i.getBaseTypeOfLiteralType),2))}function _e(he){if(he.length===1)return he[0];const be=[],lt=[],pt=[],me=[];let Oe=!1,Xe=!1;const it=of();for(const ot of he){for(const br of i.getPropertiesOfType(ot))it.add(br.escapedName,br.valueDeclaration?i.getTypeOfSymbolAtLocation(br,br.valueDeclaration):i.getAnyType());be.push(...i.getSignaturesOfType(ot,0)),lt.push(...i.getSignaturesOfType(ot,1));const Bt=i.getIndexInfoOfType(ot,0);Bt&&(pt.push(Bt.type),Oe=Oe||Bt.isReadonly);const Ht=i.getIndexInfoOfType(ot,1);Ht&&(me.push(Ht.type),Xe=Xe||Ht.isReadonly)}const mt=RZ(it,(ot,Bt)=>{const Ht=Bt.lengthi.getBaseTypeOfLiteralType(it)),Xe=(pt=he.calls)!=null&&pt.length?H(he):void 0;return Xe&&Oe?me.push(i.getUnionType([Xe,...Oe],2)):(Xe&&me.push(Xe),Ir(Oe)&&me.push(...Oe)),me.push(...K(he)),me}function H(he){const be=new Map;he.properties&&he.properties.forEach((Oe,Xe)=>{const it=i.createSymbol(4,Xe);it.links.type=Y(Oe),be.set(Xe,it)});const lt=he.calls?[Te(he.calls)]:[],pt=he.constructs?[Te(he.constructs)]:[],me=he.stringIndex?[i.createIndexInfo(i.getStringType(),Y(he.stringIndex),!1)]:[];return i.createAnonymousType(void 0,be,lt,pt,me)}function K(he){if(!he.properties||!he.properties.size)return[];const be=o.filter(lt=>oe(lt,he));return 0Se(lt,he)):[]}function oe(he,be){return be.properties?!zl(be.properties,(lt,pt)=>{const me=i.getTypeOfPropertyOfType(he,pt);return me?lt.calls?!i.getSignaturesOfType(me,0).length||!i.isTypeAssignableTo(me,ve(lt.calls)):!i.isTypeAssignableTo(me,Y(lt)):!0}):!1}function Se(he,be){if(!(Pn(he)&4)||!be.properties)return he;const lt=he.target,pt=lm(lt.typeParameters);if(!pt)return he;const me=[];return be.properties.forEach((Oe,Xe)=>{const it=i.getTypeOfPropertyOfType(lt,Xe);E.assert(!!it,"generic should have all the properties of its reference."),me.push(...se(it,Y(Oe),pt))}),s[he.symbol.escapedName](ae(me))}function se(he,be,lt){if(he===lt)return[be];if(he.flags&3145728)return ta(he.types,Oe=>se(Oe,be,lt));if(Pn(he)&4&&Pn(be)&4){const Oe=i.getTypeArguments(he),Xe=i.getTypeArguments(be),it=[];if(Oe&&Xe)for(let mt=0;mtme.argumentTypes.length));for(let me=0;meXe.argumentTypes[me]||i.getUndefinedType())),he.some(Xe=>Xe.argumentTypes[me]===void 0)&&(Oe.flags|=16777216),be.push(Oe)}const pt=Y(u(he.map(me=>me.return_)));return i.createSignature(void 0,void 0,void 0,be,pt,void 0,lt,0)}function Me(he,be){be&&!(be.flags&1)&&!(be.flags&131072)&&(he.candidateTypes||(he.candidateTypes=[])).push(be)}function ke(he,be){be&&!(be.flags&1)&&!(be.flags&131072)&&(he.candidateThisTypes||(he.candidateThisTypes=[])).push(be)}}var uX,Fue,aHe=Nt({"src/services/codefixes/inferFromUsage.ts"(){"use strict";zn(),na(),uX="inferFromUsage",Fue=[d.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,d.Variable_0_implicitly_has_an_1_type.code,d.Parameter_0_implicitly_has_an_1_type.code,d.Rest_parameter_0_implicitly_has_an_any_type.code,d.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,d._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,d.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,d.Member_0_implicitly_has_an_1_type.code,d.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,d.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,d.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,d.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,d.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,d._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,d.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,d.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,d.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code],Zs({errorCodes:Fue,getCodeActions(e){const{sourceFile:t,program:r,span:{start:i},errorCode:s,cancellationToken:o,host:c,preferences:u}=e,f=Ji(t,i);let g;const p=Qr.ChangeTracker.with(e,S=>{g=X6e(S,t,f,s,r,o,zg,c,u)}),y=g&&as(g);return!y||p.length===0?void 0:[Bs(uX,p,[Kqe(s,f),Wc(y)],uX,d.Infer_all_types_from_usage)]},fixIds:[uX],getAllCodeActions(e){const{sourceFile:t,program:r,cancellationToken:i,host:s,preferences:o}=e,c=KT();return $a(e,Fue,(u,f)=>{X6e(u,t,Ji(f.file,f.start),f.code,r,i,c,s,o)})}})}});function e4e(e,t,r){if(Hr(e))return;const i=Ji(e,r),s=Ar(i,po),o=s?.type;if(!o)return;const c=t.getTypeFromTypeNode(o),u=t.getAwaitedType(c)||t.getVoidType(),f=t.typeToTypeNode(u,o,void 0);if(f)return{returnTypeNode:o,returnType:c,promisedTypeNode:f,promisedType:u}}function t4e(e,t,r,i){e.replaceNode(t,r,I.createTypeReferenceNode("Promise",[i]))}var _X,Oue,oHe=Nt({"src/services/codefixes/fixReturnTypeInAsyncFunction.ts"(){"use strict";zn(),na(),_X="fixReturnTypeInAsyncFunction",Oue=[d.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code],Zs({errorCodes:Oue,fixIds:[_X],getCodeActions:function(t){const{sourceFile:r,program:i,span:s}=t,o=i.getTypeChecker(),c=e4e(r,i.getTypeChecker(),s.start);if(!c)return;const{returnTypeNode:u,returnType:f,promisedTypeNode:g,promisedType:p}=c,y=Qr.ChangeTracker.with(t,S=>t4e(S,r,u,g));return[Bs(_X,y,[d.Replace_0_with_Promise_1,o.typeToString(f),o.typeToString(p)],_X,d.Fix_all_incorrect_return_type_of_an_async_functions)]},getAllCodeActions:e=>$a(e,Oue,(t,r)=>{const i=e4e(r.file,e.program.getTypeChecker(),r.start);i&&t4e(t,r.file,i.returnTypeNode,i.promisedTypeNode)})})}});function r4e(e,t,r,i){const{line:s}=qa(t,r);(!i||zy(i,s))&&e.insertCommentBeforeLine(t,s,r," @ts-ignore")}var Lue,Mue,Rue,cHe=Nt({"src/services/codefixes/disableJsDiagnostics.ts"(){"use strict";zn(),na(),Lue="disableJsDiagnostics",Mue="disableJsDiagnostics",Rue=Ii(Object.keys(d),e=>{const t=d[e];return t.category===1?t.code:void 0}),Zs({errorCodes:Rue,getCodeActions:function(t){const{sourceFile:r,program:i,span:s,host:o,formatContext:c}=t;if(!Hr(r)||!O8(r,i.getCompilerOptions()))return;const u=r.checkJsDirective?"":Zh(o,c.options),f=[_d(Lue,[cke(r.fileName,[hA(r.checkJsDirective?zc(r.checkJsDirective.pos,r.checkJsDirective.end):Jl(0,0),`// @ts-nocheck${u}`)])],d.Disable_checking_for_this_file)];return Qr.isValidLocationToAddComment(r,s.start)&&f.unshift(Bs(Lue,Qr.ChangeTracker.with(t,g=>r4e(g,r,s.start)),d.Ignore_this_error_message,Mue,d.Add_ts_ignore_to_all_error_messages)),f},fixIds:[Mue],getAllCodeActions:e=>{const t=new Set;return $a(e,Rue,(r,i)=>{Qr.isValidLocationToAddComment(i.file,i.start)&&r4e(r,i.file,i.start,t)})}})}});function jue(e,t,r,i,s,o,c){const u=e.symbol.members;for(const f of t)u.has(f.escapedName)||n4e(f,e,r,i,s,o,c,void 0)}function a6(e){return{trackSymbol:()=>!1,moduleResolverHost:SH(e.program,e.host)}}function n4e(e,t,r,i,s,o,c,u,f=3,g=!1){const p=e.getDeclarations(),y=bl(p),S=i.program.getTypeChecker(),T=Da(i.program.getCompilerOptions()),C=y?.kind??171,w=K(e,y),D=y?Fu(y):0;let O=D&256;O|=D&1?1:D&4?4:0,y&&n_(y)&&(O|=512);const z=Y(),W=S.getWidenedType(S.getTypeOfSymbolAtLocation(e,t)),X=!!(e.flags&16777216),J=!!(t.flags&33554432)||g,ie=vf(r,s);switch(C){case 171:case 172:const oe=ie===0?268435456:void 0;let Se=S.typeToTypeNode(W,t,oe,a6(i));if(o){const Z=cx(Se,T);Z&&(Se=Z.typeNode,o6(o,Z.symbols))}c(I.createPropertyDeclaration(z,y?_e(w):e.getName(),X&&f&2?I.createToken(58):void 0,Se,void 0));break;case 177:case 178:{E.assertIsDefined(p);let Z=S.typeToTypeNode(W,t,void 0,a6(i));const ve=vb(p,y),Te=ve.secondAccessor?[ve.firstAccessor,ve.secondAccessor]:[ve.firstAccessor];if(o){const Me=cx(Z,T);Me&&(Z=Me.typeNode,o6(o,Me.symbols))}for(const Me of Te)if(pf(Me))c(I.createGetAccessorDeclaration(z,_e(w),ze,H(Z),$(u,ie,J)));else{E.assertNode(Me,N_,"The counterpart to a getter should be a setter");const ke=iE(Me),he=ke&&Ie(ke.name)?an(ke.name):void 0;c(I.createSetAccessorDeclaration(z,_e(w),Jue(1,[he],[H(Z)],1,!1),$(u,ie,J)))}break}case 173:case 174:E.assertIsDefined(p);const se=W.isUnion()?ta(W.types,Z=>Z.getCallSignatures()):W.getCallSignatures();if(!ut(se))break;if(p.length===1){E.assert(se.length===1,"One declaration implies one signature");const Z=se[0];B(ie,Z,z,_e(w),$(u,ie,J));break}for(const Z of se)B(ie,Z,z,_e(w));if(!J)if(p.length>se.length){const Z=S.getSignatureFromDeclaration(p[p.length-1]);B(ie,Z,z,_e(w),$(u,ie))}else E.assert(p.length===se.length,"Declarations and signatures should match count"),c(_He(S,i,t,se,_e(w),X&&!!(f&1),z,ie,u));break}function B(oe,Se,se,Z,ve){const Te=fX(174,i,oe,Se,ve,Z,se,X&&!!(f&1),t,o);Te&&c(Te)}function Y(){let oe;return O&&(oe=ik(oe,I.createModifiersFromModifierFlags(O))),ae()&&(oe=lr(oe,I.createToken(164))),oe&&I.createNodeArray(oe)}function ae(){return!!(i.program.getCompilerOptions().noImplicitOverride&&y&&Mv(y))}function _e(oe){return Ie(oe)&&oe.escapedText==="constructor"?I.createComputedPropertyName(I.createStringLiteral(an(oe),ie===0)):wo(oe,!1)}function $(oe,Se,se){return se?void 0:wo(oe,!1)||zue(Se)}function H(oe){return wo(oe,!1)}function K(oe,Se){if(Ko(oe)&262144){const se=oe.links.nameType;if(se&&pp(se))return I.createIdentifier(bi(dp(se)))}return wo(as(Se),!1)}}function fX(e,t,r,i,s,o,c,u,f,g){const p=t.program,y=p.getTypeChecker(),S=Da(p.getCompilerOptions()),T=Hr(f),C=524545|(r===0?268435456:0),w=y.signatureToSignatureDeclaration(i,e,f,C,a6(t));if(!w)return;let D=T?void 0:w.typeParameters,O=w.parameters,z=T?void 0:w.type;if(g){if(D){const ie=Yc(D,B=>{let Y=B.constraint,ae=B.default;if(Y){const _e=cx(Y,S);_e&&(Y=_e.typeNode,o6(g,_e.symbols))}if(ae){const _e=cx(ae,S);_e&&(ae=_e.typeNode,o6(g,_e.symbols))}return I.updateTypeParameterDeclaration(B,B.modifiers,B.name,Y,ae)});D!==ie&&(D=tt(I.createNodeArray(ie,D.hasTrailingComma),D))}const J=Yc(O,ie=>{let B=T?void 0:ie.type;if(B){const Y=cx(B,S);Y&&(B=Y.typeNode,o6(g,Y.symbols))}return I.updateParameterDeclaration(ie,ie.modifiers,ie.dotDotDotToken,ie.name,T?void 0:ie.questionToken,B,ie.initializer)});if(O!==J&&(O=tt(I.createNodeArray(J,O.hasTrailingComma),O)),z){const ie=cx(z,S);ie&&(z=ie.typeNode,o6(g,ie.symbols))}}const W=u?I.createToken(58):void 0,X=w.asteriskToken;if(ro(w))return I.updateFunctionExpression(w,c,w.asteriskToken,Jn(o,Ie),D,O,z,s??w.body);if(go(w))return I.updateArrowFunction(w,c,D,O,z,w.equalsGreaterThanToken,s??w.body);if(mc(w))return I.updateMethodDeclaration(w,c,X,o??I.createIdentifier(""),W,D,O,z,s);if(Zc(w))return I.updateFunctionDeclaration(w,c,w.asteriskToken,Jn(o,Ie),D,O,z,s??w.body)}function Bue(e,t,r,i,s,o,c){const u=vf(t.sourceFile,t.preferences),f=Da(t.program.getCompilerOptions()),g=a6(t),p=t.program.getTypeChecker(),y=Hr(c),{typeArguments:S,arguments:T,parent:C}=i,w=y?void 0:p.getContextualType(i),D=Yt(T,ae=>Ie(ae)?ae.text:bn(ae)&&Ie(ae.name)?ae.name.text:void 0),O=y?[]:Yt(T,ae=>p.getTypeAtLocation(ae)),{argumentTypeNodes:z,argumentTypeParameters:W}=a4e(p,r,O,c,f,1,g),X=o?I.createNodeArray(I.createModifiersFromModifierFlags(o)):void 0,J=zF(C)?I.createToken(42):void 0,ie=y?void 0:lHe(p,W,S),B=Jue(T.length,D,z,void 0,y),Y=y||w===void 0?void 0:p.typeToTypeNode(w,c,void 0,g);switch(e){case 174:return I.createMethodDeclaration(X,J,s,void 0,ie,B,Y,zue(u));case 173:return I.createMethodSignature(X,s,void 0,ie,B,Y===void 0?I.createKeywordTypeNode(159):Y);case 262:return E.assert(typeof s=="string"||Ie(s),"Unexpected name"),I.createFunctionDeclaration(X,J,s,ie,B,Y,aM(d.Function_not_implemented.message,u));default:E.fail("Unexpected kind")}}function lHe(e,t,r){const i=new Set(t.map(o=>o[0])),s=new Map(t);if(r){const o=r.filter(u=>!t.some(f=>{var g;return e.getTypeAtLocation(u)===((g=f[1])==null?void 0:g.argumentType)})),c=i.size+o.length;for(let u=0;i.size{var c;return I.createTypeParameterDeclaration(void 0,o,(c=s.get(o))==null?void 0:c.constraint)})}function i4e(e){return 84+e<=90?String.fromCharCode(84+e):`T${e}`}function pX(e,t,r,i,s,o,c){let u=e.typeToTypeNode(r,i,o,c);if(u&&Zg(u)){const f=cx(u,s);f&&(o6(t,f.symbols),u=f.typeNode)}return wo(u)}function s4e(e){return e.isUnionOrIntersection()?e.types.some(s4e):e.flags&262144}function a4e(e,t,r,i,s,o,c){const u=[],f=new Map;for(let g=0;g=i?I.createToken(58):void 0,s?void 0:r?.[u]||I.createKeywordTypeNode(159),void 0);o.push(p)}return o}function _He(e,t,r,i,s,o,c,u,f){let g=i[0],p=i[0].minArgumentCount,y=!1;for(const w of i)p=Math.min(w.minArgumentCount,p),bu(w)&&(y=!0),w.parameters.length>=g.parameters.length&&(!bu(w)||bu(g))&&(g=w);const S=g.parameters.length-(bu(g)?1:0),T=g.parameters.map(w=>w.name),C=Jue(S,T,void 0,p,!1);if(y){const w=I.createParameterDeclaration(void 0,I.createToken(26),T[S]||"rest",S>=p?I.createToken(58):void 0,I.createArrayTypeNode(I.createKeywordTypeNode(159)),void 0);C.push(w)}return pHe(c,s,o,void 0,C,fHe(i,e,t,r),u,f)}function fHe(e,t,r,i){if(Ir(e)){const s=t.getUnionType(Yt(e,t.getReturnTypeOfSignature));return t.typeToTypeNode(s,i,1,a6(r))}}function pHe(e,t,r,i,s,o,c,u){return I.createMethodDeclaration(e,void 0,t,r?I.createToken(58):void 0,i,s,o,u||zue(c))}function zue(e){return aM(d.Method_not_implemented.message,e)}function aM(e,t){return I.createBlock([I.createThrowStatement(I.createNewExpression(I.createIdentifier("Error"),void 0,[I.createStringLiteral(e,t===0)]))],!0)}function Wue(e,t,r){const i=W4(t);if(!i)return;const s=Vue(i,"compilerOptions");if(s===void 0){e.insertNodeAtObjectStart(t,i,dX("compilerOptions",I.createObjectLiteralExpression(r.map(([c,u])=>dX(c,u)),!0)));return}const o=s.initializer;if(ma(o))for(const[c,u]of r){const f=Vue(o,c);f===void 0?e.insertNodeAtObjectStart(t,o,dX(c,u)):e.replaceNode(t,f.initializer,u)}}function Uue(e,t,r,i){Wue(e,t,[[r,i]])}function dX(e,t){return I.createPropertyAssignment(I.createStringLiteral(e),t)}function Vue(e,t){return kn(e.properties,r=>Hc(r)&&!!r.name&&ra(r.name)&&r.name.text===t)}function cx(e,t){let r;const i=He(e,s,Si);if(r&&i)return{typeNode:i,symbols:r};function s(o){if(U0(o)&&o.qualifier){const c=$_(o.qualifier),u=dL(c.symbol,t),f=u!==c.text?c4e(o.qualifier,I.createIdentifier(u)):o.qualifier;r=lr(r,c.symbol);const g=kr(o.typeArguments,s,Si);return I.createTypeReferenceNode(f,g)}return sr(o,s,cd)}}function c4e(e,t){return e.kind===80?t:I.createQualifiedName(c4e(e.left,t),e.right)}function o6(e,t){t.forEach(r=>e.addImportFromExportedSymbol(r,!0))}function que(e,t){const r=yc(t);let i=Ji(e,t.start);for(;i.end(e[e.Method=1]="Method",e[e.Property=2]="Property",e[e.All=3]="All",e))(Hue||{})}});function l4e(e,t,r,i,s,o){const c=f4e(e,t,r,i);if(!c||nx.isRefactorErrorInfo(c))return;const u=Qr.ChangeTracker.fromContext(s),{isStatic:f,isReadonly:g,fieldName:p,accessorName:y,originalName:S,type:T,container:C,declaration:w}=c;O_(p),O_(y),O_(w),O_(C);let D,O;if(Qn(C)){const W=Fu(w);if(Iu(e)){const X=I.createModifiersFromModifierFlags(W);D=X,O=X}else D=I.createModifiersFromModifierFlags(hHe(W)),O=I.createModifiersFromModifierFlags(yHe(W));Lb(w)&&(O=Xi(O0(w),O))}xHe(u,e,w,T,p,O);const z=vHe(p,y,T,D,f,C);if(O_(z),p4e(u,e,z,w,C),g){const W=cg(C);W&&kHe(u,e,W,p.text,S)}else{const W=bHe(p,y,T,D,f,C);O_(W),p4e(u,e,W,w,C)}return u.getChanges()}function mHe(e){return Ie(e)||ra(e)}function gHe(e){return E_(e,e.parent)||Es(e)||Hc(e)}function u4e(e,t){return Ie(t)?I.createIdentifier(e):I.createStringLiteral(e)}function _4e(e,t,r){const i=t?r.name:I.createThis();return Ie(e)?I.createPropertyAccessExpression(i,e):I.createElementAccessExpression(i,I.createStringLiteralFromNode(e))}function hHe(e){return e&=-9,e&=-3,e&4||(e|=1),e}function yHe(e){return e&=-2,e&=-5,e|=2,e}function f4e(e,t,r,i,s=!0){const o=Ji(e,r),c=r===i&&s,u=Ar(o.parent,gHe),f=271;if(!u||!(M9(u.name,e,r,i)||c))return{error:ls(d.Could_not_find_property_for_which_to_generate_accessor)};if(!mHe(u.name))return{error:ls(d.Name_is_not_valid)};if((Fu(u)&98303|f)!==f)return{error:ls(d.Can_only_convert_property_with_modifier)};const g=u.name.text,p=UH(g),y=u4e(p?g:Gb(`_${g}`,e),u.name),S=u4e(p?Gb(g.substring(1),e):g,u.name);return{isStatic:Uc(u),isReadonly:sE(u),type:CHe(u,t),container:u.kind===169?u.parent.parent:u.parent,originalName:u.name.text,declaration:u,fieldName:y,accessorName:S,renameAccessor:p}}function vHe(e,t,r,i,s,o){return I.createGetAccessorDeclaration(i,t,[],r,I.createBlock([I.createReturnStatement(_4e(e,s,o))],!0))}function bHe(e,t,r,i,s,o){return I.createSetAccessorDeclaration(i,t,[I.createParameterDeclaration(void 0,void 0,I.createIdentifier("value"),void 0,r)],I.createBlock([I.createExpressionStatement(I.createAssignment(_4e(e,s,o),I.createIdentifier("value")))],!0))}function SHe(e,t,r,i,s,o){const c=I.updatePropertyDeclaration(r,o,s,r.questionToken||r.exclamationToken,i,r.initializer);e.replaceNode(t,r,c)}function THe(e,t,r,i){let s=I.updatePropertyAssignment(r,i,r.initializer);(s.modifiers||s.questionToken||s.exclamationToken)&&(s===r&&(s=I.cloneNode(s)),s.modifiers=void 0,s.questionToken=void 0,s.exclamationToken=void 0),e.replacePropertyAssignment(t,r,s)}function xHe(e,t,r,i,s,o){Es(r)?SHe(e,t,r,i,s,o):Hc(r)?THe(e,t,r,s):e.replaceNode(t,r,I.updateParameterDeclaration(r,o,r.dotDotDotToken,Ms(s,Ie),r.questionToken,r.type,r.initializer))}function p4e(e,t,r,i,s){E_(i,i.parent)?e.insertMemberAtStart(t,s,r):Hc(i)?e.insertNodeAfterComma(t,i,r):e.insertNodeAfter(t,i,r)}function kHe(e,t,r,i,s){r.body&&r.body.forEachChild(function o(c){mo(c)&&c.expression.kind===110&&ra(c.argumentExpression)&&c.argumentExpression.text===s&&gT(c)&&e.replaceNode(t,c.argumentExpression,I.createStringLiteral(i)),bn(c)&&c.expression.kind===110&&c.name.text===s&&gT(c)&&e.replaceNode(t,c.name,I.createIdentifier(i)),!ks(c)&&!Qn(c)&&c.forEachChild(o)})}function CHe(e,t){const r=bte(e);if(Es(e)&&r&&e.questionToken){const i=t.getTypeChecker(),s=i.getTypeFromTypeNode(r);if(!i.isTypeAssignableTo(i.getUndefinedType(),s)){const o=u1(r)?r.types:[r];return I.createUnionTypeNode([...o,I.createKeywordTypeNode(157)])}}return r}function Gue(e,t){const r=[];for(;e;){const i=Nv(e),s=i&&t.getSymbolAtLocation(i.expression);if(!s)break;const o=s.flags&2097152?t.getAliasedSymbol(s):s,c=o.declarations&&kn(o.declarations,Qn);if(!c)break;r.push(c),e=c}return r}var EHe=Nt({"src/services/codefixes/generateAccessors.ts"(){"use strict";zn()}});function DHe(e,t){const r=Or(t),i=jk(t),s=e.program.getCompilerOptions(),o=[];return o.push(d4e(e,r,t,Yh(i.name,void 0,t.moduleSpecifier,vf(r,e.preferences)))),Ul(s)===1&&o.push(d4e(e,r,t,I.createImportEqualsDeclaration(void 0,!1,i.name,I.createExternalModuleReference(t.moduleSpecifier)))),o}function d4e(e,t,r,i){const s=Qr.ChangeTracker.with(e,o=>o.replaceNode(t,r,i));return _d($ue,s,[d.Replace_import_with_0,s[0].textChanges[0].newText])}function PHe(e){const t=e.sourceFile,r=d.This_expression_is_not_callable.code===e.errorCode?213:214,i=Ar(Ji(t,e.span.start),o=>o.kind===r);if(!i)return[];const s=i.expression;return m4e(e,s)}function wHe(e){const t=e.sourceFile,r=Ar(Ji(t,e.span.start),i=>i.getStart()===e.span.start&&i.getEnd()===e.span.start+e.span.length);return r?m4e(e,r):[]}function m4e(e,t){const r=e.program.getTypeChecker().getTypeAtLocation(t);if(!(r.symbol&&ym(r.symbol)&&r.symbol.links.originatingImport))return[];const i=[],s=r.symbol.links.originatingImport;if(G_(s)||Dn(i,DHe(e,s)),ct(t)&&!(Au(t.parent)&&t.parent.name===t)){const o=e.sourceFile,c=Qr.ChangeTracker.with(e,u=>u.replaceNode(o,t,I.createPropertyAccessExpression(t,"default"),{}));i.push(_d($ue,c,d.Use_synthetic_default_member))}return i}var $ue,AHe=Nt({"src/services/codefixes/fixInvalidImportSyntax.ts"(){"use strict";zn(),na(),$ue="invalidImportSyntax",Zs({errorCodes:[d.This_expression_is_not_callable.code,d.This_expression_is_not_constructable.code],getCodeActions:PHe}),Zs({errorCodes:[d.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,d.Type_0_does_not_satisfy_the_constraint_1.code,d.Type_0_is_not_assignable_to_type_1.code,d.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,d.Type_predicate_0_is_not_assignable_to_1.code,d.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,d._0_index_type_1_is_not_assignable_to_2_index_type_3.code,d.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,d.Property_0_in_type_1_is_not_assignable_to_type_2.code,d.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,d.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code],getCodeActions:wHe})}});function g4e(e,t){const r=Ji(e,t);if(Ie(r)&&Es(r.parent)){const i=Wl(r.parent);if(i)return{type:i,prop:r.parent,isJs:Hr(r.parent)}}}function NHe(e,t){if(t.isJs)return;const r=Qr.ChangeTracker.with(e,i=>h4e(i,e.sourceFile,t.prop));return Bs(mX,r,[d.Add_definite_assignment_assertion_to_property_0,t.prop.getText()],gX,d.Add_definite_assignment_assertions_to_all_uninitialized_properties)}function h4e(e,t,r){O_(r);const i=I.updatePropertyDeclaration(r,r.modifiers,r.name,I.createToken(54),r.type,r.initializer);e.replaceNode(t,r,i)}function IHe(e,t){const r=Qr.ChangeTracker.with(e,i=>y4e(i,e.sourceFile,t));return Bs(mX,r,[d.Add_undefined_type_to_property_0,t.prop.name.getText()],hX,d.Add_undefined_type_to_all_uninitialized_properties)}function y4e(e,t,r){const i=I.createKeywordTypeNode(157),s=u1(r.type)?r.type.types.concat(i):[r.type,i],o=I.createUnionTypeNode(s);r.isJs?e.addJSDocTags(t,r.prop,[I.createJSDocTypeTag(void 0,I.createJSDocTypeExpression(o))]):e.replaceNode(t,r.type,o)}function FHe(e,t){if(t.isJs)return;const r=e.program.getTypeChecker(),i=b4e(r,t.prop);if(!i)return;const s=Qr.ChangeTracker.with(e,o=>v4e(o,e.sourceFile,t.prop,i));return Bs(mX,s,[d.Add_initializer_to_property_0,t.prop.name.getText()],yX,d.Add_initializers_to_all_uninitialized_properties)}function v4e(e,t,r,i){O_(r);const s=I.updatePropertyDeclaration(r,r.modifiers,r.name,r.questionToken,r.type,i);e.replaceNode(t,r,s)}function b4e(e,t){return S4e(e,e.getTypeFromTypeNode(t.type))}function S4e(e,t){if(t.flags&512)return t===e.getFalseType()||t===e.getFalseType(!0)?I.createFalse():I.createTrue();if(t.isStringLiteral())return I.createStringLiteral(t.value);if(t.isNumberLiteral())return I.createNumericLiteral(t.value);if(t.flags&2048)return I.createBigIntLiteral(t.value);if(t.isUnion())return ic(t.types,r=>S4e(e,r));if(t.isClass()){const r=Qg(t.symbol);if(!r||In(r,64))return;const i=cg(r);return i&&i.parameters.length?void 0:I.createNewExpression(I.createIdentifier(t.symbol.name),void 0,void 0)}else if(e.isArrayLikeType(t))return I.createArrayLiteralExpression()}var mX,gX,hX,yX,Xue,OHe=Nt({"src/services/codefixes/fixStrictClassInitialization.ts"(){"use strict";zn(),na(),mX="strictClassInitialization",gX="addMissingPropertyDefiniteAssignmentAssertions",hX="addMissingPropertyUndefinedType",yX="addMissingPropertyInitializer",Xue=[d.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code],Zs({errorCodes:Xue,getCodeActions:function(t){const r=g4e(t.sourceFile,t.span.start);if(!r)return;const i=[];return lr(i,IHe(t,r)),lr(i,NHe(t,r)),lr(i,FHe(t,r)),i},fixIds:[gX,hX,yX],getAllCodeActions:e=>$a(e,Xue,(t,r)=>{const i=g4e(r.file,r.start);if(i)switch(e.fixId){case gX:h4e(t,r.file,i.prop);break;case hX:y4e(t,r.file,i);break;case yX:const s=e.program.getTypeChecker(),o=b4e(s,i.prop);if(!o)return;v4e(t,r.file,i.prop,o);break;default:E.fail(JSON.stringify(e.fixId))}})})}});function T4e(e,t,r){const{allowSyntheticDefaults:i,defaultImportName:s,namedImports:o,statement:c,required:u}=r;e.replaceNode(t,c,s&&!i?I.createImportEqualsDeclaration(void 0,!1,s,I.createExternalModuleReference(u)):I.createImportDeclaration(void 0,I.createImportClause(!1,s,o),u,void 0))}function x4e(e,t,r){const{parent:i}=Ji(e,r);g_(i,!0)||E.failBadSyntaxKind(i);const s=Ms(i.parent,Ei),o=Jn(s.name,Ie),c=jp(s.name)?LHe(s.name):void 0;if(o||c)return{allowSyntheticDefaults:vT(t.getCompilerOptions()),defaultImportName:o,namedImports:c,statement:Ms(s.parent.parent,ec),required:ba(i.arguments)}}function LHe(e){const t=[];for(const r of e.elements){if(!Ie(r.name)||r.initializer)return;t.push(I.createImportSpecifier(!1,Jn(r.propertyName,Ie),r.name))}if(t.length)return I.createNamedImports(t)}var vX,Que,MHe=Nt({"src/services/codefixes/requireInTs.ts"(){"use strict";zn(),na(),vX="requireInTs",Que=[d.require_call_may_be_converted_to_an_import.code],Zs({errorCodes:Que,getCodeActions(e){const t=x4e(e.sourceFile,e.program,e.span.start);if(!t)return;const r=Qr.ChangeTracker.with(e,i=>T4e(i,e.sourceFile,t));return[Bs(vX,r,d.Convert_require_to_import,vX,d.Convert_all_require_to_import)]},fixIds:[vX],getAllCodeActions:e=>$a(e,Que,(t,r)=>{const i=x4e(r.file,e.program,r.start);i&&T4e(t,e.sourceFile,i)})})}});function k4e(e,t){const r=Ji(e,t);if(!Ie(r))return;const{parent:i}=r;if(Hl(i)&&Pm(i.moduleReference))return{importNode:i,name:r,moduleSpecifier:i.moduleReference.expression};if(K0(i)){const s=i.parent.parent;return{importNode:s,name:r,moduleSpecifier:s.moduleSpecifier}}}function C4e(e,t,r,i){e.replaceNode(t,r.importNode,Yh(r.name,void 0,r.moduleSpecifier,vf(t,i)))}var bX,Yue,RHe=Nt({"src/services/codefixes/useDefaultImport.ts"(){"use strict";zn(),na(),bX="useDefaultImport",Yue=[d.Import_may_be_converted_to_a_default_import.code],Zs({errorCodes:Yue,getCodeActions(e){const{sourceFile:t,span:{start:r}}=e,i=k4e(t,r);if(!i)return;const s=Qr.ChangeTracker.with(e,o=>C4e(o,t,i,e.preferences));return[Bs(bX,s,d.Convert_to_default_import,bX,d.Convert_all_to_default_imports)]},fixIds:[bX],getAllCodeActions:e=>$a(e,Yue,(t,r)=>{const i=k4e(r.file,r.start);i&&C4e(t,r.file,i,e.preferences)})})}});function E4e(e,t,r){const i=Jn(Ji(t,r.start),A_);if(!i)return;const s=i.getText(t)+"n";e.replaceNode(t,i,I.createBigIntLiteral(s))}var SX,Zue,jHe=Nt({"src/services/codefixes/useBigintLiteral.ts"(){"use strict";zn(),na(),SX="useBigintLiteral",Zue=[d.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code],Zs({errorCodes:Zue,getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>E4e(i,t.sourceFile,t.span));if(r.length>0)return[Bs(SX,r,d.Convert_to_a_bigint_numeric_literal,SX,d.Convert_all_to_bigint_numeric_literals)]},fixIds:[SX],getAllCodeActions:e=>$a(e,Zue,(t,r)=>E4e(t,r.file,r))})}});function D4e(e,t){const r=Ji(e,t);return E.assert(r.kind===102,"This token should be an ImportKeyword"),E.assert(r.parent.kind===205,"Token parent should be an ImportType"),r.parent}function P4e(e,t,r){const i=I.updateImportTypeNode(r,r.argument,r.attributes,r.qualifier,r.typeArguments,!0);e.replaceNode(t,r,i)}var w4e,TX,Kue,BHe=Nt({"src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts"(){"use strict";zn(),na(),w4e="fixAddModuleReferTypeMissingTypeof",TX=w4e,Kue=[d.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code],Zs({errorCodes:Kue,getCodeActions:function(t){const{sourceFile:r,span:i}=t,s=D4e(r,i.start),o=Qr.ChangeTracker.with(t,c=>P4e(c,r,s));return[Bs(TX,o,d.Add_missing_typeof,TX,d.Add_missing_typeof)]},fixIds:[TX],getAllCodeActions:e=>$a(e,Kue,(t,r)=>P4e(t,e.sourceFile,D4e(r.file,r.start)))})}});function A4e(e,t){let s=Ji(e,t).parent.parent;if(!(!Gr(s)&&(s=s.parent,!Gr(s)))&&sc(s.operatorToken))return s}function N4e(e,t,r){const i=JHe(r);i&&e.replaceNode(t,r,I.createJsxFragment(I.createJsxOpeningFragment(),i,I.createJsxJsxClosingFragment()))}function JHe(e){const t=[];let r=e;for(;;)if(Gr(r)&&sc(r.operatorToken)&&r.operatorToken.kind===28){if(t.push(r.left),AP(r.right))return t.push(r.right),t;if(Gr(r.right)){r=r.right;continue}else return}else return}var xX,e_e,zHe=Nt({"src/services/codefixes/wrapJsxInFragment.ts"(){"use strict";zn(),na(),xX="wrapJsxInFragment",e_e=[d.JSX_expressions_must_have_one_parent_element.code],Zs({errorCodes:e_e,getCodeActions:function(t){const{sourceFile:r,span:i}=t,s=A4e(r,i.start);if(!s)return;const o=Qr.ChangeTracker.with(t,c=>N4e(c,r,s));return[Bs(xX,o,d.Wrap_in_JSX_fragment,xX,d.Wrap_all_unparented_JSX_in_JSX_fragment)]},fixIds:[xX],getAllCodeActions:e=>$a(e,e_e,(t,r)=>{const i=A4e(e.sourceFile,r.start);i&&N4e(t,e.sourceFile,i)})})}});function I4e(e,t){const r=Ji(e,t),i=Jn(r.parent.parent,Cb);if(!i)return;const s=Mu(i.parent)?i.parent:Jn(i.parent.parent,Jp);if(s)return{indexSignature:i,container:s}}function WHe(e,t){return I.createTypeAliasDeclaration(e.modifiers,e.name,e.typeParameters,t)}function F4e(e,t,{indexSignature:r,container:i}){const o=(Mu(i)?i.members:i.type.members).filter(p=>!Cb(p)),c=ba(r.parameters),u=I.createTypeParameterDeclaration(void 0,Ms(c.name,Ie),c.type),f=I.createMappedTypeNode(sE(r)?I.createModifier(148):void 0,u,void 0,r.questionToken,r.type,void 0),g=I.createIntersectionTypeNode([...Q4(i),f,...o.length?[I.createTypeLiteralNode(o)]:ze]);e.replaceNode(t,i,WHe(i,g))}var kX,t_e,UHe=Nt({"src/services/codefixes/convertToMappedObjectType.ts"(){"use strict";zn(),na(),kX="fixConvertToMappedObjectType",t_e=[d.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code],Zs({errorCodes:t_e,getCodeActions:function(t){const{sourceFile:r,span:i}=t,s=I4e(r,i.start);if(!s)return;const o=Qr.ChangeTracker.with(t,u=>F4e(u,r,s)),c=an(s.container.name);return[Bs(kX,o,[d.Convert_0_to_mapped_object_type,c],kX,[d.Convert_0_to_mapped_object_type,c])]},fixIds:[kX],getAllCodeActions:e=>$a(e,t_e,(t,r)=>{const i=I4e(r.file,r.start);i&&F4e(t,r.file,i)})})}}),r_e,O4e,VHe=Nt({"src/services/codefixes/removeAccidentalCallParentheses.ts"(){"use strict";zn(),na(),r_e="removeAccidentalCallParentheses",O4e=[d.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code],Zs({errorCodes:O4e,getCodeActions(e){const t=Ar(Ji(e.sourceFile,e.span.start),Rs);if(!t)return;const r=Qr.ChangeTracker.with(e,i=>{i.deleteRange(e.sourceFile,{pos:t.expression.end,end:t.end})});return[_d(r_e,r,d.Remove_parentheses)]},fixIds:[r_e]})}});function L4e(e,t,r){const i=Jn(Ji(t,r.start),u=>u.kind===135),s=i&&Jn(i.parent,Z0);if(!s)return;let o=s;if(y_(s.parent)){const u=Yk(s.expression,!1);if(Ie(u)){const f=Kc(s.parent.pos,t);f&&f.kind!==105&&(o=s.parent)}}e.replaceNode(t,o,s.expression)}var CX,n_e,qHe=Nt({"src/services/codefixes/removeUnnecessaryAwait.ts"(){"use strict";zn(),na(),CX="removeUnnecessaryAwait",n_e=[d.await_has_no_effect_on_the_type_of_this_expression.code],Zs({errorCodes:n_e,getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>L4e(i,t.sourceFile,t.span));if(r.length>0)return[Bs(CX,r,d.Remove_unnecessary_await,CX,d.Remove_all_unnecessary_uses_of_await)]},fixIds:[CX],getAllCodeActions:e=>$a(e,n_e,(t,r)=>L4e(t,r.file,r))})}});function M4e(e,t){return Ar(Ji(e,t.start),gl)}function R4e(e,t,r){if(!t)return;const i=E.checkDefined(t.importClause);e.replaceNode(r.sourceFile,t,I.updateImportDeclaration(t,t.modifiers,I.updateImportClause(i,i.isTypeOnly,i.name,void 0),t.moduleSpecifier,t.attributes)),e.insertNodeAfter(r.sourceFile,t,I.createImportDeclaration(void 0,I.updateImportClause(i,i.isTypeOnly,void 0,i.namedBindings),t.moduleSpecifier,t.attributes))}var i_e,EX,HHe=Nt({"src/services/codefixes/splitTypeOnlyImport.ts"(){"use strict";zn(),na(),i_e=[d.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],EX="splitTypeOnlyImport",Zs({errorCodes:i_e,fixIds:[EX],getCodeActions:function(t){const r=Qr.ChangeTracker.with(t,i=>R4e(i,M4e(t.sourceFile,t.span),t));if(r.length)return[Bs(EX,r,d.Split_into_two_separate_import_declarations,EX,d.Split_all_invalid_type_only_imports)]},getAllCodeActions:e=>$a(e,i_e,(t,r)=>{R4e(t,M4e(e.sourceFile,r),e)})})}});function j4e(e,t,r){var i;const o=r.getTypeChecker().getSymbolAtLocation(Ji(e,t));if(o===void 0)return;const c=Jn((i=o?.valueDeclaration)==null?void 0:i.parent,ml);if(c===void 0)return;const u=Ua(c,87,e);if(u!==void 0)return{symbol:o,token:u}}function B4e(e,t,r){e.replaceNode(t,r,I.createToken(121))}var DX,s_e,GHe=Nt({"src/services/codefixes/convertConstToLet.ts"(){"use strict";zn(),na(),DX="fixConvertConstToLet",s_e=[d.Cannot_assign_to_0_because_it_is_a_constant.code],Zs({errorCodes:s_e,getCodeActions:function(t){const{sourceFile:r,span:i,program:s}=t,o=j4e(r,i.start,s);if(o===void 0)return;const c=Qr.ChangeTracker.with(t,u=>B4e(u,r,o.token));return[sle(DX,c,d.Convert_const_to_let,DX,d.Convert_all_const_to_let)]},getAllCodeActions:e=>{const{program:t}=e,r=new Map;return n6(Qr.ChangeTracker.with(e,i=>{i6(e,s_e,s=>{const o=j4e(s.file,s.start,t);if(o&&Rp(r,Xs(o.symbol)))return B4e(i,s.file,o.token)})}))},fixIds:[DX]})}});function J4e(e,t,r){const i=Ji(e,t);return i.kind===27&&i.parent&&(ma(i.parent)||Lu(i.parent))?{node:i}:void 0}function z4e(e,t,{node:r}){const i=I.createToken(28);e.replaceNode(t,r,i)}var PX,W4e,a_e,$He=Nt({"src/services/codefixes/fixExpectedComma.ts"(){"use strict";zn(),na(),PX="fixExpectedComma",W4e=d._0_expected.code,a_e=[W4e],Zs({errorCodes:a_e,getCodeActions(e){const{sourceFile:t}=e,r=J4e(t,e.span.start,e.errorCode);if(!r)return;const i=Qr.ChangeTracker.with(e,s=>z4e(s,t,r));return[Bs(PX,i,[d.Change_0_to_1,";",","],PX,[d.Change_0_to_1,";",","])]},fixIds:[PX],getAllCodeActions:e=>$a(e,a_e,(t,r)=>{const i=J4e(r.file,r.start,r.code);i&&z4e(t,e.sourceFile,i)})})}});function U4e(e,t,r,i,s){const o=Ji(t,r.start);if(!Ie(o)||!Rs(o.parent)||o.parent.expression!==o||o.parent.arguments.length!==0)return;const c=i.getTypeChecker(),u=c.getSymbolAtLocation(o),f=u?.valueDeclaration;if(!f||!us(f)||!Wv(f.parent.parent)||s?.has(f))return;s?.add(f);const g=XHe(f.parent.parent);if(ut(g)){const p=g[0],y=!u1(p)&&!IT(p)&&IT(I.createUnionTypeNode([p,I.createKeywordTypeNode(116)]).types[0]);y&&e.insertText(t,p.pos,"("),e.insertText(t,p.end,y?") | void":" | void")}else{const p=c.getResolvedSignature(o.parent),y=p?.parameters[0],S=y&&c.getTypeOfSymbolAtLocation(y,f.parent.parent);Hr(f)?(!S||S.flags&3)&&(e.insertText(t,f.parent.parent.end,")"),e.insertText(t,la(t.text,f.parent.parent.pos),"/** @type {Promise} */(")):(!S||S.flags&2)&&e.insertText(t,f.parent.parent.expression.end,"")}}function XHe(e){var t;if(Hr(e)){if(y_(e.parent)){const r=(t=Qy(e.parent))==null?void 0:t.typeExpression.type;if(r&&mp(r)&&Ie(r.typeName)&&an(r.typeName)==="Promise")return r.typeArguments}}else return e.typeArguments}var V4e,o_e,c_e,QHe=Nt({"src/services/codefixes/fixAddVoidToPromise.ts"(){"use strict";zn(),na(),V4e="addVoidToPromise",o_e="addVoidToPromise",c_e=[d.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,d.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code],Zs({errorCodes:c_e,fixIds:[o_e],getCodeActions(e){const t=Qr.ChangeTracker.with(e,r=>U4e(r,e.sourceFile,e.span,e.program));if(t.length>0)return[Bs(V4e,t,d.Add_void_to_Promise_resolved_without_a_value,o_e,d.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions(e){return $a(e,c_e,(t,r)=>U4e(t,r.file,r,e.program,new Set))}})}}),su={};jl(su,{PreserveOptionalFlags:()=>Hue,addNewNodeForMemberSymbol:()=>n4e,codeFixAll:()=>$a,createCodeFixAction:()=>Bs,createCodeFixActionMaybeFixAll:()=>sle,createCodeFixActionWithoutFixAll:()=>_d,createCombinedCodeActions:()=>n6,createFileTextChanges:()=>cke,createImportAdder:()=>ax,createImportSpecifierResolver:()=>uVe,createJsonPropertyAssignment:()=>dX,createMissingMemberNodes:()=>jue,createSignatureDeclarationFromCallExpression:()=>Bue,createSignatureDeclarationFromSignature:()=>fX,createStubbedBody:()=>aM,eachDiagnostic:()=>i6,findAncestorMatchingSpan:()=>que,findJsonProperty:()=>Vue,generateAccessorFromProperty:()=>l4e,getAccessorConvertiblePropertyAtPosition:()=>f4e,getAllFixes:()=>JWe,getAllSupers:()=>Gue,getArgumentTypesAndTypeParameters:()=>a4e,getFixes:()=>BWe,getImportCompletionAction:()=>_Ve,getImportKind:()=>Ole,getJSDocTypedefNodes:()=>sVe,getNoopSymbolTrackerWithResolver:()=>a6,getPromoteTypeOnlyCompletionAction:()=>fVe,getSupportedErrorCodes:()=>RWe,importFixName:()=>zle,importSymbols:()=>o6,moduleSpecifierToValidIdentifier:()=>Jle,moduleSymbolToValidIdentifier:()=>Ble,parameterShouldGetTypeFromJSDoc:()=>Pke,registerCodeFix:()=>Zs,setJsonCompilerOptionValue:()=>Uue,setJsonCompilerOptionValues:()=>Wue,tryGetAutoImportableReferenceFromTypeNode:()=>cx,typeToAutoImportableTypeNode:()=>pX});var na=Nt({"src/services/_namespaces/ts.codefix.ts"(){"use strict";zWe(),WWe(),UWe(),HWe(),YWe(),tUe(),rUe(),nUe(),iUe(),cUe(),yUe(),bUe(),NUe(),XUe(),QUe(),ZUe(),KUe(),aVe(),oVe(),lVe(),IVe(),LVe(),jVe(),BVe(),JVe(),UVe(),HVe(),XVe(),eqe(),uqe(),fqe(),pqe(),mqe(),gqe(),hqe(),yqe(),bqe(),Sqe(),Tqe(),xqe(),kqe(),Eqe(),wqe(),Fqe(),Wqe(),Vqe(),qqe(),$qe(),Xqe(),Yqe(),Zqe(),aHe(),oHe(),cHe(),dHe(),EHe(),AHe(),OHe(),MHe(),RHe(),jHe(),BHe(),zHe(),UHe(),VHe(),qHe(),HHe(),GHe(),$He(),QHe()}});function YHe(e){return!!(e.kind&1)}function ZHe(e){return!!(e.kind&2)}function oM(e){return!!(e&&e.kind&4)}function W3(e){return!!(e&&e.kind===32)}function KHe(e){return oM(e)||W3(e)||l_e(e)}function eGe(e){return(oM(e)||W3(e))&&!!e.isFromPackageJson}function tGe(e){return!!(e.kind&8)}function rGe(e){return!!(e.kind&16)}function q4e(e){return!!(e&&e.kind&64)}function H4e(e){return!!(e&&e.kind&128)}function nGe(e){return!!(e&&e.kind&256)}function l_e(e){return!!(e&&e.kind&512)}function G4e(e,t,r,i,s,o,c,u,f){var g,p,y;const S=_o(),T=c||bT(Vl(i.getCompilerOptions()));let C=!1,w=0,D=0,O=0,z=0;const W=f({tryResolve:J,skippedAny:()=>C,resolvedAny:()=>D>0,resolvedBeyondLimit:()=>D>jX}),X=z?` (${(O/z*100).toFixed(1)}% hit rate)`:"";return(g=t.log)==null||g.call(t,`${e}: resolved ${D} module specifiers, plus ${w} ambient and ${O} from cache${X}`),(p=t.log)==null||p.call(t,`${e}: response is ${C?"incomplete":"complete"}`),(y=t.log)==null||y.call(t,`${e}: ${_o()-S}`),W;function J(ie,B){if(B){const $=r.getModuleSpecifierForBestExportInfo(ie,s,u);return $&&w++,$||"failed"}const Y=T||o.allowIncompleteCompletions&&D{const C=Ii(f.entries,w=>{var D;if(!w.hasAction||!w.source||!w.data||$4e(w.data))return w;if(!vEe(w.name,p))return;const{origin:O}=E.checkDefined(aEe(w.name,w.data,i,s)),z=y.get(t.path,w.data.exportMapKey),W=z&&T.tryResolve(z,!Tl(lp(O.moduleSymbol.name)));if(W==="skipped")return w;if(!W||W==="failed"){(D=s.log)==null||D.call(s,`Unexpected failure resolving auto import for '${w.name}' from '${w.source}'`);return}const X={...O,kind:32,moduleSpecifier:W.moduleSpecifier};return w.data=rEe(X),w.source=f_e(X),w.sourceDisplay=[bf(X.moduleSpecifier)],w});return T.skippedAny()||(f.isIncomplete=void 0),C});return f.entries=S,f.flags=(f.flags||0)|4,f.optionalReplacementSpan=Z4e(g),f}function u_e(e){return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e}}function X4e(e,t,r,i,s,o){const c=Ji(e,t);if(!xk(c)&&!zp(c))return[];const u=zp(c)?c:c.parent;if(!zp(u))return[];const f=u.parent;if(!ks(f))return[];const g=Iu(e),p=s.includeCompletionsWithSnippetText||void 0,y=Ch(u.tags,S=>ad(S)&&S.getEnd()<=t);return Ii(f.parameters,S=>{if(!mk(S).length){if(Ie(S.name)){const T={tabstop:1},C=S.name.text;let w=nN(C,S.initializer,S.dotDotDotToken,g,!1,!1,r,i,s),D=p?nN(C,S.initializer,S.dotDotDotToken,g,!1,!0,r,i,s,T):void 0;return o&&(w=w.slice(1),D&&(D=D.slice(1))),{name:w,kind:"parameter",sortText:au.LocationPriority,insertText:p?D:void 0,isSnippet:p}}else if(S.parent.parameters.indexOf(S)===y){const T=`param${y}`,C=Q4e(T,S.name,S.initializer,S.dotDotDotToken,g,!1,r,i,s),w=p?Q4e(T,S.name,S.initializer,S.dotDotDotToken,g,!0,r,i,s):void 0;let D=C.join(zh(i)+"* "),O=w?.join(zh(i)+"* ");return o&&(D=D.slice(1),O&&(O=O.slice(1))),{name:D,kind:"parameter",sortText:au.LocationPriority,insertText:p?O:void 0,isSnippet:p}}}})}function Q4e(e,t,r,i,s,o,c,u,f){if(!s)return[nN(e,r,i,s,!1,o,c,u,f,{tabstop:1})];return g(e,t,r,i,{tabstop:1});function g(y,S,T,C,w){if(jp(S)&&!C){const O={tabstop:w.tabstop},z=nN(y,T,C,s,!0,o,c,u,f,O);let W=[];for(const X of S.elements){const J=p(y,X,O);if(J)W.push(...J);else{W=void 0;break}}if(W)return w.tabstop=O.tabstop,[z,...W]}return[nN(y,T,C,s,!1,o,c,u,f,w)]}function p(y,S,T){if(!S.propertyName&&Ie(S.name)||Ie(S.name)){const C=S.propertyName?J4(S.propertyName):S.name.text;if(!C)return;const w=`${y}.${C}`;return[nN(w,S.initializer,S.dotDotDotToken,s,!1,o,c,u,f,T)]}else if(S.propertyName){const C=J4(S.propertyName);return C&&g(`${y}.${C}`,S.name,S.initializer,S.dotDotDotToken,T)}}}function nN(e,t,r,i,s,o,c,u,f,g){if(o&&E.assertIsDefined(g),t&&(e=aGe(e,t)),o&&(e=zv(e)),i){let p="*";if(s)E.assert(!r,"Cannot annotate a rest parameter with type 'Object'."),p="Object";else{if(t){const T=c.getTypeAtLocation(t.parent);if(!(T.flags&16385)){const C=t.getSourceFile(),D=vf(C,f)===0?268435456:0,O=c.typeToTypeNode(T,Ar(t,ks),D);if(O){const z=o?NX({removeComments:!0,module:u.module,target:u.target}):S1({removeComments:!0,module:u.module,target:u.target});Vr(O,1),p=z.printNode(4,O,C)}}}o&&p==="*"&&(p=`\${${g.tabstop++}:${p}}`)}const y=!s&&r?"...":"",S=o?`\${${g.tabstop++}}`:"";return`@param {${y}${p}} ${e} ${S}`}else{const p=o?`\${${g.tabstop++}}`:"";return`@param ${e} ${p}`}}function aGe(e,t){const r=t.getText().trim();return r.includes(` +`)||r.length>80?`[${e}]`:`[${e}=${r}]`}function oGe(e){return{name:Hs(e),kind:"keyword",kindModifiers:"",sortText:au.GlobalsOrKeywords}}function cGe(e,t){return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:t,entries:e.slice()}}function Y4e(e,t,r){return{kind:4,keywordCompletions:oEe(e,t),isNewIdentifierLocation:r}}function lGe(e){switch(e){case 156:return 8;default:E.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters")}}function Z4e(e){return e?.kind===80?l_(e):void 0}function uGe(e,t,r,i,s,o,c,u,f,g){const{symbols:p,contextToken:y,completionKind:S,isInSnippetScope:T,isNewIdentifierLocation:C,location:w,propertyAccessToConvert:D,keywordFilters:O,symbolToOriginInfoMap:z,recommendedCompletion:W,isJsxInitializer:X,isTypeOnlyLocation:J,isJsxIdentifierExpected:ie,isRightOfOpenTag:B,isRightOfDotOrQuestionDot:Y,importStatementCompletion:ae,insideJsDocTagTypeExpression:_e,symbolToSortTextMap:$,hasUnresolvedAutoImports:H}=o;let K=o.literals;const oe=r.getTypeChecker();if(D8(e.scriptKind)===1){const Me=fGe(w,e);if(Me)return Me}const Se=Ar(y,mC);if(Se&&(rne(y)||Av(y,Se.expression))){const Me=yL(oe,Se.parent.clauses);K=K.filter(ke=>!Me.hasValue(ke)),p.forEach((ke,he)=>{if(ke.valueDeclaration&&$v(ke.valueDeclaration)){const be=oe.getConstantValue(ke.valueDeclaration);be!==void 0&&Me.hasValue(be)&&(z[he]={kind:256})}})}const se=dj(),Z=K4e(e,i);if(Z&&!C&&(!p||p.length===0)&&O===0)return;const ve=p_e(p,se,void 0,y,w,f,e,t,r,Da(i),s,S,c,i,u,J,D,ie,X,ae,W,z,$,ie,B,g);if(O!==0)for(const Me of oEe(O,!_e&&Iu(e)))(J&&E3(mv(Me.name))||!J&&GGe(Me.name)||!ve.has(Me.name))&&(ve.add(Me.name),P0(se,Me,cM,!0));for(const Me of OGe(y,f))ve.has(Me.name)||(ve.add(Me.name),P0(se,Me,cM,!0));for(const Me of K){const ke=dGe(e,c,Me);ve.add(ke.name),P0(se,ke,cM,!0)}Z||pGe(e,w.pos,ve,Da(i),se);let Te;if(c.includeCompletionsWithInsertText&&y&&!B&&!Y&&(Te=Ar(y,WE))){const Me=eEe(Te,e,c,i,t,r,u);Me&&se.push(Me.entry)}return{flags:o.flags,isGlobalCompletion:T,isIncomplete:c.allowIncompleteCompletions&&H?!0:void 0,isMemberCompletion:_Ge(S),isNewIdentifierLocation:C,optionalReplacementSpan:Z4e(w),entries:se}}function K4e(e,t){return!Iu(e)||!!O8(e,t)}function eEe(e,t,r,i,s,o,c){const u=e.clauses,f=o.getTypeChecker(),g=f.getTypeAtLocation(e.parent.expression);if(g&&g.isUnion()&&qi(g.types,p=>p.isLiteral())){const p=yL(f,u),y=Da(i),S=vf(t,r),T=su.createImportAdder(t,o,r,s),C=[];for(const J of g.types)if(J.flags&1024){E.assert(J.symbol,"An enum member type should have a symbol"),E.assert(J.symbol.parent,"An enum member type should have a parent symbol (the enum symbol)");const ie=J.symbol.valueDeclaration&&f.getConstantValue(J.symbol.valueDeclaration);if(ie!==void 0){if(p.hasValue(ie))continue;p.addValue(ie)}const B=su.typeToAutoImportableTypeNode(f,T,J,e,y);if(!B)return;const Y=wX(B,y,S);if(!Y)return;C.push(Y)}else if(!p.hasValue(J.value))switch(typeof J.value){case"object":C.push(J.value.negative?I.createPrefixUnaryExpression(41,I.createBigIntLiteral({negative:!1,base10Value:J.value.base10Value})):I.createBigIntLiteral(J.value));break;case"number":C.push(J.value<0?I.createPrefixUnaryExpression(41,I.createNumericLiteral(-J.value)):I.createNumericLiteral(J.value));break;case"string":C.push(I.createStringLiteral(J.value,S===0));break}if(C.length===0)return;const w=Yt(C,J=>I.createCaseClause(J,[])),D=Zh(s,c?.options),O=NX({removeComments:!0,module:i.module,target:i.target,newLine:AA(D)}),z=c?J=>O.printAndFormatNode(4,J,t,c):J=>O.printNode(4,J,t),W=Yt(w,(J,ie)=>r.includeCompletionsWithSnippetText?`${z(J)}$${ie+1}`:`${z(J)}`).join(D);return{entry:{name:`${O.printNode(4,w[0],t)} ...`,kind:"",sortText:au.GlobalsOrKeywords,insertText:W,hasAction:T.hasFixes()||void 0,source:"SwitchCases/",isSnippet:r.includeCompletionsWithSnippetText?!0:void 0},importAdder:T}}}function wX(e,t,r){switch(e.kind){case 183:const i=e.typeName;return AX(i,t,r);case 199:const s=wX(e.objectType,t,r),o=wX(e.indexType,t,r);return s&&o&&I.createElementAccessExpression(s,o);case 201:const c=e.literal;switch(c.kind){case 11:return I.createStringLiteral(c.text,r===0);case 9:return I.createNumericLiteral(c.text,c.numericLiteralFlags)}return;case 196:const u=wX(e.type,t,r);return u&&(Ie(u)?u:I.createParenthesizedExpression(u));case 186:return AX(e.exprName,t,r);case 205:E.fail("We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.")}}function AX(e,t,r){if(Ie(e))return e;const i=bi(e.right.escapedText);return Zz(i,t)?I.createPropertyAccessExpression(AX(e.left,t,r),i):I.createElementAccessExpression(AX(e.left,t,r),I.createStringLiteral(i,r===0))}function _Ge(e){switch(e){case 0:case 3:case 2:return!0;default:return!1}}function fGe(e,t){const r=Ar(e,i=>{switch(i.kind){case 287:return!0;case 44:case 32:case 80:case 211:return!1;default:return"quit"}});if(r){const i=!!Ua(r,32,t),c=r.parent.openingElement.tagName.getText(t)+(i?"":">"),u=l_(r.tagName),f={name:c,kind:"class",kindModifiers:void 0,sortText:au.LocationPriority};return{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:!1,optionalReplacementSpan:u,entries:[f]}}}function pGe(e,t,r,i,s){GG(e).forEach((o,c)=>{if(o===t)return;const u=bi(c);!r.has(u)&&lf(u,i)&&(r.add(u),P0(s,{name:u,kind:"warning",kindModifiers:"",sortText:au.JavascriptIdentifiers,isFromUncheckedFile:!0},cM))})}function __e(e,t,r){return typeof r=="object"?Bv(r)+"n":ns(r)?I3(e,t,r):JSON.stringify(r)}function dGe(e,t,r){return{name:__e(e,t,r),kind:"string",kindModifiers:"",sortText:au.LocationPriority}}function mGe(e,t,r,i,s,o,c,u,f,g,p,y,S,T,C,w,D,O,z,W,X,J,ie,B){var Y,ae;let _e,$,H=mH(r),K,oe,Se=f_e(y),se,Z,ve;const Te=f.getTypeChecker(),Me=y&&rGe(y),ke=y&&ZHe(y)||p;if(y&&YHe(y))_e=p?`this${Me?"?.":""}[${nEe(c,z,g)}]`:`this${Me?"?.":"."}${g}`;else if((ke||Me)&&T){_e=ke?p?`[${nEe(c,z,g)}]`:`[${g}]`:g,(Me||T.questionDotToken)&&(_e=`?.${_e}`);const be=Ua(T,25,c)||Ua(T,29,c);if(!be)return;const lt=Qi(g,T.name.text)?T.name.end:be.end;H=zc(be.getStart(c),lt)}if(C&&(_e===void 0&&(_e=g),_e=`{${_e}}`,typeof C!="boolean"&&(H=l_(C,c))),y&&tGe(y)&&T){_e===void 0&&(_e=g);const be=Kc(T.pos,c);let lt="";be&&cL(be.end,be.parent,c)&&(lt=";"),lt+=`(await ${T.expression.getText()})`,_e=p?`${lt}${_e}`:`${lt}${Me?"?.":"."}${_e}`;const me=Jn(T.parent,Z0)?T.parent:T.expression;H=zc(me.getStart(c),T.end)}if(W3(y)&&(se=[bf(y.moduleSpecifier)],w&&({insertText:_e,replacementSpan:H}=TGe(g,w,y,D,c,O,z),oe=z.includeCompletionsWithSnippetText?!0:void 0)),y?.kind===64&&(Z=!0),W===0&&i&&((Y=Kc(i.pos,c,i))==null?void 0:Y.kind)!==28&&(mc(i.parent.parent)||pf(i.parent.parent)||N_(i.parent.parent)||Hh(i.parent)||((ae=Ar(i.parent,Hc))==null?void 0:ae.getLastToken(c))===i||Y_(i.parent)&&qa(c,i.getEnd()).line!==qa(c,o).line)&&(Se="ObjectLiteralMemberWithComma/",Z=!0),z.includeCompletionsWithClassMemberSnippets&&z.includeCompletionsWithInsertText&&W===3&&gGe(e,s,c)){let be;const lt=tEe(u,f,O,z,g,e,s,o,i,X);if(lt)({insertText:_e,filterText:$,isSnippet:oe,importAdder:be}=lt),be?.hasFixes()&&(Z=!0,Se="ClassMemberSnippet/");else return}if(y&&H4e(y)&&({insertText:_e,isSnippet:oe,labelDetails:ve}=y,z.useLabelDetailsInCompletionEntries||(g=g+ve.detail,ve=void 0),Se="ObjectLiteralMethodSnippet/",t=au.SortBelow(t)),J&&!ie&&z.includeCompletionsWithSnippetText&&z.jsxAttributeCompletionStyle&&z.jsxAttributeCompletionStyle!=="none"&&!(Rd(s.parent)&&s.parent.initializer)){let be=z.jsxAttributeCompletionStyle==="braces";const lt=Te.getTypeOfSymbolAtLocation(e,s);z.jsxAttributeCompletionStyle==="auto"&&!(lt.flags&528)&&!(lt.flags&1048576&&kn(lt.types,pt=>!!(pt.flags&528)))&&(lt.flags&402653316||lt.flags&1048576&&qi(lt.types,pt=>!!(pt.flags&402686084||ioe(pt)))?(_e=`${zv(g)}=${I3(c,z,"$1")}`,oe=!0):be=!0),be&&(_e=`${zv(g)}={$1}`,oe=!0)}if(_e!==void 0&&!z.includeCompletionsWithInsertText)return;(oM(y)||W3(y))&&(K=rEe(y),Z=!w);const he=Ar(s,C5);if(he?.kind===275){const be=mv(g);he&&be&&(be===135||oz(be))&&(_e=`${g} as ${g}_`)}return{name:g,kind:t0.getSymbolKind(Te,e,s),kindModifiers:t0.getSymbolModifiers(Te,e),sortText:t,source:Se,hasAction:Z?!0:void 0,isRecommended:xGe(e,S,Te)||void 0,insertText:_e,filterText:$,replacementSpan:H,sourceDisplay:se,labelDetails:ve,isSnippet:oe,isPackageJsonImport:eGe(y)||void 0,isImportStatementCompletion:!!w||void 0,data:K,...B?{symbol:e}:void 0}}function gGe(e,t,r){return Hr(t)?!1:!!(e.flags&106500)&&(Qn(t)||t.parent&&t.parent.parent&&Pl(t.parent)&&t===t.parent.name&&t.parent.getLastToken(r)===t.parent.name&&Qn(t.parent.parent)||t.parent&&SC(t)&&Qn(t.parent))}function tEe(e,t,r,i,s,o,c,u,f,g){const p=Ar(c,Qn);if(!p)return;let y,S=s;const T=s,C=t.getTypeChecker(),w=c.getSourceFile(),D=NX({removeComments:!0,module:r.module,target:r.target,omitTrailingSemicolon:!1,newLine:AA(Zh(e,g?.options))}),O=su.createImportAdder(w,t,i,e);let z;if(i.includeCompletionsWithSnippetText){y=!0;const ae=I.createEmptyStatement();z=I.createBlock([ae],!0),CW(ae,{kind:0,order:0})}else z=I.createBlock([],!0);let W=0;const{modifiers:X,range:J,decorators:ie}=hGe(f,w,u),B=X&64&&p.modifierFlagsCache&64;let Y=[];if(su.addNewNodeForMemberSymbol(o,p,w,{program:t,host:e},i,O,ae=>{let _e=0;B&&(_e|=64),Pl(ae)&&C.getMemberOverrideModifierStatus(p,ae,o)===1&&(_e|=16),Y.length||(W=ae.modifierFlagsCache|_e),ae=I.replaceModifiers(ae,W),Y.push(ae)},z,su.PreserveOptionalFlags.Property,!!B),Y.length){const ae=o.flags&8192;let _e=W|16|1;ae?_e|=1024:_e|=136;const $=X&_e;if(X&~_e)return;if(W&4&&$&1&&(W&=-5),$!==0&&!($&1)&&(W&=-2),W|=$,Y=Y.map(K=>I.replaceModifiers(K,W)),ie?.length){const K=Y[Y.length-1];Lb(K)&&(Y[Y.length-1]=I.replaceDecoratorsAndModifiers(K,ie.concat(hv(K)||[])))}const H=131073;g?S=D.printAndFormatSnippetList(H,I.createNodeArray(Y),w,g):S=D.printSnippetList(H,I.createNodeArray(Y),w)}return{insertText:S,filterText:T,isSnippet:y,importAdder:O,eraseRange:J}}function hGe(e,t,r){if(!e||qa(t,r).line>qa(t,e.getEnd()).line)return{modifiers:0};let i=0,s,o;const c={pos:r,end:r};if(Es(e.parent)&&e.parent.modifiers&&(i|=Nd(e.parent.modifiers)&98303,s=e.parent.modifiers.filter(ql)||[],c.pos=Math.min(c.pos,e.parent.modifiers.pos)),o=yGe(e)){const u=mT(o);i&u||(i|=u,c.pos=Math.min(c.pos,e.pos))}return{modifiers:i,decorators:s,range:c.pos!==r?c:void 0}}function yGe(e){if(Ys(e))return e.kind;if(Ie(e)){const t=Xy(e);if(t&&Oh(t))return t}}function vGe(e,t,r,i,s,o,c,u){const f=c.includeCompletionsWithSnippetText||void 0;let g=t;const p=r.getSourceFile(),y=bGe(e,r,p,i,s,c);if(!y)return;const S=NX({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!1,newLine:AA(Zh(s,u?.options))});u?g=S.printAndFormatSnippetList(80,I.createNodeArray([y],!0),p,u):g=S.printSnippetList(80,I.createNodeArray([y],!0),p);const T=S1({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!0}),C=I.createMethodSignature(void 0,"",y.questionToken,y.typeParameters,y.parameters,y.type),w={detail:T.printNode(4,C,p)};return{isSnippet:f,insertText:g,labelDetails:w}}function bGe(e,t,r,i,s,o){const c=e.getDeclarations();if(!(c&&c.length))return;const u=i.getTypeChecker(),f=c[0],g=wo(as(f),!1),p=u.getWidenedType(u.getTypeOfSymbolAtLocation(e,t)),S=33554432|(vf(r,o)===0?268435456:0);switch(f.kind){case 171:case 172:case 173:case 174:{let T=p.flags&1048576&&p.types.length<10?u.getUnionType(p.types,2):p;if(T.flags&1048576){const z=wn(T.types,W=>u.getSignaturesOfType(W,0).length>0);if(z.length===1)T=z[0];else return}if(u.getSignaturesOfType(T,0).length!==1)return;const w=u.typeToTypeNode(T,t,S,su.getNoopSymbolTrackerWithResolver({program:i,host:s}));if(!w||!pg(w))return;let D;if(o.includeCompletionsWithSnippetText){const z=I.createEmptyStatement();D=I.createBlock([z],!0),CW(z,{kind:0,order:0})}else D=I.createBlock([],!0);const O=w.parameters.map(z=>I.createParameterDeclaration(void 0,z.dotDotDotToken,z.name,void 0,void 0,z.initializer));return I.createMethodDeclaration(void 0,void 0,g,void 0,void 0,O,void 0,D)}default:return}}function NX(e){let t;const r=Qr.createWriter(zh(e)),i=S1(e,r),s={...r,write:S=>o(S,()=>r.write(S)),nonEscapingWrite:r.write,writeLiteral:S=>o(S,()=>r.writeLiteral(S)),writeStringLiteral:S=>o(S,()=>r.writeStringLiteral(S)),writeSymbol:(S,T)=>o(S,()=>r.writeSymbol(S,T)),writeParameter:S=>o(S,()=>r.writeParameter(S)),writeComment:S=>o(S,()=>r.writeComment(S)),writeProperty:S=>o(S,()=>r.writeProperty(S))};return{printSnippetList:c,printAndFormatSnippetList:f,printNode:g,printAndFormatNode:y};function o(S,T){const C=zv(S);if(C!==S){const w=r.getTextPos();T();const D=r.getTextPos();t=lr(t||(t=[]),{newText:C,span:{start:w,length:D-w}})}else T()}function c(S,T,C){const w=u(S,T,C);return t?Qr.applyChanges(w,t):w}function u(S,T,C){return t=void 0,s.clear(),i.writeList(S,T,C,s),s.getText()}function f(S,T,C,w){const D={text:u(S,T,C),getLineAndCharacterOfPosition(X){return qa(this,X)}},O=hL(w,C),z=ta(T,X=>{const J=Qr.assignPositionsToNode(X);return ol.formatNodeGivenIndentation(J,D,C.languageVariant,0,0,{...w,options:O})}),W=t?Eh(Xi(z,t),(X,J)=>E7(X.span,J.span)):z;return Qr.applyChanges(D.text,W)}function g(S,T,C){const w=p(S,T,C);return t?Qr.applyChanges(w,t):w}function p(S,T,C){return t=void 0,s.clear(),i.writeNode(S,T,C,s),s.getText()}function y(S,T,C,w){const D={text:p(S,T,C),getLineAndCharacterOfPosition(J){return qa(this,J)}},O=hL(w,C),z=Qr.assignPositionsToNode(T),W=ol.formatNodeGivenIndentation(z,D,C.languageVariant,0,0,{...w,options:O}),X=t?Eh(Xi(W,t),(J,ie)=>E7(J.span,ie.span)):W;return Qr.applyChanges(D.text,X)}}function rEe(e){const t=e.fileName?void 0:lp(e.moduleSymbol.name),r=e.isFromPackageJson?!0:void 0;return W3(e)?{exportName:e.exportName,exportMapKey:e.exportMapKey,moduleSpecifier:e.moduleSpecifier,ambientModuleName:t,fileName:e.fileName,isPackageJsonImport:r}:{exportName:e.exportName,exportMapKey:e.exportMapKey,fileName:e.fileName,ambientModuleName:e.fileName?void 0:lp(e.moduleSymbol.name),isPackageJsonImport:e.isFromPackageJson?!0:void 0}}function SGe(e,t,r){const i=e.exportName==="default",s=!!e.isPackageJsonImport;return $4e(e)?{kind:32,exportName:e.exportName,exportMapKey:e.exportMapKey,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:i,isFromPackageJson:s}:{kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:i,isFromPackageJson:s}}function TGe(e,t,r,i,s,o,c){const u=t.replacementSpan,f=zv(I3(s,c,r.moduleSpecifier)),g=r.isDefaultExport?1:r.exportName==="export="?2:0,p=c.includeCompletionsWithSnippetText?"$1":"",y=su.getImportKind(s,g,o,!0),S=t.couldBeTypeOnlyImportSpecifier,T=t.isTopLevelTypeOnly?` ${Hs(156)} `:" ",C=S?`${Hs(156)} `:"",w=i?";":"";switch(y){case 3:return{replacementSpan:u,insertText:`import${T}${zv(e)}${p} = require(${f})${w}`};case 1:return{replacementSpan:u,insertText:`import${T}${zv(e)}${p} from ${f}${w}`};case 2:return{replacementSpan:u,insertText:`import${T}* as ${zv(e)} from ${f}${w}`};case 0:return{replacementSpan:u,insertText:`import${T}{ ${C}${zv(e)}${p} } from ${f}${w}`}}}function nEe(e,t,r){return/^\d+$/.test(r)?r:I3(e,t,r)}function xGe(e,t,r){return e===t||!!(e.flags&1048576)&&r.getExportSymbolOfSymbol(e)===t}function f_e(e){if(oM(e))return lp(e.moduleSymbol.name);if(W3(e))return e.moduleSpecifier;if(e?.kind===1)return"ThisProperty/";if(e?.kind===64)return"TypeOnlyAlias/"}function p_e(e,t,r,i,s,o,c,u,f,g,p,y,S,T,C,w,D,O,z,W,X,J,ie,B,Y,ae=!1){const _e=_o(),$=VGe(i,s),H=DA(c),K=f.getTypeChecker(),oe=new Map;for(let se=0;seme.getSourceFile()===s.getSourceFile()));oe.set(Me,pt),P0(t,lt,cM,!0)}return p("getCompletionsAtPosition: getCompletionEntriesFromSymbols: "+(_o()-_e)),{has:se=>oe.has(se),add:se=>oe.set(se,!0)};function Se(se,Z){var ve;let Te=se.flags;if(!Ai(s)){if(cc(s.parent))return!0;if(Jn($,Ei)&&se.valueDeclaration===$)return!1;const Me=se.valueDeclaration??((ve=se.declarations)==null?void 0:ve[0]);if($&&Me&&(Uo($)&&Uo(Me)||us($)&&us(Me))){const he=Me.pos,be=us($)?$.parent.parameters:NT($.parent)?void 0:$.parent.typeParameters;if(he>=$.pos&&be&&he__e(r,c,W)===s.name);return z!==void 0?{type:"literal",literal:z}:ic(g,(W,X)=>{const J=T[X],ie=FX(W,Da(u),J,S,f.isJsxIdentifierExpected);return ie&&ie.name===s.name&&(s.source==="ClassMemberSnippet/"&&W.flags&106500||s.source==="ObjectLiteralMethodSnippet/"&&W.flags&8196||f_e(J)===s.source||s.source==="ObjectLiteralMemberWithComma/")?{type:"symbol",symbol:W,location:y,origin:J,contextToken:C,previousToken:w,isJsxInitializer:D,isTypeOnlyLocation:O}:void 0})||{type:"none"}}function EGe(e,t,r,i,s,o,c,u,f){const g=e.getTypeChecker(),p=e.getCompilerOptions(),{name:y,source:S,data:T}=s,{previousToken:C,contextToken:w}=IX(i,r);if(Vb(r,i,C))return JX.getStringLiteralCompletionDetails(y,r,i,C,g,p,o,f,u);const D=iEe(e,t,r,i,s,o,u);switch(D.type){case"request":{const{request:O}=D;switch(O.kind){case 1:return D1.getJSDocTagNameCompletionDetails(y);case 2:return D1.getJSDocTagCompletionDetails(y);case 3:return D1.getJSDocParameterNameCompletionDetails(y);case 4:return ut(O.keywordCompletions,z=>z.name===y)?d_e(y,"keyword",5):void 0;default:return E.assertNever(O)}}case"symbol":{const{symbol:O,location:z,contextToken:W,origin:X,previousToken:J}=D,{codeActions:ie,sourceDisplay:B}=DGe(y,z,W,X,O,e,o,p,r,i,J,c,u,T,S,f),Y=l_e(X)?X.symbolName:O.name;return m_e(O,Y,g,r,z,f,ie,B)}case"literal":{const{literal:O}=D;return d_e(__e(r,u,O),"string",typeof O=="string"?8:7)}case"cases":{const O=eEe(w.parent,r,u,e.getCompilerOptions(),o,e,void 0);if(O?.importAdder.hasFixes()){const{entry:z,importAdder:W}=O,X=Qr.ChangeTracker.with({host:o,formatContext:c,preferences:u},W.writeFixes);return{name:z.name,kind:"",kindModifiers:"",displayParts:[],sourceDisplay:void 0,codeActions:[{changes:X,description:$b([d.Includes_imports_of_types_referenced_by_0,y])}]}}return{name:y,kind:"",kindModifiers:"",displayParts:[],sourceDisplay:void 0}}case"none":return x_e().some(O=>O.name===y)?d_e(y,"keyword",5):void 0;default:E.assertNever(D)}}function d_e(e,t,r){return lM(e,"",t,[b_(e,r)])}function m_e(e,t,r,i,s,o,c,u){const{displayParts:f,documentation:g,symbolKind:p,tags:y}=r.runWithCancellationToken(o,S=>t0.getSymbolDisplayPartsDocumentationAndSymbolKind(S,e,i,s,s,7));return lM(t,t0.getSymbolModifiers(r,e),p,f,g,y,c,u)}function lM(e,t,r,i,s,o,c,u){return{name:e,kindModifiers:t,kind:r,displayParts:i,documentation:s,tags:o,codeActions:c,source:u,sourceDisplay:u}}function DGe(e,t,r,i,s,o,c,u,f,g,p,y,S,T,C,w){if(T?.moduleSpecifier&&p&&dEe(r||p,f).replacementSpan)return{codeActions:void 0,sourceDisplay:[bf(T.moduleSpecifier)]};if(C==="ClassMemberSnippet/"){const{importAdder:ie,eraseRange:B}=tEe(c,o,u,S,e,s,t,g,r,y);if(ie||B)return{sourceDisplay:void 0,codeActions:[{changes:Qr.ChangeTracker.with({host:c,formatContext:y,preferences:S},ae=>{ie&&ie.writeFixes(ae),B&&ae.deleteRange(f,B)}),description:$b([d.Includes_imports_of_types_referenced_by_0,e])}]}}if(q4e(i)){const ie=su.getPromoteTypeOnlyCompletionAction(f,i.declaration.name,o,c,y,S);return E.assertIsDefined(ie,"Expected to have a code action for promoting type-only alias"),{codeActions:[ie],sourceDisplay:void 0}}if(C==="ObjectLiteralMemberWithComma/"&&r){const ie=Qr.ChangeTracker.with({host:c,formatContext:y,preferences:S},B=>B.insertText(f,r.end,","));if(ie)return{sourceDisplay:void 0,codeActions:[{changes:ie,description:$b([d.Add_missing_comma_for_object_member_completion_0,e])}]}}if(!i||!(oM(i)||W3(i)))return{codeActions:void 0,sourceDisplay:void 0};const D=i.isFromPackageJson?c.getPackageJsonAutoImportProvider().getTypeChecker():o.getTypeChecker(),{moduleSymbol:O}=i,z=D.getMergedSymbol(yu(s.exportSymbol||s,D)),W=r?.kind===30&&qu(r.parent),{moduleSpecifier:X,codeAction:J}=su.getImportCompletionAction(z,O,T?.exportMapKey,f,e,W,c,o,y,p&&Ie(p)?p.getStart(f):g,S,w);return E.assert(!T?.moduleSpecifier||X===T.moduleSpecifier),{sourceDisplay:[bf(X)],codeActions:[J]}}function PGe(e,t,r,i,s,o,c){const u=iEe(e,t,r,i,s,o,c);return u.type==="symbol"?u.symbol:void 0}function wGe(e,t,r){return ic(t&&(t.isUnion()?t.types:[t]),i=>{const s=i&&i.symbol;return s&&s.flags&424&&!Vte(s)?g_e(s,e,r):void 0})}function AGe(e,t,r,i){const{parent:s}=e;switch(e.kind){case 80:return sL(e,i);case 64:switch(s.kind){case 260:return i.getContextualType(s.initializer);case 226:return i.getTypeAtLocation(s.left);case 291:return i.getContextualTypeForJsxAttribute(s);default:return}case 105:return i.getContextualType(s);case 84:const o=Jn(s,mC);return o?LH(o,i):void 0;case 19:return UE(s)&&!dg(s.parent)&&!qv(s.parent)?i.getContextualTypeForJsxAttribute(s.parent):void 0;default:const c=lN.getArgumentInfoForCompletions(e,t,r);return c?i.getContextualTypeForArgumentAtIndex(c.invocation,c.argumentIndex+(e.kind===28?1:0)):aL(e.kind)&&Gr(s)&&aL(s.operatorToken.kind)?i.getTypeAtLocation(s.left):i.getContextualType(e,4)||i.getContextualType(e)}}function g_e(e,t,r){const i=r.getAccessibleSymbolChain(e,t,67108863,!1);return i?ba(i):e.parent&&(NGe(e.parent)?e:g_e(e.parent,t,r))}function NGe(e){var t;return!!((t=e.declarations)!=null&&t.some(r=>r.kind===312))}function sEe(e,t,r,i,s,o,c,u,f,g){const p=e.getTypeChecker(),y=K4e(r,i);let S=_o(),T=Ji(r,s);t("getCompletionData: Get current token: "+(_o()-S)),S=_o();const C=Xh(r,s,T);t("getCompletionData: Is inside comment: "+(_o()-S));let w=!1,D=!1;if(C){if(toe(r,s)){if(r.text.charCodeAt(s-1)===64)return{kind:1};{const De=hp(s,r);if(!/[^*|\s(/)]/.test(r.text.substring(De,s)))return{kind:2}}}const M=LGe(T,s);if(M){if(M.tagName.pos<=s&&s<=M.tagName.end)return{kind:1};const De=Ht(M);if(De&&(T=Ji(r,s),(!T||!$g(T)&&(T.parent.kind!==355||T.parent.name!==T))&&(w=ue(De))),!w&&ad(M)&&(sc(M.name)||M.name.pos<=s&&s<=M.name.end))return{kind:3,tag:M}}if(!w){t("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");return}}S=_o();const O=!w&&Iu(r),z=IX(s,r),W=z.previousToken;let X=z.contextToken;t("getCompletionData: Get previous token: "+(_o()-S));let J=T,ie,B=!1,Y=!1,ae=!1,_e=!1,$=!1,H=!1,K,oe=c_(r,s),Se=0,se=!1,Z=0;if(X){const M=dEe(X,r);if(M.keywordCompletion){if(M.isKeywordOnlyCompletion)return{kind:4,keywordCompletions:[oGe(M.keywordCompletion)],isNewIdentifierLocation:M.isNewIdentifierLocation};Se=lGe(M.keywordCompletion)}if(M.replacementSpan&&o.includeCompletionsForImportStatements&&o.includeCompletionsWithInsertText&&(Z|=2,K=M,se=M.isNewIdentifierLocation),!M.replacementSpan&&$i(X))return t("Returning an empty list because completion was requested in an invalid position."),Se?Y4e(Se,O,Ds()):void 0;let De=X.parent;if(X.kind===25||X.kind===29)switch(B=X.kind===25,Y=X.kind===29,De.kind){case 211:ie=De,J=ie.expression;const Ve=dE(ie);if(sc(Ve)||(Rs(J)||ks(J))&&J.end===X.pos&&J.getChildCount(r)&&Sa(J.getChildren(r)).kind!==22)return;break;case 166:J=De.left;break;case 267:J=De.name;break;case 205:J=De;break;case 236:J=De.getFirstToken(r),E.assert(J.kind===102||J.kind===105);break;default:return}else if(!K){if(De&&De.kind===211&&(X=De,De=De.parent),T.parent===oe)switch(T.kind){case 32:(T.parent.kind===284||T.parent.kind===286)&&(oe=T);break;case 44:T.parent.kind===285&&(oe=T);break}switch(De.kind){case 287:X.kind===44&&(_e=!0,oe=X);break;case 226:if(!pEe(De))break;case 285:case 284:case 286:H=!0,X.kind===30&&(ae=!0,oe=X);break;case 294:case 293:(W.kind===20||W.kind===80&&W.parent.kind===291)&&(H=!0);break;case 291:if(De.initializer===W&&W.endqb(M?u.getPackageJsonAutoImportProvider():e,u));if(B||Y)br();else if(ae)he=p.getJsxIntrinsicTagNamesAt(oe),E.assertEachIsDefined(he,"getJsxIntrinsicTagNames() should all be defined"),It(),Te=1,Se=0;else if(_e){const M=X.parent.parent.openingElement.tagName,De=p.getSymbolAtLocation(M);De&&(he=[De]),Te=1,Se=0}else if(!It())return Se?Y4e(Se,O,se):void 0;t("getCompletionData: Semantic work: "+(_o()-ve));const it=W&&AGe(W,s,r,p),Je=!Jn(W,Ja)&&!H?Ii(it&&(it.isUnion()?it.types:[it]),M=>M.isLiteral()&&!(M.flags&1024)?M.value:void 0):[],ot=W&&it&&wGe(W,it,p);return{kind:0,symbols:he,completionKind:Te,isInSnippetScope:D,propertyAccessToConvert:ie,isNewIdentifierLocation:se,location:oe,keywordFilters:Se,literals:Je,symbolToOriginInfoMap:lt,recommendedCompletion:ot,previousToken:W,contextToken:X,isJsxInitializer:$,insideJsDocTagTypeExpression:w,symbolToSortTextMap:pt,isTypeOnlyLocation:Oe,isJsxIdentifierExpected:H,isRightOfOpenTag:ae,isRightOfDotOrQuestionDot:B||Y,importStatementCompletion:K,hasUnresolvedAutoImports:ke,flags:Z};function Bt(M){switch(M.kind){case 348:case 355:case 349:case 351:case 353:case 356:case 357:return!0;case 352:return!!M.constraint;default:return!1}}function Ht(M){if(Bt(M)){const De=od(M)?M.constraint:M.typeExpression;return De&&De.kind===316?De:void 0}if(yC(M)||XW(M))return M.class}function br(){Te=2;const M=U0(J),De=M&&!J.isTypeOf||ig(J.parent)||mA(X,r,p),Ve=I9(J);if(V_(J)||M||bn(J)){const Fe=vc(J.parent);Fe&&(se=!0);let vt=p.getSymbolAtLocation(J);if(vt&&(vt=yu(vt,p),vt.flags&1920)){const Lt=p.getExportsOfModule(vt);E.assertEachIsDefined(Lt,"getExportsOfModule() should all be defined");const Wt=gn=>p.isValidPropertyAccess(M?J:J.parent,gn.name),Lr=gn=>y_e(gn,p),Zr=Fe?gn=>{var On;return!!(gn.flags&1920)&&!((On=gn.declarations)!=null&&On.every(Ln=>Ln.parent===J.parent))}:Ve?gn=>Lr(gn)||Wt(gn):De||w?Lr:Wt;for(const gn of Lt)Zr(gn)&&he.push(gn);if(!De&&!w&&vt.declarations&&vt.declarations.some(gn=>gn.kind!==312&&gn.kind!==267&&gn.kind!==266)){let gn=p.getTypeOfSymbolAtLocation(vt,J).getNonOptionalType(),On=!1;if(gn.isNullableType()){const Ln=B&&!Y&&o.includeAutomaticOptionalChainCompletions!==!1;(Ln||Y)&&(gn=gn.getNonNullableType(),Ln&&(On=!0))}zr(gn,!!(J.flags&65536),On)}return}}if(!De||yb(J)){p.tryGetThisTypeAt(J,!1);let Fe=p.getTypeAtLocation(J).getNonOptionalType();if(De)zr(Fe.getNonNullableType(),!1,!1);else{let vt=!1;if(Fe.isNullableType()){const Lt=B&&!Y&&o.includeAutomaticOptionalChainCompletions!==!1;(Lt||Y)&&(Fe=Fe.getNonNullableType(),Lt&&(vt=!0))}zr(Fe,!!(J.flags&65536),vt)}}}function zr(M,De,Ve){se=!!M.getStringIndexType(),Y&&ut(M.getCallSignatures())&&(se=!0);const Fe=J.kind===205?J:J.parent;if(y)for(const vt of M.getApparentProperties())p.isValidPropertyAccessForCompletions(Fe,M,vt)&&ar(vt,!1,Ve);else he.push(...wn(MX(M,p),vt=>p.isValidPropertyAccessForCompletions(Fe,M,vt)));if(De&&o.includeCompletionsWithInsertText){const vt=p.getPromisedTypeOfPromise(M);if(vt)for(const Lt of vt.getApparentProperties())p.isValidPropertyAccessForCompletions(Fe,vt,Lt)&&ar(Lt,!0,Ve)}}function ar(M,De,Ve){var Fe;const vt=ic(M.declarations,Zr=>Jn(as(Zr),xa));if(vt){const Zr=Jt(vt.expression),gn=Zr&&p.getSymbolAtLocation(Zr),On=gn&&g_e(gn,X,p),Ln=On&&Xs(On);if(Ln&&Rp(me,Ln)){const Ni=he.length;he.push(On);const Cn=On.parent;if(!Cn||!yA(Cn)||p.tryGetMemberInModuleExportsAndProperties(On.name,Cn)!==On)lt[Ni]={kind:Lr(2)};else{const Ki=Tl(lp(Cn.name))?(Fe=PI(Cn))==null?void 0:Fe.fileName:void 0,{moduleSpecifier:wr}=(be||(be=su.createImportSpecifierResolver(r,e,u,o))).getModuleSpecifierForBestExportInfo([{exportKind:0,moduleFileName:Ki,isFromPackageJson:!1,moduleSymbol:Cn,symbol:On,targetFlags:yu(On,p).flags}],s,o1(oe))||{};if(wr){const _i={kind:Lr(6),moduleSymbol:Cn,isDefaultExport:!1,symbolName:On.name,exportName:On.name,fileName:Ki,moduleSpecifier:wr};lt[Ni]=_i}}}else if(o.includeCompletionsWithInsertText){if(Ln&&me.has(Ln))return;Wt(M),Lt(M),he.push(M)}}else Wt(M),Lt(M),he.push(M);function Lt(Zr){zGe(Zr)&&(pt[Xs(Zr)]=au.LocalDeclarationPriority)}function Wt(Zr){o.includeCompletionsWithInsertText&&(De&&Rp(me,Xs(Zr))?lt[he.length]={kind:Lr(8)}:Ve&&(lt[he.length]={kind:16}))}function Lr(Zr){return Ve?Zr|16:Zr}}function Jt(M){return Ie(M)?M:bn(M)?Jt(M.expression):void 0}function It(){return(Ue()||rt()||ei()||ft()||dt()||Nn()||fe()||Fi()||(zi(),1))===1}function Nn(){return Be(X)?(Te=5,se=!0,Se=4,1):0}function Fi(){const M=G(X),De=M&&p.getContextualType(M.attributes);if(!De)return 0;const Ve=M&&p.getContextualType(M.attributes,4);return he=Xi(he,ee(LX(De,Ve,M.attributes,p),M.attributes.properties)),or(),Te=3,se=!1,1}function ei(){return K?(se=!0,Tr(),1):0}function zi(){Se=gt(X)?5:1,Te=1,se=Ds(),W!==X&&E.assert(!!W,"Expected 'contextToken' to be defined when different from 'previousToken'.");const M=W!==X?W.getStart():s,De=Di(X,M,r)||r;D=ur(De);const Ve=(Oe?0:111551)|788968|1920|2097152,Fe=W&&!o1(W);he=Xi(he,p.getSymbolsInScope(De,Ve)),E.assertEachIsDefined(he,"getSymbolsInScope() should all be defined");for(let vt=0;vtWt.getSourceFile()===r)&&(pt[Xs(Lt)]=au.GlobalsOrKeywords),Fe&&!(Lt.flags&111551)){const Wt=Lt.declarations&&kn(Lt.declarations,mI);if(Wt){const Lr={kind:64,declaration:Wt};lt[vt]=Lr}}}if(o.includeCompletionsWithInsertText&&De.kind!==312){const vt=p.tryGetThisTypeAt(De,!1,Qn(De.parent)?De:void 0);if(vt&&!JGe(vt,r,p))for(const Lt of MX(vt,p))lt[he.length]={kind:1},he.push(Lt),pt[Xs(Lt)]=au.SuggestedClassMembers}Tr(),Oe&&(Se=X&&sb(X.parent)?6:7)}function Qe(){return K?!0:Me||!o.includeCompletionsForModuleExports?!1:r.externalModuleIndicator||r.commonJsModuleIndicator||bH(e.getCompilerOptions())?!0:ooe(e)}function ur(M){switch(M.kind){case 312:case 228:case 294:case 241:return!0;default:return Ci(M)}}function Dr(){return w||!!K&&bv(oe.parent)||!Ft(X)&&(mA(X,r,p)||ig(oe)||yr(X))}function Ft(M){return M&&(M.kind===114&&(M.parent.kind===186||pC(M.parent))||M.kind===131&&M.parent.kind===182)}function yr(M){if(M){const De=M.parent.kind;switch(M.kind){case 59:return De===172||De===171||De===169||De===260||nT(De);case 64:return De===265;case 130:return De===234;case 30:return De===183||De===216;case 96:return De===168;case 152:return De===238}}return!1}function Tr(){var M,De;if(!Qe()||(E.assert(!c?.data,"Should not run 'collectAutoImports' when faster path is available via `data`"),c&&!c.source))return;Z|=1;const Fe=W===X&&K?"":W&&Ie(W)?W.text.toLowerCase():"",vt=(M=u.getModuleSpecifierCache)==null?void 0:M.call(u),Lt=NA(r,u,e,o,g),Wt=(De=u.getPackageJsonAutoImportProvider)==null?void 0:De.call(u),Lr=c?void 0:O3(r,o,u);G4e("collectAutoImports",u,be||(be=su.createImportSpecifierResolver(r,e,u,o)),e,s,o,!!K,o1(oe),gn=>{Lt.search(r.path,ae,(On,Ln)=>{if(!lf(On,Da(u.getCompilationSettings()))||!c&&_T(On)||!Oe&&!K&&!(Ln&111551)||Oe&&!(Ln&790504))return!1;const Ni=On.charCodeAt(0);return ae&&(Ni<65||Ni>90)?!1:c?!0:vEe(On,Fe)},(On,Ln,Ni,Cn)=>{if(c&&!ut(On,Cr=>c.source===lp(Cr.moduleSymbol.name))||(On=wn(On,Zr),!On.length))return;const Ki=gn.tryResolve(On,Ni)||{};if(Ki==="failed")return;let wr=On[0],_i;Ki!=="skipped"&&({exportInfo:wr=On[0],moduleSpecifier:_i}=Ki);const ia=wr.exportKind===1,Is=ia&&Xk(wr.symbol)||wr.symbol;Xr(Is,{kind:_i?32:4,moduleSpecifier:_i,symbolName:Ln,exportMapKey:Cn,exportName:wr.exportKind===2?"export=":wr.symbol.name,fileName:wr.moduleFileName,isDefaultExport:ia,moduleSymbol:wr.moduleSymbol,isFromPackageJson:wr.isFromPackageJson})}),ke=gn.skippedAny(),Z|=gn.resolvedAny()?8:0,Z|=gn.resolvedBeyondLimit()?16:0});function Zr(gn){const On=Jn(gn.moduleSymbol.valueDeclaration,Ai);if(!On){const Ln=lp(gn.moduleSymbol.name);return gg.nodeCoreModules.has(Ln)&&Qi(Ln,"node:")!==gL(r,e)?!1:Lr?Lr.allowsImportingAmbientModule(gn.moduleSymbol,Xe(gn.isFromPackageJson)):!0}return YH(gn.isFromPackageJson?Wt:e,r,On,o,Lr,Xe(gn.isFromPackageJson),vt)}}function Xr(M,De){const Ve=Xs(M);pt[Ve]!==au.GlobalsOrKeywords&&(lt[he.length]=De,pt[Ve]=K?au.LocationPriority:au.AutoImportSuggestions,he.push(M))}function Pi(M,De){Hr(oe)||M.forEach(Ve=>{if(!ji(Ve))return;const Fe=FX(Ve,Da(i),void 0,0,!1);if(!Fe)return;const{name:vt}=Fe,Lt=vGe(Ve,vt,De,e,u,i,o,f);if(!Lt)return;const Wt={kind:128,...Lt};Z|=32,lt[he.length]=Wt,he.push(Ve)})}function ji(M){return!!(M.flags&8196)}function Di(M,De,Ve){let Fe=M;for(;Fe&&!aH(Fe,De,Ve);)Fe=Fe.parent;return Fe}function $i(M){const De=_o(),Ve=Ce(M)||ht(M)||st(M)||Qs(M)||FF(M);return t("getCompletionsAtPosition: isCompletionListBlocker: "+(_o()-De)),Ve}function Qs(M){if(M.kind===12)return!0;if(M.kind===32&&M.parent){if(oe===M.parent&&(oe.kind===286||oe.kind===285))return!1;if(M.parent.kind===286)return oe.parent.kind!==286;if(M.parent.kind===287||M.parent.kind===285)return!!M.parent.parent&&M.parent.parent.kind===284}return!1}function Ds(){if(X){const M=X.parent.kind,De=OX(X);switch(De){case 28:return M===213||M===176||M===214||M===209||M===226||M===184||M===210;case 21:return M===213||M===176||M===214||M===217||M===196;case 23:return M===209||M===181||M===167;case 144:case 145:case 102:return!0;case 25:return M===267;case 19:return M===263||M===210;case 64:return M===260||M===226;case 16:return M===228;case 17:return M===239;case 134:return M===174||M===304;case 42:return M===174}if(uM(De))return!0}return!1}function Ce(M){return(AW(M)||uJ(M))&&(fA(M,s)||s===M.end&&(!!M.isUnterminated||AW(M)))}function Ue(){const M=jGe(X);if(!M)return 0;const Ve=(_C(M.parent)?M.parent:void 0)||M,Fe=fEe(Ve,p);if(!Fe)return 0;const vt=p.getTypeFromTypeNode(Ve),Lt=MX(Fe,p),Wt=MX(vt,p),Lr=new Set;return Wt.forEach(Zr=>Lr.add(Zr.escapedName)),he=Xi(he,wn(Lt,Zr=>!Lr.has(Zr.escapedName))),Te=0,se=!0,1}function rt(){const M=he.length,De=IGe(X,s,r);if(!De)return 0;Te=0;let Ve,Fe;if(De.kind===210){const vt=WGe(De,p);if(vt===void 0)return De.flags&67108864?2:(Me=!0,0);const Lt=p.getContextualType(De,4),Wt=(Lt||vt).getStringIndexType(),Lr=(Lt||vt).getNumberIndexType();if(se=!!Wt||!!Lr,Ve=LX(vt,Lt,De,p),Fe=De.properties,Ve.length===0&&!Lr)return Me=!0,0}else{E.assert(De.kind===206),se=!1;const vt=Tm(De.parent);if(!Nk(vt))return E.fail("Root declaration is not variable-like.");let Lt=J0(vt)||!!Wl(vt)||vt.parent.parent.kind===250;if(!Lt&&vt.kind===169&&(ct(vt.parent)?Lt=!!p.getContextualType(vt.parent):(vt.parent.kind===174||vt.parent.kind===178)&&(Lt=ct(vt.parent.parent)&&!!p.getContextualType(vt.parent.parent))),Lt){const Wt=p.getTypeAtLocation(De);if(!Wt)return 2;Ve=p.getPropertiesOfType(Wt).filter(Lr=>p.isPropertyAccessible(De,!1,!1,Wt,Lr)),Fe=De.elements}}if(Ve&&Ve.length>0){const vt=Qt(Ve,E.checkDefined(Fe));he=Xi(he,vt),or(),De.kind===210&&o.includeCompletionsWithObjectLiteralMethodSnippets&&o.includeCompletionsWithInsertText&&(j(M),Pi(vt,De))}return 1}function ft(){if(!X)return 0;const M=X.kind===19||X.kind===28?Jn(X.parent,C5):$9(X)?Jn(X.parent.parent,C5):void 0;if(!M)return 0;$9(X)||(Se=8);const{moduleSpecifier:De}=M.kind===275?M.parent.parent:M.parent;if(!De)return se=!0,M.kind===275?2:0;const Ve=p.getSymbolAtLocation(De);if(!Ve)return se=!0,2;Te=3,se=!1;const Fe=p.getExportsAndPropertiesOfModule(Ve),vt=new Set(M.elements.filter(Wt=>!ue(Wt)).map(Wt=>(Wt.propertyName||Wt.name).escapedText)),Lt=Fe.filter(Wt=>Wt.escapedName!=="default"&&!vt.has(Wt.escapedName));return he=Xi(he,Lt),Lt.length||(Se=0),1}function dt(){var M;const De=X&&(X.kind===19||X.kind===28)?Jn(X.parent,gp):void 0;if(!De)return 0;const Ve=Ar(De,ed(Ai,vc));return Te=5,se=!1,(M=Ve.locals)==null||M.forEach((Fe,vt)=>{var Lt,Wt;he.push(Fe),(Wt=(Lt=Ve.symbol)==null?void 0:Lt.exports)!=null&&Wt.has(vt)&&(pt[Xs(Fe)]=au.OptionalMember)}),1}function fe(){const M=RGe(r,X,oe,s);if(!M)return 0;if(Te=3,se=!0,Se=X.kind===42?0:Qn(M)?2:3,!Qn(M))return 1;const De=X.kind===27?X.parent.parent:X.parent;let Ve=Pl(De)?Fu(De):0;if(X.kind===80&&!ue(X))switch(X.getText()){case"private":Ve=Ve|2;break;case"static":Ve=Ve|256;break;case"override":Ve=Ve|16;break}if(Go(De)&&(Ve|=256),!(Ve&2)){const Fe=Qn(M)&&Ve&16?Q2(Pd(M)):Q4(M),vt=ta(Fe,Lt=>{const Wt=p.getTypeAtLocation(Lt);return Ve&256?Wt?.symbol&&p.getPropertiesOfType(p.getTypeOfSymbolAtLocation(Wt.symbol,M)):Wt&&p.getPropertiesOfType(Wt)});he=Xi(he,ce(vt,M.members,Ve)),Zt(he,(Lt,Wt)=>{const Lr=Lt?.valueDeclaration;if(Lr&&Pl(Lr)&&Lr.name&&xa(Lr.name)){const Zr={kind:512,symbolName:p.symbolToString(Lt)};lt[Wt]=Zr}})}return 1}function we(M){return!!M.parent&&us(M.parent)&&gc(M.parent.parent)&&(F4(M.kind)||$g(M))}function Be(M){if(M){const De=M.parent;switch(M.kind){case 21:case 28:return gc(M.parent)?M.parent:void 0;default:if(we(M))return De.parent}}}function gt(M){if(M){let De;const Ve=Ar(M.parent,Fe=>Qn(Fe)?"quit":po(Fe)&&De===Fe.body?!0:(De=Fe,!1));return Ve&&Ve}}function G(M){if(M){const De=M.parent;switch(M.kind){case 32:case 31:case 44:case 80:case 211:case 292:case 291:case 293:if(De&&(De.kind===285||De.kind===286)){if(M.kind===32){const Ve=Kc(M.pos,r,void 0);if(!De.typeArguments||Ve&&Ve.kind===44)break}return De}else if(De.kind===291)return De.parent.parent;break;case 11:if(De&&(De.kind===291||De.kind===293))return De.parent.parent;break;case 20:if(De&&De.kind===294&&De.parent&&De.parent.kind===291)return De.parent.parent.parent;if(De&&De.kind===293)return De.parent.parent;break}}}function ht(M){const De=M.parent,Ve=De.kind;switch(M.kind){case 28:return Ve===260||Ct(M)||Ve===243||Ve===266||Re(Ve)||Ve===264||Ve===207||Ve===265||Qn(De)&&!!De.typeParameters&&De.typeParameters.end>=M.pos;case 25:return Ve===207;case 59:return Ve===208;case 23:return Ve===207;case 21:return Ve===299||Re(Ve);case 19:return Ve===266;case 30:return Ve===263||Ve===231||Ve===264||Ve===265||nT(Ve);case 126:return Ve===172&&!Qn(De.parent);case 26:return Ve===169||!!De.parent&&De.parent.kind===207;case 125:case 123:case 124:return Ve===169&&!gc(De.parent);case 130:return Ve===276||Ve===281||Ve===274;case 139:case 153:return!RX(M);case 80:if(Ve===276&&M===De.name&&M.text==="type")return!1;break;case 86:case 94:case 120:case 100:case 115:case 102:case 121:case 87:case 140:return!0;case 156:return Ve!==276;case 42:return ks(M.parent)&&!mc(M.parent)}if(uM(OX(M))&&RX(M)||we(M)&&(!Ie(M)||F4(OX(M))||ue(M)))return!1;switch(OX(M)){case 128:case 86:case 87:case 138:case 94:case 100:case 120:case 121:case 123:case 124:case 125:case 126:case 115:return!0;case 134:return Es(M.parent)}if(Ar(M.parent,Qn)&&M===W&&Dt(M,s))return!1;const vt=r1(M.parent,172);if(vt&&M!==W&&Qn(W.parent.parent)&&s<=W.end){if(Dt(M,W.end))return!1;if(M.kind!==64&&(Uw(vt)||xI(vt)))return!0}return $g(M)&&!Y_(M.parent)&&!Rd(M.parent)&&!((Qn(M.parent)||Mu(M.parent)||Uo(M.parent))&&(M!==W||s>W.end))}function Dt(M,De){return M.kind!==64&&(M.kind===27||!_p(M.end,De,r))}function Re(M){return nT(M)&&M!==176}function st(M){if(M.kind===9){const De=M.getFullText();return De.charAt(De.length-1)==="."}return!1}function Ct(M){return M.parent.kind===261&&!mA(M,r,p)}function Qt(M,De){if(De.length===0)return M;const Ve=new Set,Fe=new Set;for(const Lt of De){if(Lt.kind!==303&&Lt.kind!==304&&Lt.kind!==208&&Lt.kind!==174&&Lt.kind!==177&&Lt.kind!==178&&Lt.kind!==305||ue(Lt))continue;let Wt;if(Hh(Lt))er(Lt,Ve);else if(Pa(Lt)&&Lt.propertyName)Lt.propertyName.kind===80&&(Wt=Lt.propertyName.escapedText);else{const Lr=as(Lt);Wt=Lr&&wd(Lr)?K4(Lr):void 0}Wt!==void 0&&Fe.add(Wt)}const vt=M.filter(Lt=>!Fe.has(Lt.escapedName));return U(Ve,vt),vt}function er(M,De){const Ve=M.expression,Fe=p.getSymbolAtLocation(Ve),vt=Fe&&p.getTypeOfSymbolAtLocation(Fe,Ve),Lt=vt&&vt.properties;Lt&&Lt.forEach(Wt=>{De.add(Wt.name)})}function or(){he.forEach(M=>{if(M.flags&16777216){const De=Xs(M);pt[De]=pt[De]??au.OptionalMember}})}function U(M,De){if(M.size!==0)for(const Ve of De)M.has(Ve.name)&&(pt[Xs(Ve)]=au.MemberDeclaredBySpreadAssignment)}function j(M){for(let De=M;De!Fe.has(vt.escapedName)&&!!vt.declarations&&!(Mf(vt)&2)&&!(vt.valueDeclaration&&Nu(vt.valueDeclaration)))}function ee(M,De){const Ve=new Set,Fe=new Set;for(const Lt of De)ue(Lt)||(Lt.kind===291?Ve.add(DE(Lt.name)):BT(Lt)&&er(Lt,Fe));const vt=M.filter(Lt=>!Ve.has(Lt.escapedName));return U(Fe,vt),vt}function ue(M){return M.getStart(r)<=s&&s<=M.getEnd()}}function IGe(e,t,r){var i;if(e){const{parent:s}=e;switch(e.kind){case 19:case 28:if(ma(s)||jp(s))return s;break;case 42:return mc(s)?Jn(s.parent,ma):void 0;case 134:return Jn(s.parent,ma);case 80:if(e.text==="async"&&Y_(e.parent))return e.parent.parent;{if(ma(e.parent.parent)&&(Hh(e.parent)||Y_(e.parent)&&qa(r,e.getEnd()).line!==qa(r,t).line))return e.parent.parent;const c=Ar(s,Hc);if(c?.getLastToken(r)===e&&ma(c.parent))return c.parent}break;default:if((i=s.parent)!=null&&i.parent&&(mc(s.parent)||pf(s.parent)||N_(s.parent))&&ma(s.parent.parent))return s.parent.parent;if(Hh(s)&&ma(s.parent))return s.parent;const o=Ar(s,Hc);if(e.kind!==59&&o?.getLastToken(r)===e&&ma(o.parent))return o.parent}}}function IX(e,t){const r=Kc(e,t);return r&&e<=r.end&&(tg(r)||a_(r.kind))?{contextToken:Kc(r.getFullStart(),t,void 0),previousToken:r}:{contextToken:r,previousToken:r}}function aEe(e,t,r,i){const s=t.isPackageJsonImport?i.getPackageJsonAutoImportProvider():r,o=s.getTypeChecker(),c=t.ambientModuleName?o.tryFindAmbientModule(t.ambientModuleName):t.fileName?o.getMergedSymbol(E.checkDefined(s.getSourceFile(t.fileName)).symbol):void 0;if(!c)return;let u=t.exportName==="export="?o.resolveExternalModuleSymbol(c):o.tryGetMemberInModuleExportsAndProperties(t.exportName,c);return u?(u=t.exportName==="default"&&Xk(u)||u,{symbol:u,origin:SGe(t,e,c)}):void 0}function FX(e,t,r,i,s){if(nGe(r))return;const o=KHe(r)?r.symbolName:e.name;if(o===void 0||e.flags&1536&&$P(o.charCodeAt(0))||p8(e))return;const c={name:o,needsConvertPropertyAccess:!1};if(lf(o,t,s?1:0)||e.valueDeclaration&&Nu(e.valueDeclaration))return c;switch(i){case 3:return l_e(r)?{name:r.symbolName,needsConvertPropertyAccess:!1}:void 0;case 0:return{name:JSON.stringify(o),needsConvertPropertyAccess:!1};case 2:case 1:return o.charCodeAt(0)===32?void 0:{name:o,needsConvertPropertyAccess:!0};case 5:case 4:return c;default:E.assertNever(i)}}function oEe(e,t){if(!t)return cEe(e);const r=e+8+1;return _M[r]||(_M[r]=cEe(e).filter(i=>!FGe(mv(i.name))))}function cEe(e){return _M[e]||(_M[e]=x_e().filter(t=>{const r=mv(t.name);switch(e){case 0:return!1;case 1:return uEe(r)||r===138||r===144||r===156||r===145||r===128||E3(r)&&r!==157;case 5:return uEe(r);case 2:return uM(r);case 3:return lEe(r);case 4:return F4(r);case 6:return E3(r)||r===87;case 7:return E3(r);case 8:return r===156;default:return E.assertNever(e)}}))}function FGe(e){switch(e){case 128:case 133:case 163:case 136:case 138:case 94:case 162:case 119:case 140:case 120:case 142:case 143:case 144:case 145:case 146:case 150:case 151:case 164:case 123:case 124:case 125:case 148:case 154:case 155:case 156:case 158:case 159:return!0;default:return!1}}function lEe(e){return e===148}function uM(e){switch(e){case 128:case 129:case 137:case 139:case 153:case 134:case 138:case 164:return!0;default:return _J(e)}}function uEe(e){return e===134||e===135||e===130||e===152||e===156||!a5(e)&&!uM(e)}function OX(e){return Ie(e)?Xy(e)??0:e.kind}function OGe(e,t){const r=[];if(e){const i=e.getSourceFile(),s=e.parent,o=i.getLineAndCharacterOfPosition(e.end).line,c=i.getLineAndCharacterOfPosition(t).line;(gl(s)||qc(s)&&s.moduleSpecifier)&&e===s.moduleSpecifier&&o===c&&r.push({name:Hs(132),kind:"keyword",kindModifiers:"",sortText:au.GlobalsOrKeywords})}return r}function LGe(e,t){return Ar(e,r=>xk(r)&&_A(r,t)?!0:zp(r)?"quit":!1)}function LX(e,t,r,i){const s=t&&t!==e,o=s&&!(t.flags&3)?i.getUnionType([e,t]):e,c=MGe(o,r,i);return o.isClass()&&_Ee(c)?[]:s?wn(c,u):c;function u(f){return Ir(f.declarations)?ut(f.declarations,g=>g.parent!==r):!0}}function MGe(e,t,r){return e.isUnion()?r.getAllPossiblePropertiesOfTypes(wn(e.types,i=>!(i.flags&402784252||r.isArrayLikeType(i)||r.isTypeInvalidDueToUnionDiscriminant(i,t)||r.typeHasCallOrConstructSignatures(i)||i.isClass()&&_Ee(i.getApparentProperties())))):e.getApparentProperties()}function _Ee(e){return ut(e,t=>!!(Mf(t)&6))}function MX(e,t){return e.isUnion()?E.checkEachDefined(t.getAllPossiblePropertiesOfTypes(e.types),"getAllPossiblePropertiesOfTypes() should all be defined"):E.checkEachDefined(e.getApparentProperties(),"getApparentProperties() should all be defined")}function RGe(e,t,r,i){switch(r.kind){case 358:return Jn(r.parent,hT);case 1:const s=Jn(Mo(Ms(r.parent,Ai).statements),hT);if(s&&!Ua(s,20,e))return s;break;case 81:if(Jn(r.parent,Es))return Ar(r,Qn);break;case 80:{if(Xy(r)||Es(r.parent)&&r.parent.initializer===r)return;if(RX(r))return Ar(r,hT)}}if(t){if(r.kind===137||Ie(t)&&Es(t.parent)&&Qn(r))return Ar(t,Qn);switch(t.kind){case 64:return;case 27:case 20:return RX(r)&&r.parent.name===r?r.parent.parent:Jn(r,hT);case 19:case 28:return Jn(t.parent,hT);default:if(hT(r)){if(qa(e,t.getEnd()).line!==qa(e,i).line)return r;const s=Qn(t.parent.parent)?uM:lEe;return s(t.kind)||t.kind===42||Ie(t)&&s(Xy(t)??0)?t.parent.parent:void 0}return}}}function jGe(e){if(!e)return;const t=e.parent;switch(e.kind){case 19:if(X_(t))return t;break;case 27:case 28:case 80:if(t.kind===171&&X_(t.parent))return t.parent;break}}function fEe(e,t){if(!e)return;if(Si(e)&&kI(e.parent))return t.getTypeArgumentConstraint(e);const r=fEe(e.parent,t);if(r)switch(e.kind){case 171:return t.getTypeOfPropertyOfContextualType(r,e.symbol.escapedName);case 193:case 187:case 192:return r}}function RX(e){return e.parent&&gI(e.parent)&&hT(e.parent.parent)}function BGe(e,t,r,i){switch(t){case".":case"@":return!0;case'"':case"'":case"`":return!!r&&Coe(r)&&i===r.getStart(e)+1;case"#":return!!r&&Ti(r)&&!!wl(r);case"<":return!!r&&r.kind===30&&(!Gr(r.parent)||pEe(r.parent));case"/":return!!r&&(Ja(r)?!!n8(r):r.kind===44&&Vv(r.parent));case" ":return!!r&&LE(r)&&r.parent.kind===312;default:return E.assertNever(t)}}function pEe({left:e}){return sc(e)}function JGe(e,t,r){const i=r.resolveName("self",void 0,111551,!1);if(i&&r.getTypeOfSymbolAtLocation(i,t)===e)return!0;const s=r.resolveName("global",void 0,111551,!1);if(s&&r.getTypeOfSymbolAtLocation(s,t)===e)return!0;const o=r.resolveName("globalThis",void 0,111551,!1);return!!(o&&r.getTypeOfSymbolAtLocation(o,t)===e)}function zGe(e){return!!(e.valueDeclaration&&Fu(e.valueDeclaration)&256&&Qn(e.valueDeclaration.parent))}function WGe(e,t){const r=t.getContextualType(e);if(r)return r;const i=Rh(e.parent);if(Gr(i)&&i.operatorToken.kind===64&&e===i.left)return t.getTypeAtLocation(i);if(ct(i))return t.getContextualType(i)}function dEe(e,t){var r,i,s;let o,c=!1;const u=f();return{isKeywordOnlyCompletion:c,keywordCompletion:o,isNewIdentifierLocation:!!(u||o===156),isTopLevelTypeOnly:!!((i=(r=Jn(u,gl))==null?void 0:r.importClause)!=null&&i.isTypeOnly)||!!((s=Jn(u,Hl))!=null&&s.isTypeOnly),couldBeTypeOnlyImportSpecifier:!!u&&gEe(u,e),replacementSpan:UGe(u)};function f(){const g=e.parent;if(Hl(g)){const p=g.getLastToken(t);if(Ie(e)&&p!==e){o=161,c=!0;return}return o=e.kind===156?void 0:156,h_e(g.moduleReference)?g:void 0}if(gEe(g,e)&&hEe(g.parent))return g;if(Kg(g)||K0(g)){if(!g.parent.isTypeOnly&&(e.kind===19||e.kind===102||e.kind===28)&&(o=156),hEe(g))if(e.kind===20||e.kind===80)c=!0,o=161;else return g.parent.parent;return}if(LE(e)&&Ai(g))return o=156,e;if(LE(e)&&gl(g))return o=156,h_e(g.moduleSpecifier)?g:void 0}}function UGe(e){var t;if(!e)return;const r=Ar(e,ed(gl,Hl))??e,i=r.getSourceFile();if(bb(r,i))return l_(r,i);E.assert(r.kind!==102&&r.kind!==276);const s=r.kind===272?mEe((t=r.importClause)==null?void 0:t.namedBindings)??r.moduleSpecifier:r.moduleReference,o={pos:r.getFirstToken().getStart(),end:s.pos};if(bb(o,i))return ry(o)}function mEe(e){var t;return kn((t=Jn(e,Kg))==null?void 0:t.elements,r=>{var i;return!r.propertyName&&_T(r.name.text)&&((i=Kc(r.name.pos,e.getSourceFile(),e))==null?void 0:i.kind)!==28})}function gEe(e,t){return v_(e)&&(e.isTypeOnly||t===e.name&&$9(t))}function hEe(e){if(!h_e(e.parent.parent.moduleSpecifier)||e.parent.name)return!1;if(Kg(e)){const t=mEe(e);return(t?e.elements.indexOf(t):e.elements.length)<2}return!0}function h_e(e){var t;return sc(e)?!0:!((t=Jn(Pm(e)?e.expression:e,Ja))!=null&&t.text)}function VGe(e,t){if(!e)return;const r=Ar(e,s=>Dv(s)||yEe(s)||As(s)?"quit":(us(s)||Uo(s))&&!Cb(s.parent)),i=Ar(t,s=>Dv(s)||yEe(s)||As(s)?"quit":Ei(s));return r||i}function yEe(e){return e.parent&&go(e.parent)&&(e.parent.body===e||e.kind===39)}function y_e(e,t,r=new Map){return i(e)||i(yu(e.exportSymbol||e,t));function i(s){return!!(s.flags&788968)||t.isUnknownSymbol(s)||!!(s.flags&1536)&&Rp(r,Xs(s))&&t.getExportsOfModule(s).some(o=>y_e(o,t,r))}}function qGe(e,t){const r=yu(e,t).declarations;return!!Ir(r)&&qi(r,mL)}function vEe(e,t){if(t.length===0)return!0;let r=!1,i,s=0;const o=e.length;for(let c=0;c(e.ThisProperty="ThisProperty/",e.ClassMemberSnippet="ClassMemberSnippet/",e.TypeOnlyAlias="TypeOnlyAlias/",e.ObjectLiteralMethodSnippet="ObjectLiteralMethodSnippet/",e.SwitchCases="SwitchCases/",e.ObjectLiteralMemberWithComma="ObjectLiteralMemberWithComma/",e))(b_e||{}),S_e=(e=>(e[e.ThisType=1]="ThisType",e[e.SymbolMember=2]="SymbolMember",e[e.Export=4]="Export",e[e.Promise=8]="Promise",e[e.Nullable=16]="Nullable",e[e.ResolvedExport=32]="ResolvedExport",e[e.TypeOnlyAlias=64]="TypeOnlyAlias",e[e.ObjectLiteralMethod=128]="ObjectLiteralMethod",e[e.Ignore=256]="Ignore",e[e.ComputedPropertyName=512]="ComputedPropertyName",e[e.SymbolMemberNoExport=2]="SymbolMemberNoExport",e[e.SymbolMemberExport=6]="SymbolMemberExport",e))(S_e||{}),T_e=(e=>(e[e.ObjectPropertyDeclaration=0]="ObjectPropertyDeclaration",e[e.Global=1]="Global",e[e.PropertyAccess=2]="PropertyAccess",e[e.MemberLike=3]="MemberLike",e[e.String=4]="String",e[e.None=5]="None",e))(T_e||{}),_M=[],x_e=Vu(()=>{const e=[];for(let t=83;t<=165;t++)e.push({name:Hs(t),kind:"keyword",kindModifiers:"",sortText:au.GlobalsOrKeywords});return e})}});function k_e(){const e=new Map;function t(r){const i=e.get(r.name);(!i||w_e[i.kind]({name:n1(T.value,y),kindModifiers:"",kind:"string",sortText:au.LocationPriority,replacementSpan:mH(t)}));return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:e.isNewIdentifier,optionalReplacementSpan:p,entries:S}}default:return E.assertNever(e)}}function YGe(e,t,r,i,s,o,c,u,f){if(!i||!Ja(i))return;const g=TEe(t,i,r,s,o,c,f);return g&&ZGe(e,i,g,t,s,u)}function ZGe(e,t,r,i,s,o){switch(r.kind){case 0:{const c=kn(r.paths,u=>u.name===e);return c&&lM(e,SEe(c.extension),c.kind,[bf(e)])}case 1:{const c=kn(r.symbols,u=>u.name===e);return c&&m_e(c,c.name,s,i,t,o)}case 2:return kn(r.types,c=>c.value===e)?lM(e,"","string",[bf(e)]):void 0;default:return E.assertNever(r)}}function bEe(e){return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!0,entries:e.map(({name:s,kind:o,span:c,extension:u})=>({name:s,kind:o,kindModifiers:SEe(u),sortText:au.LocationPriority,replacementSpan:c}))}}function SEe(e){switch(e){case".d.ts":return".d.ts";case".js":return".js";case".json":return".json";case".jsx":return".jsx";case".ts":return".ts";case".tsx":return".tsx";case".d.mts":return".d.mts";case".mjs":return".mjs";case".mts":return".mts";case".d.cts":return".d.cts";case".cjs":return".cjs";case".cts":return".cts";case".tsbuildinfo":return E.fail("Extension .tsbuildinfo is unsupported.");case void 0:return"";default:return E.assertNever(e)}}function TEe(e,t,r,i,s,o,c){const u=C_e(t.parent);switch(u.kind){case 201:{const T=C_e(u.parent);return T.kind===205?{kind:0,paths:CEe(e,t,s,o,i,c)}:f(T)}case 303:return ma(u.parent)&&u.name===t?t$e(i,u.parent):g()||g(0);case 212:{const{expression:T,argumentExpression:C}=u;return t===Ha(C)?xEe(i.getTypeAtLocation(T)):void 0}case 213:case 214:case 291:if(!m$e(t)&&!G_(u)){const T=lN.getArgumentInfoForCompletions(u.kind===291?u.parent:t,r,e);return T&&e$e(T.invocation,t,T,i)||g(0)}case 272:case 278:case 283:return{kind:0,paths:CEe(e,t,s,o,i,c)};case 296:const p=yL(i,u.parent.clauses),y=g();return y?{kind:2,types:y.types.filter(T=>!p.hasValue(T.value)),isNewIdentifier:!1}:void 0;default:return g()||g(0)}function f(p){switch(p.kind){case 233:case 183:{const T=Ar(u,C=>C.parent===p);return T?{kind:2,types:BX(i.getTypeArgumentConstraint(T)),isNewIdentifier:!1}:void 0}case 199:const{indexType:y,objectType:S}=p;return _A(y,r)?xEe(i.getTypeFromTypeNode(S)):void 0;case 192:{const T=f(C_e(p.parent));if(!T)return;const C=KGe(p,u);return T.kind===1?{kind:1,symbols:T.symbols.filter(w=>!_s(C,w.name)),hasIndexSignature:T.hasIndexSignature}:{kind:2,types:T.types.filter(w=>!_s(C,w.value)),isNewIdentifier:!1}}default:return}}function g(p=4){const y=BX(sL(t,i,p));if(y.length)return{kind:2,types:y,isNewIdentifier:!1}}}function C_e(e){switch(e.kind){case 196:return c8(e);case 217:return Rh(e);default:return e}}function KGe(e,t){return Ii(e.types,r=>r!==t&&_1(r)&&ra(r.literal)?r.literal.text:void 0)}function e$e(e,t,r,i){let s=!1;const o=new Map,c=qu(e)?E.checkDefined(Ar(t.parent,Rd)):t,u=i.getCandidateSignaturesForStringLiteralCompletions(e,c),f=ta(u,g=>{if(!bu(g)&&r.argumentCount>g.parameters.length)return;let p=g.getTypeParameterAtPosition(r.argumentIndex);if(qu(e)){const y=i.getTypeOfPropertyOfType(p,j8(c.name));y&&(p=y)}return s=s||!!(p.flags&4),BX(p,o)});return Ir(f)?{kind:2,types:f,isNewIdentifier:s}:void 0}function xEe(e){return e&&{kind:1,symbols:wn(e.getApparentProperties(),t=>!(t.valueDeclaration&&Nu(t.valueDeclaration))),hasIndexSignature:OH(e)}}function t$e(e,t){const r=e.getContextualType(t);if(!r)return;const i=e.getContextualType(t,4);return{kind:1,symbols:LX(r,i,t,e),hasIndexSignature:OH(r)}}function BX(e,t=new Map){return e?(e=vH(e),e.isUnion()?ta(e.types,r=>BX(r,t)):e.isStringLiteral()&&!(e.flags&1024)&&Rp(t,e.value)?[e]:ze):ze}function U3(e,t,r){return{name:e,kind:t,extension:r}}function E_e(e){return U3(e,"directory",void 0)}function kEe(e,t,r){const i=p$e(e,t),s=e.length===0?void 0:Jl(t,e.length);return r.map(({name:o,kind:c,extension:u})=>o.includes(Co)||o.includes(sP)?{name:o,kind:c,extension:u,span:s}:{name:o,kind:c,extension:u,span:i})}function CEe(e,t,r,i,s,o){return kEe(t.text,t.getStart(e)+1,r$e(e,t,r,i,s,o))}function r$e(e,t,r,i,s,o){const c=du(t.text),u=Ja(t)?ld(e,t):void 0,f=e.path,g=qn(f),p=D_e(r,1,e,s,o,u);return d$e(c)||!r.baseUrl&&!r.paths&&(C_(c)||yK(c))?n$e(c,g,r,i,f,p):o$e(c,g,u,r,i,p,s)}function D_e(e,t,r,i,s,o){return{extensionsToSearch:Np(i$e(e,i)),referenceKind:t,importingSourceFile:r,endingPreference:s?.importModuleSpecifierEnding,resolutionMode:o}}function n$e(e,t,r,i,s,o){return r.rootDirs?a$e(r.rootDirs,e,t,o,r,i,s):fs(iN(e,t,o,i,!0,s).values())}function i$e(e,t){const r=t?Ii(t.getAmbientModules(),o=>{const c=o.name.slice(1,-1);if(!(!c.startsWith("*.")||c.includes("/")))return c.slice(1)}):[],i=[...hE(e),r],s=Vl(e);return X9(s)?N8(e,i):i}function s$e(e,t,r,i){e=e.map(o=>Sl(qs(C_(o)?o:Hn(t,o))));const s=ic(e,o=>dm(o,r,t,i)?r.substr(o.length):void 0);return VS([...e.map(o=>Hn(o,s)),r].map(o=>Vy(o)),QS,Du)}function a$e(e,t,r,i,s,o,c){const u=s.project||o.getCurrentDirectory(),f=!(o.useCaseSensitiveFileNames&&o.useCaseSensitiveFileNames()),g=s$e(e,u,r,f);return ta(g,p=>fs(iN(t,p,i,o,!0,c).values()))}function iN(e,t,r,i,s,o,c=k_e()){var u;e===void 0&&(e=""),e=du(e),Nh(e)||(e=qn(e)),e===""&&(e="."+Co),e=Sl(e);const f=I0(t,e),g=Nh(f)?f:qn(f);if(!s){const T=Doe(g,i);if(T){const w=lE(T,i).typesVersions;if(typeof w=="object"){const D=(u=hO(w))==null?void 0:u.paths;if(D){const O=qn(T),z=f.slice(Sl(O).length);if(DEe(c,z,O,r,i,D))return c}}}}const p=!(i.useCaseSensitiveFileNames&&i.useCaseSensitiveFileNames());if(!uL(i,g))return c;const y=MH(i,g,r.extensionsToSearch,void 0,["./*"]);if(y)for(let T of y){if(T=qs(T),o&&qy(T,o,t,p)===0)continue;const{name:C,extension:w}=EEe(Pc(T),i.getCompilationSettings(),r);c.add(U3(C,"script",w))}const S=lL(i,g);if(S)for(const T of S){const C=Pc(qs(T));C!=="@types"&&c.add(E_e(C))}return c}function EEe(e,t,r){const i=Zv.tryGetRealFileNameForNonJsDeclarationFileName(e);if(i)return{name:i,extension:ug(i)};if(r.referenceKind===0)return{name:e,extension:ug(e)};const s=Vz(r.endingPreference,r.resolutionMode,t,r.importingSourceFile);if(s===3){if(Jc(e,W8))return{name:e,extension:ug(e)};const c=Zv.tryGetJSExtensionForFile(e,t);return c?{name:a1(e,c),extension:c}:{name:e,extension:ug(e)}}if((s===0||s===1)&&Jc(e,[".js",".jsx",".ts",".tsx",".d.ts"]))return{name:Ou(e),extension:ug(e)};const o=Zv.tryGetJSExtensionForFile(e,t);return o?{name:a1(e,o),extension:o}:{name:e,extension:ug(e)}}function DEe(e,t,r,i,s,o){const c=f=>o[f],u=(f,g)=>{const p=Kk(f),y=Kk(g),S=typeof p=="object"?p.prefix.length:f.length,T=typeof y=="object"?y.prefix.length:g.length;return xo(T,S)};return PEe(e,t,r,i,s,Jg(o),c,u)}function PEe(e,t,r,i,s,o,c,u){let f=[],g;for(const p of o){if(p===".")continue;const y=p.replace(/^\.\//,""),S=c(p);if(S){const T=Kk(y);if(!T)continue;const C=typeof T=="object"&&P7(T,t);C&&(g===void 0||u(p,g)===-1)&&(g=p,f=f.filter(D=>!D.matchedPattern)),(typeof T=="string"||g===void 0||u(p,g)!==1)&&f.push({matchedPattern:C,results:c$e(y,S,t,r,i,s).map(({name:D,kind:O,extension:z})=>U3(D,O,z))})}}return f.forEach(p=>p.results.forEach(y=>e.add(y))),g!==void 0}function o$e(e,t,r,i,s,o,c){const{baseUrl:u,paths:f}=i,g=k_e(),p=Vl(i);if(u){const S=qs(Hn(s.getCurrentDirectory(),u));iN(e,S,o,s,!1,void 0,g)}if(f){const S=p5(i,s);DEe(g,e,S,o,s,f)}const y=AEe(e);for(const S of u$e(e,y,c))g.add(U3(S,"external module name",void 0));if(FEe(s,i,t,y,o,g),X9(p)){let S=!1;if(y===void 0)for(const T of f$e(s,t)){const C=U3(T,"external module name",void 0);g.has(C.name)||(S=!0,g.add(C))}if(!S){let T=C=>{const w=Hn(C,"node_modules");uL(s,w)&&iN(e,w,o,s,!1,void 0,g)};if(y&&Rz(i)){const C=T;T=w=>{const D=fl(e);D.shift();let O=D.shift();if(!O)return C(w);if(Qi(O,"@")){const X=D.shift();if(!X)return C(w);O=Hn(O,X)}const z=Hn(w,"node_modules",O),W=Hn(z,"package.json");if(PA(s,W)){const J=lE(W,s).exports;if(J){if(typeof J!="object"||J===null)return;const ie=Jg(J),B=D.join("/")+(D.length&&Nh(e)?"/":""),Y=Xv(i,r);PEe(g,B,z,o,s,ie,ae=>Q2(wEe(J[ae],Y)),VU);return}}return C(w)}}kd(t,T)}}return fs(g.values())}function wEe(e,t){if(typeof e=="string")return e;if(e&&typeof e=="object"&&!es(e)){for(const r in e)if(r==="default"||t.includes(r)||jw(t,r)){const i=e[r];return wEe(i,t)}}}function AEe(e){return P_e(e)?Nh(e)?e:qn(e):void 0}function c$e(e,t,r,i,s,o){if(!fc(e,"*"))return e.includes("*")?ze:f(e,"script");const c=e.slice(0,e.length-1),u=Dj(r,c);if(u===void 0)return e[e.length-2]==="/"?f(c,"directory"):ta(t,p=>{var y;return(y=NEe("",i,p,s,o))==null?void 0:y.map(({name:S,...T})=>({name:c+S,...T}))});return ta(t,g=>NEe(u,i,g,s,o));function f(g,p){return Qi(g,r)?[{name:Vy(g),kind:p,extension:void 0}]:ze}}function NEe(e,t,r,i,s){if(!s.readDirectory)return;const o=Kk(r);if(o===void 0||ns(o))return;const c=I0(o.prefix),u=Nh(o.prefix)?c:qn(c),f=Nh(o.prefix)?"":Pc(c),g=P_e(e),p=g?Nh(e)?e:qn(e):void 0,y=g?Hn(u,f+p):u,S=qs(o.suffix),T=S&&v8("_"+S),C=T?[a1(S,T),S]:[S],w=qs(Hn(t,y)),D=g?w:Sl(w)+f,O=S?C.map(J=>"**/*"+J):["./*"],z=Ii(MH(s,w,i.extensionsToSearch,void 0,O),J=>{const ie=X(J);if(ie){if(P_e(ie))return E_e(fl(IEe(ie))[1]);const{name:B,extension:Y}=EEe(ie,s.getCompilationSettings(),i);return U3(B,"script",Y)}}),W=S?ze:Ii(lL(s,w),J=>J==="node_modules"?void 0:E_e(J));return[...z,...W];function X(J){return ic(C,ie=>{const B=l$e(qs(J),D,ie);return B===void 0?void 0:IEe(B)})}}function l$e(e,t,r){return Qi(e,t)&&fc(e,r)?e.slice(t.length,e.length-r.length):void 0}function IEe(e){return e[0]===Co?e.slice(1):e}function u$e(e,t,r){const s=r.getAmbientModules().map(o=>lp(o.name)).filter(o=>Qi(o,e)&&!o.includes("*"));if(t!==void 0){const o=Sl(t);return s.map(c=>g4(c,o))}return s}function _$e(e,t,r,i){const s=Ji(e,t),o=Km(e.text,s.pos),c=o&&kn(o,C=>t>=C.pos&&t<=C.end);if(!c)return;const u=e.text.slice(c.pos,t),f=OEe.exec(u);if(!f)return;const[,g,p,y]=f,S=qn(e.path),T=p==="path"?iN(y,S,D_e(r,0,e),i,!0,e.path):p==="types"?FEe(i,r,S,AEe(y),D_e(r,1,e)):E.fail();return kEe(y,c.pos+g.length,fs(T.values()))}function FEe(e,t,r,i,s,o=k_e()){const c=new Map,u=_L(()=>r3(t,e))||ze;for(const g of u)f(g);for(const g of RH(r,e)){const p=Hn(qn(g),"node_modules/@types");f(p)}return o;function f(g){if(uL(e,g))for(const p of lL(e,g)){const y=Bw(p);if(!(t.types&&!_s(t.types,y)))if(i===void 0)c.has(y)||(o.add(U3(y,"external module name",void 0)),c.set(y,!0));else{const S=Hn(g,p),T=Jz(i,y,jh(e));T!==void 0&&iN(T,S,s,e,!1,void 0,o)}}}}function f$e(e,t){if(!e.readFile||!e.fileExists)return ze;const r=[];for(const i of RH(t,e)){const s=lE(i,e);for(const o of LEe){const c=s[o];if(c)for(const u in c)Ya(c,u)&&!Qi(u,"@types/")&&r.push(u)}}return r}function p$e(e,t){const r=Math.max(e.lastIndexOf(Co),e.lastIndexOf(sP)),i=r!==-1?r+1:0,s=e.length-i;return s===0||lf(e.substr(i,s),99)?void 0:Jl(t+i,s)}function d$e(e){if(e&&e.length>=2&&e.charCodeAt(0)===46){const t=e.length>=3&&e.charCodeAt(1)===46?2:1,r=e.charCodeAt(t);return r===47||r===92}return!1}function P_e(e){return e.includes(Co)}function m$e(e){return Rs(e.parent)&&bl(e.parent.arguments)===e&&Ie(e.parent.expression)&&e.parent.expression.escapedText==="require"}var w_e,OEe,LEe,g$e=Nt({"src/services/stringCompletions.ts"(){"use strict";zn(),A_e(),w_e={directory:0,script:1,"external module name":2},OEe=/^(\/\/\/\s*YGe,getStringLiteralCompletions:()=>XGe});var h$e=Nt({"src/services/_namespaces/ts.Completions.StringCompletions.ts"(){"use strict";g$e()}}),lx={};jl(lx,{CompletionKind:()=>T_e,CompletionSource:()=>b_e,SortText:()=>au,StringCompletions:()=>JX,SymbolOriginInfoKind:()=>S_e,createCompletionDetails:()=>lM,createCompletionDetailsForSymbol:()=>m_e,getCompletionEntriesFromSymbols:()=>p_e,getCompletionEntryDetails:()=>EGe,getCompletionEntrySymbol:()=>PGe,getCompletionsAtPosition:()=>iGe,getPropertiesForObjectExpression:()=>LX,moduleSpecifierResolutionCacheAttemptLimit:()=>v_e,moduleSpecifierResolutionLimit:()=>jX});var A_e=Nt({"src/services/_namespaces/ts.Completions.ts"(){"use strict";$Ge(),h$e()}});function N_e(e,t,r,i){const s=S$e(e,r,i);return(o,c,u)=>{const{directImports:f,indirectUsers:g}=y$e(e,t,s,c,r,i);return{indirectUsers:g,...v$e(f,o,c.exportKind,r,u)}}}function y$e(e,t,r,{exportingModuleSymbol:i,exportKind:s},o,c){const u=KT(),f=KT(),g=[],p=!!i.globalExports,y=p?void 0:[];return T(i),{directImports:g,indirectUsers:S()};function S(){if(p)return e;if(i.declarations)for(const W of i.declarations)xv(W)&&t.has(W.getSourceFile().fileName)&&O(W);return y.map(Or)}function T(W){const X=z(W);if(X){for(const J of X)if(u(J))switch(c&&c.throwIfCancellationRequested(),J.kind){case 213:if(G_(J)){C(J);break}if(!p){const B=J.parent;if(s===2&&B.kind===260){const{name:Y}=B;if(Y.kind===80){g.push(Y);break}}}break;case 80:break;case 271:D(J,J.name,In(J,32),!1);break;case 272:g.push(J);const ie=J.importClause&&J.importClause.namedBindings;ie&&ie.kind===274?D(J,ie.name,!1,!0):!p&&oT(J)&&O(fM(J));break;case 278:J.exportClause?J.exportClause.kind===280?O(fM(J),!0):g.push(J):T(E$e(J,o));break;case 205:!p&&J.isTypeOf&&!J.qualifier&&w(J)&&O(J.getSourceFile(),!0),g.push(J);break;default:E.failBadSyntaxKind(J,"Unexpected import kind.")}}}function C(W){const X=Ar(W,zX)||W.getSourceFile();O(X,!!w(W,!0))}function w(W,X=!1){return Ar(W,J=>X&&zX(J)?"quit":Wp(J)&&ut(J.modifiers,wT))}function D(W,X,J,ie){if(s===2)ie||g.push(W);else if(!p){const B=fM(W);E.assert(B.kind===312||B.kind===267),J||b$e(B,X,o)?O(B,!0):O(B)}}function O(W,X=!1){if(E.assert(!p),!f(W)||(y.push(W),!X))return;const ie=o.getMergedSymbol(W.symbol);if(!ie)return;E.assert(!!(ie.flags&1536));const B=z(ie);if(B)for(const Y of B)Zg(Y)||O(fM(Y),!0)}function z(W){return r.get(Xs(W).toString())}}function v$e(e,t,r,i,s){const o=[],c=[];function u(S,T){o.push([S,T])}if(e)for(const S of e)f(S);return{importSearches:o,singleReferences:c};function f(S){if(S.kind===271){F_e(S)&&g(S.name);return}if(S.kind===80){g(S);return}if(S.kind===205){if(S.qualifier){const w=$_(S.qualifier);w.escapedText===pc(t)&&c.push(w)}else r===2&&c.push(S.argument.literal);return}if(S.moduleSpecifier.kind!==11)return;if(S.kind===278){S.exportClause&&gp(S.exportClause)&&p(S.exportClause);return}const{name:T,namedBindings:C}=S.importClause||{name:void 0,namedBindings:void 0};if(C)switch(C.kind){case 274:g(C.name);break;case 275:(r===0||r===1)&&p(C);break;default:E.assertNever(C)}if(T&&(r===1||r===2)&&(!s||T.escapedText===Y9(t))){const w=i.getSymbolAtLocation(T);u(T,w)}}function g(S){r===2&&(!s||y(S.escapedText))&&u(S,i.getSymbolAtLocation(S))}function p(S){if(S)for(const T of S.elements){const{name:C,propertyName:w}=T;if(y((w||C).escapedText))if(w)c.push(w),(!s||C.escapedText===t.escapedName)&&u(C,i.getSymbolAtLocation(C));else{const D=T.kind===281&&T.propertyName?i.getExportSpecifierLocalTargetSymbol(T):i.getSymbolAtLocation(C);u(C,D)}}}function y(S){return S===t.escapedName||r!==0&&S==="default"}}function b$e(e,t,r){const i=r.getSymbolAtLocation(t);return!!REe(e,s=>{if(!qc(s))return;const{exportClause:o,moduleSpecifier:c}=s;return!c&&o&&gp(o)&&o.elements.some(u=>r.getExportSpecifierLocalTargetSymbol(u)===i)})}function MEe(e,t,r){var i;const s=[],o=e.getTypeChecker();for(const c of t){const u=r.valueDeclaration;if(u?.kind===312){for(const f of c.referencedFiles)e.getSourceFileFromReference(c,f)===u&&s.push({kind:"reference",referencingFile:c,ref:f});for(const f of c.typeReferenceDirectives){const g=(i=e.getResolvedTypeReferenceDirectives().get(f.fileName,f.resolutionMode||c.impliedNodeFormat))==null?void 0:i.resolvedTypeReferenceDirective;g!==void 0&&g.resolvedFileName===u.fileName&&s.push({kind:"reference",referencingFile:c,ref:f})}}jEe(c,(f,g)=>{o.getSymbolAtLocation(g)===r&&s.push(Po(f)?{kind:"implicit",literal:g,referencingFile:c}:{kind:"import",literal:g})})}return s}function S$e(e,t,r){const i=new Map;for(const s of e)r&&r.throwIfCancellationRequested(),jEe(s,(o,c)=>{const u=t.getSymbolAtLocation(c);if(u){const f=Xs(u).toString();let g=i.get(f);g||i.set(f,g=[]),g.push(o)}});return i}function REe(e,t){return Zt(e.kind===312?e.statements:e.body.statements,r=>t(r)||zX(r)&&Zt(r.body&&r.body.statements,t))}function jEe(e,t){if(e.externalModuleIndicator||e.imports!==void 0)for(const r of e.imports)t(G4(r),r);else REe(e,r=>{switch(r.kind){case 278:case 272:{const i=r;i.moduleSpecifier&&ra(i.moduleSpecifier)&&t(i,i.moduleSpecifier);break}case 271:{const i=r;F_e(i)&&t(i,i.moduleReference.expression);break}}})}function BEe(e,t,r,i){return i?s():s()||o();function s(){var f;const{parent:g}=e,p=g.parent;if(t.exportSymbol)return g.kind===211?(f=t.declarations)!=null&&f.some(T=>T===g)&&Gr(p)?S(p,!1):void 0:c(t.exportSymbol,u(g));{const T=x$e(g,e);if(T&&In(T,32))return Hl(T)&&T.moduleReference===e?i?void 0:{kind:0,symbol:r.getSymbolAtLocation(T.name)}:c(t,u(T));if(Dm(g))return c(t,0);if(cc(g))return y(g);if(cc(p))return y(p);if(Gr(g))return S(g,!0);if(Gr(p))return S(p,!0);if(bC(g)||UW(g))return c(t,0)}function y(T){if(!T.symbol.parent)return;const C=T.isExportEquals?2:1;return{kind:1,symbol:t,exportInfo:{exportingModuleSymbol:T.symbol.parent,exportKind:C}}}function S(T,C){let w;switch(ac(T)){case 1:w=0;break;case 2:w=2;break;default:return}const D=C?r.getSymbolAtLocation(Hte(Ms(T.left,co))):t;return D&&c(D,w)}}function o(){if(!k$e(e))return;let g=r.getImmediateAliasedSymbol(t);if(!g||(g=C$e(g,r),g.escapedName==="export="&&(g=T$e(g,r),g===void 0)))return;const p=Y9(g);if(p===void 0||p==="default"||p===t.escapedName)return{kind:0,symbol:g}}function c(f,g){const p=I_e(f,g,r);return p&&{kind:1,symbol:f,exportInfo:p}}function u(f){return In(f,2048)?1:0}}function T$e(e,t){var r,i;if(e.flags&2097152)return t.getImmediateAliasedSymbol(e);const s=E.checkDefined(e.valueDeclaration);if(cc(s))return(r=Jn(s.expression,Ed))==null?void 0:r.symbol;if(Gr(s))return(i=Jn(s.right,Ed))==null?void 0:i.symbol;if(Ai(s))return s.symbol}function x$e(e,t){const r=Ei(e)?e:Pa(e)?dk(e):void 0;return r?e.name!==t||Gv(r.parent)?void 0:ec(r.parent.parent)?r.parent.parent:void 0:e}function k$e(e){const{parent:t}=e;switch(t.kind){case 271:return t.name===e&&F_e(t);case 276:return!t.propertyName;case 273:case 274:return E.assert(t.name===e),!0;case 208:return Hr(e)&&Pv(t.parent.parent);default:return!1}}function I_e(e,t,r){const i=e.parent;if(!i)return;const s=r.getMergedSymbol(i);return yA(s)?{exportingModuleSymbol:s,exportKind:t}:void 0}function C$e(e,t){if(e.declarations)for(const r of e.declarations){if(vu(r)&&!r.propertyName&&!r.parent.parent.moduleSpecifier)return t.getExportSpecifierLocalTargetSymbol(r)||e;if(bn(r)&&ag(r.expression)&&!Ti(r.name))return t.getSymbolAtLocation(r);if(Y_(r)&&Gr(r.parent.parent)&&ac(r.parent.parent)===2)return t.getExportSpecifierLocalTargetSymbol(r.name)}return e}function E$e(e,t){return t.getMergedSymbol(fM(e).symbol)}function fM(e){if(e.kind===213)return e.getSourceFile();const{parent:t}=e;return t.kind===312?t:(E.assert(t.kind===268),Ms(t.parent,zX))}function zX(e){return e.kind===267&&e.name.kind===11}function F_e(e){return e.moduleReference.kind===283&&e.moduleReference.expression.kind===11}var O_e,L_e,D$e=Nt({"src/services/importTracker.ts"(){"use strict";zn(),O_e=(e=>(e[e.Named=0]="Named",e[e.Default=1]="Default",e[e.ExportEquals=2]="ExportEquals",e))(O_e||{}),L_e=(e=>(e[e.Import=0]="Import",e[e.Export=1]="Export",e))(L_e||{})}});function yg(e,t=1){return{kind:t,node:e.name||e,context:P$e(e)}}function JEe(e){return e&&e.kind===void 0}function P$e(e){if(hu(e))return Xb(e);if(e.parent){if(!hu(e.parent)&&!cc(e.parent)){if(Hr(e)){const r=Gr(e.parent)?e.parent:co(e.parent)&&Gr(e.parent.parent)&&e.parent.parent.left===e.parent?e.parent.parent:void 0;if(r&&ac(r)!==0)return Xb(r)}if(Md(e.parent)||Vv(e.parent))return e.parent.parent;if(Nb(e.parent)||Uv(e.parent)||N4(e.parent))return e.parent;if(Ja(e)){const r=n8(e);if(r){const i=Ar(r,s=>hu(s)||Ci(s)||xk(s));return hu(i)?Xb(i):i}}const t=Ar(e,xa);return t?Xb(t.parent):void 0}if(e.parent.name===e||gc(e.parent)||cc(e.parent)||(rT(e.parent)||Pa(e.parent))&&e.parent.propertyName===e||e.kind===90&&In(e.parent,2080))return Xb(e.parent)}}function Xb(e){if(e)switch(e.kind){case 260:return!ml(e.parent)||e.parent.declarations.length!==1?e:ec(e.parent.parent)?e.parent.parent:Sk(e.parent.parent)?Xb(e.parent.parent):e.parent;case 208:return Xb(e.parent.parent);case 276:return e.parent.parent.parent;case 281:case 274:return e.parent.parent;case 273:case 280:return e.parent;case 226:return kl(e.parent)?e.parent:e;case 250:case 249:return{start:e.initializer,end:e.expression};case 303:case 304:return Qh(e.parent)?Xb(Ar(e.parent,t=>Gr(t)||Sk(t))):e;default:return e}}function M_e(e,t,r){if(!r)return;const i=JEe(r)?dM(r.start,t,r.end):dM(r,t);return i.start!==e.start||i.length!==e.length?{contextSpan:i}:void 0}function w$e(e,t,r,i,s){const o=c_(i,s),c={use:1},u=ux.getReferencedSymbolsForNode(s,o,e,r,t,c),f=e.getTypeChecker(),g=ux.getAdjustedNode(o,c),p=A$e(g)?f.getSymbolAtLocation(g):void 0;return!u||!u.length?void 0:Ii(u,({definition:y,references:S})=>y&&{definition:f.runWithCancellationToken(t,T=>F$e(y,T,o)),references:S.map(T=>L$e(T,p))})}function A$e(e){return e.kind===90||!!X4(e)||l8(e)||e.kind===137&&gc(e.parent)}function N$e(e,t,r,i,s){const o=c_(i,s);let c;const u=zEe(e,t,r,o,s);if(o.parent.kind===211||o.parent.kind===208||o.parent.kind===212||o.kind===108)c=u&&[...u];else if(u){const g=C7(u),p=new Map;for(;!g.isEmpty();){const y=g.dequeue();if(!Rp(p,Oa(y.node)))continue;c=lr(c,y);const S=zEe(e,t,r,y.node,y.node.pos);S&&g.enqueue(...S)}}const f=e.getTypeChecker();return Yt(c,g=>R$e(g,f))}function zEe(e,t,r,i,s){if(i.kind===312)return;const o=e.getTypeChecker();if(i.parent.kind===304){const c=[];return ux.getReferenceEntriesForShorthandPropertyAssignment(i,o,u=>c.push(yg(u))),c}else if(i.kind===108||s_(i.parent)){const c=o.getSymbolAtLocation(i);return c.valueDeclaration&&[yg(c.valueDeclaration)]}else return WEe(s,i,e,r,t,{implementations:!0,use:1})}function I$e(e,t,r,i,s,o,c){return Yt(UEe(ux.getReferencedSymbolsForNode(s,i,e,r,t,o)),u=>c(u,i,e.getTypeChecker()))}function WEe(e,t,r,i,s,o={},c=new Set(i.map(u=>u.fileName))){return UEe(ux.getReferencedSymbolsForNode(e,t,r,i,s,o,c))}function UEe(e){return e&&ta(e,t=>t.references)}function F$e(e,t,r){const i=(()=>{switch(e.type){case 0:{const{symbol:p}=e,{displayParts:y,kind:S}=VEe(p,t,r),T=y.map(D=>D.text).join(""),C=p.declarations&&bl(p.declarations),w=C?as(C)||C:r;return{...pM(w),name:T,kind:S,displayParts:y,context:Xb(C)}}case 1:{const{node:p}=e;return{...pM(p),name:p.text,kind:"label",displayParts:[b_(p.text,17)]}}case 2:{const{node:p}=e,y=Hs(p.kind);return{...pM(p),name:y,kind:"keyword",displayParts:[{text:y,kind:"keyword"}]}}case 3:{const{node:p}=e,y=t.getSymbolAtLocation(p),S=y&&t0.getSymbolDisplayPartsDocumentationAndSymbolKind(t,y,p.getSourceFile(),Ub(p),p).displayParts||[bf("this")];return{...pM(p),name:"this",kind:"var",displayParts:S}}case 4:{const{node:p}=e;return{...pM(p),name:p.text,kind:"var",displayParts:[b_(Wc(p),8)]}}case 5:return{textSpan:ry(e.reference),sourceFile:e.file,name:e.reference.fileName,kind:"string",displayParts:[b_(`"${e.reference.fileName}"`,8)]};default:return E.assertNever(e)}})(),{sourceFile:s,textSpan:o,name:c,kind:u,displayParts:f,context:g}=i;return{containerKind:"",containerName:"",fileName:s.fileName,kind:u,name:c,textSpan:o,displayParts:f,...M_e(o,s,g)}}function pM(e){const t=e.getSourceFile();return{sourceFile:t,textSpan:dM(xa(e)?e.expression:e,t)}}function VEe(e,t,r){const i=ux.getIntersectingMeaningFromDeclarations(r,e),s=e.declarations&&bl(e.declarations)||r,{displayParts:o,symbolKind:c}=t0.getSymbolDisplayPartsDocumentationAndSymbolKind(t,e,s.getSourceFile(),s,s,i);return{displayParts:o,kind:c}}function O$e(e,t,r,i,s){return{...WX(e),...i&&M$e(e,t,r,s)}}function L$e(e,t){const r=qEe(e);return t?{...r,isDefinition:e.kind!==0&&HEe(e.node,t)}:r}function qEe(e){const t=WX(e);if(e.kind===0)return{...t,isWriteAccess:!1};const{kind:r,node:i}=e;return{...t,isWriteAccess:j_e(i),isInString:r===2?!0:void 0}}function WX(e){if(e.kind===0)return{textSpan:e.textSpan,fileName:e.fileName};{const t=e.node.getSourceFile(),r=dM(e.node,t);return{textSpan:r,fileName:t.fileName,...M_e(r,t,e.context)}}}function M$e(e,t,r,i){if(e.kind!==0&&Ie(t)){const{node:s,kind:o}=e,c=s.parent,u=t.text,f=Y_(c);if(f||SA(c)&&c.name===s&&c.dotDotDotToken===void 0){const g={prefixText:u+": "},p={suffixText:": "+u};if(o===3)return g;if(o===4)return p;if(f){const y=c.parent;return ma(y)&&Gr(y.parent)&&ag(y.parent.left)?g:p}else return g}else if(v_(c)&&!c.propertyName){const g=vu(t.parent)?r.getExportSpecifierLocalTargetSymbol(t.parent):r.getSymbolAtLocation(t);return _s(g.declarations,c)?{prefixText:u+" as "}:jf}else if(vu(c)&&!c.propertyName)return t===e.node||r.getSymbolAtLocation(t)===r.getSymbolAtLocation(e.node)?{prefixText:u+" as "}:{suffixText:" as "+u}}if(e.kind!==0&&A_(e.node)&&co(e.node.parent)){const s=xH(i);return{prefixText:s,suffixText:s}}return jf}function R$e(e,t){const r=WX(e);if(e.kind!==0){const{node:i}=e;return{...r,...j$e(i,t)}}else return{...r,kind:"",displayParts:[]}}function j$e(e,t){const r=t.getSymbolAtLocation(hu(e)&&e.name?e.name:e);return r?VEe(r,t,e):e.kind===210?{kind:"interface",displayParts:[Su(21),bf("object literal"),Su(22)]}:e.kind===231?{kind:"local class",displayParts:[Su(21),bf("anonymous local class"),Su(22)]}:{kind:n2(e),displayParts:[]}}function B$e(e){const t=WX(e);if(e.kind===0)return{fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}};const r=j_e(e.node),i={textSpan:t.textSpan,kind:r?"writtenReference":"reference",isInString:e.kind===2?!0:void 0,...t.contextSpan&&{contextSpan:t.contextSpan}};return{fileName:t.fileName,span:i}}function dM(e,t,r){let i=e.getStart(t),s=(r||e).getEnd();return Ja(e)&&s-i>2&&(E.assert(r===void 0),i+=1,s-=1),zc(i,s)}function R_e(e){return e.kind===0?e.textSpan:dM(e.node,e.node.getSourceFile())}function j_e(e){const t=X4(e);return!!t&&J$e(t)||e.kind===90||gT(e)}function HEe(e,t){var r;if(!t)return!1;const i=X4(e)||(e.kind===90?e.parent:l8(e)||e.kind===137&&gc(e.parent)?e.parent.parent:void 0),s=i&&Gr(i)?i.left:void 0;return!!(i&&((r=t.declarations)!=null&&r.some(o=>o===i||o===s)))}function J$e(e){if(e.flags&33554432)return!0;switch(e.kind){case 226:case 208:case 263:case 231:case 90:case 266:case 306:case 281:case 273:case 271:case 276:case 264:case 345:case 353:case 291:case 267:case 270:case 274:case 280:case 169:case 304:case 265:case 168:return!0;case 303:return!Qh(e.parent);case 262:case 218:case 176:case 174:case 177:case 178:return!!e.body;case 260:case 172:return!!e.initializer||Gv(e.parent);case 173:case 171:case 355:case 348:return!1;default:return E.failBadSyntaxKind(e)}}var B_e,J_e,z_e,ux,z$e=Nt({"src/services/findAllReferences.ts"(){"use strict";zn(),GEe(),B_e=(e=>(e[e.Symbol=0]="Symbol",e[e.Label=1]="Label",e[e.Keyword=2]="Keyword",e[e.This=3]="This",e[e.String=4]="String",e[e.TripleSlashReference=5]="TripleSlashReference",e))(B_e||{}),J_e=(e=>(e[e.Span=0]="Span",e[e.Node=1]="Node",e[e.StringLiteral=2]="StringLiteral",e[e.SearchedLocalFoundProperty=3]="SearchedLocalFoundProperty",e[e.SearchedPropertyFoundLocal=4]="SearchedPropertyFoundLocal",e))(J_e||{}),z_e=(e=>(e[e.Other=0]="Other",e[e.References=1]="References",e[e.Rename=2]="Rename",e))(z_e||{}),(e=>{function t(Ce,Ue,rt,ft,dt,fe={},we=new Set(ft.map(Be=>Be.fileName))){var Be,gt;if(Ue=r(Ue,fe),Ai(Ue)){const Qt=c6.getReferenceAtPosition(Ue,Ce,rt);if(!Qt?.file)return;const er=rt.getTypeChecker().getMergedSymbol(Qt.file.symbol);if(er)return g(rt,er,!1,ft,we);const or=rt.getFileIncludeReasons();return or?[{definition:{type:5,reference:Qt.reference,file:Ue},references:s(Qt.file,or,rt)||ze}]:void 0}if(!fe.implementations){const Qt=y(Ue,ft,dt);if(Qt)return Qt}const G=rt.getTypeChecker(),ht=G.getSymbolAtLocation(gc(Ue)&&Ue.parent.name||Ue);if(!ht){if(!fe.implementations&&Ja(Ue)){if(Z9(Ue)){const Qt=rt.getFileIncludeReasons(),er=(gt=(Be=rt.getResolvedModule(Ue.getSourceFile(),Ue.text,ld(Ue.getSourceFile(),Ue)))==null?void 0:Be.resolvedModule)==null?void 0:gt.resolvedFileName,or=er?rt.getSourceFile(er):void 0;if(or)return[{definition:{type:4,node:Ue},references:s(or,Qt,rt)||ze}]}return Qe(Ue,ft,G,dt)}return}if(ht.escapedName==="export=")return g(rt,ht.parent,!1,ft,we);const Dt=c(ht,rt,ft,dt,fe,we);if(Dt&&!(ht.flags&33554432))return Dt;const Re=o(Ue,ht,G),st=Re&&c(Re,rt,ft,dt,fe,we),Ct=S(ht,Ue,ft,we,G,dt,fe);return u(rt,Dt,Ct,st)}e.getReferencedSymbolsForNode=t;function r(Ce,Ue){return Ue.use===1?Ce=cH(Ce):Ue.use===2&&(Ce=J9(Ce)),Ce}e.getAdjustedNode=r;function i(Ce,Ue,rt,ft=new Set(rt.map(dt=>dt.fileName))){var dt,fe;const we=(dt=Ue.getSourceFile(Ce))==null?void 0:dt.symbol;if(we)return((fe=g(Ue,we,!1,rt,ft)[0])==null?void 0:fe.references)||ze;const Be=Ue.getFileIncludeReasons(),gt=Ue.getSourceFile(Ce);return gt&&Be&&s(gt,Be,Ue)||ze}e.getReferencesForFileName=i;function s(Ce,Ue,rt){let ft;const dt=Ue.get(Ce.path)||ze;for(const fe of dt)if(T1(fe)){const we=rt.getSourceFileByPath(fe.file),Be=y3(rt,fe);MC(Be)&&(ft=lr(ft,{kind:0,fileName:we.fileName,textSpan:ry(Be)}))}return ft}function o(Ce,Ue,rt){if(Ce.parent&&aw(Ce.parent)){const ft=rt.getAliasedSymbol(Ue),dt=rt.getMergedSymbol(ft);if(ft!==dt)return dt}}function c(Ce,Ue,rt,ft,dt,fe){const we=Ce.flags&1536&&Ce.declarations&&kn(Ce.declarations,Ai);if(!we)return;const Be=Ce.exports.get("export="),gt=g(Ue,Ce,!!Be,rt,fe);if(!Be||!fe.has(we.fileName))return gt;const G=Ue.getTypeChecker();return Ce=yu(Be,G),u(Ue,gt,S(Ce,void 0,rt,fe,G,ft,dt))}function u(Ce,...Ue){let rt;for(const ft of Ue)if(!(!ft||!ft.length)){if(!rt){rt=ft;continue}for(const dt of ft){if(!dt.definition||dt.definition.type!==0){rt.push(dt);continue}const fe=dt.definition.symbol,we=Dc(rt,gt=>!!gt.definition&>.definition.type===0&>.definition.symbol===fe);if(we===-1){rt.push(dt);continue}const Be=rt[we];rt[we]={definition:Be.definition,references:Be.references.concat(dt.references).sort((gt,G)=>{const ht=f(Ce,gt),Dt=f(Ce,G);if(ht!==Dt)return xo(ht,Dt);const Re=R_e(gt),st=R_e(G);return Re.start!==st.start?xo(Re.start,st.start):xo(Re.length,st.length)})}}}return rt}function f(Ce,Ue){const rt=Ue.kind===0?Ce.getSourceFile(Ue.fileName):Ue.node.getSourceFile();return Ce.getSourceFiles().indexOf(rt)}function g(Ce,Ue,rt,ft,dt){E.assert(!!Ue.valueDeclaration);const fe=Ii(MEe(Ce,ft,Ue),Be=>{if(Be.kind==="import"){const gt=Be.literal.parent;if(_1(gt)){const G=Ms(gt.parent,Zg);if(rt&&!G.qualifier)return}return yg(Be.literal)}else if(Be.kind==="implicit"){const gt=Be.literal.text!==X0&&QE(Be.referencingFile,G=>G.transformFlags&2?dg(G)||Nb(G)||qv(G)?G:void 0:"skip")||Be.referencingFile.statements[0]||Be.referencingFile;return yg(gt)}else return{kind:0,fileName:Be.referencingFile.fileName,textSpan:ry(Be.ref)}});if(Ue.declarations)for(const Be of Ue.declarations)switch(Be.kind){case 312:break;case 267:dt.has(Be.getSourceFile().fileName)&&fe.push(yg(Be.name));break;default:E.assert(!!(Ue.flags&33554432),"Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.")}const we=Ue.exports.get("export=");if(we?.declarations)for(const Be of we.declarations){const gt=Be.getSourceFile();if(dt.has(gt.fileName)){const G=Gr(Be)&&bn(Be.left)?Be.left.expression:cc(Be)?E.checkDefined(Ua(Be,95,gt)):as(Be)||Be;fe.push(yg(G))}}return fe.length?[{definition:{type:0,symbol:Ue},references:fe}]:ze}function p(Ce){return Ce.kind===148&&FT(Ce.parent)&&Ce.parent.operator===148}function y(Ce,Ue,rt){if(E3(Ce.kind))return Ce.kind===116&<(Ce.parent)||Ce.kind===148&&!p(Ce)?void 0:Te(Ue,Ce.kind,rt,Ce.kind===148?p:void 0);if(Ak(Ce.parent)&&Ce.parent.name===Ce)return ve(Ue,rt);if(AT(Ce)&&Go(Ce.parent))return[{definition:{type:2,node:Ce},references:[yg(Ce)]}];if(uA(Ce)){const ft=O9(Ce.parent,Ce.text);return ft&&se(ft.parent,ft)}else if(Kq(Ce))return se(Ce.parent,Ce);if(qC(Ce))return zi(Ce,Ue,rt);if(Ce.kind===108)return Fi(Ce)}function S(Ce,Ue,rt,ft,dt,fe,we){const Be=Ue&&w(Ce,Ue,dt,!Ds(we))||Ce,gt=Ue?Xr(Ue,Be):7,G=[],ht=new z(rt,ft,Ue?C(Ue):0,dt,fe,gt,we,G),Dt=!Ds(we)||!Be.declarations?void 0:kn(Be.declarations,vu);if(Dt)lt(Dt.name,Be,Dt,ht.createSearch(Ue,Ce,void 0),ht,!0,!0);else if(Ue&&Ue.kind===90&&Be.escapedName==="default"&&Be.parent)it(Ue,Be,ht),W(Ue,Be,{exportingModuleSymbol:Be.parent,exportKind:1},ht);else{const Re=ht.createSearch(Ue,Be,void 0,{allSearchSymbols:Ue?ur(Be,Ue,dt,we.use===2,!!we.providePrefixAndSuffixTextForRename,!!we.implementations):[Be]});T(Be,ht,Re)}return G}function T(Ce,Ue,rt){const ft=ae(Ce);if(ft)ke(ft,ft.getSourceFile(),rt,Ue,!(Ai(ft)&&!_s(Ue.sourceFiles,ft)));else for(const dt of Ue.sourceFiles)Ue.cancellationToken.throwIfCancellationRequested(),B(dt,rt,Ue)}function C(Ce){switch(Ce.kind){case 176:case 137:return 1;case 80:if(Qn(Ce.parent))return E.assert(Ce.parent.name===Ce),2;default:return 0}}function w(Ce,Ue,rt,ft){const{parent:dt}=Ue;return vu(dt)&&ft?pt(Ue,Ce,dt,rt):ic(Ce.declarations,fe=>{if(!fe.parent){if(Ce.flags&33554432)return;E.fail(`Unexpected symbol at ${E.formatSyntaxKind(Ue.kind)}: ${E.formatSymbol(Ce)}`)}return X_(fe.parent)&&u1(fe.parent.parent)?rt.getPropertyOfType(rt.getTypeFromTypeNode(fe.parent.parent),Ce.name):void 0})}let D;(Ce=>{Ce[Ce.None=0]="None",Ce[Ce.Constructor=1]="Constructor",Ce[Ce.Class=2]="Class"})(D||(D={}));function O(Ce){if(!(Ce.flags&33555968))return;const Ue=Ce.declarations&&kn(Ce.declarations,rt=>!Ai(rt)&&!vc(rt));return Ue&&Ue.symbol}class z{constructor(Ue,rt,ft,dt,fe,we,Be,gt){this.sourceFiles=Ue,this.sourceFilesSet=rt,this.specialSearchKind=ft,this.checker=dt,this.cancellationToken=fe,this.searchMeaning=we,this.options=Be,this.result=gt,this.inheritsFromCache=new Map,this.markSeenContainingTypeReference=KT(),this.markSeenReExportRHS=KT(),this.symbolIdToReferences=[],this.sourceFileToSeenSymbols=[]}includesSourceFile(Ue){return this.sourceFilesSet.has(Ue.fileName)}getImportSearches(Ue,rt){return this.importTracker||(this.importTracker=N_e(this.sourceFiles,this.sourceFilesSet,this.checker,this.cancellationToken)),this.importTracker(Ue,rt,this.options.use===2)}createSearch(Ue,rt,ft,dt={}){const{text:fe=lp(pc(Xk(rt)||O(rt)||rt)),allSearchSymbols:we=[rt]}=dt,Be=zo(fe),gt=this.options.implementations&&Ue?Qs(Ue,rt,this.checker):void 0;return{symbol:rt,comingFrom:ft,text:fe,escapedText:Be,parents:gt,allSearchSymbols:we,includes:G=>_s(we,G)}}referenceAdder(Ue){const rt=Xs(Ue);let ft=this.symbolIdToReferences[rt];return ft||(ft=this.symbolIdToReferences[rt]=[],this.result.push({definition:{type:0,symbol:Ue},references:ft})),(dt,fe)=>ft.push(yg(dt,fe))}addStringOrCommentReference(Ue,rt){this.result.push({definition:void 0,references:[{kind:0,fileName:Ue,textSpan:rt}]})}markSearchedSymbols(Ue,rt){const ft=Oa(Ue),dt=this.sourceFileToSeenSymbols[ft]||(this.sourceFileToSeenSymbols[ft]=new Set);let fe=!1;for(const we of rt)fe=zy(dt,Xs(we))||fe;return fe}}function W(Ce,Ue,rt,ft){const{importSearches:dt,singleReferences:fe,indirectUsers:we}=ft.getImportSearches(Ue,rt);if(fe.length){const Be=ft.referenceAdder(Ue);for(const gt of fe)J(gt,ft)&&Be(gt)}for(const[Be,gt]of dt)Me(Be.getSourceFile(),ft.createSearch(Be,gt,1),ft);if(we.length){let Be;switch(rt.exportKind){case 0:Be=ft.createSearch(Ce,Ue,1);break;case 1:Be=ft.options.use===2?void 0:ft.createSearch(Ce,Ue,1,{text:"default"});break;case 2:break}if(Be)for(const gt of we)B(gt,Be,ft)}}function X(Ce,Ue,rt,ft,dt,fe,we,Be){const gt=N_e(Ce,new Set(Ce.map(Re=>Re.fileName)),Ue,rt),{importSearches:G,indirectUsers:ht,singleReferences:Dt}=gt(ft,{exportKind:we?1:0,exportingModuleSymbol:dt},!1);for(const[Re]of G)Be(Re);for(const Re of Dt)Ie(Re)&&Zg(Re.parent)&&Be(Re);for(const Re of ht)for(const st of oe(Re,we?"default":fe)){const Ct=Ue.getSymbolAtLocation(st),Qt=ut(Ct?.declarations,er=>!!Jn(er,cc));Ie(st)&&!rT(st.parent)&&(Ct===ft||Qt)&&Be(st)}}e.eachExportReference=X;function J(Ce,Ue){return he(Ce,Ue)?Ue.options.use!==2?!0:Ie(Ce)?!(rT(Ce.parent)&&Ce.escapedText==="default"):!1:!1}function ie(Ce,Ue){if(Ce.declarations)for(const rt of Ce.declarations){const ft=rt.getSourceFile();Me(ft,Ue.createSearch(rt,Ce,0),Ue,Ue.includesSourceFile(ft))}}function B(Ce,Ue,rt){GG(Ce).get(Ue.escapedText)!==void 0&&Me(Ce,Ue,rt)}function Y(Ce,Ue){return Qh(Ce.parent.parent)?Ue.getPropertySymbolOfDestructuringAssignment(Ce):void 0}function ae(Ce){const{declarations:Ue,flags:rt,parent:ft,valueDeclaration:dt}=Ce;if(dt&&(dt.kind===218||dt.kind===231))return dt;if(!Ue)return;if(rt&8196){const Be=kn(Ue,gt=>w_(gt,2)||Nu(gt));return Be?r1(Be,263):void 0}if(Ue.some(SA))return;const fe=ft&&!(Ce.flags&262144);if(fe&&!(yA(ft)&&!ft.globalExports))return;let we;for(const Be of Ue){const gt=Ub(Be);if(we&&we!==gt||!gt||gt.kind===312&&!H_(gt))return;if(we=gt,ro(we)){let G;for(;G=ez(we);)we=G}}return fe?we.getSourceFile():we}function _e(Ce,Ue,rt,ft=rt){return $(Ce,Ue,rt,()=>!0,ft)||!1}e.isSymbolReferencedInFile=_e;function $(Ce,Ue,rt,ft,dt=rt){const fe=E_(Ce.parent,Ce.parent.parent)?ba(Ue.getSymbolsOfParameterPropertyDeclaration(Ce.parent,Ce.text)):Ue.getSymbolAtLocation(Ce);if(fe)for(const we of oe(rt,fe.name,dt)){if(!Ie(we)||we===Ce||we.escapedText!==Ce.escapedText)continue;const Be=Ue.getSymbolAtLocation(we);if(Be===fe||Ue.getShorthandAssignmentValueSymbol(we.parent)===fe||vu(we.parent)&&pt(we,Be,we.parent,Ue)===fe){const gt=ft(we);if(gt)return gt}}}e.eachSymbolReferenceInFile=$;function H(Ce,Ue){return wn(oe(Ue,Ce),dt=>!!X4(dt)).reduce((dt,fe)=>{const we=ft(fe);return!ut(dt.declarationNames)||we===dt.depth?(dt.declarationNames.push(fe),dt.depth=we):weht===dt)&&ft(we,gt))return!0}return!1}e.someSignatureUsage=K;function oe(Ce,Ue,rt=Ce){return Ii(Se(Ce,Ue,rt),ft=>{const dt=c_(Ce,ft);return dt===Ce?void 0:dt})}function Se(Ce,Ue,rt=Ce){const ft=[];if(!Ue||!Ue.length)return ft;const dt=Ce.text,fe=dt.length,we=Ue.length;let Be=dt.indexOf(Ue,rt.pos);for(;Be>=0&&!(Be>rt.end);){const gt=Be+we;(Be===0||!Gy(dt.charCodeAt(Be-1),99))&&(gt===fe||!Gy(dt.charCodeAt(gt),99))&&ft.push(Be),Be=dt.indexOf(Ue,Be+we+1)}return ft}function se(Ce,Ue){const rt=Ce.getSourceFile(),ft=Ue.text,dt=Ii(oe(rt,ft,Ce),fe=>fe===Ue||uA(fe)&&O9(fe,ft)===Ue?yg(fe):void 0);return[{definition:{type:1,node:Ue},references:dt}]}function Z(Ce,Ue){switch(Ce.kind){case 81:if(d1(Ce.parent))return!0;case 80:return Ce.text.length===Ue.length;case 15:case 11:{const rt=Ce;return(L9(rt)||nH(Ce)||Hae(Ce)||Rs(Ce.parent)&&pb(Ce.parent)&&Ce.parent.arguments[1]===Ce)&&rt.text.length===Ue.length}case 9:return L9(Ce)&&Ce.text.length===Ue.length;case 90:return Ue.length===7;default:return!1}}function ve(Ce,Ue){const rt=ta(Ce,ft=>(Ue.throwIfCancellationRequested(),Ii(oe(ft,"meta",ft),dt=>{const fe=dt.parent;if(Ak(fe))return yg(fe)})));return rt.length?[{definition:{type:2,node:rt[0].node},references:rt}]:void 0}function Te(Ce,Ue,rt,ft){const dt=ta(Ce,fe=>(rt.throwIfCancellationRequested(),Ii(oe(fe,Hs(Ue),fe),we=>{if(we.kind===Ue&&(!ft||ft(we)))return yg(we)})));return dt.length?[{definition:{type:2,node:dt[0].node},references:dt}]:void 0}function Me(Ce,Ue,rt,ft=!0){return rt.cancellationToken.throwIfCancellationRequested(),ke(Ce,Ce,Ue,rt,ft)}function ke(Ce,Ue,rt,ft,dt){if(ft.markSearchedSymbols(Ue,rt.allSearchSymbols))for(const fe of Se(Ue,rt.text,Ce))be(Ue,fe,rt,ft,dt)}function he(Ce,Ue){return!!(Wb(Ce)&Ue.searchMeaning)}function be(Ce,Ue,rt,ft,dt){const fe=c_(Ce,Ue);if(!Z(fe,rt.text)){!ft.options.implementations&&(ft.options.findInStrings&&Vb(Ce,Ue)||ft.options.findInComments&&aoe(Ce,Ue))&&ft.addStringOrCommentReference(Ce.fileName,Jl(Ue,rt.text.length));return}if(!he(fe,ft))return;let we=ft.checker.getSymbolAtLocation(fe);if(!we)return;const Be=fe.parent;if(v_(Be)&&Be.propertyName===fe)return;if(vu(Be)){E.assert(fe.kind===80),lt(fe,we,Be,rt,ft,dt);return}const gt=Tr(rt,we,fe,ft);if(!gt){Xe(we,rt,ft);return}switch(ft.specialSearchKind){case 0:dt&&it(fe,gt,ft);break;case 1:mt(fe,Ce,rt,ft);break;case 2:Je(fe,rt,ft);break;default:E.assertNever(ft.specialSearchKind)}Hr(fe)&&Pa(fe.parent)&&Pv(fe.parent.parent.parent)&&(we=fe.parent.symbol,!we)||Oe(fe,we,rt,ft)}function lt(Ce,Ue,rt,ft,dt,fe,we){E.assert(!we||!!dt.options.providePrefixAndSuffixTextForRename,"If alwaysGetReferences is true, then prefix/suffix text must be enabled");const{parent:Be,propertyName:gt,name:G}=rt,ht=Be.parent,Dt=pt(Ce,Ue,rt,dt.checker);if(!we&&!ft.includes(Dt))return;if(gt?Ce===gt?(ht.moduleSpecifier||Re(),fe&&dt.options.use!==2&&dt.markSeenReExportRHS(G)&&it(G,E.checkDefined(rt.symbol),dt)):dt.markSeenReExportRHS(Ce)&&Re():dt.options.use===2&&G.escapedText==="default"||Re(),!Ds(dt.options)||we){const Ct=Ce.escapedText==="default"||rt.name.escapedText==="default"?1:0,Qt=E.checkDefined(rt.symbol),er=I_e(Qt,Ct,dt.checker);er&&W(Ce,Qt,er,dt)}if(ft.comingFrom!==1&&ht.moduleSpecifier&&!gt&&!Ds(dt.options)){const st=dt.checker.getExportSpecifierLocalTargetSymbol(rt);st&&ie(st,dt)}function Re(){fe&&it(Ce,Dt,dt)}}function pt(Ce,Ue,rt,ft){return me(Ce,rt)&&ft.getExportSpecifierLocalTargetSymbol(rt)||Ue}function me(Ce,Ue){const{parent:rt,propertyName:ft,name:dt}=Ue;return E.assert(ft===Ce||dt===Ce),ft?ft===Ce:!rt.parent.moduleSpecifier}function Oe(Ce,Ue,rt,ft){const dt=BEe(Ce,Ue,ft.checker,rt.comingFrom===1);if(!dt)return;const{symbol:fe}=dt;dt.kind===0?Ds(ft.options)||ie(fe,ft):W(Ce,fe,dt.exportInfo,ft)}function Xe({flags:Ce,valueDeclaration:Ue},rt,ft){const dt=ft.checker.getShorthandAssignmentValueSymbol(Ue),fe=Ue&&as(Ue);!(Ce&33554432)&&fe&&rt.includes(dt)&&it(fe,dt,ft)}function it(Ce,Ue,rt){const{kind:ft,symbol:dt}="kind"in Ue?Ue:{kind:void 0,symbol:Ue};if(rt.options.use===2&&Ce.kind===90)return;const fe=rt.referenceAdder(dt);rt.options.implementations?ar(Ce,fe,rt):fe(Ce,ft)}function mt(Ce,Ue,rt,ft){T3(Ce)&&it(Ce,rt.symbol,ft);const dt=()=>ft.referenceAdder(rt.symbol);if(Qn(Ce.parent))E.assert(Ce.kind===90||Ce.parent.name===Ce),ot(rt.symbol,Ue,dt());else{const fe=$i(Ce);fe&&(Ht(fe,dt()),zr(fe,ft))}}function Je(Ce,Ue,rt){it(Ce,Ue.symbol,rt);const ft=Ce.parent;if(rt.options.use===2||!Qn(ft))return;E.assert(ft.name===Ce);const dt=rt.referenceAdder(Ue.symbol);for(const fe of ft.members)vk(fe)&&Ls(fe)&&fe.body&&fe.body.forEachChild(function we(Be){Be.kind===110?dt(Be):!ks(Be)&&!Qn(Be)&&Be.forEachChild(we)})}function ot(Ce,Ue,rt){const ft=Bt(Ce);if(ft&&ft.declarations)for(const dt of ft.declarations){const fe=Ua(dt,137,Ue);E.assert(dt.kind===176&&!!fe),rt(fe)}Ce.exports&&Ce.exports.forEach(dt=>{const fe=dt.valueDeclaration;if(fe&&fe.kind===174){const we=fe.body;we&&Di(we,110,Be=>{T3(Be)&&rt(Be)})}})}function Bt(Ce){return Ce.members&&Ce.members.get("__constructor")}function Ht(Ce,Ue){const rt=Bt(Ce.symbol);if(rt&&rt.declarations)for(const ft of rt.declarations){E.assert(ft.kind===176);const dt=ft.body;dt&&Di(dt,108,fe=>{Qq(fe)&&Ue(fe)})}}function br(Ce){return!!Bt(Ce.symbol)}function zr(Ce,Ue){if(br(Ce))return;const rt=Ce.symbol,ft=Ue.createSearch(void 0,rt,void 0);T(rt,Ue,ft)}function ar(Ce,Ue,rt){if($g(Ce)&&Pi(Ce.parent)){Ue(Ce);return}if(Ce.kind!==80)return;Ce.parent.kind===304&&ji(Ce,rt.checker,Ue);const ft=Jt(Ce);if(ft){Ue(ft);return}const dt=Ar(Ce,Be=>!h_(Be.parent)&&!Si(Be.parent)&&!ib(Be.parent)),fe=dt.parent;if(xI(fe)&&fe.type===dt&&rt.markSeenContainingTypeReference(fe))if(J0(fe))we(fe.initializer);else if(ks(fe)&&fe.body){const Be=fe.body;Be.kind===241?Ev(Be,gt=>{gt.expression&&we(gt.expression)}):we(Be)}else sb(fe)&&we(fe.expression);function we(Be){It(Be)&&Ue(Be)}}function Jt(Ce){return Ie(Ce)||bn(Ce)?Jt(Ce.parent):qh(Ce)?Jn(Ce.parent.parent,ed(Qn,Mu)):void 0}function It(Ce){switch(Ce.kind){case 217:return It(Ce.expression);case 219:case 218:case 210:case 231:case 209:return!0;default:return!1}}function Nn(Ce,Ue,rt,ft){if(Ce===Ue)return!0;const dt=Xs(Ce)+","+Xs(Ue),fe=rt.get(dt);if(fe!==void 0)return fe;rt.set(dt,!1);const we=!!Ce.declarations&&Ce.declarations.some(Be=>Q4(Be).some(gt=>{const G=ft.getTypeAtLocation(gt);return!!G&&!!G.symbol&&Nn(G.symbol,Ue,rt,ft)}));return rt.set(dt,we),we}function Fi(Ce){let Ue=UP(Ce,!1);if(!Ue)return;let rt=256;switch(Ue.kind){case 172:case 171:case 174:case 173:case 176:case 177:case 178:rt&=q0(Ue),Ue=Ue.parent;break;default:return}const ft=Ue.getSourceFile(),dt=Ii(oe(ft,"super",Ue),fe=>{if(fe.kind!==108)return;const we=UP(fe,!1);return we&&Ls(we)===!!rt&&we.parent.symbol===Ue.symbol?yg(fe):void 0});return[{definition:{type:0,symbol:Ue.symbol},references:dt}]}function ei(Ce){return Ce.kind===80&&Ce.parent.kind===169&&Ce.parent.name===Ce}function zi(Ce,Ue,rt){let ft=i_(Ce,!1,!1),dt=256;switch(ft.kind){case 174:case 173:if(Mp(ft)){dt&=q0(ft),ft=ft.parent;break}case 172:case 171:case 176:case 177:case 178:dt&=q0(ft),ft=ft.parent;break;case 312:if(Nc(ft)||ei(Ce))return;case 262:case 218:break;default:return}const fe=ta(ft.kind===312?Ue:[ft.getSourceFile()],Be=>(rt.throwIfCancellationRequested(),oe(Be,"this",Ai(ft)?Be:ft).filter(gt=>{if(!qC(gt))return!1;const G=i_(gt,!1,!1);if(!Ed(G))return!1;switch(ft.kind){case 218:case 262:return ft.symbol===G.symbol;case 174:case 173:return Mp(ft)&&ft.symbol===G.symbol;case 231:case 263:case 210:return G.parent&&Ed(G.parent)&&ft.symbol===G.parent.symbol&&Ls(G)===!!dt;case 312:return G.kind===312&&!Nc(G)&&!ei(gt)}}))).map(Be=>yg(Be));return[{definition:{type:3,node:ic(fe,Be=>us(Be.node.parent)?Be.node:void 0)||Ce},references:fe}]}function Qe(Ce,Ue,rt,ft){const dt=B9(Ce,rt),fe=ta(Ue,we=>(ft.throwIfCancellationRequested(),Ii(oe(we,Ce.text),Be=>{if(Ja(Be)&&Be.text===Ce.text)if(dt){const gt=B9(Be,rt);if(dt!==rt.getStringType()&&dt===gt)return yg(Be,2)}else return PT(Be)&&!bb(Be,we)?void 0:yg(Be,2)})));return[{definition:{type:4,node:Ce},references:fe}]}function ur(Ce,Ue,rt,ft,dt,fe){const we=[];return Dr(Ce,Ue,rt,ft,!(ft&&dt),(Be,gt,G)=>{G&&yr(Ce)!==yr(G)&&(G=void 0),we.push(G||gt||Be)},()=>!fe),we}function Dr(Ce,Ue,rt,ft,dt,fe,we){const Be=$A(Ue);if(Be){const Ct=rt.getShorthandAssignmentValueSymbol(Ue.parent);if(Ct&&ft)return fe(Ct,void 0,void 0,3);const Qt=rt.getContextualType(Be.parent),er=Qt&&ic(XL(Be,rt,Qt,!0),ce=>Re(ce,4));if(er)return er;const or=Y(Ue,rt),U=or&&fe(or,void 0,void 0,4);if(U)return U;const j=Ct&&fe(Ct,void 0,void 0,3);if(j)return j}const gt=o(Ue,Ce,rt);if(gt){const Ct=fe(gt,void 0,void 0,1);if(Ct)return Ct}const G=Re(Ce);if(G)return G;if(Ce.valueDeclaration&&E_(Ce.valueDeclaration,Ce.valueDeclaration.parent)){const Ct=rt.getSymbolsOfParameterPropertyDeclaration(Ms(Ce.valueDeclaration,us),Ce.name);return E.assert(Ct.length===2&&!!(Ct[0].flags&1)&&!!(Ct[1].flags&4)),Re(Ce.flags&1?Ct[1]:Ct[0])}const ht=Wo(Ce,281);if(!ft||ht&&!ht.propertyName){const Ct=ht&&rt.getExportSpecifierLocalTargetSymbol(ht);if(Ct){const Qt=fe(Ct,void 0,void 0,1);if(Qt)return Qt}}if(!ft){let Ct;return dt?Ct=SA(Ue.parent)?K9(rt,Ue.parent):void 0:Ct=st(Ce,rt),Ct&&Re(Ct,4)}if(E.assert(ft),dt){const Ct=st(Ce,rt);return Ct&&Re(Ct,4)}function Re(Ct,Qt){return ic(rt.getRootSymbols(Ct),er=>fe(Ct,er,void 0,Qt)||(er.parent&&er.parent.flags&96&&we(er)?Ft(er.parent,er.name,rt,or=>fe(Ct,er,or,Qt)):void 0))}function st(Ct,Qt){const er=Wo(Ct,208);if(er&&SA(er))return K9(Qt,er)}}function Ft(Ce,Ue,rt,ft){const dt=new Map;return fe(Ce);function fe(we){if(!(!(we.flags&96)||!Rp(dt,Xs(we))))return ic(we.declarations,Be=>ic(Q4(Be),gt=>{const G=rt.getTypeAtLocation(gt),ht=G&&G.symbol&&rt.getPropertyOfType(G,Ue);return G&&ht&&(ic(rt.getRootSymbols(ht),ft)||fe(G.symbol))}))}}function yr(Ce){return Ce.valueDeclaration?!!(Fu(Ce.valueDeclaration)&256):!1}function Tr(Ce,Ue,rt,ft){const{checker:dt}=ft;return Dr(Ue,rt,dt,!1,ft.options.use!==2||!!ft.options.providePrefixAndSuffixTextForRename,(fe,we,Be,gt)=>(Be&&yr(Ue)!==yr(Be)&&(Be=void 0),Ce.includes(Be||we||fe)?{symbol:we&&!(Ko(fe)&6)?we:fe,kind:gt}:void 0),fe=>!(Ce.parents&&!Ce.parents.some(we=>Nn(fe.parent,we,ft.inheritsFromCache,dt))))}function Xr(Ce,Ue){let rt=Wb(Ce);const{declarations:ft}=Ue;if(ft){let dt;do{dt=rt;for(const fe of ft){const we=oA(fe);we&rt&&(rt|=we)}}while(rt!==dt)}return rt}e.getIntersectingMeaningFromDeclarations=Xr;function Pi(Ce){return Ce.flags&33554432?!(Mu(Ce)||Jp(Ce)):Nk(Ce)?J0(Ce):po(Ce)?!!Ce.body:Qn(Ce)||PP(Ce)}function ji(Ce,Ue,rt){const ft=Ue.getSymbolAtLocation(Ce),dt=Ue.getShorthandAssignmentValueSymbol(ft.valueDeclaration);if(dt)for(const fe of dt.getDeclarations())oA(fe)&1&&rt(fe)}e.getReferenceEntriesForShorthandPropertyAssignment=ji;function Di(Ce,Ue,rt){ds(Ce,ft=>{ft.kind===Ue&&rt(ft),Di(ft,Ue,rt)})}function $i(Ce){return kz(F9(Ce).parent)}function Qs(Ce,Ue,rt){const ft=VC(Ce)?Ce.parent:void 0,dt=ft&&rt.getTypeAtLocation(ft.expression),fe=Ii(dt&&(dt.isUnionOrIntersection()?dt.types:dt.symbol===Ue.parent?void 0:[dt]),we=>we.symbol&&we.symbol.flags&96?we.symbol:void 0);return fe.length===0?void 0:fe}function Ds(Ce){return Ce.use===2&&Ce.providePrefixAndSuffixTextForRename}})(ux||(ux={}))}}),ho={};jl(ho,{Core:()=>ux,DefinitionKind:()=>B_e,EntryKind:()=>J_e,ExportKind:()=>O_e,FindReferencesUse:()=>z_e,ImportExport:()=>L_e,createImportTracker:()=>N_e,findModuleReferences:()=>MEe,findReferenceOrRenameEntries:()=>I$e,findReferencedSymbols:()=>w$e,getContextNode:()=>Xb,getExportInfo:()=>I_e,getImplementationsAtPosition:()=>N$e,getImportOrExportSymbol:()=>BEe,getReferenceEntriesForNode:()=>WEe,getTextSpanOfEntry:()=>R_e,isContextWithStartAndEndNode:()=>JEe,isDeclarationOfSymbol:()=>HEe,isWriteAccessForReference:()=>j_e,nodeEntry:()=>yg,toContextSpan:()=>M_e,toHighlightSpan:()=>B$e,toReferenceEntry:()=>qEe,toRenameLocation:()=>O$e});var GEe=Nt({"src/services/_namespaces/ts.FindAllReferences.ts"(){"use strict";D$e(),z$e()}});function $Ee(e,t,r,i,s){var o;const c=QEe(t,r,e),u=c&&[Z$e(c.reference.fileName,c.fileName,c.unverified)]||ze;if(c?.file)return u;const f=c_(t,r);if(f===t)return;const{parent:g}=f,p=e.getTypeChecker();if(f.kind===164||Ie(f)&&GF(g)&&g.tagName===f)return U$e(p,f)||ze;if(uA(f)){const D=O9(f.parent,f.text);return D?[W_e(p,D,"label",f.text,void 0)]:void 0}if(f.kind===107){const D=Ar(f.parent,O=>Go(O)?"quit":po(O));return D?[mM(p,D)]:void 0}if(f.kind===135){const D=Ar(f,z=>po(z));return D&&ut(D.modifiers,z=>z.kind===134)?[mM(p,D)]:void 0}if(f.kind===127){const D=Ar(f,z=>po(z));return D&&D.asteriskToken?[mM(p,D)]:void 0}if(AT(f)&&Go(f.parent)){const D=f.parent.parent,{symbol:O,failedAliasResolution:z}=UX(D,p,s),W=wn(D.members,Go),X=O?p.symbolToString(O,D):"",J=f.getSourceFile();return Yt(W,ie=>{let{pos:B}=Id(ie);return B=la(J.text,B),W_e(p,ie,"constructor","static {}",X,!1,z,{start:B,length:6})})}let{symbol:y,failedAliasResolution:S}=UX(f,p,s),T=f;if(i&&S){const D=Zt([f,...y?.declarations||ze],z=>Ar(z,Fee)),O=D&&Mk(D);O&&({symbol:y,failedAliasResolution:S}=UX(O,p,s),T=O)}if(!y&&Z9(T)){const D=(o=e.getResolvedModule(t,T.text,ld(t,T)))==null?void 0:o.resolvedModule;if(D)return[{name:T.text,fileName:D.resolvedFileName,containerName:void 0,containerKind:void 0,kind:"script",textSpan:Jl(0,0),failedAliasResolution:S,isAmbient:Il(D.resolvedFileName),unverified:T!==f}]}if(!y)return Xi(u,X$e(f,p));if(i&&qi(y.declarations,D=>D.getSourceFile().fileName===t.fileName))return;const C=eXe(p,f);if(C&&!(qu(f.parent)&&tXe(C))){const D=mM(p,C,S);if(p.getRootSymbols(y).some(O=>W$e(O,C)))return[D];{const O=V3(p,y,f,S,C)||ze;return f.kind===108?[D,...O]:[...O,D]}}if(f.parent.kind===304){const D=p.getShorthandAssignmentValueSymbol(y.valueDeclaration),O=D?.declarations?D.declarations.map(z=>aN(z,p,D,f,!1,S)):ze;return Xi(O,XEe(p,f))}if(wc(f)&&Pa(g)&&jp(g.parent)&&f===(g.propertyName||g.name)){const D=bA(f),O=p.getTypeAtLocation(g.parent);return D===void 0?ze:ta(O.isUnion()?O.types:[O],z=>{const W=z.getProperty(D);return W&&V3(p,W,f)})}const w=XEe(p,f);return Xi(u,w.length?w:V3(p,y,f,S))}function W$e(e,t){var r;return e===t.symbol||e===t.symbol.parent||sl(t.parent)||!Sv(t.parent)&&e===((r=Jn(t.parent,Ed))==null?void 0:r.symbol)}function XEe(e,t){const r=$A(t);if(r){const i=r&&e.getContextualType(r.parent);if(i)return ta(XL(r,e,i,!1),s=>V3(e,s,t))}return ze}function U$e(e,t){const r=Ar(t,Pl);if(!(r&&r.name))return;const i=Ar(r,Qn);if(!i)return;const s=Pd(i);if(!s)return;const o=Ha(s.expression),c=Nl(o)?o.symbol:e.getSymbolAtLocation(o);if(!c)return;const u=bi(Dk(r.name)),f=Uc(r)?e.getPropertyOfType(e.getTypeOfSymbol(c),u):e.getPropertyOfType(e.getDeclaredTypeOfSymbol(c),u);if(f)return V3(e,f,t)}function QEe(e,t,r){var i,s;const o=q3(e.referencedFiles,t);if(o){const f=r.getSourceFileFromReference(e,o);return f&&{reference:o,fileName:f.fileName,file:f,unverified:!1}}const c=q3(e.typeReferenceDirectives,t);if(c){const f=(i=r.getResolvedTypeReferenceDirectives().get(c.fileName,c.resolutionMode||e.impliedNodeFormat))==null?void 0:i.resolvedTypeReferenceDirective,g=f&&r.getSourceFile(f.resolvedFileName);return g&&{reference:c,fileName:g.fileName,file:g,unverified:!1}}const u=q3(e.libReferenceDirectives,t);if(u){const f=r.getLibFileFromReference(u);return f&&{reference:u,fileName:f.fileName,file:f,unverified:!1}}if(e.imports.length||e.moduleAugmentations.length){const f=k3(e,t);let g;if(Z9(f)&&Tl(f.text)&&(g=r.getResolvedModule(e,f.text,ld(e,f)))){const p=(s=g.resolvedModule)==null?void 0:s.resolvedFileName,y=p||I0(qn(e.fileName),f.text);return{file:r.getSourceFile(y),fileName:y,reference:{pos:f.getStart(),end:f.getEnd(),fileName:f.text},unverified:!p}}}}function V$e(e,t){const r=t.symbol.name;if(!V_e.has(r))return!1;const i=e.resolveName(r,void 0,788968,!1);return!!i&&i===t.target.symbol}function YEe(e,t){if(!t.aliasSymbol)return!1;const r=t.aliasSymbol.name;if(!V_e.has(r))return!1;const i=e.resolveName(r,void 0,788968,!1);return!!i&&i===t.aliasSymbol}function q$e(e,t,r,i){var s,o;if(Pn(t)&4&&V$e(e,t))return sN(e.getTypeArguments(t)[0],e,r,i);if(YEe(e,t)&&t.aliasTypeArguments)return sN(t.aliasTypeArguments[0],e,r,i);if(Pn(t)&32&&t.target&&YEe(e,t.target)){const c=(o=(s=t.aliasSymbol)==null?void 0:s.declarations)==null?void 0:o[0];if(c&&Jp(c)&&mp(c.type)&&c.type.typeArguments)return sN(e.getTypeAtLocation(c.type.typeArguments[0]),e,r,i)}return[]}function H$e(e,t,r){const i=c_(t,r);if(i===t)return;if(Ak(i.parent)&&i.parent.name===i)return sN(e.getTypeAtLocation(i.parent),e,i.parent,!1);const{symbol:s,failedAliasResolution:o}=UX(i,e,!1);if(!s)return;const c=e.getTypeOfSymbolAtLocation(s,i),u=G$e(s,c,e),f=u&&sN(u,e,i,o),[g,p]=f&&f.length!==0?[u,f]:[c,sN(c,e,i,o)];return p.length?[...q$e(e,g,i,o),...p]:!(s.flags&111551)&&s.flags&788968?V3(e,yu(s,e),i,o):void 0}function sN(e,t,r,i){return ta(e.isUnion()&&!(e.flags&32)?e.types:[e],s=>s.symbol&&V3(t,s.symbol,r,i))}function G$e(e,t,r){if(t.symbol===e||e.valueDeclaration&&t.symbol&&Ei(e.valueDeclaration)&&e.valueDeclaration.initializer===t.symbol.valueDeclaration){const i=t.getCallSignatures();if(i.length===1)return r.getReturnTypeOfSignature(ba(i))}}function $$e(e,t,r){const i=$Ee(e,t,r);if(!i||i.length===0)return;const s=q3(t.referencedFiles,r)||q3(t.typeReferenceDirectives,r)||q3(t.libReferenceDirectives,r);if(s)return{definitions:i,textSpan:ry(s)};const o=c_(t,r),c=Jl(o.getStart(),o.getWidth());return{definitions:i,textSpan:c}}function X$e(e,t){return Ii(t.getIndexInfosAtLocation(e),r=>r.declaration&&mM(t,r.declaration))}function UX(e,t,r){const i=t.getSymbolAtLocation(e);let s=!1;if(i?.declarations&&i.flags&2097152&&!r&&Q$e(e,i.declarations[0])){const o=t.getAliasedSymbol(i);if(o.declarations)return{symbol:o};s=!0}return{symbol:i,failedAliasResolution:s}}function Q$e(e,t){return e.kind!==80?!1:e.parent===t?!0:t.kind!==274}function Y$e(e){if(!H4(e))return!1;const t=Ar(e,r=>sl(r)?!0:H4(r)?!1:"quit");return!!t&&ac(t)===5}function V3(e,t,r,i,s){const o=wn(t.declarations,y=>y!==s),c=wn(o,y=>!Y$e(y)),u=ut(c)?c:o;return f()||g()||Yt(u,y=>aN(y,e,t,r,!1,i));function f(){if(t.flags&32&&!(t.flags&19)&&(T3(r)||r.kind===137)){const y=kn(o,Qn)||E.fail("Expected declaration to have at least one class-like declaration");return p(y.members,!0)}}function g(){return Yq(r)||iH(r)?p(o,!1):void 0}function p(y,S){if(!y)return;const T=y.filter(S?gc:ks),C=T.filter(w=>!!w.body);return T.length?C.length!==0?C.map(w=>aN(w,e,t,r)):[aN(Sa(T),e,t,r,!1,i)]:void 0}}function aN(e,t,r,i,s,o){const c=t.symbolToString(r),u=t0.getSymbolKind(t,r,i),f=r.parent?t.symbolToString(r.parent,i):"";return W_e(t,e,u,c,f,s,o)}function W_e(e,t,r,i,s,o,c,u){const f=t.getSourceFile();if(!u){const g=as(t)||t;u=l_(g,f)}return{fileName:f.fileName,textSpan:u,kind:r,name:i,containerKind:void 0,containerName:s,...ho.toContextSpan(u,f,ho.getContextNode(t)),isLocal:!U_e(e,t),isAmbient:!!(t.flags&33554432),unverified:o,failedAliasResolution:c}}function U_e(e,t){if(e.isDeclarationVisible(t))return!0;if(!t.parent)return!1;if(J0(t.parent)&&t.parent.initializer===t)return U_e(e,t.parent);switch(t.kind){case 172:case 177:case 178:case 174:if(w_(t,2))return!1;case 176:case 303:case 304:case 210:case 231:case 219:case 218:return U_e(e,t.parent);default:return!1}}function mM(e,t,r){return aN(t,e,t.symbol,t,!1,r)}function q3(e,t){return kn(e,r=>pP(r,t))}function Z$e(e,t,r){return{fileName:t,textSpan:zc(0,0),kind:"script",name:e,containerName:void 0,containerKind:void 0,unverified:r}}function K$e(e){const t=Ar(e,i=>!VC(i)),r=t?.parent;return r&&Sv(r)&&HI(r)===t?r:void 0}function eXe(e,t){const r=K$e(t),i=r&&e.getResolvedSignature(r);return Jn(i&&i.declaration,s=>ks(s)&&!pg(s))}function tXe(e){switch(e.kind){case 176:case 185:case 180:return!0;default:return!1}}var V_e,rXe=Nt({"src/services/goToDefinition.ts"(){"use strict";zn(),V_e=new Set(["Array","ArrayLike","ReadonlyArray","Promise","PromiseLike","Iterable","IterableIterator","AsyncIterable","Set","WeakSet","ReadonlySet","Map","WeakMap","ReadonlyMap","Partial","Required","Readonly","Pick","Omit"])}}),c6={};jl(c6,{createDefinitionInfo:()=>aN,findReferenceInPosition:()=>q3,getDefinitionAndBoundSpan:()=>$$e,getDefinitionAtPosition:()=>$Ee,getReferenceAtPosition:()=>QEe,getTypeDefinitionAtPosition:()=>H$e});var nXe=Nt({"src/services/_namespaces/ts.GoToDefinition.ts"(){"use strict";rXe()}});function iXe(e){return e.includeInlayParameterNameHints==="literals"||e.includeInlayParameterNameHints==="all"}function sXe(e){return e.includeInlayParameterNameHints==="literals"}function ZEe(e){return e.interactiveInlayHints===!0}function aXe(e){const{file:t,program:r,span:i,cancellationToken:s,preferences:o}=e,c=t.text,u=r.getCompilerOptions(),f=vf(t,o),g=r.getTypeChecker(),p=[];return y(t),p;function y(se){if(!(!se||se.getFullWidth()===0)){switch(se.kind){case 267:case 263:case 264:case 262:case 231:case 218:case 174:case 219:s.throwIfCancellationRequested()}if(oI(i,se.pos,se.getFullWidth())&&!(Si(se)&&!qh(se)))return o.includeInlayVariableTypeHints&&Ei(se)||o.includeInlayPropertyDeclarationTypeHints&&Es(se)?z(se):o.includeInlayEnumMemberValueHints&&$v(se)?D(se):iXe(o)&&(Rs(se)||Wv(se))?W(se):(o.includeInlayFunctionParameterTypeHints&&po(se)&&V5(se)&&ae(se),o.includeInlayFunctionLikeReturnTypeHints&&S(se)&&B(se)),ds(se,y)}}function S(se){return go(se)||ro(se)||Zc(se)||mc(se)||pf(se)}function T(se,Z,ve,Te){let Me=`${Te?"...":""}${se}`,ke;ZEe(o)?(ke=[Se(Me,Z),{text:":"}],Me=""):Me+=":",p.push({text:Me,position:ve,kind:"Parameter",whitespaceAfter:!0,displayParts:ke})}function C(se,Z){p.push({text:typeof se=="string"?`: ${se}`:"",displayParts:typeof se=="string"?void 0:[{text:": "},...se],position:Z,kind:"Type",whitespaceBefore:!0})}function w(se,Z){p.push({text:`= ${se}`,position:Z,kind:"Enum",whitespaceBefore:!0})}function D(se){if(se.initializer)return;const Z=g.getConstantValue(se);Z!==void 0&&w(Z.toString(),se.end)}function O(se){return se.symbol&&se.symbol.flags&1536}function z(se){if(!se.initializer||As(se.name)||Ei(se)&&!oe(se)||Wl(se))return;const ve=g.getTypeAtLocation(se);if(O(ve))return;const Te=H(ve);if(Te){const Me=typeof Te=="string"?Te:Te.map(he=>he.text).join("");if(o.includeInlayVariableTypeHintsWhenTypeMatchesName===!1&&XS(se.name.getText(),Me))return;C(Te,se.name.end)}}function W(se){const Z=se.arguments;if(!Z||!Z.length)return;const ve=[],Te=g.getResolvedSignatureForSignatureHelp(se,ve);if(!Te||!ve.length)return;let Me=0;for(const ke of Z){const he=Ha(ke);if(sXe(o)&&!ie(he)){Me++;continue}let be=0;if(Od(he)){const pt=g.getTypeAtLocation(he.expression);if(g.isTupleType(pt)){const{elementFlags:me,fixedLength:Oe}=pt.target;if(Oe===0)continue;const Xe=Dc(me,mt=>!(mt&1));(Xe<0?Oe:Xe)>0&&(be=Xe<0?Oe:Xe)}}const lt=g.getParameterIdentifierInfoAtPosition(Te,Me);if(Me=Me+(be||1),lt){const{parameter:pt,parameterName:me,isRestParameter:Oe}=lt;if(!(o.includeInlayParameterNameHintsWhenArgumentMatchesName||!X(he,me))&&!Oe)continue;const it=bi(me);if(J(he,it))continue;T(it,pt,ke.getStart(),Oe)}}}function X(se,Z){return Ie(se)?se.text===Z:bn(se)?se.name.text===Z:!1}function J(se,Z){if(!lf(Z,u.target,D8(t.scriptKind)))return!1;const ve=Km(c,se.pos);if(!ve?.length)return!1;const Te=KEe(Z);return ut(ve,Me=>Te.test(c.substring(Me.pos,Me.end)))}function ie(se){switch(se.kind){case 224:{const Z=se.operand;return vv(Z)||Ie(Z)&&kE(Z.escapedText)}case 112:case 97:case 106:case 15:case 228:return!0;case 80:{const Z=se.escapedText;return K(Z)||kE(Z)}}return vv(se)}function B(se){if(go(se)&&!Ua(se,21,t)||up(se)||!se.body)return;const ve=g.getSignatureFromDeclaration(se);if(!ve)return;const Te=g.getReturnTypeOfSignature(ve);if(O(Te))return;const Me=H(Te);Me&&C(Me,Y(se))}function Y(se){const Z=Ua(se,22,t);return Z?Z.end:se.parameters.end}function ae(se){const Z=g.getSignatureFromDeclaration(se);if(Z)for(let ve=0;ve{const Me=g.typeToTypeNode(se,void 0,71286784);E.assertIsDefined(Me,"should always get typenode"),ve.writeNode(4,Me,t,Te)})}function H(se){if(!ZEe(o))return $(se);const ve=g.typeToTypeNode(se,void 0,71286784);E.assertIsDefined(ve,"should always get typenode");const Te=[];return Me(ve),Te;function Me(be){if(!be)return;const lt=Hs(be.kind);if(lt){Te.push({text:lt});return}if(vv(be)){Te.push({text:he(be)});return}switch(be.kind){case 80:const pt=be,me=an(pt),Oe=pt.symbol&&pt.symbol.declarations&&pt.symbol.declarations.length&&as(pt.symbol.declarations[0]);Oe?Te.push(Se(me,Oe)):Te.push({text:me});break;case 166:const Xe=be;Me(Xe.left),Te.push({text:"."}),Me(Xe.right);break;case 182:const it=be;it.assertsModifier&&Te.push({text:"asserts "}),Me(it.parameterName),it.type&&(Te.push({text:" is "}),Me(it.type));break;case 183:const mt=be;Me(mt.typeName),mt.typeArguments&&(Te.push({text:"<"}),ke(mt.typeArguments,", "),Te.push({text:">"}));break;case 168:const Je=be;Je.modifiers&&ke(Je.modifiers," "),Me(Je.name),Je.constraint&&(Te.push({text:" extends "}),Me(Je.constraint)),Je.default&&(Te.push({text:" = "}),Me(Je.default));break;case 169:const ot=be;ot.modifiers&&ke(ot.modifiers," "),ot.dotDotDotToken&&Te.push({text:"..."}),Me(ot.name),ot.questionToken&&Te.push({text:"?"}),ot.type&&(Te.push({text:": "}),Me(ot.type));break;case 185:const Bt=be;Te.push({text:"new "}),Bt.typeParameters&&(Te.push({text:"<"}),ke(Bt.typeParameters,", "),Te.push({text:">"})),Te.push({text:"("}),ke(Bt.parameters,", "),Te.push({text:")"}),Te.push({text:" => "}),Me(Bt.type);break;case 186:const Ht=be;Te.push({text:"typeof "}),Me(Ht.exprName),Ht.typeArguments&&(Te.push({text:"<"}),ke(Ht.typeArguments,", "),Te.push({text:">"}));break;case 187:const br=be;Te.push({text:"{"}),br.members.length&&(Te.push({text:" "}),ke(br.members,"; "),Te.push({text:" "})),Te.push({text:"}"});break;case 188:Me(be.elementType),Te.push({text:"[]"});break;case 189:Te.push({text:"["}),ke(be.elements,", "),Te.push({text:"]"});break;case 202:const zr=be;zr.dotDotDotToken&&Te.push({text:"..."}),Me(zr.name),zr.questionToken&&Te.push({text:"?"}),Te.push({text:": "}),Me(zr.type);break;case 190:Me(be.type),Te.push({text:"?"});break;case 191:Te.push({text:"..."}),Me(be.type);break;case 192:ke(be.types," | ");break;case 193:ke(be.types," & ");break;case 194:const ar=be;Me(ar.checkType),Te.push({text:" extends "}),Me(ar.extendsType),Te.push({text:" ? "}),Me(ar.trueType),Te.push({text:" : "}),Me(ar.falseType);break;case 195:Te.push({text:"infer "}),Me(be.typeParameter);break;case 196:Te.push({text:"("}),Me(be.type),Te.push({text:")"});break;case 198:const Jt=be;Te.push({text:`${Hs(Jt.operator)} `}),Me(Jt.type);break;case 199:const It=be;Me(It.objectType),Te.push({text:"["}),Me(It.indexType),Te.push({text:"]"});break;case 200:const Nn=be;Te.push({text:"{ "}),Nn.readonlyToken&&(Nn.readonlyToken.kind===40?Te.push({text:"+"}):Nn.readonlyToken.kind===41&&Te.push({text:"-"}),Te.push({text:"readonly "})),Te.push({text:"["}),Me(Nn.typeParameter),Nn.nameType&&(Te.push({text:" as "}),Me(Nn.nameType)),Te.push({text:"]"}),Nn.questionToken&&(Nn.questionToken.kind===40?Te.push({text:"+"}):Nn.questionToken.kind===41&&Te.push({text:"-"}),Te.push({text:"?"})),Te.push({text:": "}),Nn.type&&Me(Nn.type),Te.push({text:"; }"});break;case 201:Me(be.literal);break;case 184:const Fi=be;Fi.typeParameters&&(Te.push({text:"<"}),ke(Fi.typeParameters,", "),Te.push({text:">"})),Te.push({text:"("}),ke(Fi.parameters,", "),Te.push({text:")"}),Te.push({text:" => "}),Me(Fi.type);break;case 205:const ei=be;ei.isTypeOf&&Te.push({text:"typeof "}),Te.push({text:"import("}),Me(ei.argument),ei.assertions&&(Te.push({text:", { assert: "}),ke(ei.assertions.assertClause.elements,", "),Te.push({text:" }"})),Te.push({text:")"}),ei.qualifier&&(Te.push({text:"."}),Me(ei.qualifier)),ei.typeArguments&&(Te.push({text:"<"}),ke(ei.typeArguments,", "),Te.push({text:">"}));break;case 171:const zi=be;zi.modifiers&&ke(zi.modifiers," "),Me(zi.name),zi.questionToken&&Te.push({text:"?"}),zi.type&&(Te.push({text:": "}),Me(zi.type));break;default:E.failBadSyntaxKind(be)}}function ke(be,lt){be.forEach((pt,me)=>{me>0&&Te.push({text:lt}),Me(pt)})}function he(be){return ra(be)?f===0?`'${n1(be.text,39)}'`:`"${n1(be.text,34)}"`:be.text}}function K(se){return se==="undefined"}function oe(se){if((Iv(se)||Ei(se)&&wk(se))&&se.initializer){const Z=Ha(se.initializer);return!(ie(Z)||Wv(Z)||ma(Z)||sb(Z))}return!0}function Se(se,Z){const ve=Z.getSourceFile();return{text:se,span:l_(Z,ve),file:ve.fileName}}}var KEe,oXe=Nt({"src/services/inlayHints.ts"(){"use strict";zn(),KEe=e=>new RegExp(`^\\s?/\\*\\*?\\s?${e}\\s?\\*\\/\\s?$`)}}),VX={};jl(VX,{provideInlayHints:()=>aXe});var cXe=Nt({"src/services/_namespaces/ts.InlayHints.ts"(){"use strict";oXe()}});function lXe(e,t){const r=[];return CH(e,i=>{for(const s of _Xe(i)){const o=zp(s)&&s.tags&&kn(s.tags,u=>u.kind===334&&(u.tagName.escapedText==="inheritDoc"||u.tagName.escapedText==="inheritdoc"));if(s.comment===void 0&&!o||zp(s)&&i.kind!==353&&i.kind!==345&&s.tags&&s.tags.some(u=>u.kind===353||u.kind===345)&&!s.tags.some(u=>u.kind===348||u.kind===349))continue;let c=s.comment?l6(s.comment,t):[];o&&o.comment&&(c=c.concat(l6(o.comment,t))),_s(r,c,uXe)||r.push(c)}}),Np(cj(r,[XC()]))}function uXe(e,t){return zD(e,t,(r,i)=>r.kind===i.kind&&r.text===i.text)}function _Xe(e){switch(e.kind){case 348:case 355:return[e];case 345:case 353:return[e,e.parent];case 330:if(vC(e.parent))return[e.parent.parent];default:return KJ(e)}}function fXe(e,t){const r=[];return CH(e,i=>{const s=Zy(i);if(!(s.some(o=>o.kind===353||o.kind===345)&&!s.some(o=>o.kind===348||o.kind===349)))for(const o of s)r.push({name:o.tagName.text,text:e3e(o,t)}),bP(o)&&o.isNameFirst&&o.typeExpression&&JT(o.typeExpression.type)&&Zt(o.typeExpression.type.jsDocPropertyTags,c=>{r.push({name:c.tagName.text,text:e3e(c,t)})})}),r}function l6(e,t){return typeof e=="string"?[bf(e)]:ta(e,r=>r.kind===328?[bf(r.text)]:hoe(r,t))}function e3e(e,t){const{comment:r,kind:i}=e,s=pXe(i);switch(i){case 356:const u=e.typeExpression;return u?o(u):r===void 0?void 0:l6(r,t);case 336:return o(e.class);case 335:return o(e.class);case 352:const f=e,g=[];if(f.constraint&&g.push(bf(f.constraint.getText())),Ir(f.typeParameters)){Ir(g)&&g.push(tc());const y=f.typeParameters[f.typeParameters.length-1];Zt(f.typeParameters,S=>{g.push(s(S.getText())),y!==S&&g.push(Su(28),tc())})}return r&&g.push(tc(),...l6(r,t)),g;case 351:case 357:return o(e.typeExpression);case 353:case 345:case 355:case 348:case 354:const{name:p}=e;return p?o(p):r===void 0?void 0:l6(r,t);default:return r===void 0?void 0:l6(r,t)}function o(u){return c(u.getText())}function c(u){return r?u.match(/^https?$/)?[bf(u),...l6(r,t)]:[s(u),tc(),...l6(r,t)]:[bf(u)]}}function pXe(e){switch(e){case 348:return foe;case 355:return poe;case 352:return moe;case 353:case 345:return doe;default:return bf}}function dXe(){return r3e||(r3e=Yt(H_e,e=>({name:e,kind:"keyword",kindModifiers:"",sortText:lx.SortText.LocationPriority})))}function mXe(){return n3e||(n3e=Yt(H_e,e=>({name:`@${e}`,kind:"keyword",kindModifiers:"",sortText:lx.SortText.LocationPriority})))}function t3e(e){return{name:e,kind:"",kindModifiers:"",displayParts:[bf(e)],documentation:ze,tags:void 0,codeActions:void 0}}function gXe(e){if(!Ie(e.name))return ze;const t=e.name.text,r=e.parent,i=r.parent;return ks(i)?Ii(i.parameters,s=>{if(!Ie(s.name))return;const o=s.name.text;if(!(r.tags.some(c=>c!==e&&ad(c)&&Ie(c.name)&&c.name.escapedText===o)||t!==void 0&&!Qi(o,t)))return{name:o,kind:"parameter",kindModifiers:"",sortText:lx.SortText.LocationPriority}}):[]}function hXe(e){return{name:e,kind:"parameter",kindModifiers:"",displayParts:[bf(e)],documentation:ze,tags:void 0,codeActions:void 0}}function yXe(e,t,r,i){const s=Ji(t,r),o=Ar(s,zp);if(o&&(o.comment!==void 0||Ir(o.tags)))return;const c=s.getStart(t);if(!o&&c0;if(w&&!z){const W=D+e+T+" * ",X=c===r?e+T:"";return{newText:W+e+w+T+O+X,caretOffset:W.length}}return{newText:D+O,caretOffset:3}}function vXe(e,t){const{text:r}=e,i=hp(t,e);let s=i;for(;s<=t&&Cd(r.charCodeAt(s));s++);return r.slice(i,s)}function bXe(e,t,r,i){return e.map(({name:s,dotDotDotToken:o},c)=>{const u=s.kind===80?s.text:"param"+c;return`${r} * @param ${t?o?"{...any} ":"{any} ":""}${u}${i}`}).join("")}function SXe(e,t){return`${e} * @returns${t}`}function TXe(e,t){return Tee(e,r=>q_e(r,t))}function q_e(e,t){switch(e.kind){case 262:case 218:case 174:case 176:case 173:case 219:const r=e;return{commentOwner:e,parameters:r.parameters,hasReturn:gM(r,t)};case 303:return q_e(e.initializer,t);case 263:case 264:case 266:case 306:case 265:return{commentOwner:e};case 171:{const s=e;return s.type&&pg(s.type)?{commentOwner:e,parameters:s.type.parameters,hasReturn:gM(s.type,t)}:{commentOwner:e}}case 243:{const o=e.declarationList.declarations,c=o.length===1&&o[0].initializer?xXe(o[0].initializer):void 0;return c?{commentOwner:e,parameters:c.parameters,hasReturn:gM(c,t)}:{commentOwner:e}}case 312:return"quit";case 267:return e.parent.kind===267?void 0:{commentOwner:e};case 244:return q_e(e.expression,t);case 226:{const s=e;return ac(s)===0?"quit":ks(s.right)?{commentOwner:e,parameters:s.right.parameters,hasReturn:gM(s.right,t)}:{commentOwner:e}}case 172:const i=e.initializer;if(i&&(ro(i)||go(i)))return{commentOwner:e,parameters:i.parameters,hasReturn:gM(i,t)}}}function gM(e,t){return!!t?.generateReturnInDocTemplate&&(pg(e)||go(e)&&ct(e.body)||po(e)&&e.body&&Ss(e.body)&&!!Ev(e.body,r=>r))}function xXe(e){for(;e.kind===217;)e=e.expression;switch(e.kind){case 218:case 219:return e;case 231:return kn(e.members,gc)}}var H_e,r3e,n3e,i3e,kXe=Nt({"src/services/jsDoc.ts"(){"use strict";zn(),H_e=["abstract","access","alias","argument","async","augments","author","borrows","callback","class","classdesc","constant","constructor","constructs","copyright","default","deprecated","description","emits","enum","event","example","exports","extends","external","field","file","fileoverview","fires","function","generator","global","hideconstructor","host","ignore","implements","inheritdoc","inner","instance","interface","kind","lends","license","link","linkcode","linkplain","listens","member","memberof","method","mixes","module","name","namespace","overload","override","package","param","private","prop","property","protected","public","readonly","requires","returns","satisfies","see","since","static","summary","template","this","throws","todo","tutorial","type","typedef","var","variation","version","virtual","yields"],i3e=t3e}}),D1={};jl(D1,{getDocCommentTemplateAtPosition:()=>yXe,getJSDocParameterNameCompletionDetails:()=>hXe,getJSDocParameterNameCompletions:()=>gXe,getJSDocTagCompletionDetails:()=>t3e,getJSDocTagCompletions:()=>mXe,getJSDocTagNameCompletionDetails:()=>i3e,getJSDocTagNameCompletions:()=>dXe,getJsDocCommentsFromDeclarations:()=>lXe,getJsDocTagsFromDeclarations:()=>fXe});var CXe=Nt({"src/services/_namespaces/ts.JsDoc.ts"(){"use strict";kXe()}});function EXe(e,t,r,i,s,o){const c=Qr.ChangeTracker.fromContext({host:r,formatContext:t,preferences:s}),u=o==="SortAndCombine"||o==="All",f=u,g=o==="RemoveUnused"||o==="All",p=qX(e,e.statements.filter(gl)),y=UXe(s,u?()=>o3e(p,s)===2:void 0),S=C=>(g&&(C=PXe(C,e,i)),f&&(C=s3e(C,y,e)),u&&(C=Eh(C,(w,D)=>Y_e(w,D,y))),C);p.forEach(C=>T(C,S)),o!=="RemoveUnused"&&VXe(e).forEach(C=>T(C,w=>G_e(w,y)));for(const C of e.statements.filter(ru)){if(!C.body)continue;if(qX(e,C.body.statements.filter(gl)).forEach(D=>T(D,S)),o!=="RemoveUnused"){const D=C.body.statements.filter(qc);T(D,O=>G_e(O,y))}}return c.getChanges();function T(C,w){if(Ir(C)===0)return;Vr(C[0],1024);const D=f?p4(C,W=>hM(W.moduleSpecifier)):[C],O=u?Eh(D,(W,X)=>X_e(W[0].moduleSpecifier,X[0].moduleSpecifier,y)):D,z=ta(O,W=>hM(W[0].moduleSpecifier)||W[0].moduleSpecifier===void 0?w(W):W);if(z.length===0)c.deleteNodes(e,C,{leadingTriviaOption:Qr.LeadingTriviaOption.Exclude,trailingTriviaOption:Qr.TrailingTriviaOption.Include},!0);else{const W={leadingTriviaOption:Qr.LeadingTriviaOption.Exclude,trailingTriviaOption:Qr.TrailingTriviaOption.Include,suffix:Zh(r,t.options)};c.replaceNodeWithNodes(e,C[0],z,W);const X=c.nodeHasTrailingComment(e,C[0],W);c.deleteNodes(e,C.slice(1),{trailingTriviaOption:Qr.TrailingTriviaOption.Include},X)}}}function qX(e,t){const r=Ih(e.languageVersion,!1,e.languageVariant),i=[];let s=0;for(const o of t)i[s]&&DXe(e,o,r)&&s++,i[s]||(i[s]=[]),i[s].push(o);return i}function DXe(e,t,r){const i=t.getFullStart(),s=t.getStart();r.setText(e.text,i,s-i);let o=0;for(;r.getTokenStart()=2))return!0;return!1}function PXe(e,t,r){const i=r.getTypeChecker(),s=r.getCompilerOptions(),o=i.getJsxNamespace(t),c=i.getJsxFragmentFactory(t),u=!!(t.transformFlags&2),f=[];for(const p of e){const{importClause:y,moduleSpecifier:S}=p;if(!y){f.push(p);continue}let{name:T,namedBindings:C}=y;if(T&&!g(T)&&(T=void 0),C)if(K0(C))g(C.name)||(C=void 0);else{const w=C.elements.filter(D=>g(D.name));w.lengthra(i)&&i.text===r)}function hM(e){return e!==void 0&&Ja(e)?e.text:void 0}function AXe(e,t,r){const i=HX(t);return s3e(e,i,r)}function s3e(e,t,r){if(e.length===0)return e;const{importWithoutClause:i,typeOnlyImports:s,regularImports:o}=NXe(e),c=[];i&&c.push(i);for(const u of[o,s]){const f=u===s,{defaultImports:g,namespaceImports:p,namedImports:y}=u;if(!f&&g.length===1&&p.length===1&&y.length===0){const X=g[0];c.push(oN(X,X.importClause.name,p[0].importClause.namedBindings));continue}const S=Eh(p,(X,J)=>t(X.importClause.namedBindings.name.text,J.importClause.namedBindings.name.text));for(const X of S)c.push(oN(X,void 0,X.importClause.namedBindings));const T=bl(g),C=bl(y),w=T??C;if(!w)continue;let D;const O=[];if(g.length===1)D=g[0].importClause.name;else for(const X of g)O.push(I.createImportSpecifier(!1,I.createIdentifier("default"),X.importClause.name));O.push(...BXe(y));const z=I.createNodeArray(a3e(O,t),C?.importClause.namedBindings.elements.hasTrailingComma),W=z.length===0?D?void 0:I.createNamedImports(ze):C?I.updateNamedImports(C.importClause.namedBindings,z):I.createNamedImports(z);r&&W&&C?.importClause.namedBindings&&!bb(C.importClause.namedBindings,r)&&Vr(W,2),f&&D&&W?(c.push(oN(w,D,void 0)),c.push(oN(C??w,void 0,W))):c.push(oN(w,D,W))}return c}function NXe(e){let t;const r={defaultImports:[],namespaceImports:[],namedImports:[]},i={defaultImports:[],namespaceImports:[],namedImports:[]};for(const s of e){if(s.importClause===void 0){t=t||s;continue}const o=s.importClause.isTypeOnly?r:i,{name:c,namedBindings:u}=s.importClause;c&&o.defaultImports.push(s),u&&(K0(u)?o.namespaceImports.push(s):o.namedImports.push(s))}return{importWithoutClause:t,typeOnlyImports:r,regularImports:i}}function IXe(e,t){const r=HX(t);return G_e(e,r)}function G_e(e,t){if(e.length===0)return e;const{exportWithoutClause:r,namedExports:i,typeOnlyExports:s}=c(e),o=[];r&&o.push(r);for(const u of[i,s]){if(u.length===0)continue;const f=[];f.push(...ta(u,y=>y.exportClause&&gp(y.exportClause)?y.exportClause.elements:ze));const g=a3e(f,t),p=u[0];o.push(I.updateExportDeclaration(p,p.modifiers,p.isTypeOnly,p.exportClause&&(gp(p.exportClause)?I.updateNamedExports(p.exportClause,g):I.updateNamespaceExport(p.exportClause,p.exportClause.name)),p.moduleSpecifier,p.attributes))}return o;function c(u){let f;const g=[],p=[];for(const y of u)y.exportClause===void 0?f=f||y:y.isTypeOnly?p.push(y):g.push(y);return{exportWithoutClause:f,namedExports:g,typeOnlyExports:p}}}function oN(e,t,r){return I.updateImportDeclaration(e,e.modifiers,I.updateImportClause(e.importClause,e.importClause.isTypeOnly,t,r),e.moduleSpecifier,e.attributes)}function a3e(e,t){return Eh(e,(r,i)=>$_e(r,i,t))}function $_e(e,t,r){return pv(e.isTypeOnly,t.isTypeOnly)||r(e.name.text,t.name.text)}function FXe(e,t,r){const i=HX(!!r);return X_e(e,t,i)}function X_e(e,t,r){const i=e===void 0?void 0:hM(e),s=t===void 0?void 0:hM(t);return pv(i===void 0,s===void 0)||pv(Tl(i),Tl(s))||r(i,s)}function Q_e(e){var t;switch(e.kind){case 271:return(t=Jn(e.moduleReference,Pm))==null?void 0:t.expression;case 272:return e.moduleSpecifier;case 243:return e.declarationList.declarations[0].initializer.arguments[0]}}function OXe(e,t){return o3e(qX(e,e.statements.filter(gl)),t)}function o3e(e,t){const r=u6(t,!1),i=u6(t,!0);let s=3,o=!1;for(const c of e){if(c.length>1){const f=S7(c,g=>{var p;return((p=Jn(g.moduleSpecifier,ra))==null?void 0:p.text)??""},r,i);if(f&&(s&=f,o=!0),!s)return s}const u=kn(c,f=>{var g,p;return((p=Jn((g=f.importClause)==null?void 0:g.namedBindings,Kg))==null?void 0:p.elements.length)>1});if(u){const f=Z_e(u.importClause.namedBindings.elements,t);if(f&&(s&=f,o=!0),!s)return s}if(s!==3)return s}return o?0:s}function LXe(e,t){const r=u6(t,!1),i=u6(t,!0);return S7(e,s=>hM(Q_e(s))||"",r,i)}function MXe(e,t,r){const i=Dh(e,t,To,(s,o)=>Y_e(s,o,r));return i<0?~i:i}function RXe(e,t,r){const i=Dh(e,t,To,(s,o)=>$_e(s,o,r));return i<0?~i:i}function Y_e(e,t,r){return X_e(Q_e(e),Q_e(t),r)||jXe(e,t)}function jXe(e,t){return xo(c3e(e),c3e(t))}function c3e(e){var t;switch(e.kind){case 272:return e.importClause?e.importClause.isTypeOnly?1:((t=e.importClause.namedBindings)==null?void 0:t.kind)===274?2:e.importClause.name?3:4:0;case 271:return 5;case 243:return 6}}function BXe(e){return ta(e,t=>Yt(JXe(t),r=>r.name&&r.propertyName&&r.name.escapedText===r.propertyName.escapedText?I.updateImportSpecifier(r,r.isTypeOnly,void 0,r.name):r))}function JXe(e){var t;return(t=e.importClause)!=null&&t.namedBindings&&Kg(e.importClause.namedBindings)?e.importClause.namedBindings.elements:void 0}function HX(e){return e?GZ:Du}function zXe(e,t){const r=WXe(t),i=t.organizeImportsCaseFirst??!1,s=t.organizeImportsNumericCollation??!1,o=t.organizeImportsAccentCollation??!0,c=e?o?"accent":"base":o?"variant":"case";return new Intl.Collator(r,{usage:"sort",caseFirst:i||"false",sensitivity:c,numeric:s}).compare}function WXe(e){let t=e.organizeImportsLocale;t==="auto"&&(t=$Z()),t===void 0&&(t="en");const r=Intl.Collator.supportedLocalesOf(t);return r.length?r[0]:"en"}function u6(e,t){return(e.organizeImportsCollation??"ordinal")==="unicode"?zXe(t,e):HX(t)}function UXe(e,t){const r=typeof e.organizeImportsIgnoreCase=="boolean"?e.organizeImportsIgnoreCase:t?.()??!1;return u6(e,r)}function VXe(e){const t=[],r=e.statements,i=Ir(r);let s=0,o=0;for(;sqX(e,c))}var l3e,Z_e,qXe=Nt({"src/services/organizeImports.ts"(){"use strict";zn(),l3e=class{has([e,t]){return this._lastPreferences!==t||!this._cache?!1:this._cache.has(e)}get([e,t]){if(!(this._lastPreferences!==t||!this._cache))return this._cache.get(e)}set([e,t],r){this._lastPreferences!==t&&(this._lastPreferences=t,this._cache=void 0),this._cache??(this._cache=new WeakMap),this._cache.set(e,r)}},Z_e=HZ((e,t)=>{if(!jZ(e,(s,o)=>pv(s.isTypeOnly,o.isTypeOnly)))return 0;const r=u6(t,!1),i=u6(t,!0);return S7(e,s=>s.name.text,r,i)},new l3e)}}),qp={};jl(qp,{coalesceExports:()=>IXe,coalesceImports:()=>AXe,compareImportOrExportSpecifiers:()=>$_e,compareImportsOrRequireStatements:()=>Y_e,compareModuleSpecifiers:()=>FXe,detectImportDeclarationSorting:()=>LXe,detectImportSpecifierSorting:()=>Z_e,detectSorting:()=>OXe,getImportDeclarationInsertionIndex:()=>MXe,getImportSpecifierInsertionIndex:()=>RXe,getOrganizeImportsComparer:()=>u6,organizeImports:()=>EXe});var HXe=Nt({"src/services/_namespaces/ts.OrganizeImports.ts"(){"use strict";qXe()}});function GXe(e,t){const r=[];return $Xe(e,t,r),XXe(e,r),r.sort((i,s)=>i.textSpan.start-s.textSpan.start)}function $Xe(e,t,r){let i=40,s=0;const o=[...e.statements,e.endOfFileToken],c=o.length;for(;s1&&i.push(yM(o,c,"comment"))}}function _3e(e,t,r,i){DT(e)||K_e(e.pos,t,r,i)}function yM(e,t,r){return _x(zc(e,t),r)}function QXe(e,t){switch(e.kind){case 241:if(ks(e.parent))return YXe(e.parent,e,t);switch(e.parent.kind){case 246:case 249:case 250:case 248:case 245:case 247:case 254:case 299:return p(e.parent);case 258:const T=e.parent;if(T.tryBlock===e)return p(e.parent);if(T.finallyBlock===e){const C=Ua(T,98,t);if(C)return p(C)}default:return _x(l_(e,t),"code")}case 268:return p(e.parent);case 263:case 231:case 264:case 266:case 269:case 187:case 206:return p(e);case 189:return p(e,!1,!uC(e.parent),23);case 296:case 297:return y(e.statements);case 210:return g(e);case 209:return g(e,23);case 284:return o(e);case 288:return c(e);case 285:case 286:return u(e.attributes);case 228:case 15:return f(e);case 207:return p(e,!1,!Pa(e.parent),23);case 219:return s(e);case 213:return i(e);case 217:return S(e);case 275:case 279:case 300:return r(e)}function r(T){if(!T.elements.length)return;const C=Ua(T,19,t),w=Ua(T,20,t);if(!(!C||!w||_p(C.pos,w.pos,t)))return GX(C,w,T,t,!1,!1)}function i(T){if(!T.arguments.length)return;const C=Ua(T,21,t),w=Ua(T,22,t);if(!(!C||!w||_p(C.pos,w.pos,t)))return GX(C,w,T,t,!1,!0)}function s(T){if(Ss(T.body)||y_(T.body)||_p(T.body.getFullStart(),T.body.getEnd(),t))return;const C=zc(T.body.getFullStart(),T.body.getEnd());return _x(C,"code",l_(T))}function o(T){const C=zc(T.openingElement.getStart(t),T.closingElement.getEnd()),w=T.openingElement.tagName.getText(t),D="<"+w+">...";return _x(C,"code",C,!1,D)}function c(T){const C=zc(T.openingFragment.getStart(t),T.closingFragment.getEnd());return _x(C,"code",C,!1,"<>...")}function u(T){if(T.properties.length!==0)return yM(T.getStart(t),T.getEnd(),"code")}function f(T){if(!(T.kind===15&&T.text.length===0))return yM(T.getStart(t),T.getEnd(),"code")}function g(T,C=19){return p(T,!1,!Lu(T.parent)&&!Rs(T.parent),C)}function p(T,C=!1,w=!0,D=19,O=D===19?20:24){const z=Ua(e,D,t),W=Ua(e,O,t);return z&&W&&GX(z,W,T,t,C,w)}function y(T){return T.length?_x(ry(T),"code"):void 0}function S(T){if(_p(T.getStart(),T.getEnd(),t))return;const C=zc(T.getStart(),T.getEnd());return _x(C,"code",l_(T))}}function YXe(e,t,r){const i=ZXe(e,t,r),s=Ua(t,20,r);return i&&s&&GX(i,s,e,r,e.kind!==219)}function GX(e,t,r,i,s=!1,o=!0){const c=zc(o?e.getFullStart():e.getStart(i),t.getEnd());return _x(c,"code",l_(r,i),s)}function _x(e,t,r=e,i=!1,s="..."){return{textSpan:e,kind:t,hintSpan:r,bannerText:s,autoCollapse:i}}function ZXe(e,t,r){if(zte(e.parameters,r)){const i=Ua(e,21,r);if(i)return i}return Ua(t,19,r)}var f3e,KXe=Nt({"src/services/outliningElementsCollector.ts"(){"use strict";zn(),f3e=/^#(end)?region(?:\s+(.*))?(?:\r)?$/}}),$X={};jl($X,{collectElements:()=>GXe});var eQe=Nt({"src/services/_namespaces/ts.OutliningElementsCollector.ts"(){"use strict";KXe()}});function tQe(e,t,r,i){const s=J9(c_(t,r));if(d3e(s)){const o=rQe(s,e.getTypeChecker(),t,e,i);if(o)return o}return XX(d.You_cannot_rename_this_element)}function rQe(e,t,r,i,s){const o=t.getSymbolAtLocation(e);if(!o){if(Ja(e)){const S=B9(e,t);if(S&&(S.flags&128||S.flags&1048576&&qi(S.types,T=>!!(T.flags&128))))return efe(e.text,e.text,"string","",e,r)}else if(eH(e)){const S=Wc(e);return efe(S,S,"label","",e,r)}return}const{declarations:c}=o;if(!c||c.length===0)return;if(c.some(S=>nQe(i,S)))return XX(d.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);if(Ie(e)&&e.escapedText==="default"&&o.parent&&o.parent.flags&1536)return;if(Ja(e)&&n8(e))return s.allowRenameOfImportPath?sQe(e,r,o):void 0;const u=iQe(r,o,t,s);if(u)return XX(u);const f=t0.getSymbolKind(t,o,e),g=yoe(e)||_f(e)&&e.parent.kind===167?lp(cp(e)):void 0,p=g||t.symbolToString(o),y=g||t.getFullyQualifiedName(o);return efe(p,y,f,t0.getSymbolModifiers(t,o),e,r)}function nQe(e,t){const r=t.getSourceFile();return e.isSourceFileDefaultLibrary(r)&&Ho(r.fileName,".d.ts")}function iQe(e,t,r,i){if(!i.providePrefixAndSuffixTextForRename&&t.flags&2097152){const c=t.declarations&&kn(t.declarations,u=>v_(u));c&&!c.propertyName&&(t=r.getAliasedSymbol(t))}const{declarations:s}=t;if(!s)return;const o=p3e(e.path);if(o===void 0)return ut(s,c=>wA(c.getSourceFile().path))?d.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:void 0;for(const c of s){const u=p3e(c.getSourceFile().path);if(u){const f=Math.min(o.length,u.length);for(let g=0;g<=f;g++)if(Du(o[g],u[g])!==0)return d.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder}}}function p3e(e){const t=fl(e),r=t.lastIndexOf("node_modules");if(r!==-1)return t.slice(0,r+2)}function sQe(e,t,r){if(!Tl(e.text))return XX(d.You_cannot_rename_a_module_via_a_global_import);const i=r.declarations&&kn(r.declarations,Ai);if(!i)return;const s=fc(e.text,"/index")||fc(e.text,"/index.js")?void 0:YZ(Ou(i.fileName),"/index"),o=s===void 0?i.fileName:s,c=s===void 0?"module":"directory",u=e.text.lastIndexOf("/")+1,f=Jl(e.getStart(t)+1+u,e.text.length-u);return{canRename:!0,fileToRename:o,kind:c,displayName:o,fullDisplayName:o,kindModifiers:"",triggerSpan:f}}function efe(e,t,r,i,s,o){return{canRename:!0,fileToRename:void 0,kind:r,displayName:e,fullDisplayName:t,kindModifiers:i,triggerSpan:aQe(s,o)}}function XX(e){return{canRename:!1,localizedErrorMessage:ls(e)}}function aQe(e,t){let r=e.getStart(t),i=e.getWidth(t);return Ja(e)&&(r+=1,i-=2),Jl(r,i)}function d3e(e){switch(e.kind){case 80:case 81:case 11:case 15:case 110:return!0;case 9:return L9(e);default:return!1}}var oQe=Nt({"src/services/rename.ts"(){"use strict";zn()}}),vM={};jl(vM,{getRenameInfo:()=>tQe,nodeIsEligibleForRename:()=>d3e});var cQe=Nt({"src/services/_namespaces/ts.Rename.ts"(){"use strict";oQe()}});function lQe(e,t,r,i,s){const o=e.getTypeChecker(),c=z9(t,r);if(!c)return;const u=!!i&&i.kind==="characterTyped";if(u&&(Vb(t,r,c)||Xh(t,r)))return;const f=!!i&&i.kind==="invoked",g=CQe(c,r,t,o,f);if(!g)return;s.throwIfCancellationRequested();const p=uQe(g,o,t,c,u);return s.throwIfCancellationRequested(),p?o.runWithCancellationToken(s,y=>p.kind===0?S3e(p.candidates,p.resolvedSignature,g,t,y):DQe(p.symbol,g,t,y)):Iu(t)?fQe(g,e,s):void 0}function uQe({invocation:e,argumentCount:t},r,i,s,o){switch(e.kind){case 0:{if(o&&!_Qe(s,e.node,i))return;const c=[],u=r.getResolvedSignatureForSignatureHelp(e.node,c,t);return c.length===0?void 0:{kind:0,candidates:c,resolvedSignature:u}}case 1:{const{called:c}=e;if(o&&!m3e(s,i,Ie(c)?c.parent:c))return;const u=uH(c,t,r);if(u.length!==0)return{kind:0,candidates:u,resolvedSignature:ba(u)};const f=r.getSymbolAtLocation(c);return f&&{kind:1,symbol:f}}case 2:return{kind:0,candidates:[e.signature],resolvedSignature:e.signature};default:return E.assertNever(e)}}function _Qe(e,t,r){if(!gm(t))return!1;const i=t.getChildren(r);switch(e.kind){case 21:return _s(i,e);case 28:{const s=j9(e);return!!s&&_s(i,s)}case 30:return m3e(e,r,t.expression);default:return!1}}function fQe(e,t,r){if(e.invocation.kind===2)return;const i=v3e(e.invocation),s=bn(i)?i.name.text:void 0,o=t.getTypeChecker();return s===void 0?void 0:ic(t.getSourceFiles(),c=>ic(c.getNamedDeclarations().get(s),u=>{const f=u.symbol&&o.getTypeOfSymbolAtLocation(u.symbol,u),g=f&&f.getCallSignatures();if(g&&g.length)return o.runWithCancellationToken(r,p=>S3e(g,g[0],e,c,p,!0))}))}function m3e(e,t,r){const i=e.getFullStart();let s=e.parent;for(;s;){const o=Kc(i,t,s,!0);if(o)return yf(r,o);s=s.parent}return E.fail("Could not find preceding token")}function pQe(e,t,r){const i=h3e(e,t,r);return!i||i.isTypeParameterList||i.invocation.kind!==0?void 0:{invocation:i.invocation.node,argumentCount:i.argumentCount,argumentIndex:i.argumentIndex}}function g3e(e,t,r){const i=dQe(e,r);if(!i)return;const{list:s,argumentIndex:o}=i,c=SQe(s,Vb(r,t,e));o!==0&&E.assertLessThan(o,c);const u=xQe(s,r);return{list:s,argumentIndex:o,argumentCount:c,argumentsSpan:u}}function dQe(e,t){if(e.kind===30||e.kind===21)return{list:EQe(e.parent,e,t),argumentIndex:0};{const r=j9(e);return r&&{list:r,argumentIndex:bQe(r,e)}}}function h3e(e,t,r){const{parent:i}=e;if(gm(i)){const s=i,o=g3e(e,t,r);if(!o)return;const{list:c,argumentIndex:u,argumentCount:f,argumentsSpan:g}=o;return{isTypeParameterList:!!i.typeArguments&&i.typeArguments.pos===c.pos,invocation:{kind:0,node:s},argumentsSpan:g,argumentIndex:u,argumentCount:f}}else{if(PT(e)&&Db(i))return gA(e,t,r)?rfe(i,0,r):void 0;if(oC(e)&&i.parent.kind===215){const s=i,o=s.parent;E.assert(s.kind===228);const c=gA(e,t,r)?0:1;return rfe(o,c,r)}else if(zE(i)&&Db(i.parent.parent)){const s=i,o=i.parent.parent;if(NW(e)&&!gA(e,t,r))return;const c=s.parent.templateSpans.indexOf(s),u=TQe(c,e,t,r);return rfe(o,u,r)}else if(qu(i)){const s=i.attributes.pos,o=la(r.text,i.attributes.end,!1);return{isTypeParameterList:!1,invocation:{kind:0,node:i},argumentsSpan:Jl(s,o-s),argumentIndex:0,argumentCount:1}}else{const s=_H(e,r);if(s){const{called:o,nTypeArguments:c}=s,u={kind:1,called:o},f=zc(o.getStart(r),e.end);return{isTypeParameterList:!0,invocation:u,argumentsSpan:f,argumentIndex:c,argumentCount:c+1}}return}}}function mQe(e,t,r,i){return gQe(e,t,r,i)||h3e(e,t,r)}function y3e(e){return Gr(e.parent)?y3e(e.parent):e}function tfe(e){return Gr(e.left)?tfe(e.left)+1:2}function gQe(e,t,r,i){const s=hQe(e);if(s===void 0)return;const o=yQe(s,r,t,i);if(o===void 0)return;const{contextualType:c,argumentIndex:u,argumentCount:f,argumentsSpan:g}=o,p=c.getNonNullableType(),y=p.symbol;if(y===void 0)return;const S=Mo(p.getCallSignatures());return S===void 0?void 0:{isTypeParameterList:!1,invocation:{kind:2,signature:S,node:e,symbol:vQe(y)},argumentsSpan:g,argumentIndex:u,argumentCount:f}}function hQe(e){switch(e.kind){case 21:case 28:return e;default:return Ar(e.parent,t=>us(t)?!0:Pa(t)||jp(t)||Eb(t)?!1:"quit")}}function yQe(e,t,r,i){const{parent:s}=e;switch(s.kind){case 217:case 174:case 218:case 219:const o=g3e(e,r,t);if(!o)return;const{argumentIndex:c,argumentCount:u,argumentsSpan:f}=o,g=mc(s)?i.getContextualTypeForObjectLiteralElement(s):i.getContextualType(s);return g&&{contextualType:g,argumentIndex:c,argumentCount:u,argumentsSpan:f};case 226:{const p=y3e(s),y=i.getContextualType(p),S=e.kind===21?0:tfe(s)-1,T=tfe(p);return y&&{contextualType:y,argumentIndex:S,argumentCount:T,argumentsSpan:l_(s)}}default:return}}function vQe(e){return e.name==="__type"&&ic(e.declarations,t=>{var r;return pg(t)?(r=Jn(t.parent,Ed))==null?void 0:r.symbol:void 0})||e}function bQe(e,t){let r=0;for(const i of e.getChildren()){if(i===t)break;i.kind!==28&&r++}return r}function SQe(e,t){const r=e.getChildren();let i=Ch(r,s=>s.kind!==28);return!t&&r.length>0&&Sa(r).kind===28&&i++,i}function TQe(e,t,r,i){return E.assert(r>=t.getStart(),"Assumed 'position' could not occur before node."),YK(t)?gA(t,r,i)?0:e+2:e+1}function rfe(e,t,r){const i=PT(e.template)?1:e.template.templateSpans.length+1;return t!==0&&E.assertLessThan(t,i),{isTypeParameterList:!1,invocation:{kind:0,node:e},argumentsSpan:kQe(e,r),argumentIndex:t,argumentCount:i}}function xQe(e,t){const r=e.getFullStart(),i=la(t.text,e.getEnd(),!1);return Jl(r,i-r)}function kQe(e,t){const r=e.template,i=r.getStart();let s=r.getEnd();return r.kind===228&&Sa(r.templateSpans).literal.getFullWidth()===0&&(s=la(t.text,s,!1)),Jl(i,s-i)}function CQe(e,t,r,i,s){for(let o=e;!Ai(o)&&(s||!Ss(o));o=o.parent){E.assert(yf(o.parent,o),"Not a subspan",()=>`Child: ${E.formatSyntaxKind(o.kind)}, parent: ${E.formatSyntaxKind(o.parent.kind)}`);const c=mQe(o,t,r,i);if(c)return c}}function EQe(e,t,r){const i=e.getChildren(r),s=i.indexOf(t);return E.assert(s>=0&&i.length>s+1),i[s+1]}function v3e(e){return e.kind===0?HI(e.node):e.called}function b3e(e){return e.kind===0?e.node:e.kind===1?e.called:e.node}function S3e(e,t,{isTypeParameterList:r,argumentCount:i,argumentsSpan:s,invocation:o,argumentIndex:c},u,f,g){var p;const y=b3e(o),S=o.kind===2?o.symbol:f.getSymbolAtLocation(v3e(o))||g&&((p=t.declaration)==null?void 0:p.symbol),T=S?A3(f,S,g?u:void 0,void 0):ze,C=Yt(e,W=>wQe(W,T,r,f,y,u));c!==0&&E.assertLessThan(c,i);let w=0,D=0;for(let W=0;W1)){let J=0;for(const ie of X){if(ie.isVariadic||ie.parameters.length>=i){w=D+J;break}J++}}D+=X.length}E.assert(w!==-1);const O={items:l4(C,To),applicableSpan:s,selectedItemIndex:w,argumentIndex:c,argumentCount:i},z=O.items[w];if(z.isVariadic){const W=Dc(z.parameters,X=>!!X.isRest);-1T3e(y,r,i,s,c)),f=e.getDocumentationComment(r),g=e.getJsDocTags(r);return{isVariadic:!1,prefixDisplayParts:[...o,Su(30)],suffixDisplayParts:[Su(32)],separatorDisplayParts:nfe,parameters:u,documentation:f,tags:g}}function wQe(e,t,r,i,s,o){const c=(r?NQe:IQe)(e,i,s,o);return Yt(c,({isVariadic:u,parameters:f,prefix:g,suffix:p})=>{const y=[...t,...g],S=[...p,...AQe(e,s,i)],T=e.getDocumentationComment(i),C=e.getJsDocTags();return{isVariadic:u,prefixDisplayParts:y,suffixDisplayParts:S,separatorDisplayParts:nfe,parameters:f,documentation:T,tags:C}})}function AQe(e,t,r){return ny(i=>{i.writePunctuation(":"),i.writeSpace(" ");const s=r.getTypePredicateOfSignature(e);s?r.writeTypePredicate(s,t,void 0,i):r.writeType(r.getReturnTypeOfSignature(e),t,void 0,i)})}function NQe(e,t,r,i){const s=(e.target||e).typeParameters,o=t2(),c=(s||ze).map(f=>T3e(f,t,r,i,o)),u=e.thisParameter?[t.symbolToParameterDeclaration(e.thisParameter,r,cN)]:[];return t.getExpandedParameters(e).map(f=>{const g=I.createNodeArray([...u,...Yt(f,y=>t.symbolToParameterDeclaration(y,r,cN))]),p=ny(y=>{o.writeList(2576,g,i,y)});return{isVariadic:!1,parameters:c,prefix:[Su(30)],suffix:[Su(32),...p]}})}function IQe(e,t,r,i){const s=t2(),o=ny(f=>{if(e.typeParameters&&e.typeParameters.length){const g=I.createNodeArray(e.typeParameters.map(p=>t.typeParameterToDeclaration(p,r,cN)));s.writeList(53776,g,i,f)}}),c=t.getExpandedParameters(e),u=t.hasEffectiveRestParameter(e)?c.length===1?f=>!0:f=>{var g;return!!(f.length&&((g=Jn(f[f.length-1],ym))==null?void 0:g.links.checkFlags)&32768)}:f=>!1;return c.map(f=>({isVariadic:u(f),parameters:f.map(g=>FQe(g,t,r,i,s)),prefix:[...o,Su(21)],suffix:[Su(22)]}))}function FQe(e,t,r,i,s){const o=ny(f=>{const g=t.symbolToParameterDeclaration(e,r,cN);s.writeNode(4,g,i,f)}),c=t.isOptionalParameter(e.valueDeclaration),u=ym(e)&&!!(e.links.checkFlags&32768);return{name:e.name,documentation:e.getDocumentationComment(t),displayParts:o,isOptional:c,isRest:u}}function T3e(e,t,r,i,s){const o=ny(c=>{const u=t.typeParameterToDeclaration(e,r,cN);s.writeNode(4,u,i,c)});return{name:e.symbol.name,documentation:e.symbol.getDocumentationComment(t),displayParts:o,isOptional:!1,isRest:!1}}var cN,nfe,OQe=Nt({"src/services/signatureHelp.ts"(){"use strict";zn(),cN=70246400,nfe=[Su(28),tc()]}}),lN={};jl(lN,{getArgumentInfoForCompletions:()=>pQe,getSignatureHelpItems:()=>lQe});var LQe=Nt({"src/services/_namespaces/ts.SignatureHelp.ts"(){"use strict";OQe()}});function MQe(e,t){var r,i;let s={textSpan:zc(t.getFullStart(),t.getEnd())},o=t;e:for(;;){const f=jQe(o);if(!f.length)break;for(let g=0;ge)break e;const T=lm(Hy(t.text,y.end));if(T&&T.kind===2&&u(T.pos,T.end),RQe(t,e,y)){if(hJ(y)&&po(o)&&!_p(y.getStart(t),y.getEnd(),t)&&c(y.getStart(t),y.getEnd()),Ss(y)||zE(y)||oC(y)||NW(y)||p&&oC(p)||ml(y)&&ec(o)||SC(y)&&ml(o)||Ei(y)&&SC(o)&&f.length===1||Fb(y)||m1(y)||JT(y)){o=y;break}if(zE(o)&&S&&dI(S)){const O=y.getFullStart()-2,z=S.getStart()+1;c(O,z)}const C=SC(y)&&BQe(p)&&JQe(S)&&!_p(p.getStart(),S.getStart(),t);let w=C?p.getEnd():y.getStart();const D=C?S.getStart():zQe(t,y);if(q_(y)&&((r=y.jsDoc)!=null&&r.length)&&c(ba(y.jsDoc).getStart(),D),SC(y)){const O=y.getChildren()[0];O&&q_(O)&&((i=O.jsDoc)!=null&&i.length)&&O.getStart()!==y.pos&&(w=Math.min(w,ba(O.jsDoc).getStart()))}c(w,D),(ra(y)||bk(y))&&c(w+1,D-1),o=y;break}if(g===f.length-1)break e}}return s;function c(f,g){if(f!==g){const p=zc(f,g);(!s||!$C(p,s.textSpan)&&wK(p,e))&&(s={textSpan:p,...s&&{parent:s}})}}function u(f,g){c(f,g);let p=f;for(;t.text.charCodeAt(p)===47;)p++;c(p,g)}}function RQe(e,t,r){return E.assert(r.pos<=t),tu===e.readonlyToken||u.kind===148||u===e.questionToken||u.kind===58),c=uN(o,({kind:u})=>u===23||u===168||u===24);return[r,_N(QX(c,({kind:u})=>u===59)),s]}if(ff(e)){const r=uN(e.getChildren(),c=>c===e.name||_s(e.modifiers,c)),i=((t=r[0])==null?void 0:t.kind)===327?r[0]:void 0,s=i?r.slice(1):r,o=QX(s,({kind:c})=>c===59);return i?[i,_N(o)]:o}if(us(e)){const r=uN(e.getChildren(),s=>s===e.dotDotDotToken||s===e.name),i=uN(r,s=>s===r[0]||s===e.questionToken);return QX(i,({kind:s})=>s===64)}return Pa(e)?QX(e.getChildren(),({kind:r})=>r===64):e.getChildren()}function uN(e,t){const r=[];let i;for(const s of e)t(s)?(i=i||[],i.push(s)):(i&&(r.push(_N(i)),i=void 0),r.push(s));return i&&r.push(_N(i)),r}function QX(e,t,r=!0){if(e.length<2)return e;const i=Dc(e,t);if(i===-1)return e;const s=e.slice(0,i),o=e[i],c=Sa(e),u=r&&c.kind===27,f=e.slice(i+1,u?e.length-1:void 0),g=UD([s.length?_N(s):void 0,o,f.length?_N(f):void 0]);return u?g.concat(c):g}function _N(e){return E.assertGreaterThanOrEqual(e.length,1),km(wm.createSyntaxList(e),e[0].pos,Sa(e).end)}function BQe(e){const t=e&&e.kind;return t===19||t===23||t===21||t===286}function JQe(e){const t=e&&e.kind;return t===20||t===24||t===22||t===287}function zQe(e,t){switch(t.kind){case 348:case 345:case 355:case 353:case 350:return e.getLineEndOfPosition(t.getStart());default:return t.getEnd()}}var x3e,WQe=Nt({"src/services/smartSelection.ts"(){"use strict";zn(),x3e=ed(gl,Hl)}}),YX={};jl(YX,{getSmartSelectionRange:()=>MQe});var UQe=Nt({"src/services/_namespaces/ts.SmartSelectionRange.ts"(){"use strict";WQe()}});function k3e(e,t,r){const i=C3e(e,t,r);if(i!=="")return i;const s=fE(t);return s&32?Wo(t,231)?"local class":"class":s&384?"enum":s&524288?"type":s&64?"interface":s&262144?"type parameter":s&8?"enum member":s&2097152?"alias":s&1536?"module":i}function C3e(e,t,r){const i=e.getRootSymbols(t);if(i.length===1&&ba(i).flags&8192&&e.getTypeOfSymbolAtLocation(t,r).getNonNullableType().getCallSignatures().length!==0)return"method";if(e.isUndefinedSymbol(t))return"var";if(e.isArgumentsSymbol(t))return"local var";if(r.kind===110&&ct(r)||pT(r))return"parameter";const s=fE(t);if(s&3)return DH(t)?"parameter":t.valueDeclaration&&wk(t.valueDeclaration)?"const":t.valueDeclaration&&JP(t.valueDeclaration)?"using":t.valueDeclaration&&BP(t.valueDeclaration)?"await using":Zt(t.declarations,MI)?"let":P3e(t)?"local var":"var";if(s&16)return P3e(t)?"local function":"function";if(s&32768)return"getter";if(s&65536)return"setter";if(s&8192)return"method";if(s&16384)return"constructor";if(s&131072)return"index";if(s&4){if(s&33554432&&t.links.checkFlags&6){const o=Zt(e.getRootSymbols(t),c=>{if(c.getFlags()&98311)return"property"});return o||(e.getTypeOfSymbolAtLocation(t,r).getCallSignatures().length?"method":"property")}return"property"}return""}function E3e(e){if(e.declarations&&e.declarations.length){const[t,...r]=e.declarations,i=Ir(r)&&mL(t)&&ut(r,o=>!mL(o))?65536:0,s=C3(t,i);if(s)return s.split(",")}return[]}function VQe(e,t){if(!t)return"";const r=new Set(E3e(t));if(t.flags&2097152){const i=e.getAliasedSymbol(t);i!==t&&Zt(E3e(i),s=>{r.add(s)})}return t.flags&16777216&&r.add("optional"),r.size>0?fs(r.values()).join(","):""}function D3e(e,t,r,i,s,o,c,u){var f;const g=[];let p=[],y=[];const S=fE(t);let T=c&1?C3e(e,t,s):"",C=!1;const w=s.kind===110&&$I(s)||pT(s);let D,O,z=!1;if(s.kind===110&&!w)return{displayParts:[F_(110)],documentation:[],symbolKind:"primitive type",tags:void 0};if(T!==""||S&32||S&2097152){if(T==="getter"||T==="setter"){const oe=kn(t.declarations,Se=>Se.name===s);if(oe)switch(oe.kind){case 177:T="getter";break;case 178:T="setter";break;case 172:T="accessor";break;default:E.assertNever(oe)}else T="property"}let H;if(o??(o=w?e.getTypeAtLocation(s):e.getTypeOfSymbolAtLocation(t,s)),s.parent&&s.parent.kind===211){const oe=s.parent.name;(oe===s||oe&&oe.getFullWidth()===0)&&(s=s.parent)}let K;if(gm(s)?K=s:(Qq(s)||T3(s)||s.parent&&(qu(s.parent)||Db(s.parent))&&ks(t.valueDeclaration))&&(K=s.parent),K){H=e.getResolvedSignature(K);const oe=K.kind===214||Rs(K)&&K.expression.kind===108,Se=oe?o.getConstructSignatures():o.getCallSignatures();if(H&&!_s(Se,H.target)&&!_s(Se,H)&&(H=Se.length?Se[0]:void 0),H){switch(oe&&S&32?(T="constructor",Y(o.symbol,T)):S&2097152?(T="alias",ae(T),g.push(tc()),oe&&(H.flags&4&&(g.push(F_(128)),g.push(tc())),g.push(F_(105)),g.push(tc())),B(t)):Y(t,T),T){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":g.push(Su(59)),g.push(tc()),!(Pn(o)&16)&&o.symbol&&(Dn(g,A3(e,o.symbol,i,void 0,5)),g.push(XC())),oe&&(H.flags&4&&(g.push(F_(128)),g.push(tc())),g.push(F_(105)),g.push(tc())),_e(H,Se,262144);break;default:_e(H,Se)}C=!0,z=Se.length>1}}else if(iH(s)&&!(S&98304)||s.kind===137&&s.parent.kind===176){const oe=s.parent;if(t.declarations&&kn(t.declarations,se=>se===(s.kind===137?oe.parent:oe))){const se=oe.kind===176?o.getNonNullableType().getConstructSignatures():o.getNonNullableType().getCallSignatures();e.isImplementationOfOverload(oe)?H=se[0]:H=e.getSignatureFromDeclaration(oe),oe.kind===176?(T="constructor",Y(o.symbol,T)):Y(oe.kind===179&&!(o.symbol.flags&2048||o.symbol.flags&4096)?o.symbol:t,T),H&&_e(H,se),C=!0,z=se.length>1}}}if(S&32&&!C&&!w&&(J(),Wo(t,231)?ae("local class"):g.push(F_(86)),g.push(tc()),B(t),$(t,r)),S&64&&c&2&&(X(),g.push(F_(120)),g.push(tc()),B(t),$(t,r)),S&524288&&c&2&&(X(),g.push(F_(156)),g.push(tc()),B(t),$(t,r),g.push(tc()),g.push(w3(64)),g.push(tc()),Dn(g,xA(e,s.parent&&Vg(s.parent)?e.getTypeAtLocation(s.parent):e.getDeclaredTypeOfSymbol(t),i,8388608))),S&384&&(X(),ut(t.declarations,H=>p1(H)&&Cv(H))&&(g.push(F_(87)),g.push(tc())),g.push(F_(94)),g.push(tc()),B(t)),S&1536&&!w){X();const H=Wo(t,267),K=H&&H.name&&H.name.kind===80;g.push(F_(K?145:144)),g.push(tc()),B(t)}if(S&262144&&c&2)if(X(),g.push(Su(21)),g.push(bf("type parameter")),g.push(Su(22)),g.push(tc()),B(t),t.parent)ie(),B(t.parent,i),$(t.parent,i);else{const H=Wo(t,168);if(H===void 0)return E.fail();const K=H.parent;if(K)if(ks(K)){ie();const oe=e.getSignatureFromDeclaration(K);K.kind===180?(g.push(F_(105)),g.push(tc())):K.kind!==179&&K.name&&B(K.symbol),Dn(g,AH(e,oe,r,32))}else Jp(K)&&(ie(),g.push(F_(156)),g.push(tc()),B(K.symbol),$(K.symbol,r))}if(S&8){T="enum member",Y(t,"enum member");const H=(f=t.declarations)==null?void 0:f[0];if(H?.kind===306){const K=e.getConstantValue(H);K!==void 0&&(g.push(tc()),g.push(w3(64)),g.push(tc()),g.push(b_(wee(K),typeof K=="number"?7:8)))}}if(t.flags&2097152){if(X(),!C||p.length===0&&y.length===0){const H=e.getAliasedSymbol(t);if(H!==t&&H.declarations&&H.declarations.length>0){const K=H.declarations[0],oe=as(K);if(oe&&!C){const Se=II(K)&&In(K,128),se=t.name!=="default"&&!Se,Z=D3e(e,H,Or(K),K,oe,o,c,se?t:H);g.push(...Z.displayParts),g.push(XC()),D=Z.documentation,O=Z.tags}else D=H.getContextualDocumentationComment(K,e),O=H.getJsDocTags(e)}}if(t.declarations)switch(t.declarations[0].kind){case 270:g.push(F_(95)),g.push(tc()),g.push(F_(145));break;case 277:g.push(F_(95)),g.push(tc()),g.push(F_(t.declarations[0].isExportEquals?64:90));break;case 281:g.push(F_(95));break;default:g.push(F_(102))}g.push(tc()),B(t),Zt(t.declarations,H=>{if(H.kind===271){const K=H;if(Ky(K))g.push(tc()),g.push(w3(64)),g.push(tc()),g.push(F_(149)),g.push(Su(21)),g.push(b_(Wc(q4(K)),8)),g.push(Su(22));else{const oe=e.getSymbolAtLocation(K.moduleReference);oe&&(g.push(tc()),g.push(w3(64)),g.push(tc()),B(oe,i))}return!0}})}if(!C)if(T!==""){if(o){if(w?(X(),g.push(F_(110))):Y(t,T),T==="property"||T==="accessor"||T==="getter"||T==="setter"||T==="JSX attribute"||S&3||T==="local var"||T==="index"||T==="using"||T==="await using"||w){if(g.push(Su(59)),g.push(tc()),o.symbol&&o.symbol.flags&262144&&T!=="index"){const H=ny(K=>{const oe=e.typeParameterToDeclaration(o,i,ife);W().writeNode(4,oe,Or(ss(i)),K)});Dn(g,H)}else Dn(g,xA(e,o,i));if(ym(t)&&t.links.target&&ym(t.links.target)&&t.links.target.links.tupleLabelDeclaration){const H=t.links.target.links.tupleLabelDeclaration;E.assertNode(H.name,Ie),g.push(tc()),g.push(Su(21)),g.push(bf(an(H.name))),g.push(Su(22))}}else if(S&16||S&8192||S&16384||S&131072||S&98304||T==="method"){const H=o.getNonNullableType().getCallSignatures();H.length&&(_e(H[0],H),z=H.length>1)}}}else T=k3e(e,t,s);if(p.length===0&&!z&&(p=t.getContextualDocumentationComment(i,e)),p.length===0&&S&4&&t.parent&&t.declarations&&Zt(t.parent.declarations,H=>H.kind===312))for(const H of t.declarations){if(!H.parent||H.parent.kind!==226)continue;const K=e.getSymbolAtLocation(H.parent.right);if(K&&(p=K.getDocumentationComment(e),y=K.getJsDocTags(e),p.length>0))break}if(p.length===0&&Ie(s)&&t.valueDeclaration&&Pa(t.valueDeclaration)){const H=t.valueDeclaration,K=H.parent,oe=H.propertyName||H.name;if(Ie(oe)&&jp(K)){const Se=cp(oe),se=e.getTypeAtLocation(K);p=ic(se.isUnion()?se.types:[se],Z=>{const ve=Z.getProperty(Se);return ve?ve.getDocumentationComment(e):void 0})||ze}}return y.length===0&&!z&&(y=t.getContextualJsDocTags(i,e)),p.length===0&&D&&(p=D),y.length===0&&O&&(y=O),{displayParts:g,documentation:p,symbolKind:T,tags:y.length===0?void 0:y};function W(){return t2()}function X(){g.length&&g.push(XC()),J()}function J(){u&&(ae("alias"),g.push(tc()))}function ie(){g.push(tc()),g.push(F_(103)),g.push(tc())}function B(H,K){let oe;u&&H===t&&(H=u),T==="index"&&(oe=e.getIndexInfosOfIndexSymbol(H));let Se=[];H.flags&131072&&oe?(H.parent&&(Se=A3(e,H.parent)),Se.push(Su(23)),oe.forEach((se,Z)=>{Se.push(...xA(e,se.keyType)),Z!==oe.length-1&&(Se.push(tc()),Se.push(Su(52)),Se.push(tc()))}),Se.push(Su(24))):Se=A3(e,H,K||r,void 0,7),Dn(g,Se),t.flags&16777216&&g.push(Su(58))}function Y(H,K){X(),K&&(ae(K),H&&!ut(H.declarations,oe=>go(oe)||(ro(oe)||Nl(oe))&&!oe.name)&&(g.push(tc()),B(H)))}function ae(H){switch(H){case"var":case"function":case"let":case"const":case"constructor":case"using":case"await using":g.push(PH(H));return;default:g.push(Su(21)),g.push(PH(H)),g.push(Su(22));return}}function _e(H,K,oe=0){Dn(g,AH(e,H,i,oe|32)),K.length>1&&(g.push(tc()),g.push(Su(21)),g.push(w3(40)),g.push(b_((K.length-1).toString(),7)),g.push(tc()),g.push(bf(K.length===2?"overload":"overloads")),g.push(Su(22))),p=H.getDocumentationComment(e),y=H.getJsDocTags(),K.length>1&&p.length===0&&y.length===0&&(p=K[0].getDocumentationComment(e),y=K[0].getJsDocTags().filter(Se=>Se.name!=="deprecated"))}function $(H,K){const oe=ny(Se=>{const se=e.symbolToTypeParameterDeclarations(H,K,ife);W().writeList(53776,se,Or(ss(K)),Se)});Dn(g,oe)}}function qQe(e,t,r,i,s,o=Wb(s),c){return D3e(e,t,r,i,s,void 0,o,c)}function P3e(e){return e.parent?!1:Zt(e.declarations,t=>{if(t.kind===218)return!0;if(t.kind!==260&&t.kind!==262)return!1;for(let r=t.parent;!Dv(r);r=r.parent)if(r.kind===312||r.kind===268)return!1;return!0})}var ife,HQe=Nt({"src/services/symbolDisplay.ts"(){"use strict";zn(),ife=70246400}}),t0={};jl(t0,{getSymbolDisplayPartsDocumentationAndSymbolKind:()=>qQe,getSymbolKind:()=>k3e,getSymbolModifiers:()=>VQe});var GQe=Nt({"src/services/_namespaces/ts.SymbolDisplay.ts"(){"use strict";HQe()}});function w3e(e){const t=e.__pos;return E.assert(typeof t=="number"),t}function sfe(e,t){E.assert(typeof t=="number"),e.__pos=t}function A3e(e){const t=e.__end;return E.assert(typeof t=="number"),t}function afe(e,t){E.assert(typeof t=="number"),e.__end=t}function N3e(e,t){return la(e,t,!1,!0)}function $Qe(e,t){let r=t;for(;r0?1:0;let S=W0(nE(e,g)+y,e);return S=N3e(e.text,S),W0(nE(e,S),e)}function ofe(e,t,r){const{end:i}=t,{trailingTriviaOption:s}=r;if(s===2){const o=Hy(e.text,i);if(o){const c=nE(e,t.end);for(const u of o){if(u.kind===2||nE(e,u.pos)>c)break;if(nE(e,u.end)>c)return la(e.text,u.end,!0,!0)}}}}function _6(e,t,r){var i;const{end:s}=t,{trailingTriviaOption:o}=r;if(o===0)return s;if(o===1){const f=Xi(Hy(e.text,s),Km(e.text,s)),g=(i=f?.[f.length-1])==null?void 0:i.end;return g||s}const c=ofe(e,t,r);if(c)return c;const u=la(e.text,s,!0);return u!==s&&(o===2||mu(e.text.charCodeAt(u-1)))?u:s}function ZX(e,t){return!!t&&!!e.parent&&(t.kind===28||t.kind===27&&e.parent.kind===210)}function XQe(e){return ro(e)||Zc(e)}function QQe(e){if(e.kind!==219)return e;const t=e.parent.kind===172?e.parent:e.parent.parent;return t.jsDoc=e.jsDoc,t}function YQe(e,t){if(e.kind===t.kind)switch(e.kind){case 348:{const r=e,i=t;return Ie(r.name)&&Ie(i.name)&&r.name.escapedText===i.name.escapedText?I.createJSDocParameterTag(void 0,i.name,!1,i.typeExpression,i.isNameFirst,r.comment):void 0}case 349:return I.createJSDocReturnTag(void 0,t.typeExpression,e.comment);case 351:return I.createJSDocTypeTag(void 0,t.typeExpression,e.comment)}}function cfe(e,t){return la(e.text,Qb(e,t,{leadingTriviaOption:1}),!1,!0)}function ZQe(e,t,r,i){const s=cfe(e,i);if(r===void 0||_p(_6(e,t,{}),s,e))return s;const o=Kc(i.getStart(e),e);if(ZX(t,o)){const c=Kc(t.getStart(e),e);if(ZX(r,c)){const u=la(e.text,o.getEnd(),!0,!0);if(_p(c.getStart(e),o.getStart(e),e))return mu(e.text.charCodeAt(u-1))?u-1:u;if(mu(e.text.charCodeAt(u)))return u}}return s}function KQe(e,t){const r=Ua(e,19,t),i=Ua(e,20,t);return[r?.end,i?.end]}function KX(e){return ma(e)?e.properties:e.members}function lfe(e,t){for(let r=t.length-1;r>=0;r--){const{span:i,newText:s}=t[r];e=`${e.substring(0,i.start)}${s}${e.substring(yc(i))}`}return e}function eYe(e){return la(e,0)===e.length}function eQ(e){const t=sr(e,eQ,L3e,tYe,eQ),r=Po(t)?t:Object.create(t);return km(r,w3e(e),A3e(e)),r}function tYe(e,t,r,i,s){const o=kr(e,t,r,i,s);if(!o)return o;E.assert(e);const c=o===e?I.createNodeArray(o.slice(0)):o;return km(c,w3e(e),A3e(e)),c}function I3e(e){let t=0;const r=h8(e),i=Z=>{Z&&sfe(Z,t)},s=Z=>{Z&&afe(Z,t)},o=Z=>{Z&&sfe(Z,t)},c=Z=>{Z&&afe(Z,t)},u=Z=>{Z&&sfe(Z,t)},f=Z=>{Z&&afe(Z,t)};function g(Z,ve){if(ve||!eYe(Z)){t=r.getTextPos();let Te=0;for(;Ug(Z.charCodeAt(Z.length-Te-1));)Te++;t-=Te}}function p(Z){r.write(Z),g(Z,!1)}function y(Z){r.writeComment(Z)}function S(Z){r.writeKeyword(Z),g(Z,!1)}function T(Z){r.writeOperator(Z),g(Z,!1)}function C(Z){r.writePunctuation(Z),g(Z,!1)}function w(Z){r.writeTrailingSemicolon(Z),g(Z,!1)}function D(Z){r.writeParameter(Z),g(Z,!1)}function O(Z){r.writeProperty(Z),g(Z,!1)}function z(Z){r.writeSpace(Z),g(Z,!1)}function W(Z){r.writeStringLiteral(Z),g(Z,!1)}function X(Z,ve){r.writeSymbol(Z,ve),g(Z,!1)}function J(Z){r.writeLine(Z)}function ie(){r.increaseIndent()}function B(){r.decreaseIndent()}function Y(){return r.getText()}function ae(Z){r.rawWrite(Z),g(Z,!1)}function _e(Z){r.writeLiteral(Z),g(Z,!0)}function $(){return r.getTextPos()}function H(){return r.getLine()}function K(){return r.getColumn()}function oe(){return r.getIndent()}function Se(){return r.isAtStartOfLine()}function se(){r.clear(),t=0}return{onBeforeEmitNode:i,onAfterEmitNode:s,onBeforeEmitNodeArray:o,onAfterEmitNodeArray:c,onBeforeEmitToken:u,onAfterEmitToken:f,write:p,writeComment:y,writeKeyword:S,writeOperator:T,writePunctuation:C,writeTrailingSemicolon:w,writeParameter:D,writeProperty:O,writeSpace:z,writeStringLiteral:W,writeSymbol:X,writeLine:J,increaseIndent:ie,decreaseIndent:B,getText:Y,rawWrite:ae,writeLiteral:_e,getTextPos:$,getLine:H,getColumn:K,getIndent:oe,isAtStartOfLine:Se,hasTrailingComment:()=>r.hasTrailingComment(),hasTrailingWhitespace:()=>r.hasTrailingWhitespace(),clear:se}}function rYe(e){let t;for(const g of e.statements)if(Lp(g))t=g;else break;let r=0;const i=e.text;if(t)return r=t.end,f(),r;const s=sI(i);s!==void 0&&(r=s.length,f());const o=Km(i,r);if(!o)return r;let c,u;for(const g of o){if(g.kind===3){if(AI(i,g.pos)){c={range:g,pinnedOrTripleSlash:!0};continue}}else if(EJ(i,g.pos,g.end)){c={range:g,pinnedOrTripleSlash:!0};continue}if(c){if(c.pinnedOrTripleSlash)break;const p=e.getLineAndCharacterOfPosition(g.pos).line,y=e.getLineAndCharacterOfPosition(c.range.end).line;if(p>=y+2)break}if(e.statements.length){u===void 0&&(u=e.getLineAndCharacterOfPosition(e.statements[0].getStart()).line);const p=e.getLineAndCharacterOfPosition(g.end).line;if(u(e[e.Exclude=0]="Exclude",e[e.IncludeAll=1]="IncludeAll",e[e.JSDoc=2]="JSDoc",e[e.StartLine=3]="StartLine",e))(ufe||{}),_fe=(e=>(e[e.Exclude=0]="Exclude",e[e.ExcludeWhitespace=1]="ExcludeWhitespace",e[e.Include=2]="Include",e))(_fe||{}),H3={leadingTriviaOption:0,trailingTriviaOption:0},O3e=class ehe{constructor(t,r){this.newLineCharacter=t,this.formatContext=r,this.changes=[],this.classesWithNodesInsertedAtStart=new Map,this.deletedNodes=[]}static fromContext(t){return new ehe(Zh(t.host,t.formatContext.options),t.formatContext)}static with(t,r){const i=ehe.fromContext(t);return r(i),i.getChanges()}pushRaw(t,r){E.assertEqual(t.fileName,r.fileName);for(const i of r.textChanges)this.changes.push({kind:3,sourceFile:t,text:i.newText,range:H9(i.span)})}deleteRange(t,r){this.changes.push({kind:0,sourceFile:t,range:r})}delete(t,r){this.deletedNodes.push({sourceFile:t,node:r})}deleteNode(t,r,i={leadingTriviaOption:1}){this.deleteRange(t,fN(t,r,r,i))}deleteNodes(t,r,i={leadingTriviaOption:1},s){for(const o of r){const c=Qb(t,o,i,s),u=_6(t,o,i);this.deleteRange(t,{pos:c,end:u}),s=!!ofe(t,o,i)}}deleteModifier(t,r){this.deleteRange(t,{pos:r.getStart(t),end:la(t.text,r.end,!0)})}deleteNodeRange(t,r,i,s={leadingTriviaOption:1}){const o=Qb(t,r,s),c=_6(t,i,s);this.deleteRange(t,{pos:o,end:c})}deleteNodeRangeExcludingEnd(t,r,i,s={leadingTriviaOption:1}){const o=Qb(t,r,s),c=i===void 0?t.text.length:Qb(t,i,s);this.deleteRange(t,{pos:o,end:c})}replaceRange(t,r,i,s={}){this.changes.push({kind:1,sourceFile:t,range:r,options:s,node:i})}replaceNode(t,r,i,s=H3){this.replaceRange(t,fN(t,r,r,s),i,s)}replaceNodeRange(t,r,i,s,o=H3){this.replaceRange(t,fN(t,r,i,o),s,o)}replaceRangeWithNodes(t,r,i,s={}){this.changes.push({kind:2,sourceFile:t,range:r,options:s,nodes:i})}replaceNodeWithNodes(t,r,i,s=H3){this.replaceRangeWithNodes(t,fN(t,r,r,s),i,s)}replaceNodeWithText(t,r,i){this.replaceRangeWithText(t,fN(t,r,r,H3),i)}replaceNodeRangeWithNodes(t,r,i,s,o=H3){this.replaceRangeWithNodes(t,fN(t,r,i,o),s,o)}nodeHasTrailingComment(t,r,i=H3){return!!ofe(t,r,i)}nextCommaToken(t,r){const i=i2(r,r.parent,t);return i&&i.kind===28?i:void 0}replacePropertyAssignment(t,r,i){const s=this.nextCommaToken(t,r)?"":","+this.newLineCharacter;this.replaceNode(t,r,i,{suffix:s})}insertNodeAt(t,r,i,s={}){this.replaceRange(t,Lf(r),i,s)}insertNodesAt(t,r,i,s={}){this.replaceRangeWithNodes(t,Lf(r),i,s)}insertNodeAtTopOfFile(t,r,i){this.insertAtTopOfFile(t,r,i)}insertNodesAtTopOfFile(t,r,i){this.insertAtTopOfFile(t,r,i)}insertAtTopOfFile(t,r,i){const s=rYe(t),o={prefix:s===0?void 0:this.newLineCharacter,suffix:(mu(t.text.charCodeAt(s))?"":this.newLineCharacter)+(i?this.newLineCharacter:"")};es(r)?this.insertNodesAt(t,s,r,o):this.insertNodeAt(t,s,r,o)}insertNodesAtEndOfFile(t,r,i){this.insertAtEndOfFile(t,r,i)}insertAtEndOfFile(t,r,i){const s=t.end+1,o={prefix:this.newLineCharacter,suffix:this.newLineCharacter+(i?this.newLineCharacter:"")};this.insertNodesAt(t,s,r,o)}insertStatementsInNewFile(t,r,i){this.newFileChanges||(this.newFileChanges=of()),this.newFileChanges.add(t,{oldFile:i,statements:r})}insertFirstParameter(t,r,i){const s=bl(r);s?this.insertNodeBefore(t,s,i):this.insertNodeAt(t,r.pos,i)}insertNodeBefore(t,r,i,s=!1,o={}){this.insertNodeAt(t,Qb(t,r,o),i,this.getOptionsForInsertNodeBefore(r,i,s))}insertNodesBefore(t,r,i,s=!1,o={}){this.insertNodesAt(t,Qb(t,r,o),i,this.getOptionsForInsertNodeBefore(r,ba(i),s))}insertModifierAt(t,r,i,s={}){this.insertNodeAt(t,r,I.createToken(i),s)}insertModifierBefore(t,r,i){return this.insertModifierAt(t,i.getStart(t),r,{suffix:" "})}insertCommentBeforeLine(t,r,i,s){const o=W0(r,t),c=Soe(t.text,o),u=F3e(t,c),f=k3(t,u?c:i),g=t.text.slice(o,c),p=`${u?"":this.newLineCharacter}//${s}${this.newLineCharacter}${g}`;this.insertText(t,f.getStart(t),p)}insertJsdocCommentBefore(t,r,i){const s=r.getStart(t);if(r.jsDoc)for(const u of r.jsDoc)this.deleteRange(t,{pos:hp(u.getStart(t),t),end:_6(t,u,{})});const o=nL(t.text,s-1),c=t.text.slice(o,s);this.insertNodeAt(t,s,i,{suffix:this.newLineCharacter+c})}createJSDocText(t,r){const i=ta(r.jsDoc,o=>ns(o.comment)?I.createJSDocText(o.comment):o.comment),s=lm(r.jsDoc);return s&&_p(s.pos,s.end,t)&&Ir(i)===0?void 0:I.createNodeArray(cj(i,I.createJSDocText(` +`)))}replaceJSDocComment(t,r,i){this.insertJsdocCommentBefore(t,QQe(r),I.createJSDocComment(this.createJSDocText(t,r),I.createNodeArray(i)))}addJSDocTags(t,r,i){const s=l4(r.jsDoc,c=>c.tags),o=i.filter(c=>!s.some((u,f)=>{const g=YQe(u,c);return g&&(s[f]=g),!!g}));this.replaceJSDocComment(t,r,[...s,...o])}filterJSDocTags(t,r,i){this.replaceJSDocComment(t,r,wn(l4(r.jsDoc,s=>s.tags),i))}replaceRangeWithText(t,r,i){this.changes.push({kind:3,sourceFile:t,range:r,text:i})}insertText(t,r,i){this.replaceRangeWithText(t,Lf(r),i)}tryInsertTypeAnnotation(t,r,i){let s;if(ks(r)){if(s=Ua(r,22,t),!s){if(!go(r))return!1;s=ba(r.parameters)}}else s=(r.kind===260?r.exclamationToken:r.questionToken)??r.name;return this.insertNodeAt(t,s.end,i,{prefix:": "}),!0}tryInsertThisTypeAnnotation(t,r,i){const s=Ua(r,21,t).getStart(t)+1,o=r.parameters.length?", ":"";this.insertNodeAt(t,s,i,{prefix:"this: ",suffix:o})}insertTypeParameters(t,r,i){const s=(Ua(r,21,t)||ba(r.parameters)).getStart(t);this.insertNodesAt(t,s,i,{prefix:"<",suffix:">",joiner:", "})}getOptionsForInsertNodeBefore(t,r,i){return Ci(t)||Pl(t)?{suffix:i?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}:Ei(t)?{suffix:", "}:us(t)?us(r)?{suffix:", "}:{}:ra(t)&&gl(t.parent)||Kg(t)?{suffix:", "}:v_(t)?{suffix:","+(i?this.newLineCharacter:" ")}:E.failBadSyntaxKind(t)}insertNodeAtConstructorStart(t,r,i){const s=bl(r.body.statements);!s||!r.body.multiLine?this.replaceConstructorBody(t,r,[i,...r.body.statements]):this.insertNodeBefore(t,s,i)}insertNodeAtConstructorStartAfterSuperCall(t,r,i){const s=kn(r.body.statements,o=>kl(o)&&ub(o.expression));!s||!r.body.multiLine?this.replaceConstructorBody(t,r,[...r.body.statements,i]):this.insertNodeAfter(t,s,i)}insertNodeAtConstructorEnd(t,r,i){const s=Mo(r.body.statements);!s||!r.body.multiLine?this.replaceConstructorBody(t,r,[...r.body.statements,i]):this.insertNodeAfter(t,s,i)}replaceConstructorBody(t,r,i){this.replaceNode(t,r.body,I.createBlock(i,!0))}insertNodeAtEndOfScope(t,r,i){const s=Qb(t,r.getLastToken(),{});this.insertNodeAt(t,s,i,{prefix:mu(t.text.charCodeAt(r.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter})}insertMemberAtStart(t,r,i){this.insertNodeAtStartWorker(t,r,i)}insertNodeAtObjectStart(t,r,i){this.insertNodeAtStartWorker(t,r,i)}insertNodeAtStartWorker(t,r,i){const s=this.guessIndentationFromExistingMembers(t,r)??this.computeIndentationForNewMember(t,r);this.insertNodeAt(t,KX(r).pos,i,this.getInsertNodeAtStartInsertOptions(t,r,s))}guessIndentationFromExistingMembers(t,r){let i,s=r;for(const o of KX(r)){if(T5(s,o,t))return;const c=o.getStart(t),u=ol.SmartIndenter.findFirstNonWhitespaceColumn(hp(c,t),c,t,this.formatContext.options);if(i===void 0)i=u;else if(u!==i)return;s=o}return i}computeIndentationForNewMember(t,r){const i=r.getStart(t);return ol.SmartIndenter.findFirstNonWhitespaceColumn(hp(i,t),i,t,this.formatContext.options)+(this.formatContext.options.indentSize??4)}getInsertNodeAtStartInsertOptions(t,r,i){const o=KX(r).length===0,c=Rp(this.classesWithNodesInsertedAtStart,Oa(r),{node:r,sourceFile:t}),u=ma(r)&&(!ap(t)||!o),f=ma(r)&&ap(t)&&o&&!c;return{indentation:i,prefix:(f?",":"")+this.newLineCharacter,suffix:u?",":Mu(r)&&o?";":""}}insertNodeAfterComma(t,r,i){const s=this.insertNodeAfterWorker(t,this.nextCommaToken(t,r)||r,i);this.insertNodeAt(t,s,i,this.getInsertNodeAfterOptions(t,r))}insertNodeAfter(t,r,i){const s=this.insertNodeAfterWorker(t,r,i);this.insertNodeAt(t,s,i,this.getInsertNodeAfterOptions(t,r))}insertNodeAtEndOfList(t,r,i){this.insertNodeAt(t,r.end,i,{prefix:", "})}insertNodesAfter(t,r,i){const s=this.insertNodeAfterWorker(t,r,ba(i));this.insertNodesAt(t,s,i,this.getInsertNodeAfterOptions(t,r))}insertNodeAfterWorker(t,r,i){return nYe(r,i)&&t.text.charCodeAt(r.end-1)!==59&&this.replaceRange(t,Lf(r.end),I.createToken(27)),_6(t,r,{})}getInsertNodeAfterOptions(t,r){const i=this.getInsertNodeAfterOptionsWorker(r);return{...i,prefix:r.end===t.end&&Ci(r)?i.prefix?` +${i.prefix}`:` +`:i.prefix}}getInsertNodeAfterOptionsWorker(t){switch(t.kind){case 263:case 267:return{prefix:this.newLineCharacter,suffix:this.newLineCharacter};case 260:case 11:case 80:return{prefix:", "};case 303:return{suffix:","+this.newLineCharacter};case 95:return{prefix:" "};case 169:return{};default:return E.assert(Ci(t)||gI(t)),{suffix:this.newLineCharacter}}}insertName(t,r,i){if(E.assert(!r.name),r.kind===219){const s=Ua(r,39,t),o=Ua(r,21,t);o?(this.insertNodesAt(t,o.getStart(t),[I.createToken(100),I.createIdentifier(i)],{joiner:" "}),ih(this,t,s)):(this.insertText(t,ba(r.parameters).getStart(t),`function ${i}(`),this.replaceRange(t,s,I.createToken(22))),r.body.kind!==241&&(this.insertNodesAt(t,r.body.getStart(t),[I.createToken(19),I.createToken(107)],{joiner:" ",suffix:" "}),this.insertNodesAt(t,r.body.end,[I.createToken(27),I.createToken(20)],{joiner:" "}))}else{const s=Ua(r,r.kind===218?100:86,t).end;this.insertNodeAt(t,s,I.createIdentifier(i),{prefix:" "})}}insertExportModifier(t,r){this.insertText(t,r.getStart(t),"export ")}insertImportSpecifierAtIndex(t,r,i,s){const o=i.elements[s-1];o?this.insertNodeInListAfter(t,o,r):this.insertNodeBefore(t,i.elements[0],r,!_p(i.elements[0].getStart(),i.parent.parent.getStart(),t))}insertNodeInListAfter(t,r,i,s=ol.SmartIndenter.getContainingList(r,t)){if(!s){E.fail("node is not a list element");return}const o=Ek(s,r);if(o<0)return;const c=r.getEnd();if(o!==s.length-1){const u=Ji(t,r.end);if(u&&ZX(r,u)){const f=s[o+1],g=N3e(t.text,f.getFullStart()),p=`${Hs(u.kind)}${t.text.substring(u.end,g)}`;this.insertNodesAt(t,g,[i],{suffix:p})}}else{const u=r.getStart(t),f=hp(u,t);let g,p=!1;if(s.length===1)g=28;else{const y=Kc(r.pos,t);g=ZX(r,y)?y.kind:28,p=hp(s[o-1].getStart(t),t)!==f}if($Qe(t.text,r.end)&&(p=!0),p){this.replaceRange(t,Lf(c),I.createToken(g));const y=ol.SmartIndenter.findFirstNonWhitespaceColumn(f,u,t,this.formatContext.options);let S=la(t.text,c,!0,!1);for(;S!==c&&mu(t.text.charCodeAt(S-1));)S--;this.replaceRange(t,Lf(S),i,{indentation:y,prefix:this.newLineCharacter})}else this.replaceRange(t,Lf(c),i,{prefix:`${Hs(g)} `})}}parenthesizeExpression(t,r){this.replaceRange(t,Gz(r),I.createParenthesizedExpression(r))}finishClassesWithNodesInsertedAtStart(){this.classesWithNodesInsertedAtStart.forEach(({node:t,sourceFile:r})=>{const[i,s]=KQe(t,r);if(i!==void 0&&s!==void 0){const o=KX(t).length===0,c=_p(i,s,r);o&&c&&i!==s-1&&this.deleteRange(r,Lf(i,s-1)),c&&this.insertText(r,s-1,this.newLineCharacter)}})}finishDeleteDeclarations(){const t=new Set;for(const{sourceFile:r,node:i}of this.deletedNodes)this.deletedNodes.some(s=>s.sourceFile===r&&Gae(s.node,i))||(es(i)?this.deleteRange(r,$z(r,i)):ffe.deleteDeclaration(this,t,r,i));t.forEach(r=>{const i=r.getSourceFile(),s=ol.SmartIndenter.getContainingList(r,i);if(r!==Sa(s))return;const o=b7(s,c=>!t.has(c),s.length-2);o!==-1&&this.deleteRange(i,{pos:s[o].end,end:cfe(i,s[o+1])})})}getChanges(t){this.finishDeleteDeclarations(),this.finishClassesWithNodesInsertedAtStart();const r=tQ.getTextChangesFromChanges(this.changes,this.newLineCharacter,this.formatContext,t);return this.newFileChanges&&this.newFileChanges.forEach((i,s)=>{r.push(tQ.newFileChanges(s,i,this.newLineCharacter,this.formatContext))}),r}createNewFile(t,r,i){this.insertStatementsInNewFile(r,i,t)}},(e=>{function t(u,f,g,p){return Ii(p4(u,y=>y.sourceFile.path),y=>{const S=y[0].sourceFile,T=Eh(y,(w,D)=>w.range.pos-D.range.pos||w.range.end-D.range.end);for(let w=0;w`${JSON.stringify(T[w].range)} and ${JSON.stringify(T[w+1].range)}`);const C=Ii(T,w=>{const D=ry(w.range),O=w.kind===1?Or(Zo(w.node))??w.sourceFile:w.kind===2?Or(Zo(w.nodes[0]))??w.sourceFile:w.sourceFile,z=s(w,O,S,f,g,p);if(!(D.length===z.length&&Foe(O.text,z,D.start)))return hA(D,z)});return C.length>0?{fileName:S.fileName,textChanges:C}:void 0})}e.getTextChangesFromChanges=t;function r(u,f,g,p){const y=i(B5(u),f,g,p);return{fileName:u,textChanges:[hA(Jl(0,0),y)],isNewFile:!0}}e.newFileChanges=r;function i(u,f,g,p){const y=ta(f,C=>C.statements.map(w=>w===4?"":c(w,C.oldFile,g).text)).join(g),S=vw("any file name",y,{languageVersion:99,jsDocParsingMode:1},!0,u),T=ol.formatDocument(S,p);return lfe(y,T)+g}e.newFileChangesWorker=i;function s(u,f,g,p,y,S){var T;if(u.kind===0)return"";if(u.kind===3)return u.text;const{options:C={},range:{pos:w}}=u,D=W=>o(W,f,g,w,C,p,y,S),O=u.kind===2?u.nodes.map(W=>sk(D(W),p)).join(((T=u.options)==null?void 0:T.joiner)||p):D(u.node),z=C.indentation!==void 0||hp(w,f)===w?O:O.replace(/^\s+/,"");return(C.prefix||"")+z+(!C.suffix||fc(z,C.suffix)?"":C.suffix)}function o(u,f,g,p,{indentation:y,prefix:S,delta:T},C,w,D){const{node:O,text:z}=c(u,f,C);D&&D(O,z);const W=hL(w,f),X=y!==void 0?y:ol.SmartIndenter.getIndentation(p,g,W,S===C||hp(p,f)===p);T===void 0&&(T=ol.SmartIndenter.shouldIndentChildNode(W,u)&&W.indentSize||0);const J={text:z,getLineAndCharacterOfPosition(B){return qa(this,B)}},ie=ol.formatNodeGivenIndentation(O,J,f.languageVariant,X,T,{...w,options:W});return lfe(z,ie)}function c(u,f,g){const p=I3e(g),y=AA(g);return S1({newLine:y,neverAsciiEscape:!0,preserveSourceNewlines:!0,terminateUnterminatedLiterals:!0},p).writeNode(4,u,f,p),{text:p.getText(),node:eQ(u)}}e.getNonformattedText=c})(tQ||(tQ={})),L3e={...cd,factory:V8(cd.factory.flags|1,cd.factory.baseFactory)},(e=>{function t(o,c,u,f){switch(f.kind){case 169:{const T=f.parent;go(T)&&T.parameters.length===1&&!Ua(T,21,u)?o.replaceNodeWithText(u,f,"()"):pN(o,c,u,f);break}case 272:case 271:const g=u.imports.length&&f===ba(u.imports).parent||f===kn(u.statements,lb);ih(o,u,f,{leadingTriviaOption:g?0:q_(f)?2:3});break;case 208:const p=f.parent;p.kind===207&&f!==Sa(p.elements)?ih(o,u,f):pN(o,c,u,f);break;case 260:s(o,c,u,f);break;case 168:pN(o,c,u,f);break;case 276:const S=f.parent;S.elements.length===1?i(o,u,S):pN(o,c,u,f);break;case 274:i(o,u,f);break;case 27:ih(o,u,f,{trailingTriviaOption:0});break;case 100:ih(o,u,f,{leadingTriviaOption:0});break;case 263:case 262:ih(o,u,f,{leadingTriviaOption:q_(f)?2:3});break;default:f.parent?Em(f.parent)&&f.parent.name===f?r(o,u,f.parent):Rs(f.parent)&&_s(f.parent.arguments,f)?pN(o,c,u,f):ih(o,u,f):ih(o,u,f)}}e.deleteDeclaration=t;function r(o,c,u){if(!u.namedBindings)ih(o,c,u.parent);else{const f=u.name.getStart(c),g=Ji(c,u.name.end);if(g&&g.kind===28){const p=la(c.text,g.end,!1,!0);o.deleteRange(c,{pos:f,end:p})}else ih(o,c,u.name)}}function i(o,c,u){if(u.parent.name){const f=E.checkDefined(Ji(c,u.pos-1));o.deleteRange(c,{pos:f.getStart(c),end:u.end})}else{const f=r1(u,272);ih(o,c,f)}}function s(o,c,u,f){const{parent:g}=f;if(g.kind===299){o.deleteNodeRange(u,Ua(g,21,u),Ua(g,22,u));return}if(g.declarations.length!==1){pN(o,c,u,f);return}const p=g.parent;switch(p.kind){case 250:case 249:o.replaceNode(u,f,I.createObjectLiteralExpression());break;case 248:ih(o,u,g);break;case 243:ih(o,u,p,{leadingTriviaOption:q_(p)?2:3});break;default:E.assertNever(p)}}})(ffe||(ffe={}))}}),Qr={};jl(Qr,{ChangeTracker:()=>O3e,LeadingTriviaOption:()=>ufe,TrailingTriviaOption:()=>_fe,applyChanges:()=>lfe,assignPositionsToNode:()=>eQ,createWriter:()=>I3e,deleteNode:()=>ih,isThisTypeAnnotatable:()=>XQe,isValidLocationToAddComment:()=>F3e});var sYe=Nt({"src/services/_namespaces/ts.textChanges.ts"(){"use strict";iYe()}}),pfe,dfe,aYe=Nt({"src/services/formatting/formattingContext.ts"(){"use strict";zn(),pfe=(e=>(e[e.FormatDocument=0]="FormatDocument",e[e.FormatSelection=1]="FormatSelection",e[e.FormatOnEnter=2]="FormatOnEnter",e[e.FormatOnSemicolon=3]="FormatOnSemicolon",e[e.FormatOnOpeningCurlyBrace=4]="FormatOnOpeningCurlyBrace",e[e.FormatOnClosingCurlyBrace=5]="FormatOnClosingCurlyBrace",e))(pfe||{}),dfe=class{constructor(e,t,r){this.sourceFile=e,this.formattingRequestKind=t,this.options=r}updateContext(e,t,r,i,s){this.currentTokenSpan=E.checkDefined(e),this.currentTokenParent=E.checkDefined(t),this.nextTokenSpan=E.checkDefined(r),this.nextTokenParent=E.checkDefined(i),this.contextNode=E.checkDefined(s),this.contextNodeAllOnSameLine=void 0,this.nextNodeAllOnSameLine=void 0,this.tokensAreOnSameLine=void 0,this.contextNodeBlockIsOnOneLine=void 0,this.nextNodeBlockIsOnOneLine=void 0}ContextNodeAllOnSameLine(){return this.contextNodeAllOnSameLine===void 0&&(this.contextNodeAllOnSameLine=this.NodeIsOnOneLine(this.contextNode)),this.contextNodeAllOnSameLine}NextNodeAllOnSameLine(){return this.nextNodeAllOnSameLine===void 0&&(this.nextNodeAllOnSameLine=this.NodeIsOnOneLine(this.nextTokenParent)),this.nextNodeAllOnSameLine}TokensAreOnSameLine(){if(this.tokensAreOnSameLine===void 0){const e=this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line,t=this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;this.tokensAreOnSameLine=e===t}return this.tokensAreOnSameLine}ContextNodeBlockIsOnOneLine(){return this.contextNodeBlockIsOnOneLine===void 0&&(this.contextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.contextNode)),this.contextNodeBlockIsOnOneLine}NextNodeBlockIsOnOneLine(){return this.nextNodeBlockIsOnOneLine===void 0&&(this.nextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.nextTokenParent)),this.nextNodeBlockIsOnOneLine}NodeIsOnOneLine(e){const t=this.sourceFile.getLineAndCharacterOfPosition(e.getStart(this.sourceFile)).line,r=this.sourceFile.getLineAndCharacterOfPosition(e.getEnd()).line;return t===r}BlockIsOnOneLine(e){const t=Ua(e,19,this.sourceFile),r=Ua(e,20,this.sourceFile);if(t&&r){const i=this.sourceFile.getLineAndCharacterOfPosition(t.getEnd()).line,s=this.sourceFile.getLineAndCharacterOfPosition(r.getStart(this.sourceFile)).line;return i===s}return!1}}}});function mfe(e,t,r,i,s){const o=t===1?R3e:M3e;o.setText(e),o.resetTokenState(r);let c=!0,u,f,g,p,y;const S=s({advance:T,readTokenInfo:J,readEOFTokenRange:B,isOnToken:Y,isOnEOF:ae,getCurrentLeadingTrivia:()=>u,lastTrailingTriviaWasNewLine:()=>c,skipToEndOf:$,skipToStartOf:H,getTokenFullStart:()=>y?.token.pos??o.getTokenStart(),getStartPos:()=>y?.token.pos??o.getTokenStart()});return y=void 0,o.setText(void 0),S;function T(){y=void 0,o.getTokenFullStart()!==r?c=!!f&&Sa(f).kind===4:o.scan(),u=void 0,f=void 0;let oe=o.getTokenFullStart();for(;oe(e[e.None=0]="None",e[e.StopProcessingSpaceActions=1]="StopProcessingSpaceActions",e[e.StopProcessingTokenActions=2]="StopProcessingTokenActions",e[e.InsertSpace=4]="InsertSpace",e[e.InsertNewLine=8]="InsertNewLine",e[e.DeleteSpace=16]="DeleteSpace",e[e.DeleteToken=32]="DeleteToken",e[e.InsertTrailingSemicolon=64]="InsertTrailingSemicolon",e[e.StopAction=3]="StopAction",e[e.ModifySpaceAction=28]="ModifySpaceAction",e[e.ModifyTokenAction=96]="ModifyTokenAction",e))(gfe||{}),hfe=(e=>(e[e.None=0]="None",e[e.CanDeleteNewLines=1]="CanDeleteNewLines",e))(hfe||{})}});function j3e(){const e=[];for(let ie=0;ie<=165;ie++)ie!==1&&e.push(ie);function t(...ie){return{tokens:e.filter(B=>!ie.some(Y=>Y===B)),isSpecific:!1}}const r={tokens:e,isSpecific:!1},i=G3([...e,3]),s=G3([...e,1]),o=J3e(83,165),c=J3e(30,79),u=[103,104,165,130,142,152],f=[46,47,55,54],g=[9,10,80,21,23,19,110,105],p=[80,21,110,105],y=[80,22,24,105],S=[80,21,110,105],T=[80,22,24,105],C=[2,3],w=[80,...vL],D=i,O=G3([80,3,86,95,102]),z=G3([22,3,92,113,98,93]),W=[An("IgnoreBeforeComment",r,C,bM,1),An("IgnoreAfterLineComment",2,r,bM,1),An("NotSpaceBeforeColon",r,59,[xi,SM,U3e],16),An("SpaceAfterColon",59,r,[xi,SM,CYe],4),An("NoSpaceBeforeQuestionMark",r,58,[xi,SM,U3e],16),An("SpaceAfterQuestionMarkInConditionalOperator",58,r,[xi,fYe],4),An("NoSpaceAfterQuestionMark",58,r,[xi,_Ye],16),An("NoSpaceBeforeDot",r,[25,29],[xi,jYe],16),An("NoSpaceAfterDot",[25,29],r,[xi],16),An("NoSpaceBetweenImportParenInImportType",102,21,[xi,xYe],16),An("NoSpaceAfterUnaryPrefixOperator",f,g,[xi,SM],16),An("NoSpaceAfterUnaryPreincrementOperator",46,p,[xi],16),An("NoSpaceAfterUnaryPredecrementOperator",47,S,[xi],16),An("NoSpaceBeforeUnaryPostincrementOperator",y,46,[xi,sDe],16),An("NoSpaceBeforeUnaryPostdecrementOperator",T,47,[xi,sDe],16),An("SpaceAfterPostincrementWhenFollowedByAdd",46,40,[xi,sy],4),An("SpaceAfterAddWhenFollowedByUnaryPlus",40,40,[xi,sy],4),An("SpaceAfterAddWhenFollowedByPreincrement",40,46,[xi,sy],4),An("SpaceAfterPostdecrementWhenFollowedBySubtract",47,41,[xi,sy],4),An("SpaceAfterSubtractWhenFollowedByUnaryMinus",41,41,[xi,sy],4),An("SpaceAfterSubtractWhenFollowedByPredecrement",41,47,[xi,sy],4),An("NoSpaceAfterCloseBrace",20,[28,27],[xi],16),An("NewLineBeforeCloseBraceInBlockContext",i,20,[q3e],8),An("SpaceAfterCloseBrace",20,t(22),[xi,mYe],4),An("SpaceBetweenCloseBraceAndElse",20,93,[xi],4),An("SpaceBetweenCloseBraceAndWhile",20,117,[xi],4),An("NoSpaceBetweenEmptyBraceBrackets",19,20,[xi,Y3e],16),An("SpaceAfterConditionalClosingParen",22,23,[TM],4),An("NoSpaceBetweenFunctionKeywordAndStar",100,42,[$3e],16),An("SpaceAfterStarInGeneratorDeclaration",42,80,[$3e],4),An("SpaceAfterFunctionInFuncDecl",100,r,[Yb],4),An("NewLineAfterOpenBraceInBlockContext",19,r,[q3e],8),An("SpaceAfterGetSetInMember",[139,153],80,[Yb],4),An("NoSpaceBetweenYieldKeywordAndStar",127,42,[xi,iDe],16),An("SpaceBetweenYieldOrYieldStarAndOperand",[127,42],r,[xi,iDe],4),An("NoSpaceBetweenReturnAndSemicolon",107,27,[xi],16),An("SpaceAfterCertainKeywords",[115,111,105,91,107,114,135],r,[xi],4),An("SpaceAfterLetConstInVariableDeclaration",[121,87],r,[xi,PYe],4),An("NoSpaceBeforeOpenParenInFuncCall",r,21,[xi,yYe,vYe],16),An("SpaceBeforeBinaryKeywordOperator",r,u,[xi,sy],4),An("SpaceAfterBinaryKeywordOperator",u,r,[xi,sy],4),An("SpaceAfterVoidOperator",116,r,[xi,FYe],4),An("SpaceBetweenAsyncAndOpenParen",134,21,[TYe,xi],4),An("SpaceBetweenAsyncAndFunctionKeyword",134,[100,80],[xi],4),An("NoSpaceBetweenTagAndTemplateString",[80,22],[15,16],[xi],16),An("SpaceBeforeJsxAttribute",r,80,[kYe,xi],4),An("SpaceBeforeSlashInJsxOpeningElement",r,44,[tDe,xi],4),An("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement",44,32,[tDe,xi],16),An("NoSpaceBeforeEqualInJsxAttribute",r,64,[K3e,xi],16),An("NoSpaceAfterEqualInJsxAttribute",64,r,[K3e,xi],16),An("NoSpaceBeforeJsxNamespaceColon",80,59,[eDe],16),An("NoSpaceAfterJsxNamespaceColon",59,80,[eDe],16),An("NoSpaceAfterModuleImport",[144,149],21,[xi],16),An("SpaceAfterCertainTypeScriptKeywords",[128,129,86,138,90,94,95,96,139,119,102,120,144,145,123,125,124,148,153,126,156,161,143,140],r,[xi],4),An("SpaceBeforeCertainTypeScriptKeywords",r,[96,119,161],[xi],4),An("SpaceAfterModuleName",11,19,[wYe],4),An("SpaceBeforeArrow",r,39,[xi],4),An("SpaceAfterArrow",39,r,[xi],4),An("NoSpaceAfterEllipsis",26,80,[xi],16),An("NoSpaceAfterOptionalParameters",58,[22,28],[xi,SM],16),An("NoSpaceBetweenEmptyInterfaceBraceBrackets",19,20,[xi,AYe],16),An("NoSpaceBeforeOpenAngularBracket",w,30,[xi,xM],16),An("NoSpaceBetweenCloseParenAndAngularBracket",22,30,[xi,xM],16),An("NoSpaceAfterOpenAngularBracket",30,r,[xi,xM],16),An("NoSpaceBeforeCloseAngularBracket",r,32,[xi,xM],16),An("NoSpaceAfterCloseAngularBracket",32,[21,23,32,28],[xi,xM,dYe,IYe],16),An("SpaceBeforeAt",[22,80],60,[xi],4),An("NoSpaceAfterAt",60,r,[xi],16),An("SpaceAfterDecorator",r,[128,80,95,90,86,126,125,123,124,139,153,23,42],[DYe],4),An("NoSpaceBeforeNonNullAssertionOperator",r,54,[xi,OYe],16),An("NoSpaceAfterNewKeywordOnConstructorSignature",105,21,[xi,NYe],16),An("SpaceLessThanAndNonJSXTypeAnnotation",30,30,[xi],4)],X=[An("SpaceAfterConstructor",137,21,[Sf("insertSpaceAfterConstructor"),xi],4),An("NoSpaceAfterConstructor",137,21,[zd("insertSpaceAfterConstructor"),xi],16),An("SpaceAfterComma",28,r,[Sf("insertSpaceAfterCommaDelimiter"),xi,kfe,bYe,SYe],4),An("NoSpaceAfterComma",28,r,[zd("insertSpaceAfterCommaDelimiter"),xi,kfe],16),An("SpaceAfterAnonymousFunctionKeyword",[100,42],21,[Sf("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),Yb],4),An("NoSpaceAfterAnonymousFunctionKeyword",[100,42],21,[zd("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),Yb],16),An("SpaceAfterKeywordInControl",o,21,[Sf("insertSpaceAfterKeywordsInControlFlowStatements"),TM],4),An("NoSpaceAfterKeywordInControl",o,21,[zd("insertSpaceAfterKeywordsInControlFlowStatements"),TM],16),An("SpaceAfterOpenParen",21,r,[Sf("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),xi],4),An("SpaceBeforeCloseParen",r,22,[Sf("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),xi],4),An("SpaceBetweenOpenParens",21,21,[Sf("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),xi],4),An("NoSpaceBetweenParens",21,22,[xi],16),An("NoSpaceAfterOpenParen",21,r,[zd("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),xi],16),An("NoSpaceBeforeCloseParen",r,22,[zd("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),xi],16),An("SpaceAfterOpenBracket",23,r,[Sf("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),xi],4),An("SpaceBeforeCloseBracket",r,24,[Sf("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),xi],4),An("NoSpaceBetweenBrackets",23,24,[xi],16),An("NoSpaceAfterOpenBracket",23,r,[zd("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),xi],16),An("NoSpaceBeforeCloseBracket",r,24,[zd("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),xi],16),An("SpaceAfterOpenBrace",19,r,[W3e("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),V3e],4),An("SpaceBeforeCloseBrace",r,20,[W3e("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),V3e],4),An("NoSpaceBetweenEmptyBraceBrackets",19,20,[xi,Y3e],16),An("NoSpaceAfterOpenBrace",19,r,[yfe("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),xi],16),An("NoSpaceBeforeCloseBrace",r,20,[yfe("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),xi],16),An("SpaceBetweenEmptyBraceBrackets",19,20,[Sf("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")],4),An("NoSpaceBetweenEmptyBraceBrackets",19,20,[yfe("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"),xi],16),An("SpaceAfterTemplateHeadAndMiddle",[16,17],r,[Sf("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),Z3e],4,1),An("SpaceBeforeTemplateMiddleAndTail",r,[17,18],[Sf("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),xi],4),An("NoSpaceAfterTemplateHeadAndMiddle",[16,17],r,[zd("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),Z3e],16,1),An("NoSpaceBeforeTemplateMiddleAndTail",r,[17,18],[zd("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),xi],16),An("SpaceAfterOpenBraceInJsxExpression",19,r,[Sf("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),xi,nQ],4),An("SpaceBeforeCloseBraceInJsxExpression",r,20,[Sf("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),xi,nQ],4),An("NoSpaceAfterOpenBraceInJsxExpression",19,r,[zd("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),xi,nQ],16),An("NoSpaceBeforeCloseBraceInJsxExpression",r,20,[zd("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),xi,nQ],16),An("SpaceAfterSemicolonInFor",27,r,[Sf("insertSpaceAfterSemicolonInForStatements"),xi,bfe],4),An("NoSpaceAfterSemicolonInFor",27,r,[zd("insertSpaceAfterSemicolonInForStatements"),xi,bfe],16),An("SpaceBeforeBinaryOperator",r,c,[Sf("insertSpaceBeforeAndAfterBinaryOperators"),xi,sy],4),An("SpaceAfterBinaryOperator",c,r,[Sf("insertSpaceBeforeAndAfterBinaryOperators"),xi,sy],4),An("NoSpaceBeforeBinaryOperator",r,c,[zd("insertSpaceBeforeAndAfterBinaryOperators"),xi,sy],16),An("NoSpaceAfterBinaryOperator",c,r,[zd("insertSpaceBeforeAndAfterBinaryOperators"),xi,sy],16),An("SpaceBeforeOpenParenInFuncDecl",r,21,[Sf("insertSpaceBeforeFunctionParenthesis"),xi,Yb],4),An("NoSpaceBeforeOpenParenInFuncDecl",r,21,[zd("insertSpaceBeforeFunctionParenthesis"),xi,Yb],16),An("NewLineBeforeOpenBraceInControl",z,19,[Sf("placeOpenBraceOnNewLineForControlBlocks"),TM,xfe],8,1),An("NewLineBeforeOpenBraceInFunction",D,19,[Sf("placeOpenBraceOnNewLineForFunctions"),Yb,xfe],8,1),An("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock",O,19,[Sf("placeOpenBraceOnNewLineForFunctions"),X3e,xfe],8,1),An("SpaceAfterTypeAssertion",32,r,[Sf("insertSpaceAfterTypeAssertion"),xi,Efe],4),An("NoSpaceAfterTypeAssertion",32,r,[zd("insertSpaceAfterTypeAssertion"),xi,Efe],16),An("SpaceBeforeTypeAnnotation",r,[58,59],[Sf("insertSpaceBeforeTypeAnnotation"),xi,Sfe],4),An("NoSpaceBeforeTypeAnnotation",r,[58,59],[zd("insertSpaceBeforeTypeAnnotation"),xi,Sfe],16),An("NoOptionalSemicolon",27,s,[z3e("semicolons","remove"),MYe],32),An("OptionalSemicolon",r,s,[z3e("semicolons","insert"),RYe],64)],J=[An("NoSpaceBeforeSemicolon",r,27,[xi],16),An("SpaceBeforeOpenBraceInControl",z,19,[vfe("placeOpenBraceOnNewLineForControlBlocks"),TM,Cfe,Tfe],4,1),An("SpaceBeforeOpenBraceInFunction",D,19,[vfe("placeOpenBraceOnNewLineForFunctions"),Yb,rQ,Cfe,Tfe],4,1),An("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock",O,19,[vfe("placeOpenBraceOnNewLineForFunctions"),X3e,Cfe,Tfe],4,1),An("NoSpaceBeforeComma",r,28,[xi],16),An("NoSpaceBeforeOpenBracket",t(134,84),23,[xi],16),An("NoSpaceAfterCloseBracket",24,r,[xi,EYe],16),An("SpaceAfterSemicolon",27,r,[xi],4),An("SpaceBetweenForAndAwaitKeyword",99,135,[xi],4),An("SpaceBetweenStatements",[22,92,93,84],r,[xi,kfe,lYe],4),An("SpaceAfterTryCatchFinally",[113,85,98],19,[xi],4)];return[...W,...X,...J]}function An(e,t,r,i,s,o=0){return{leftTokenRange:B3e(t),rightTokenRange:B3e(r),rule:{debugName:e,context:i,action:s,flags:o}}}function G3(e){return{tokens:e,isSpecific:!0}}function B3e(e){return typeof e=="number"?G3([e]):es(e)?G3(e):e}function J3e(e,t,r=[]){const i=[];for(let s=e;s<=t;s++)_s(r,s)||i.push(s);return G3(i)}function z3e(e,t){return r=>r.options&&r.options[e]===t}function Sf(e){return t=>t.options&&Ya(t.options,e)&&!!t.options[e]}function yfe(e){return t=>t.options&&Ya(t.options,e)&&!t.options[e]}function zd(e){return t=>!t.options||!Ya(t.options,e)||!t.options[e]}function vfe(e){return t=>!t.options||!Ya(t.options,e)||!t.options[e]||t.TokensAreOnSameLine()}function W3e(e){return t=>!t.options||!Ya(t.options,e)||!!t.options[e]}function bfe(e){return e.contextNode.kind===248}function lYe(e){return!bfe(e)}function sy(e){switch(e.contextNode.kind){case 226:return e.contextNode.operatorToken.kind!==28;case 227:case 194:case 234:case 281:case 276:case 182:case 192:case 193:case 238:return!0;case 208:case 265:case 271:case 277:case 260:case 169:case 306:case 172:case 171:return e.currentTokenSpan.kind===64||e.nextTokenSpan.kind===64;case 249:case 168:return e.currentTokenSpan.kind===103||e.nextTokenSpan.kind===103||e.currentTokenSpan.kind===64||e.nextTokenSpan.kind===64;case 250:return e.currentTokenSpan.kind===165||e.nextTokenSpan.kind===165}return!1}function SM(e){return!sy(e)}function U3e(e){return!Sfe(e)}function Sfe(e){const t=e.contextNode.kind;return t===172||t===171||t===169||t===260||nT(t)}function uYe(e){return Es(e.contextNode)&&e.contextNode.questionToken}function _Ye(e){return!uYe(e)}function fYe(e){return e.contextNode.kind===227||e.contextNode.kind===194}function Tfe(e){return e.TokensAreOnSameLine()||rQ(e)}function V3e(e){return e.contextNode.kind===206||e.contextNode.kind===200||pYe(e)}function xfe(e){return rQ(e)&&!(e.NextNodeAllOnSameLine()||e.NextNodeBlockIsOnOneLine())}function q3e(e){return H3e(e)&&!(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function pYe(e){return H3e(e)&&(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function H3e(e){return G3e(e.contextNode)}function rQ(e){return G3e(e.nextTokenParent)}function G3e(e){if(Q3e(e))return!0;switch(e.kind){case 241:case 269:case 210:case 268:return!0}return!1}function Yb(e){switch(e.contextNode.kind){case 262:case 174:case 173:case 177:case 178:case 179:case 218:case 176:case 219:case 264:return!0}return!1}function dYe(e){return!Yb(e)}function $3e(e){return e.contextNode.kind===262||e.contextNode.kind===218}function X3e(e){return Q3e(e.contextNode)}function Q3e(e){switch(e.kind){case 263:case 231:case 264:case 266:case 187:case 267:case 278:case 279:case 272:case 275:return!0}return!1}function mYe(e){switch(e.currentTokenParent.kind){case 263:case 267:case 266:case 299:case 268:case 255:return!0;case 241:{const t=e.currentTokenParent.parent;if(!t||t.kind!==219&&t.kind!==218)return!0}}return!1}function TM(e){switch(e.contextNode.kind){case 245:case 255:case 248:case 249:case 250:case 247:case 258:case 246:case 254:case 299:return!0;default:return!1}}function Y3e(e){return e.contextNode.kind===210}function gYe(e){return e.contextNode.kind===213}function hYe(e){return e.contextNode.kind===214}function yYe(e){return gYe(e)||hYe(e)}function vYe(e){return e.currentTokenSpan.kind!==28}function bYe(e){return e.nextTokenSpan.kind!==24}function SYe(e){return e.nextTokenSpan.kind!==22}function TYe(e){return e.contextNode.kind===219}function xYe(e){return e.contextNode.kind===205}function xi(e){return e.TokensAreOnSameLine()&&e.contextNode.kind!==12}function Z3e(e){return e.contextNode.kind!==12}function kfe(e){return e.contextNode.kind!==284&&e.contextNode.kind!==288}function nQ(e){return e.contextNode.kind===294||e.contextNode.kind===293}function kYe(e){return e.nextTokenParent.kind===291||e.nextTokenParent.kind===295&&e.nextTokenParent.parent.kind===291}function K3e(e){return e.contextNode.kind===291}function CYe(e){return e.nextTokenParent.kind!==295}function eDe(e){return e.nextTokenParent.kind===295}function tDe(e){return e.contextNode.kind===285}function EYe(e){return!Yb(e)&&!rQ(e)}function DYe(e){return e.TokensAreOnSameLine()&&Of(e.contextNode)&&rDe(e.currentTokenParent)&&!rDe(e.nextTokenParent)}function rDe(e){for(;e&&ct(e);)e=e.parent;return e&&e.kind===170}function PYe(e){return e.currentTokenParent.kind===261&&e.currentTokenParent.getStart(e.sourceFile)===e.currentTokenSpan.pos}function Cfe(e){return e.formattingRequestKind!==2}function wYe(e){return e.contextNode.kind===267}function AYe(e){return e.contextNode.kind===187}function NYe(e){return e.contextNode.kind===180}function nDe(e,t){if(e.kind!==30&&e.kind!==32)return!1;switch(t.kind){case 183:case 216:case 265:case 263:case 231:case 264:case 262:case 218:case 219:case 174:case 173:case 179:case 180:case 213:case 214:case 233:return!0;default:return!1}}function xM(e){return nDe(e.currentTokenSpan,e.currentTokenParent)||nDe(e.nextTokenSpan,e.nextTokenParent)}function Efe(e){return e.contextNode.kind===216}function IYe(e){return!Efe(e)}function FYe(e){return e.currentTokenSpan.kind===116&&e.currentTokenParent.kind===222}function iDe(e){return e.contextNode.kind===229&&e.contextNode.expression!==void 0}function OYe(e){return e.contextNode.kind===235}function sDe(e){return!LYe(e)}function LYe(e){switch(e.contextNode.kind){case 245:case 248:case 249:case 250:case 246:case 247:return!0;default:return!1}}function MYe(e){let t=e.nextTokenSpan.kind,r=e.nextTokenSpan.pos;if(Uk(t)){const o=e.nextTokenParent===e.currentTokenParent?i2(e.currentTokenParent,Ar(e.currentTokenParent,c=>!c.parent),e.sourceFile):e.nextTokenParent.getFirstToken(e.sourceFile);if(!o)return!0;t=o.kind,r=o.getStart(e.sourceFile)}const i=e.sourceFile.getLineAndCharacterOfPosition(e.currentTokenSpan.pos).line,s=e.sourceFile.getLineAndCharacterOfPosition(r).line;return i===s?t===20||t===1:t===240||t===27?!1:e.contextNode.kind===264||e.contextNode.kind===265?!ff(e.currentTokenParent)||!!e.currentTokenParent.type||t!==21:Es(e.currentTokenParent)?!e.currentTokenParent.initializer:e.currentTokenParent.kind!==248&&e.currentTokenParent.kind!==242&&e.currentTokenParent.kind!==240&&t!==23&&t!==21&&t!==40&&t!==41&&t!==44&&t!==14&&t!==28&&t!==228&&t!==16&&t!==15&&t!==25}function RYe(e){return cL(e.currentTokenSpan.end,e.currentTokenParent,e.sourceFile)}function jYe(e){return!bn(e.contextNode)||!A_(e.contextNode.expression)||e.contextNode.expression.getText().includes(".")}var BYe=Nt({"src/services/formatting/rules.ts"(){"use strict";zn(),gN()}});function JYe(e,t){return{options:e,getRules:zYe(),host:t}}function zYe(){return Dfe===void 0&&(Dfe=UYe(j3e())),Dfe}function WYe(e){let t=0;return e&1&&(t|=28),e&2&&(t|=96),e&28&&(t|=28),e&96&&(t|=96),t}function UYe(e){const t=VYe(e);return r=>{const i=t[aDe(r.currentTokenSpan.kind,r.nextTokenSpan.kind)];if(i){const s=[];let o=0;for(const c of i){const u=~WYe(o);c.action&u&&qi(c.context,f=>f(r))&&(s.push(c),o|=c.action)}if(s.length)return s}}}function VYe(e){const t=new Array(iQ*iQ),r=new Array(t.length);for(const i of e){const s=i.leftTokenRange.isSpecific&&i.rightTokenRange.isSpecific;for(const o of i.leftTokenRange.tokens)for(const c of i.rightTokenRange.tokens){const u=aDe(o,c);let f=t[u];f===void 0&&(f=t[u]=[]),qYe(f,i.rule,s,r,u)}}return t}function aDe(e,t){return E.assert(e<=165&&t<=165,"Must compute formatting context from tokens"),e*iQ+t}function qYe(e,t,r,i,s){const o=t.action&3?r?0:$3.StopRulesAny:t.context!==bM?r?$3.ContextRulesSpecific:$3.ContextRulesAny:r?$3.NoContextRulesSpecific:$3.NoContextRulesAny,c=i[s]||0;e.splice(HYe(c,o),0,t),i[s]=GYe(c,o)}function HYe(e,t){let r=0;for(let i=0;i<=t;i+=f6)r+=e&kM,e>>=f6;return r}function GYe(e,t){const r=(e>>t&kM)+1;return E.assert((r&kM)===r,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."),e&~(kM<(e[e.StopRulesSpecific=0]="StopRulesSpecific",e[e.StopRulesAny=f6*1]="StopRulesAny",e[e.ContextRulesSpecific=f6*2]="ContextRulesSpecific",e[e.ContextRulesAny=f6*3]="ContextRulesAny",e[e.NoContextRulesSpecific=f6*4]="NoContextRulesSpecific",e[e.NoContextRulesAny=f6*5]="NoContextRulesAny",e))($3||{})}});function sQ(e,t,r){const i={pos:e,end:t,kind:r};return E.isDebugging&&Object.defineProperty(i,"__debugKind",{get:()=>E.formatSyntaxKind(r)}),i}function XYe(e,t,r){const i=t.getLineAndCharacterOfPosition(e).line;if(i===0)return[];let s=OP(i,t);for(;Cd(t.text.charCodeAt(s));)s--;mu(t.text.charCodeAt(s))&&s--;const o={pos:W0(i-1,t),end:s+1};return CM(o,t,r,2)}function QYe(e,t,r){const i=Pfe(e,27,t);return oDe(wfe(i),t,r,3)}function YYe(e,t,r){const i=Pfe(e,19,t);if(!i)return[];const s=i.parent,o=wfe(s),c={pos:hp(o.getStart(t),t),end:e};return CM(c,t,r,4)}function ZYe(e,t,r){const i=Pfe(e,20,t);return oDe(wfe(i),t,r,5)}function KYe(e,t){const r={pos:0,end:e.text.length};return CM(r,e,t,0)}function eZe(e,t,r,i){const s={pos:hp(e,r),end:t};return CM(s,r,i,1)}function Pfe(e,t,r){const i=Kc(e,r);return i&&i.kind===t&&e===i.getEnd()?i:void 0}function wfe(e){let t=e;for(;t&&t.parent&&t.parent.end===e.end&&!tZe(t.parent,t);)t=t.parent;return t}function tZe(e,t){switch(e.kind){case 263:case 264:return yf(e.members,t);case 267:const r=e.body;return!!r&&r.kind===268&&yf(r.statements,t);case 312:case 241:case 268:return yf(e.statements,t);case 299:return yf(e.block.statements,t)}return!1}function rZe(e,t){return r(t);function r(i){const s=ds(i,o=>sH(o.getStart(t),o.end,e)&&o);if(s){const o=r(s);if(o)return o}return i}}function nZe(e,t){if(!e.length)return s;const r=e.filter(o=>x3(t,o.start,o.start+o.length)).sort((o,c)=>o.start-c.start);if(!r.length)return s;let i=0;return o=>{for(;;){if(i>=r.length)return!1;const c=r[i];if(o.end<=c.start)return!1;if(R9(o.pos,o.end,c.start,c.start+c.length))return!0;i++}};function s(){return!1}}function iZe(e,t,r){const i=e.getStart(r);if(i===t.pos&&e.end===t.end)return i;const s=Kc(t.pos,r);return!s||s.end>=t.pos?e.pos:s.end}function sZe(e,t,r){let i=-1,s;for(;e;){const o=r.getLineAndCharacterOfPosition(e.getStart(r)).line;if(i!==-1&&o!==i)break;if(Wd.shouldIndentChildNode(t,e,s,r))return t.indentSize;i=o,s=e,e=e.parent}return 0}function aZe(e,t,r,i,s,o){const c={pos:e.pos,end:e.end};return mfe(t.text,r,c.pos,c.end,u=>cDe(c,e,i,s,u,o,1,f=>!1,t))}function oDe(e,t,r,i){if(!e)return[];const s={pos:hp(e.getStart(t),t),end:e.end};return CM(s,t,r,i)}function CM(e,t,r,i){const s=rZe(e,t);return mfe(t.text,t.languageVariant,iZe(s,e,t),e.end,o=>cDe(e,s,Wd.getIndentationForNode(s,e,t,r.options),sZe(s,r.options,t),o,r,i,nZe(t.parseDiagnostics,e),t))}function cDe(e,t,r,i,s,{options:o,getRules:c,host:u},f,g,p){var y;const S=new dfe(p,f,o);let T,C,w,D,O,z=-1;const W=[];if(s.advance(),s.isOnToken()){const me=p.getLineAndCharacterOfPosition(t.getStart(p)).line;let Oe=me;Of(t)&&(Oe=p.getLineAndCharacterOfPosition(DJ(t,p)).line),ae(t,t,me,Oe,r,i)}const X=s.getCurrentLeadingTrivia();if(X){const me=Wd.nodeWillIndentChild(o,t,void 0,p,!1)?r+o.indentSize:r;_e(X,me,!0,Oe=>{H(Oe,p.getLineAndCharacterOfPosition(Oe.pos),t,t,void 0),oe(Oe.pos,me,!1)}),o.trimTrailingWhitespace!==!1&&Me(X)}if(C&&s.getTokenFullStart()>=e.end){const me=s.isOnEOF()?s.readEOFTokenRange():s.isOnToken()?s.readTokenInfo(t).token:void 0;if(me&&me.pos===T){const Oe=((y=Kc(me.end,p,t))==null?void 0:y.parent)||w;K(me,p.getLineAndCharacterOfPosition(me.pos).line,Oe,C,D,w,Oe,void 0)}}return W;function J(me,Oe,Xe,it,mt){if(x3(it,me,Oe)||pA(it,me,Oe)){if(mt!==-1)return mt}else{const Je=p.getLineAndCharacterOfPosition(me).line,ot=hp(me,p),Bt=Wd.findFirstNonWhitespaceColumn(ot,me,p,o);if(Je!==Xe||me===Bt){const Ht=Wd.getBaseIndentation(o);return Ht>Bt?Ht:Bt}}return-1}function ie(me,Oe,Xe,it,mt,Je){const ot=Wd.shouldIndentChildNode(o,me)?o.indentSize:0;return Je===Oe?{indentation:Oe===O?z:mt.getIndentation(),delta:Math.min(o.indentSize,mt.getDelta(me)+ot)}:Xe===-1?me.kind===21&&Oe===O?{indentation:z,delta:mt.getDelta(me)}:Wd.childStartsOnTheSameLineWithElseInIfStatement(it,me,Oe,p)||Wd.childIsUnindentedBranchOfConditionalExpression(it,me,Oe,p)||Wd.argumentStartsOnSameLineAsPreviousArgument(it,me,Oe,p)?{indentation:mt.getIndentation(),delta:ot}:{indentation:mt.getIndentation()+mt.getDelta(me),delta:ot}:{indentation:Xe,delta:ot}}function B(me){if(Wp(me)){const Oe=kn(me.modifiers,Ys,Dc(me.modifiers,ql));if(Oe)return Oe.kind}switch(me.kind){case 263:return 86;case 264:return 120;case 262:return 100;case 266:return 266;case 177:return 139;case 178:return 153;case 174:if(me.asteriskToken)return 42;case 172:case 169:const Oe=as(me);if(Oe)return Oe.kind}}function Y(me,Oe,Xe,it){return{getIndentationForComment:(ot,Bt,Ht)=>{switch(ot){case 20:case 24:case 22:return Xe+Je(Ht)}return Bt!==-1?Bt:Xe},getIndentationForToken:(ot,Bt,Ht,br)=>!br&&mt(ot,Bt,Ht)?Xe+Je(Ht):Xe,getIndentation:()=>Xe,getDelta:Je,recomputeIndentation:(ot,Bt)=>{Wd.shouldIndentChildNode(o,Bt,me,p)&&(Xe+=ot?o.indentSize:-o.indentSize,it=Wd.shouldIndentChildNode(o,me)?o.indentSize:0)}};function mt(ot,Bt,Ht){switch(Bt){case 19:case 20:case 22:case 93:case 117:case 60:return!1;case 44:case 32:switch(Ht.kind){case 286:case 287:case 285:return!1}break;case 23:case 24:if(Ht.kind!==200)return!1;break}return Oe!==ot&&!(Of(me)&&Bt===B(me))}function Je(ot){return Wd.nodeWillIndentChild(o,me,ot,p,!0)?it:0}}function ae(me,Oe,Xe,it,mt,Je){if(!x3(e,me.getStart(p),me.getEnd()))return;const ot=Y(me,Xe,mt,Je);let Bt=Oe;for(ds(me,ar=>{Ht(ar,-1,me,ot,Xe,it,!1)},ar=>{br(ar,me,Xe,ot)});s.isOnToken()&&s.getTokenFullStart()Math.min(me.end,e.end))break;zr(ar,me,ot,me)}function Ht(ar,Jt,It,Nn,Fi,ei,zi,Qe){if(E.assert(!Po(ar)),sc(ar)||Eee(It,ar))return Jt;const ur=ar.getStart(p),Dr=p.getLineAndCharacterOfPosition(ur).line;let Ft=Dr;Of(ar)&&(Ft=p.getLineAndCharacterOfPosition(DJ(ar,p)).line);let yr=-1;if(zi&&yf(e,It)&&(yr=J(ur,ar.end,Fi,e,Jt),yr!==-1&&(Jt=yr)),!x3(e,ar.pos,ar.end))return ar.ende.end)return Jt;if(Pi.token.end>ur){Pi.token.pos>ur&&s.skipToStartOf(ar);break}zr(Pi,me,Nn,me)}if(!s.isOnToken()||s.getTokenFullStart()>=e.end)return Jt;if(tT(ar)){const Pi=s.readTokenInfo(ar);if(ar.kind!==12)return E.assert(Pi.token.end===ar.end,"Token end is child end"),zr(Pi,me,Nn,ar),Jt}const Tr=ar.kind===170?Dr:ei,Xr=ie(ar,Dr,yr,me,Nn,Tr);return ae(ar,Bt,Dr,Ft,Xr.indentation,Xr.delta),Bt=me,Qe&&It.kind===209&&Jt===-1&&(Jt=Xr.indentation),Jt}function br(ar,Jt,It,Nn){E.assert(yv(ar)),E.assert(!Po(ar));const Fi=oZe(Jt,ar);let ei=Nn,zi=It;if(!x3(e,ar.pos,ar.end)){ar.endar.pos)break;if(Dr.token.kind===Fi){zi=p.getLineAndCharacterOfPosition(Dr.token.pos).line,zr(Dr,Jt,Nn,Jt);let Ft;if(z!==-1)Ft=z;else{const yr=hp(Dr.token.pos,p);Ft=Wd.findFirstNonWhitespaceColumn(yr,Dr.token.pos,p,o)}ei=Y(Jt,It,Ft,o.indentSize)}else zr(Dr,Jt,Nn,Jt)}let Qe=-1;for(let Dr=0;Droe(Xr.pos,Tr,!1))}Ft!==-1&&yr&&(oe(ar.token.pos,Ft,Qe===1),O=Dr.line,z=Ft)}s.advance(),Bt=Jt}}function _e(me,Oe,Xe,it){for(const mt of me){const Je=yf(e,mt);switch(mt.kind){case 3:Je&&Z(mt,Oe,!Xe),Xe=!1;break;case 2:Xe&&Je&&it(mt),Xe=!1;break;case 4:Xe=!0;break}}return Xe}function $(me,Oe,Xe,it){for(const mt of me)if(q9(mt.kind)&&yf(e,mt)){const Je=p.getLineAndCharacterOfPosition(mt.pos);H(mt,Je,Oe,Xe,it)}}function H(me,Oe,Xe,it,mt){const Je=g(me);let ot=0;if(!Je)if(C)ot=K(me,Oe.line,Xe,C,D,w,it,mt);else{const Bt=p.getLineAndCharacterOfPosition(e.pos);ve(Bt.line,Oe.line)}return C=me,T=me.end,w=Xe,D=Oe.line,ot}function K(me,Oe,Xe,it,mt,Je,ot,Bt){S.updateContext(it,Je,me,Xe,ot);const Ht=c(S);let br=S.options.trimTrailingWhitespace!==!1,zr=0;return Ht?IZ(Ht,ar=>{if(zr=pt(ar,it,mt,me,Oe),Bt)switch(zr){case 2:Xe.getStart(p)===me.pos&&Bt.recomputeIndentation(!1,ot);break;case 1:Xe.getStart(p)===me.pos&&Bt.recomputeIndentation(!0,ot);break;default:E.assert(zr===0)}br=br&&!(ar.action&16)&&ar.flags!==1}):br=br&&me.kind!==1,Oe!==mt&&br&&ve(mt,Oe,it),zr}function oe(me,Oe,Xe){const it=Afe(Oe,o);if(Xe)be(me,0,it);else{const mt=p.getLineAndCharacterOfPosition(me),Je=W0(mt.line,p);(Oe!==Se(Je,mt.character)||se(it,Je))&&be(Je,mt.character,it)}}function Se(me,Oe){let Xe=0;for(let it=0;it0){const ei=Afe(Fi,o);be(It,Nn.character,ei)}else he(It,Nn.character)}}function ve(me,Oe,Xe){for(let it=me;itJe)continue;const ot=Te(mt,Je);ot!==-1&&(E.assert(ot===mt||!Cd(p.text.charCodeAt(ot-1))),he(ot,Je+1-ot))}}function Te(me,Oe){let Xe=Oe;for(;Xe>=me&&Cd(p.text.charCodeAt(Xe));)Xe--;return Xe!==Oe?Xe+1:-1}function Me(me){let Oe=C?C.end:e.pos;for(const Xe of me)q9(Xe.kind)&&(OefA(g,t)||t===g.end&&(g.kind===2||t===e.getFullWidth()))}function oZe(e,t){switch(e.kind){case 176:case 262:case 218:case 174:case 173:case 219:case 179:case 180:case 184:case 185:case 177:case 178:if(e.typeParameters===t)return 30;if(e.parameters===t)return 21;break;case 213:case 214:if(e.typeArguments===t)return 30;if(e.arguments===t)return 21;break;case 263:case 231:case 264:case 265:if(e.typeParameters===t)return 30;break;case 183:case 215:case 186:case 233:case 205:if(e.typeArguments===t)return 30;break;case 187:return 19}return 0}function cZe(e){switch(e){case 21:return 22;case 30:return 32;case 19:return 20}return 0}function Afe(e,t){if((!aQ||aQ.tabSize!==t.tabSize||aQ.indentSize!==t.indentSize)&&(aQ={tabSize:t.tabSize,indentSize:t.indentSize},dN=mN=void 0),t.convertTabsToSpaces){let i;const s=Math.floor(e/t.indentSize),o=e%t.indentSize;return mN||(mN=[]),mN[s]===void 0?(i=vA(" ",t.indentSize*s),mN[s]=i):i=mN[s],o?i+vA(" ",o):i}else{const i=Math.floor(e/t.tabSize),s=e-i*t.tabSize;let o;return dN||(dN=[]),dN[i]===void 0?dN[i]=o=vA(" ",i):o=dN[i],s?o+vA(" ",s):o}}var aQ,dN,mN,lZe=Nt({"src/services/formatting/formatting.ts"(){"use strict";zn(),gN()}}),Wd,uZe=Nt({"src/services/formatting/smartIndenter.ts"(){"use strict";zn(),gN(),(e=>{let t;(Z=>{Z[Z.Unknown=-1]="Unknown"})(t||(t={}));function r(Z,ve,Te,Me=!1){if(Z>ve.text.length)return u(Te);if(Te.indentStyle===0)return 0;const ke=Kc(Z,ve,void 0,!0),he=lDe(ve,Z,ke||null);if(he&&he.kind===3)return i(ve,Z,Te,he);if(!ke)return u(Te);if(fH(ke.kind)&&ke.getStart(ve)<=Z&&Z=0),ke<=he)return H(W0(he,Z),ve,Z,Te);const be=W0(ke,Z),{column:lt,character:pt}=$(be,ve,Z,Te);return lt===0?lt:Z.text.charCodeAt(be+pt)===42?lt-1:lt}function s(Z,ve,Te){let Me=ve;for(;Me>0;){const he=Z.text.charCodeAt(Me);if(!Ug(he))break;Me--}const ke=hp(Me,Z);return H(ke,Me,Z,Te)}function o(Z,ve,Te,Me,ke,he){let be,lt=Te;for(;lt;){if(aH(lt,ve,Z)&&Se(he,lt,be,Z,!0)){const me=C(lt,Z),Oe=T(Te,lt,Me,Z),Xe=Oe!==0?ke&&Oe===2?he.indentSize:0:Me!==me.line?he.indentSize:0;return f(lt,me,void 0,Xe,Z,!0,he)}const pt=Y(lt,Z,he,!0);if(pt!==-1)return pt;be=lt,lt=lt.parent}return u(he)}function c(Z,ve,Te,Me){const ke=Te.getLineAndCharacterOfPosition(Z.getStart(Te));return f(Z,ke,ve,0,Te,!1,Me)}e.getIndentationForNode=c;function u(Z){return Z.baseIndentSize||0}e.getBaseIndentation=u;function f(Z,ve,Te,Me,ke,he,be){var lt;let pt=Z.parent;for(;pt;){let me=!0;if(Te){const mt=Z.getStart(ke);me=mtTe.end}const Oe=g(pt,Z,ke),Xe=Oe.line===ve.line||D(pt,Z,ve.line,ke);if(me){const mt=(lt=W(Z,ke))==null?void 0:lt[0],Je=!!mt&&C(mt,ke).line>Oe.line;let ot=Y(Z,ke,be,Je);if(ot!==-1||(ot=y(Z,pt,ve,Xe,ke,be),ot!==-1))return ot+Me}Se(be,pt,Z,ke,he)&&!Xe&&(Me+=be.indentSize);const it=w(pt,Z,ve.line,ke);Z=pt,pt=Z.parent,ve=it?ke.getLineAndCharacterOfPosition(Z.getStart(ke)):Oe}return Me+u(be)}function g(Z,ve,Te){const Me=W(ve,Te),ke=Me?Me.pos:Z.getStart(Te);return Te.getLineAndCharacterOfPosition(ke)}function p(Z,ve,Te){const Me=$ae(Z);return Me&&Me.listItemIndex>0?ae(Me.list.getChildren(),Me.listItemIndex-1,ve,Te):-1}function y(Z,ve,Te,Me,ke,he){return(hu(Z)||wP(Z))&&(ve.kind===312||!Me)?_e(Te,ke,he):-1}let S;(Z=>{Z[Z.Unknown=0]="Unknown",Z[Z.OpenBrace=1]="OpenBrace",Z[Z.CloseBrace=2]="CloseBrace"})(S||(S={}));function T(Z,ve,Te,Me){const ke=i2(Z,ve,Me);if(!ke)return 0;if(ke.kind===19)return 1;if(ke.kind===20){const he=C(ke,Me).line;return Te===he?2:0}return 0}function C(Z,ve){return ve.getLineAndCharacterOfPosition(Z.getStart(ve))}function w(Z,ve,Te,Me){if(!(Rs(Z)&&_s(Z.arguments,ve)))return!1;const ke=Z.expression.getEnd();return qa(Me,ke).line===Te}e.isArgumentAndStartLineOverlapsExpressionBeingCalled=w;function D(Z,ve,Te,Me){if(Z.kind===245&&Z.elseStatement===ve){const ke=Ua(Z,93,Me);return E.assert(ke!==void 0),C(ke,Me).line===Te}return!1}e.childStartsOnTheSameLineWithElseInIfStatement=D;function O(Z,ve,Te,Me){if(dC(Z)&&(ve===Z.whenTrue||ve===Z.whenFalse)){const ke=qa(Me,Z.condition.end).line;if(ve===Z.whenTrue)return Te===ke;{const he=C(Z.whenTrue,Me).line,be=qa(Me,Z.whenTrue.end).line;return ke===he&&be===Te}}return!1}e.childIsUnindentedBranchOfConditionalExpression=O;function z(Z,ve,Te,Me){if(gm(Z)){if(!Z.arguments)return!1;const ke=kn(Z.arguments,pt=>pt.pos===ve.pos);if(!ke)return!1;const he=Z.arguments.indexOf(ke);if(he===0)return!1;const be=Z.arguments[he-1],lt=qa(Me,be.getEnd()).line;if(Te===lt)return!0}return!1}e.argumentStartsOnSameLineAsPreviousArgument=z;function W(Z,ve){return Z.parent&&J(Z.getStart(ve),Z.getEnd(),Z.parent,ve)}e.getContainingList=W;function X(Z,ve,Te){return ve&&J(Z,Z,ve,Te)}function J(Z,ve,Te,Me){switch(Te.kind){case 183:return ke(Te.typeArguments);case 210:return ke(Te.properties);case 209:return ke(Te.elements);case 187:return ke(Te.members);case 262:case 218:case 219:case 174:case 173:case 179:case 176:case 185:case 180:return ke(Te.typeParameters)||ke(Te.parameters);case 177:return ke(Te.parameters);case 263:case 231:case 264:case 265:case 352:return ke(Te.typeParameters);case 214:case 213:return ke(Te.typeArguments)||ke(Te.arguments);case 261:return ke(Te.declarations);case 275:case 279:return ke(Te.elements);case 206:case 207:return ke(Te.elements)}function ke(he){return he&&pA(ie(Te,he,Me),Z,ve)?he:void 0}}function ie(Z,ve,Te){const Me=Z.getChildren(Te);for(let ke=1;ke=0&&ve=0;be--){if(Z[be].kind===28)continue;if(Te.getLineAndCharacterOfPosition(Z[be].end).line!==he.line)return _e(he,Te,Me);he=C(Z[be],Te)}return-1}function _e(Z,ve,Te){const Me=ve.getPositionOfLineAndCharacter(Z.line,0);return H(Me,Me+Z.character,ve,Te)}function $(Z,ve,Te,Me){let ke=0,he=0;for(let be=Z;bedfe,FormattingRequestKind:()=>pfe,RuleAction:()=>gfe,RuleFlags:()=>hfe,SmartIndenter:()=>Wd,anyContext:()=>bM,createTextRangeWithKind:()=>sQ,formatDocument:()=>KYe,formatNodeGivenIndentation:()=>aZe,formatOnClosingCurly:()=>ZYe,formatOnEnter:()=>XYe,formatOnOpeningCurly:()=>YYe,formatOnSemicolon:()=>QYe,formatSelection:()=>eZe,getAllRules:()=>j3e,getFormatContext:()=>JYe,getFormattingScanner:()=>mfe,getIndentationString:()=>Afe,getRangeOfEnclosingComment:()=>lDe});var gN=Nt({"src/services/_namespaces/ts.formatting.ts"(){"use strict";aYe(),oYe(),cYe(),BYe(),$Ye(),lZe(),uZe()}}),zn=Nt({"src/services/_namespaces/ts.ts"(){"use strict";Ns(),sA(),DRe(),ZRe(),rje(),WSe(),dje(),mje(),Tje(),Ije(),Fje(),Lje(),Uje(),Vje(),uWe(),_We(),dWe(),OWe(),MWe(),na(),A_e(),GEe(),nXe(),cXe(),CXe(),fTe(),FTe(),HXe(),eQe(),Nm(),cQe(),LQe(),UQe(),GQe(),sYe(),gN()}});function _Ze(){return fDe??(fDe=new Ip(Qm))}function uDe(e,t,r,i,s){let o=t?"DeprecationError: ":"DeprecationWarning: ";return o+=`'${e}' `,o+=i?`has been deprecated since v${i}`:"is deprecated",o+=t?" and can no longer be used.":r?` and will no longer be usable after v${r}.`:".",o+=s?` ${lg(s,[e])}`:"",o}function fZe(e,t,r,i){const s=uDe(e,!0,t,r,i);return()=>{throw new TypeError(s)}}function pZe(e,t,r,i){let s=!1;return()=>{_De&&!s&&(E.log.warn(uDe(e,!1,t,r,i)),s=!0)}}function dZe(e,t={}){const r=typeof t.typeScriptVersion=="string"?new Ip(t.typeScriptVersion):t.typeScriptVersion??_Ze(),i=typeof t.errorAfter=="string"?new Ip(t.errorAfter):t.errorAfter,s=typeof t.warnAfter=="string"?new Ip(t.warnAfter):t.warnAfter,o=typeof t.since=="string"?new Ip(t.since):t.since??s,c=t.error||i&&r.compareTo(i)>=0,u=!s||r.compareTo(s)>=0;return c?fZe(e,i,o,t.message):u?pZe(e,i,o,t.message):Ca}function mZe(e,t){return function(){return e(),t.apply(this,arguments)}}function Nfe(e,t){const r=dZe(t?.name??E.getFunctionName(e),t);return mZe(r,e)}var _De,fDe,pDe=Nt({"src/deprecatedCompat/deprecate.ts"(){"use strict";cQ(),_De=!0}});function oQ(e,t,r,i){if(Object.defineProperty(o,"name",{...Object.getOwnPropertyDescriptor(o,"name"),value:e}),i)for(const c of Object.keys(i)){const u=+c;!isNaN(u)&&Ya(t,`${u}`)&&(t[u]=Nfe(t[u],{...i[u],name:e}))}const s=gZe(t,r);return o;function o(...c){const u=s(c),f=u!==void 0?t[u]:void 0;if(typeof f=="function")return f(...c);throw new TypeError("Invalid arguments")}}function gZe(e,t){return r=>{for(let i=0;Ya(e,`${i}`)&&Ya(t,`${i}`);i++){const s=t[i];if(s(r))return i}}}function dDe(e){return{overload:t=>({bind:r=>({finish:()=>oQ(e,t,r),deprecate:i=>({finish:()=>oQ(e,t,r,i)})})})}}var hZe=Nt({"src/deprecatedCompat/deprecations.ts"(){"use strict";cQ(),pDe()}}),yZe=Nt({"src/deprecatedCompat/5.0/identifierProperties.ts"(){"use strict";cQ(),pDe(),Qte(e=>{const t=e.getIdentifierConstructor();Ya(t.prototype,"originalKeywordKind")||Object.defineProperty(t.prototype,"originalKeywordKind",{get:Nfe(function(){return Xy(this)},{name:"originalKeywordKind",since:"5.0",warnAfter:"5.1",errorAfter:"5.2",message:"Use 'identifierToKeywordKind(identifier)' instead."})}),Ya(t.prototype,"isInJSDocNamespace")||Object.defineProperty(t.prototype,"isInJSDocNamespace",{get:Nfe(function(){return this.flags&4096?!0:void 0},{name:"isInJSDocNamespace",since:"5.0",warnAfter:"5.1",errorAfter:"5.2",message:"Use '.parent' or the surrounding context to determine this instead."})})})}}),cQ=Nt({"src/deprecatedCompat/_namespaces/ts.ts"(){"use strict";Ns(),hZe(),yZe()}}),vZe=Nt({"src/typingsInstallerCore/_namespaces/ts.ts"(){"use strict";Ns(),sA(),Ffe()}});function mDe(e,t,r,i){try{const s=AC(t,Hn(e,"index.d.ts"),{moduleResolution:2},r);return s.resolvedModule&&s.resolvedModule.resolvedFileName}catch(s){i.isEnabled()&&i.writeLine(`Failed to resolve ${t} in folder '${e}': ${s.message}`);return}}function bZe(e,t,r,i){let s=!1;for(let o=r.length;o>0;){const c=gDe(e,t,r,o);o=c.remaining,s=i(c.command)||s}return s}function gDe(e,t,r,i){const s=r.length-i;let o,c=i;for(;o=`${e} install --ignore-scripts ${(c===r.length?r:r.slice(s,s+c)).join(" ")} --save-dev --user-agent="typesInstaller/${t}"`,!(o.length<8e3);)c=c-Math.floor(c/2);return{command:o,remaining:i-c}}function hDe(e){return`@types/${e}@ts${rk}`}var yDe,vDe,SZe=Nt({"src/typingsInstallerCore/typingsInstaller.ts"(){"use strict";vZe(),Ffe(),yDe={isEnabled:()=>!1,writeLine:Ca},vDe=class{constructor(e,t,r,i,s,o=yDe){this.installTypingHost=e,this.globalCachePath=t,this.safeListPath=r,this.typesMapLocation=i,this.throttleLimit=s,this.log=o,this.packageNameToTypingLocation=new Map,this.missingTypingsSet=new Set,this.knownCachesSet=new Set,this.projectWatchers=new Map,this.pendingRunRequests=[],this.installRunCount=1,this.inFlightRequestCount=0,this.latestDistTag="latest",this.log.isEnabled()&&this.log.writeLine(`Global cache location '${t}', safe file path '${r}', types map path ${i}`),this.processCacheLocation(this.globalCachePath)}closeProject(e){this.closeWatchers(e.projectName)}closeWatchers(e){if(this.log.isEnabled()&&this.log.writeLine(`Closing file watchers for project '${e}'`),!this.projectWatchers.get(e)){this.log.isEnabled()&&this.log.writeLine(`No watchers are registered for project '${e}'`);return}this.projectWatchers.delete(e),this.sendResponse({kind:iA,projectName:e,files:[]}),this.log.isEnabled()&&this.log.writeLine(`Closing file watchers for project '${e}' - done.`)}install(e){this.log.isEnabled()&&this.log.writeLine(`Got install request${UC(e)}`),e.cachePath&&(this.log.isEnabled()&&this.log.writeLine(`Request specifies cache path '${e.cachePath}', loading cached information...`),this.processCacheLocation(e.cachePath)),this.safeList===void 0&&this.initializeSafeList();const t=gg.discoverTypings(this.installTypingHost,this.log.isEnabled()?r=>this.log.writeLine(r):void 0,e.fileNames,e.projectRootPath,this.safeList,this.packageNameToTypingLocation,e.typeAcquisition,e.unresolvedImports,this.typesRegistry,e.compilerOptions);this.watchFiles(e.projectName,t.filesToWatch),t.newTypingNames.length?this.installTypings(e,e.cachePath||this.globalCachePath,t.cachedTypingPaths,t.newTypingNames):(this.sendResponse(this.createSetTypings(e,t.cachedTypingPaths)),this.log.isEnabled()&&this.log.writeLine("No new typings were requested as a result of typings discovery"))}initializeSafeList(){if(this.typesMapLocation){const e=gg.loadTypesMap(this.installTypingHost,this.typesMapLocation);if(e){this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`),this.safeList=e;return}this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`)}this.safeList=gg.loadSafeList(this.installTypingHost,this.safeListPath)}processCacheLocation(e){if(this.log.isEnabled()&&this.log.writeLine(`Processing cache location '${e}'`),this.knownCachesSet.has(e)){this.log.isEnabled()&&this.log.writeLine("Cache location was already processed...");return}const t=Hn(e,"package.json"),r=Hn(e,"package-lock.json");if(this.log.isEnabled()&&this.log.writeLine(`Trying to find '${t}'...`),this.installTypingHost.fileExists(t)&&this.installTypingHost.fileExists(r)){const i=JSON.parse(this.installTypingHost.readFile(t)),s=JSON.parse(this.installTypingHost.readFile(r));if(this.log.isEnabled()&&(this.log.writeLine(`Loaded content of '${t}':${UC(i)}`),this.log.writeLine(`Loaded content of '${r}':${UC(s)}`)),i.devDependencies&&s.dependencies)for(const o in i.devDependencies){if(!Ya(s.dependencies,o))continue;const c=Pc(o);if(!c)continue;const u=mDe(e,c,this.installTypingHost,this.log);if(!u){this.missingTypingsSet.add(c);continue}const f=this.packageNameToTypingLocation.get(c);if(f){if(f.typingLocation===u)continue;this.log.isEnabled()&&this.log.writeLine(`New typing for package ${c} from '${u}' conflicts with existing typing file '${f}'`)}this.log.isEnabled()&&this.log.writeLine(`Adding entry into typings cache: '${c}' => '${u}'`);const g=x7(s.dependencies,o),p=g&&g.version;if(!p)continue;const y={typingLocation:u,version:new Ip(p)};this.packageNameToTypingLocation.set(c,y)}}this.log.isEnabled()&&this.log.writeLine(`Finished processing cache location '${e}'`),this.knownCachesSet.add(e)}filterTypings(e){return Ii(e,t=>{const r=IC(t);if(this.missingTypingsSet.has(r)){this.log.isEnabled()&&this.log.writeLine(`'${t}':: '${r}' is in missingTypingsSet - skipping...`);return}const i=gg.validatePackageName(t);if(i!==gg.NameValidationResult.Ok){this.missingTypingsSet.add(r),this.log.isEnabled()&&this.log.writeLine(gg.renderPackageNameValidationFailure(i,t));return}if(!this.typesRegistry.has(r)){this.log.isEnabled()&&this.log.writeLine(`'${t}':: Entry for package '${r}' does not exist in local types registry - skipping...`);return}if(this.packageNameToTypingLocation.get(r)&&gg.isTypingUpToDate(this.packageNameToTypingLocation.get(r),this.typesRegistry.get(r))){this.log.isEnabled()&&this.log.writeLine(`'${t}':: '${r}' already has an up-to-date typing - skipping...`);return}return r})}ensurePackageDirectoryExists(e){const t=Hn(e,"package.json");this.log.isEnabled()&&this.log.writeLine(`Npm config file: ${t}`),this.installTypingHost.fileExists(t)||(this.log.isEnabled()&&this.log.writeLine(`Npm config file: '${t}' is missing, creating new one...`),this.ensureDirectoryExists(e,this.installTypingHost),this.installTypingHost.writeFile(t,'{ "private": true }'))}installTypings(e,t,r,i){this.log.isEnabled()&&this.log.writeLine(`Installing typings ${JSON.stringify(i)}`);const s=this.filterTypings(i);if(s.length===0){this.log.isEnabled()&&this.log.writeLine("All typings are known to be missing or invalid - no need to install more typings"),this.sendResponse(this.createSetTypings(e,r));return}this.ensurePackageDirectoryExists(t);const o=this.installRunCount;this.installRunCount++,this.sendResponse({kind:Pq,eventId:o,typingsInstallerVersion:Qm,projectName:e.projectName});const c=s.map(hDe);this.installTypingsAsync(o,c,t,u=>{try{if(!u){this.log.isEnabled()&&this.log.writeLine(`install request failed, marking packages as missing to prevent repeated requests: ${JSON.stringify(s)}`);for(const g of s)this.missingTypingsSet.add(g);return}this.log.isEnabled()&&this.log.writeLine(`Installed typings ${JSON.stringify(c)}`);const f=[];for(const g of s){const p=mDe(t,g,this.installTypingHost,this.log);if(!p){this.missingTypingsSet.add(g);continue}const y=this.typesRegistry.get(g),S=new Ip(y[`ts${rk}`]||y[this.latestDistTag]),T={typingLocation:p,version:S};this.packageNameToTypingLocation.set(g,T),f.push(p)}this.log.isEnabled()&&this.log.writeLine(`Installed typing files ${JSON.stringify(f)}`),this.sendResponse(this.createSetTypings(e,r.concat(f)))}finally{const f={kind:wq,eventId:o,projectName:e.projectName,packagesToInstall:c,installSuccess:u,typingsInstallerVersion:Qm};this.sendResponse(f)}})}ensureDirectoryExists(e,t){const r=qn(e);t.directoryExists(r)||this.ensureDirectoryExists(r,t),t.directoryExists(e)||t.createDirectory(e)}watchFiles(e,t){if(!t.length){this.closeWatchers(e);return}const r=this.projectWatchers.get(e),i=new Set(t);!r||ng(i,s=>!r.has(s))||ng(r,s=>!i.has(s))?(this.projectWatchers.set(e,i),this.sendResponse({kind:iA,projectName:e,files:t})):this.sendResponse({kind:iA,projectName:e,files:void 0})}createSetTypings(e,t){return{projectName:e.projectName,typeAcquisition:e.typeAcquisition,compilerOptions:e.compilerOptions,typings:t,unresolvedImports:e.unresolvedImports,kind:D9}}installTypingsAsync(e,t,r,i){this.pendingRunRequests.unshift({requestId:e,packageNames:t,cwd:r,onRequestCompleted:i}),this.executeWithThrottling()}executeWithThrottling(){for(;this.inFlightRequestCount{this.inFlightRequestCount--,e.onRequestCompleted(t),this.executeWithThrottling()})}}}}}),Ife={};jl(Ife,{TypingsInstaller:()=>vDe,getNpmCommandForInstallation:()=>gDe,installNpmPackages:()=>bZe,typingsName:()=>hDe});var TZe=Nt({"src/typingsInstallerCore/_namespaces/ts.server.typingsInstaller.ts"(){"use strict";SZe()}}),Ffe=Nt({"src/typingsInstallerCore/_namespaces/ts.server.ts"(){"use strict";w9(),TZe()}}),xZe=Nt({"src/server/types.ts"(){"use strict"}});function bDe(e,t,r,i){return{projectName:e.getProjectName(),fileNames:e.getFileNames(!0,!0).concat(e.getExcludedFiles()),compilerOptions:e.getCompilationSettings(),typeAcquisition:t,unresolvedImports:r,projectRootPath:e.getCurrentDirectory(),cachePath:i,kind:"discover"}}function Lo(e){return qs(e)}function hN(e,t,r){const i=C_(e)?e:is(e,t);return r(i)}function SDe(e){return e}function TDe(){const e=new Map;return{get(t){return e.get(t)},set(t,r){e.set(t,r)},contains(t){return e.has(t)},remove(t){e.delete(t)}}}function Ofe(e){return/dev\/null\/inferredProject\d+\*/.test(e)}function Lfe(e){return`/dev/null/inferredProject${e}*`}function Mfe(e){return`/dev/null/autoImportProviderProject${e}*`}function Rfe(e){return`/dev/null/auxiliaryProject${e}*`}function jfe(){return[]}var lQ,Gc,uQ,r0,kZe=Nt({"src/server/utilitiesPublic.ts"(){"use strict";w1(),lQ=(e=>(e[e.terse=0]="terse",e[e.normal=1]="normal",e[e.requestTime=2]="requestTime",e[e.verbose=3]="verbose",e))(lQ||{}),Gc=jfe(),uQ=(e=>(e.Err="Err",e.Info="Info",e.Perf="Perf",e))(uQ||{}),(e=>{function t(){throw new Error("No Project.")}e.ThrowNoProject=t;function r(){throw new Error("The project's language service is disabled.")}e.ThrowProjectLanguageServiceDisabled=r;function i(s,o){throw new Error(`Project '${o.getProjectName()}' does not contain document '${s}'`)}e.ThrowProjectDoesNotContainDocument=i})(r0||(r0={}))}});function _Q(e){const t=Pc(e);return t==="tsconfig.json"||t==="jsconfig.json"?t:void 0}function xDe(e,t,r){if(!e||e.length===0)return;if(e[0]===t){e.splice(0,1);return}const i=Dh(e,t,To,r);i>=0&&e.splice(i,1)}var fQ,pQ,CZe=Nt({"src/server/utilities.ts"(){"use strict";w1(),mx(),fQ=class uIe{constructor(t,r){this.host=t,this.pendingTimeouts=new Map,this.logger=r.hasLevel(3)?r:void 0}schedule(t,r,i){const s=this.pendingTimeouts.get(t);s&&this.host.clearTimeout(s),this.pendingTimeouts.set(t,this.host.setTimeout(uIe.run,r,t,this,i)),this.logger&&this.logger.info(`Scheduled: ${t}${s?", Cancelled earlier one":""}`)}cancel(t){const r=this.pendingTimeouts.get(t);return r?(this.host.clearTimeout(r),this.pendingTimeouts.delete(t)):!1}static run(t,r,i){var s,o;(s=Pu)==null||s.logStartScheduledOperation(t),r.pendingTimeouts.delete(t),r.logger&&r.logger.info(`Running: ${t}`),i(),(o=Pu)==null||o.logStopScheduledOperation()}},pQ=class _Ie{constructor(t,r,i){this.host=t,this.delay=r,this.logger=i}scheduleCollect(){!this.host.gc||this.timerId!==void 0||(this.timerId=this.host.setTimeout(_Ie.run,this.delay,this))}static run(t){var r,i;t.timerId=void 0,(r=Pu)==null||r.logStartScheduledOperation("GC collect");const s=t.logger.hasLevel(2),o=s&&t.host.getMemoryUsage();if(t.host.gc(),s){const c=t.host.getMemoryUsage();t.logger.perftrc(`GC::before ${o}, after ${c}`)}(i=Pu)==null||i.logStopScheduledOperation()}}}}),dQ,Bfe,Jfe,zfe,Wfe,Ufe,Vfe,qfe,Hfe,Gfe,$fe,Xfe,Qfe,Yfe,Zfe=Nt({"src/server/protocol.ts"(){"use strict";dQ=(e=>(e.JsxClosingTag="jsxClosingTag",e.LinkedEditingRange="linkedEditingRange",e.Brace="brace",e.BraceFull="brace-full",e.BraceCompletion="braceCompletion",e.GetSpanOfEnclosingComment="getSpanOfEnclosingComment",e.Change="change",e.Close="close",e.Completions="completions",e.CompletionInfo="completionInfo",e.CompletionsFull="completions-full",e.CompletionDetails="completionEntryDetails",e.CompletionDetailsFull="completionEntryDetails-full",e.CompileOnSaveAffectedFileList="compileOnSaveAffectedFileList",e.CompileOnSaveEmitFile="compileOnSaveEmitFile",e.Configure="configure",e.Definition="definition",e.DefinitionFull="definition-full",e.DefinitionAndBoundSpan="definitionAndBoundSpan",e.DefinitionAndBoundSpanFull="definitionAndBoundSpan-full",e.Implementation="implementation",e.ImplementationFull="implementation-full",e.EmitOutput="emit-output",e.Exit="exit",e.FileReferences="fileReferences",e.FileReferencesFull="fileReferences-full",e.Format="format",e.Formatonkey="formatonkey",e.FormatFull="format-full",e.FormatonkeyFull="formatonkey-full",e.FormatRangeFull="formatRange-full",e.Geterr="geterr",e.GeterrForProject="geterrForProject",e.SemanticDiagnosticsSync="semanticDiagnosticsSync",e.SyntacticDiagnosticsSync="syntacticDiagnosticsSync",e.SuggestionDiagnosticsSync="suggestionDiagnosticsSync",e.NavBar="navbar",e.NavBarFull="navbar-full",e.Navto="navto",e.NavtoFull="navto-full",e.NavTree="navtree",e.NavTreeFull="navtree-full",e.DocumentHighlights="documentHighlights",e.DocumentHighlightsFull="documentHighlights-full",e.Open="open",e.Quickinfo="quickinfo",e.QuickinfoFull="quickinfo-full",e.References="references",e.ReferencesFull="references-full",e.Reload="reload",e.Rename="rename",e.RenameInfoFull="rename-full",e.RenameLocationsFull="renameLocations-full",e.Saveto="saveto",e.SignatureHelp="signatureHelp",e.SignatureHelpFull="signatureHelp-full",e.FindSourceDefinition="findSourceDefinition",e.Status="status",e.TypeDefinition="typeDefinition",e.ProjectInfo="projectInfo",e.ReloadProjects="reloadProjects",e.Unknown="unknown",e.OpenExternalProject="openExternalProject",e.OpenExternalProjects="openExternalProjects",e.CloseExternalProject="closeExternalProject",e.SynchronizeProjectList="synchronizeProjectList",e.ApplyChangedToOpenFiles="applyChangedToOpenFiles",e.UpdateOpen="updateOpen",e.EncodedSyntacticClassificationsFull="encodedSyntacticClassifications-full",e.EncodedSemanticClassificationsFull="encodedSemanticClassifications-full",e.Cleanup="cleanup",e.GetOutliningSpans="getOutliningSpans",e.GetOutliningSpansFull="outliningSpans",e.TodoComments="todoComments",e.Indentation="indentation",e.DocCommentTemplate="docCommentTemplate",e.CompilerOptionsDiagnosticsFull="compilerOptionsDiagnostics-full",e.NameOrDottedNameSpan="nameOrDottedNameSpan",e.BreakpointStatement="breakpointStatement",e.CompilerOptionsForInferredProjects="compilerOptionsForInferredProjects",e.GetCodeFixes="getCodeFixes",e.GetCodeFixesFull="getCodeFixes-full",e.GetCombinedCodeFix="getCombinedCodeFix",e.GetCombinedCodeFixFull="getCombinedCodeFix-full",e.ApplyCodeActionCommand="applyCodeActionCommand",e.GetSupportedCodeFixes="getSupportedCodeFixes",e.GetApplicableRefactors="getApplicableRefactors",e.GetEditsForRefactor="getEditsForRefactor",e.GetMoveToRefactoringFileSuggestions="getMoveToRefactoringFileSuggestions",e.GetEditsForRefactorFull="getEditsForRefactor-full",e.OrganizeImports="organizeImports",e.OrganizeImportsFull="organizeImports-full",e.GetEditsForFileRename="getEditsForFileRename",e.GetEditsForFileRenameFull="getEditsForFileRename-full",e.ConfigurePlugin="configurePlugin",e.SelectionRange="selectionRange",e.SelectionRangeFull="selectionRange-full",e.ToggleLineComment="toggleLineComment",e.ToggleLineCommentFull="toggleLineComment-full",e.ToggleMultilineComment="toggleMultilineComment",e.ToggleMultilineCommentFull="toggleMultilineComment-full",e.CommentSelection="commentSelection",e.CommentSelectionFull="commentSelection-full",e.UncommentSelection="uncommentSelection",e.UncommentSelectionFull="uncommentSelection-full",e.PrepareCallHierarchy="prepareCallHierarchy",e.ProvideCallHierarchyIncomingCalls="provideCallHierarchyIncomingCalls",e.ProvideCallHierarchyOutgoingCalls="provideCallHierarchyOutgoingCalls",e.ProvideInlayHints="provideInlayHints",e.WatchChange="watchChange",e))(dQ||{}),Bfe=(e=>(e.All="All",e.SortAndCombine="SortAndCombine",e.RemoveUnused="RemoveUnused",e))(Bfe||{}),Jfe=(e=>(e.FixedPollingInterval="FixedPollingInterval",e.PriorityPollingInterval="PriorityPollingInterval",e.DynamicPriorityPolling="DynamicPriorityPolling",e.FixedChunkSizePolling="FixedChunkSizePolling",e.UseFsEvents="UseFsEvents",e.UseFsEventsOnParentDirectory="UseFsEventsOnParentDirectory",e))(Jfe||{}),zfe=(e=>(e.UseFsEvents="UseFsEvents",e.FixedPollingInterval="FixedPollingInterval",e.DynamicPriorityPolling="DynamicPriorityPolling",e.FixedChunkSizePolling="FixedChunkSizePolling",e))(zfe||{}),Wfe=(e=>(e.FixedInterval="FixedInterval",e.PriorityInterval="PriorityInterval",e.DynamicPriority="DynamicPriority",e.FixedChunkSize="FixedChunkSize",e))(Wfe||{}),Ufe=(e=>(e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",e))(Ufe||{}),Vfe=(e=>(e.None="None",e.Block="Block",e.Smart="Smart",e))(Vfe||{}),qfe=(e=>(e.Ignore="ignore",e.Insert="insert",e.Remove="remove",e))(qfe||{}),Hfe=(e=>(e.None="None",e.Preserve="Preserve",e.ReactNative="ReactNative",e.React="React",e))(Hfe||{}),Gfe=(e=>(e.None="None",e.CommonJS="CommonJS",e.AMD="AMD",e.UMD="UMD",e.System="System",e.ES6="ES6",e.ES2015="ES2015",e.ESNext="ESNext",e))(Gfe||{}),$fe=(e=>(e.Classic="Classic",e.Node="Node",e))($fe||{}),Xfe=(e=>(e.Crlf="Crlf",e.Lf="Lf",e))(Xfe||{}),Qfe=(e=>(e.ES3="ES3",e.ES5="ES5",e.ES6="ES6",e.ES2015="ES2015",e.ES2016="ES2016",e.ES2017="ES2017",e.ES2018="ES2018",e.ES2019="ES2019",e.ES2020="ES2020",e.ES2021="ES2021",e.ES2022="ES2022",e.ESNext="ESNext",e))(Qfe||{}),Yfe=(e=>(e[e.comment=1]="comment",e[e.identifier=2]="identifier",e[e.keyword=3]="keyword",e[e.numericLiteral=4]="numericLiteral",e[e.operator=5]="operator",e[e.stringLiteral=6]="stringLiteral",e[e.regularExpressionLiteral=7]="regularExpressionLiteral",e[e.whiteSpace=8]="whiteSpace",e[e.text=9]="text",e[e.punctuation=10]="punctuation",e[e.className=11]="className",e[e.enumName=12]="enumName",e[e.interfaceName=13]="interfaceName",e[e.moduleName=14]="moduleName",e[e.typeParameterName=15]="typeParameterName",e[e.typeAliasName=16]="typeAliasName",e[e.parameterName=17]="parameterName",e[e.docCommentTagName=18]="docCommentTagName",e[e.jsxOpenTagName=19]="jsxOpenTagName",e[e.jsxCloseTagName=20]="jsxCloseTagName",e[e.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",e[e.jsxAttribute=22]="jsxAttribute",e[e.jsxText=23]="jsxText",e[e.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",e[e.bigintLiteral=25]="bigintLiteral",e))(Yfe||{})}}),Kfe={};jl(Kfe,{ClassificationType:()=>Yfe,CommandTypes:()=>dQ,CompletionTriggerKind:()=>Ufe,IndentStyle:()=>Vfe,JsxEmit:()=>Hfe,ModuleKind:()=>Gfe,ModuleResolutionKind:()=>$fe,NewLineKind:()=>Xfe,OrganizeImportsMode:()=>Bfe,PollingWatchKind:()=>Wfe,ScriptTarget:()=>Qfe,SemicolonPreference:()=>qfe,WatchDirectoryKind:()=>zfe,WatchFileKind:()=>Jfe});var EZe=Nt({"src/server/_namespaces/ts.server.protocol.ts"(){"use strict";Zfe()}});function yN(e){return e[0]==="^"||(e.includes("walkThroughSnippet:/")||e.includes("untitled:/"))&&Pc(e)[0]==="^"||e.includes(":^")&&!e.includes(Co)}function kDe(e){return!e||bN(e)?r0.ThrowNoProject():e}function DZe(e){E.assert(typeof e=="number",`Expected position ${e} to be a number.`),E.assert(e>=0,"Expected position to be non-negative.")}function PZe(e){E.assert(typeof e.line=="number",`Expected line ${e.line} to be a number.`),E.assert(typeof e.offset=="number",`Expected offset ${e.offset} to be a number.`),E.assert(e.line>0,`Expected line to be non-${e.line===0?"zero":"negative"}`),E.assert(e.offset>0,`Expected offset to be non-${e.offset===0?"zero":"negative"}`)}var mQ,gQ,wZe=Nt({"src/server/scriptInfo.ts"(){"use strict";w1(),mx(),mQ=class{constructor(e,t,r){this.host=e,this.info=t,this.isOpen=!1,this.ownFileText=!1,this.pendingReloadFromDisk=!1,this.version=r||0}getVersion(){return this.svc?`SVC-${this.version}-${this.svc.getSnapshotVersion()}`:`Text-${this.version}`}hasScriptVersionCache_TestOnly(){return this.svc!==void 0}resetSourceMapInfo(){this.info.sourceFileLike=void 0,this.info.closeSourceMapFileWatcher(),this.info.sourceMapFilePath=void 0,this.info.declarationInfoPath=void 0,this.info.sourceInfos=void 0,this.info.documentPositionMapper=void 0}useText(e){this.svc=void 0,this.text=e,this.textSnapshot=void 0,this.lineMap=void 0,this.fileSize=void 0,this.resetSourceMapInfo(),this.version++}edit(e,t,r){this.switchToScriptVersionCache().edit(e,t-e,r),this.ownFileText=!1,this.text=void 0,this.textSnapshot=void 0,this.lineMap=void 0,this.fileSize=void 0,this.resetSourceMapInfo()}reload(e){return E.assert(e!==void 0),this.pendingReloadFromDisk=!1,!this.text&&this.svc&&(this.text=HC(this.svc.getSnapshot())),this.text!==e?(this.useText(e),this.ownFileText=!1,!0):!1}reloadWithFileText(e){const{text:t,fileSize:r}=e||!this.info.isDynamicOrHasMixedContent()?this.getFileTextAndSize(e):{text:"",fileSize:void 0},i=this.reload(t);return this.fileSize=r,this.ownFileText=!e||e===this.info.fileName,i}scheduleReloadIfNeeded(){return!this.pendingReloadFromDisk&&!this.ownFileText?this.pendingReloadFromDisk=!0:!1}delayReloadFromFileIntoText(){this.pendingReloadFromDisk=!0}getTelemetryFileSize(){return this.fileSize?this.fileSize:this.text?this.text.length:this.svc?this.svc.getSnapshot().getLength():this.getSnapshot().getLength()}getSnapshot(){var e;return((e=this.tryUseScriptVersionCache())==null?void 0:e.getSnapshot())||(this.textSnapshot??(this.textSnapshot=N9.fromString(E.checkDefined(this.text))))}getAbsolutePositionAndLineText(e){const t=this.tryUseScriptVersionCache();if(t)return t.getAbsolutePositionAndLineText(e);const r=this.getLineMap();return e<=r.length?{absolutePosition:r[e-1],lineText:this.text.substring(r[e-1],r[e])}:{absolutePosition:this.text.length,lineText:void 0}}lineToTextSpan(e){const t=this.tryUseScriptVersionCache();if(t)return t.lineToTextSpan(e);const r=this.getLineMap(),i=r[e],s=e+1t===void 0?t=this.host.readFile(r)||"":t;if(!Tb(this.info.fileName)){const s=this.host.getFileSize?this.host.getFileSize(r):i().length;if(s>NM)return E.assert(!!this.info.containingProjects.length),this.info.containingProjects[0].projectService.logger.info(`Skipped loading contents of large file ${r} for info ${this.info.fileName}: fileSize: ${s}`),this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(r,s),{text:"",fileSize:s}}return{text:i()}}switchToScriptVersionCache(){return(!this.svc||this.pendingReloadFromDisk)&&(this.svc=VM.fromString(this.getOrLoadText()),this.textSnapshot=void 0,this.version++),this.svc}tryUseScriptVersionCache(){return(!this.svc||this.pendingReloadFromDisk)&&this.getOrLoadText(),this.isOpen?(!this.svc&&!this.textSnapshot&&(this.svc=VM.fromString(E.checkDefined(this.text)),this.textSnapshot=void 0),this.svc):this.svc}getOrLoadText(){return(this.text===void 0||this.pendingReloadFromDisk)&&(E.assert(!this.svc||this.pendingReloadFromDisk,"ScriptVersionCache should not be set when reloading from disk"),this.reloadWithFileText()),this.text}getLineMap(){return E.assert(!this.svc,"ScriptVersionCache should not be set"),this.lineMap||(this.lineMap=eT(E.checkDefined(this.text)))}getLineInfo(){const e=this.tryUseScriptVersionCache();if(e)return{getLineCount:()=>e.getLineCount(),getLineText:r=>e.getAbsolutePositionAndLineText(r+1).lineText};const t=this.getLineMap();return sV(this.text,t)}},gQ=class{constructor(e,t,r,i,s,o){this.host=e,this.fileName=t,this.scriptKind=r,this.hasMixedContent=i,this.path=s,this.containingProjects=[],this.isDynamic=yN(t),this.textStorage=new mQ(e,this,o),(i||this.isDynamic)&&(this.realpath=this.path),this.scriptKind=r||B5(t)}isDynamicOrHasMixedContent(){return this.hasMixedContent||this.isDynamic}isScriptOpen(){return this.textStorage.isOpen}open(e){this.textStorage.isOpen=!0,e!==void 0&&this.textStorage.reload(e)&&this.markContainingProjectsAsDirty()}close(e=!0){this.textStorage.isOpen=!1,e&&this.textStorage.scheduleReloadIfNeeded()&&this.markContainingProjectsAsDirty()}getSnapshot(){return this.textStorage.getSnapshot()}ensureRealPath(){if(this.realpath===void 0&&(this.realpath=this.path,this.host.realpath)){E.assert(!!this.containingProjects.length);const e=this.containingProjects[0],t=this.host.realpath(this.path);t&&(this.realpath=e.toPath(t),this.realpath!==this.path&&e.projectService.realpathToScriptInfos.add(this.realpath,this))}}getRealpathIfDifferent(){return this.realpath&&this.realpath!==this.path?this.realpath:void 0}isSymlink(){return this.realpath&&this.realpath!==this.path}getFormatCodeSettings(){return this.formatSettings}getPreferences(){return this.preferences}attachToProject(e){const t=!this.isAttached(e);return t&&(this.containingProjects.push(e),e.getCompilerOptions().preserveSymlinks||this.ensureRealPath(),e.onFileAddedOrRemoved(this.isSymlink())),t}isAttached(e){switch(this.containingProjects.length){case 0:return!1;case 1:return this.containingProjects[0]===e;case 2:return this.containingProjects[0]===e||this.containingProjects[1]===e;default:return _s(this.containingProjects,e)}}detachFromProject(e){switch(this.containingProjects.length){case 0:return;case 1:this.containingProjects[0]===e&&(e.onFileAddedOrRemoved(this.isSymlink()),this.containingProjects.pop());break;case 2:this.containingProjects[0]===e?(e.onFileAddedOrRemoved(this.isSymlink()),this.containingProjects[0]=this.containingProjects.pop()):this.containingProjects[1]===e&&(e.onFileAddedOrRemoved(this.isSymlink()),this.containingProjects.pop());break;default:X2(this.containingProjects,e)&&e.onFileAddedOrRemoved(this.isSymlink());break}}detachAllProjects(){for(const e of this.containingProjects){P1(e)&&e.getCachedDirectoryStructureHost().addOrDeleteFile(this.fileName,this.path,2);const t=e.getRootFilesMap().get(this.path);e.removeFile(this,!1,!1),e.onFileAddedOrRemoved(this.isSymlink()),t&&!p6(e)&&e.addMissingFileRoot(t.fileName)}Ym(this.containingProjects)}getDefaultProject(){switch(this.containingProjects.length){case 0:return r0.ThrowNoProject();case 1:return kDe(this.containingProjects[0]);default:let e,t,r,i,s;for(let o=0;o!e.isOrphan())}isContainedByBackgroundProject(){return ut(this.containingProjects,bN)}lineToTextSpan(e){return this.textStorage.lineToTextSpan(e)}lineOffsetToPosition(e,t,r){return this.textStorage.lineOffsetToPosition(e,t,r)}positionToLineOffset(e){DZe(e);const t=this.textStorage.positionToLineOffset(e);return PZe(t),t}isJavaScript(){return this.scriptKind===1||this.scriptKind===2}closeSourceMapFileWatcher(){this.sourceMapFilePath&&!ns(this.sourceMapFilePath)&&(hf(this.sourceMapFilePath),this.sourceMapFilePath=void 0)}}}});function CDe(e,t){if(e===t||(e||Gc).length===0&&(t||Gc).length===0)return!0;const r=new Map;let i=0;for(const s of e)r.get(s)!==!0&&(r.set(s,!0),i++);for(const s of t){const o=r.get(s);if(o===void 0)return!1;o===!0&&(r.set(s,!1),i--)}return i===0}function AZe(e,t){return e.enable!==t.enable||!CDe(e.include,t.include)||!CDe(e.exclude,t.exclude)}function NZe(e,t){return s1(e)!==s1(t)}function IZe(e,t){return e===t?!1:!Zp(e,t)}var EM,hQ,FZe=Nt({"src/server/typingsCache.ts"(){"use strict";w1(),mx(),EM={isKnownTypesPackageName:Kp,installPackage:ys,enqueueInstallTypingsRequest:Ca,attach:Ca,onProjectClosed:Ca,globalTypingsCacheLocation:void 0},hQ=class{constructor(e){this.installer=e,this.perProjectCache=new Map}isKnownTypesPackageName(e){return this.installer.isKnownTypesPackageName(e)}installPackage(e){return this.installer.installPackage(e)}enqueueInstallTypingsForProject(e,t,r){const i=e.getTypeAcquisition();if(!i||!i.enable)return;const s=this.perProjectCache.get(e.getProjectName());(r||!s||AZe(i,s.typeAcquisition)||NZe(e.getCompilationSettings(),s.compilerOptions)||IZe(t,s.unresolvedImports))&&(this.perProjectCache.set(e.getProjectName(),{compilerOptions:e.getCompilationSettings(),typeAcquisition:i,typings:s?s.typings:Gc,unresolvedImports:t,poisoned:!0}),this.installer.enqueueInstallTypingsRequest(e,i,t))}updateTypingsForProject(e,t,r,i,s){const o=qS(s);return this.perProjectCache.set(e,{compilerOptions:t,typeAcquisition:r,typings:o,unresolvedImports:i,poisoned:!1}),!r||!r.enable?Gc:o}onProjectClosed(e){this.perProjectCache.delete(e.getProjectName()),this.installer.onProjectClosed(e)}}}});function vN(e,t=!1){const r={js:0,jsSize:0,jsx:0,jsxSize:0,ts:0,tsSize:0,tsx:0,tsxSize:0,dts:0,dtsSize:0,deferred:0,deferredSize:0};for(const i of e){const s=t?i.textStorage.getTelemetryFileSize():0;switch(i.scriptKind){case 1:r.js+=1,r.jsSize+=s;break;case 2:r.jsx+=1,r.jsxSize+=s;break;case 3:Il(i.fileName)?(r.dts+=1,r.dtsSize+=s):(r.ts+=1,r.tsSize+=s);break;case 4:r.tsx+=1,r.tsxSize+=s;break;case 7:r.deferred+=1,r.deferredSize+=s;break}}return r}function OZe(e){const t=vN(e.getScriptInfos());return t.js>0&&t.ts===0&&t.tsx===0}function epe(e){const t=vN(e.getRootScriptInfos());return t.ts===0&&t.tsx===0}function tpe(e){const t=vN(e.getScriptInfos());return t.ts===0&&t.tsx===0}function rpe(e){return!e.some(t=>Ho(t,".ts")&&!Il(t)||Ho(t,".tsx"))}function npe(e){return e.generatedFilePath!==void 0}function LZe(e,t){var r,i;const s=e.getSourceFiles();(r=Jr)==null||r.push(Jr.Phase.Session,"getUnresolvedImports",{count:s.length});const o=e.getTypeChecker().getAmbientModules().map(u=>lp(u.getName())),c=_4(ta(s,u=>MZe(e,u,o,t)));return(i=Jr)==null||i.pop(),c}function MZe(e,t,r,i){return u4(i,t.path,()=>{let s;return e.forEachResolvedModule(({resolvedModule:o},c)=>{(!o||!yE(o.extension))&&!Tl(c)&&!r.some(u=>u===c)&&(s=lr(s,Rw(c).packageName))},t),s||Gc})}function p6(e){return e.projectKind===0}function P1(e){return e.projectKind===1}function yQ(e){return e.projectKind===2}function bN(e){return e.projectKind===3||e.projectKind===4}var X3,Zb,vQ,bQ,SQ,TQ,xQ,DM,RZe=Nt({"src/server/project.ts"(){"use strict";w1(),w1(),mx(),X3=(e=>(e[e.Inferred=0]="Inferred",e[e.Configured=1]="Configured",e[e.External=2]="External",e[e.AutoImportProvider=3]="AutoImportProvider",e[e.Auxiliary=4]="Auxiliary",e))(X3||{}),Zb=class fIe{constructor(t,r,i,s,o,c,u,f,g,p,y){switch(this.projectKind=r,this.projectService=i,this.documentRegistry=s,this.compilerOptions=u,this.compileOnSaveEnabled=f,this.watchOptions=g,this.rootFiles=[],this.rootFilesMap=new Map,this.plugins=[],this.cachedUnresolvedImportsPerFile=new Map,this.hasAddedorRemovedFiles=!1,this.hasAddedOrRemovedSymlinks=!1,this.lastReportedVersion=0,this.projectProgramVersion=0,this.projectStateVersion=0,this.isInitialLoadPending=Kp,this.dirty=!1,this.typingFiles=Gc,this.moduleSpecifierCache=mpe(this),this.createHash=Os(this.projectService.host,this.projectService.host.createHash),this.globalCacheResolutionModuleName=gg.nonRelativeModuleNameForTypingCache,this.projectName=t,this.directoryStructureHost=p,this.currentDirectory=this.projectService.getNormalizedAbsolutePath(y),this.getCanonicalFileName=this.projectService.toCanonicalFileName,this.jsDocParsingMode=this.projectService.jsDocParsingMode,this.cancellationToken=new ZG(this.projectService.cancellationToken,this.projectService.throttleWaitMilliseconds),this.compilerOptions?(o||s1(this.compilerOptions)||this.projectService.hasDeferredExtension())&&(this.compilerOptions.allowNonTsExtensions=!0):(this.compilerOptions=GL(),this.compilerOptions.allowNonTsExtensions=!0,this.compilerOptions.allowJs=!0),i.serverMode){case 0:this.languageServiceEnabled=!0;break;case 1:this.languageServiceEnabled=!0,this.compilerOptions.noResolve=!0,this.compilerOptions.types=[];break;case 2:this.languageServiceEnabled=!1,this.compilerOptions.noResolve=!0,this.compilerOptions.types=[];break;default:E.assertNever(i.serverMode)}this.setInternalCompilerOptionsForEmittingJsFiles();const S=this.projectService.host;this.projectService.logger.loggingEnabled()?this.trace=T=>this.writeLog(T):S.trace&&(this.trace=T=>S.trace(T)),this.realpath=Os(S,S.realpath),this.resolutionCache=lq(this,this.currentDirectory,!0),this.languageService=Zce(this,this.documentRegistry,this.projectService.serverMode),c&&this.disableLanguageService(c),this.markAsDirty(),bN(this)||(this.projectService.pendingEnsureProjectForOpenFiles=!0),this.projectService.onProjectCreation(this)}getResolvedProjectReferenceToRedirect(t){}isNonTsProject(){return Tf(this),tpe(this)}isJsOnlyProject(){return Tf(this),OZe(this)}static resolveModule(t,r,i,s){return fIe.importServicePluginSync({name:t},[r],i,s).resolvedModule}static importServicePluginSync(t,r,i,s){E.assertIsDefined(i.require);let o,c;for(const u of r){const f=du(i.resolvePath(Hn(u,"node_modules")));s(`Loading ${t.name} from ${u} (resolved to ${f})`);const g=i.require(f,t.name);if(!g.error){c=g.module;break}const p=g.error.stack||g.error.message||JSON.stringify(g.error);(o??(o=[])).push(`Failed to load module '${t.name}' from ${f}: ${p}`)}return{pluginConfigEntry:t,resolvedModule:c,errorLogs:o}}static async importServicePluginAsync(t,r,i,s){E.assertIsDefined(i.importPlugin);let o,c;for(const u of r){const f=Hn(u,"node_modules");s(`Dynamically importing ${t.name} from ${u} (resolved to ${f})`);let g;try{g=await i.importPlugin(f,t.name)}catch(y){g={module:void 0,error:y}}if(!g.error){c=g.module;break}const p=g.error.stack||g.error.message||JSON.stringify(g.error);(o??(o=[])).push(`Failed to dynamically import module '${t.name}' from ${f}: ${p}`)}return{pluginConfigEntry:t,resolvedModule:c,errorLogs:o}}isKnownTypesPackageName(t){return this.typingsCache.isKnownTypesPackageName(t)}installPackage(t){return this.typingsCache.installPackage({...t,projectName:this.projectName,projectRootPath:this.toPath(this.currentDirectory)})}getGlobalTypingsCacheLocation(){return this.getGlobalCache()}get typingsCache(){return this.projectService.typingsCache}getSymlinkCache(){return this.symlinks||(this.symlinks=Bz(this.getCurrentDirectory(),this.getCanonicalFileName)),this.program&&!this.symlinks.hasProcessedResolutions()&&this.symlinks.setSymlinksFromResolutions(this.program.forEachResolvedModule,this.program.forEachResolvedTypeReferenceDirective,this.program.getAutomaticTypeDirectiveResolutions()),this.symlinks}getCompilationSettings(){return this.compilerOptions}getCompilerOptions(){return this.getCompilationSettings()}getNewLine(){return this.projectService.host.newLine}getProjectVersion(){return this.projectStateVersion.toString()}getProjectReferences(){}getScriptFileNames(){if(!this.rootFiles)return ze;let t;return this.rootFilesMap.forEach(r=>{(this.languageServiceEnabled||r.info&&r.info.isScriptOpen())&&(t||(t=[])).push(r.fileName)}),Dn(t,this.typingFiles)||ze}getOrCreateScriptInfoAndAttachToProject(t){const r=this.projectService.getOrCreateScriptInfoNotOpenedByClient(t,this.currentDirectory,this.directoryStructureHost);if(r){const i=this.rootFilesMap.get(r.path);i&&i.info!==r&&(this.rootFiles.push(r),i.info=r),r.attachToProject(this)}return r}getScriptKind(t){const r=this.projectService.getScriptInfoForPath(this.toPath(t));return r&&r.scriptKind}getScriptVersion(t){const r=this.projectService.getOrCreateScriptInfoNotOpenedByClient(t,this.currentDirectory,this.directoryStructureHost);return r&&r.getLatestVersion()}getScriptSnapshot(t){const r=this.getOrCreateScriptInfoAndAttachToProject(t);if(r)return r.getSnapshot()}getCancellationToken(){return this.cancellationToken}getCurrentDirectory(){return this.currentDirectory}getDefaultLibFileName(){const t=qn(qs(this.projectService.getExecutingFilePath()));return Hn(t,fP(this.compilerOptions))}useCaseSensitiveFileNames(){return this.projectService.host.useCaseSensitiveFileNames}readDirectory(t,r,i,s,o){return this.directoryStructureHost.readDirectory(t,r,i,s,o)}readFile(t){return this.projectService.host.readFile(t)}writeFile(t,r){return this.projectService.host.writeFile(t,r)}fileExists(t){const r=this.toPath(t);return!this.isWatchedMissingFile(r)&&this.directoryStructureHost.fileExists(t)}resolveModuleNameLiterals(t,r,i,s,o,c){return this.resolutionCache.resolveModuleNameLiterals(t,r,i,s,o,c)}getModuleResolutionCache(){return this.resolutionCache.getModuleResolutionCache()}resolveTypeReferenceDirectiveReferences(t,r,i,s,o,c){return this.resolutionCache.resolveTypeReferenceDirectiveReferences(t,r,i,s,o,c)}resolveLibrary(t,r,i,s){return this.resolutionCache.resolveLibrary(t,r,i,s)}directoryExists(t){return this.directoryStructureHost.directoryExists(t)}getDirectories(t){return this.directoryStructureHost.getDirectories(t)}getCachedDirectoryStructureHost(){}toPath(t){return fo(t,this.currentDirectory,this.projectService.toCanonicalFileName)}watchDirectoryOfFailedLookupLocation(t,r,i){return this.projectService.watchFactory.watchDirectory(t,r,i,this.projectService.getWatchOptions(this),al.FailedLookupLocations,this)}watchAffectingFileLocation(t,r){return this.projectService.watchFactory.watchFile(t,r,2e3,this.projectService.getWatchOptions(this),al.AffectingFileLocation,this)}clearInvalidateResolutionOfFailedLookupTimer(){return this.projectService.throttledOperations.cancel(`${this.getProjectName()}FailedLookupInvalidation`)}scheduleInvalidateResolutionsOfFailedLookupLocations(){this.projectService.throttledOperations.schedule(`${this.getProjectName()}FailedLookupInvalidation`,1e3,()=>{this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()&&this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)})}invalidateResolutionsOfFailedLookupLocations(){this.clearInvalidateResolutionOfFailedLookupTimer()&&this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()&&(this.markAsDirty(),this.projectService.delayEnsureProjectForOpenFiles())}onInvalidatedResolution(){this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}watchTypeRootsDirectory(t,r,i){return this.projectService.watchFactory.watchDirectory(t,r,i,this.projectService.getWatchOptions(this),al.TypeRoots,this)}hasChangedAutomaticTypeDirectiveNames(){return this.resolutionCache.hasChangedAutomaticTypeDirectiveNames()}onChangedAutomaticTypeDirectiveNames(){this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}getGlobalCache(){return this.getTypeAcquisition().enable?this.projectService.typingsInstaller.globalTypingsCacheLocation:void 0}fileIsOpen(t){return this.projectService.openFiles.has(t)}writeLog(t){this.projectService.logger.info(t)}log(t){this.writeLog(t)}error(t){this.projectService.logger.msg(t,"Err")}setInternalCompilerOptionsForEmittingJsFiles(){(this.projectKind===0||this.projectKind===2)&&(this.compilerOptions.noEmitForJsFiles=!0)}getGlobalProjectErrors(){return wn(this.projectErrors,t=>!t.file)||Gc}getAllProjectErrors(){return this.projectErrors||Gc}setProjectErrors(t){this.projectErrors=t}getLanguageService(t=!0){return t&&Tf(this),this.languageService}getSourceMapper(){return this.getLanguageService().getSourceMapper()}clearSourceMapperCache(){this.languageService.clearSourceMapperCache()}getDocumentPositionMapper(t,r){return this.projectService.getDocumentPositionMapper(this,t,r)}getSourceFileLike(t){return this.projectService.getSourceFileLike(t,this)}shouldEmitFile(t){return t&&!t.isDynamicOrHasMixedContent()&&!this.program.isSourceOfProjectReferenceRedirect(t.path)}getCompileOnSaveAffectedFileList(t){return this.languageServiceEnabled?(Tf(this),this.builderState=Vp.create(this.program,this.builderState,!0),Ii(Vp.getFilesAffectedBy(this.builderState,this.program,t.path,this.cancellationToken,this.projectService.host),r=>this.shouldEmitFile(this.projectService.getScriptInfoForPath(r.path))?r.fileName:void 0)):[]}emitFile(t,r){if(!this.languageServiceEnabled||!this.shouldEmitFile(t))return{emitSkipped:!0,diagnostics:Gc};const{emitSkipped:i,diagnostics:s,outputFiles:o}=this.getLanguageService().getEmitOutput(t.fileName);if(!i){for(const c of o){const u=is(c.name,this.currentDirectory);r(u,c.text,c.writeByteOrderMark)}if(this.builderState&&Rf(this.compilerOptions)){const c=o.filter(u=>Il(u.name));if(c.length===1){const u=this.program.getSourceFile(t.fileName),f=this.projectService.host.createHash?this.projectService.host.createHash(c[0].text):v4(c[0].text);Vp.updateSignatureOfFile(this.builderState,f,u.resolvedPath)}}}return{emitSkipped:i,diagnostics:s}}enableLanguageService(){this.languageServiceEnabled||this.projectService.serverMode===2||(this.languageServiceEnabled=!0,this.lastFileExceededProgramSize=void 0,this.projectService.onUpdateLanguageServiceStateForProject(this,!0))}cleanupProgram(){if(this.program){for(const t of this.program.getSourceFiles())this.detachScriptInfoIfNotRoot(t.fileName);this.program.forEachResolvedProjectReference(t=>this.detachScriptInfoFromProject(t.sourceFile.fileName)),this.program=void 0}}disableLanguageService(t){this.languageServiceEnabled&&(E.assert(this.projectService.serverMode!==2),this.languageService.cleanupSemanticCache(),this.languageServiceEnabled=!1,this.cleanupProgram(),this.lastFileExceededProgramSize=t,this.builderState=void 0,this.autoImportProviderHost&&this.autoImportProviderHost.close(),this.autoImportProviderHost=void 0,this.resolutionCache.closeTypeRootsWatch(),this.clearGeneratedFileWatch(),this.projectService.verifyDocumentRegistry(),this.projectService.onUpdateLanguageServiceStateForProject(this,!1))}getProjectName(){return this.projectName}removeLocalTypingsFromTypeAcquisition(t){return!t||!t.include?t:{...t,include:this.removeExistingTypings(t.include)}}getExternalFiles(t){return qS(ta(this.plugins,r=>{if(typeof r.module.getExternalFiles=="function")try{return r.module.getExternalFiles(this,t||0)}catch(i){this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${i}`),i.stack&&this.projectService.logger.info(i.stack)}}))}getSourceFile(t){if(this.program)return this.program.getSourceFileByPath(t)}getSourceFileOrConfigFile(t){const r=this.program.getCompilerOptions();return t===r.configFilePath?r.configFile:this.getSourceFile(t)}close(){this.projectService.typingsCache.onProjectClosed(this),this.closeWatchingTypingLocations(),this.cleanupProgram(),Zt(this.externalFiles,t=>this.detachScriptInfoIfNotRoot(t));for(const t of this.rootFiles)t.detachFromProject(this);this.projectService.pendingEnsureProjectForOpenFiles=!0,this.rootFiles=void 0,this.rootFilesMap=void 0,this.externalFiles=void 0,this.program=void 0,this.builderState=void 0,this.resolutionCache.clear(),this.resolutionCache=void 0,this.cachedUnresolvedImportsPerFile=void 0,this.moduleSpecifierCache=void 0,this.directoryStructureHost=void 0,this.exportMapCache=void 0,this.projectErrors=void 0,this.plugins.length=0,this.missingFilesMap&&(o_(this.missingFilesMap,rd),this.missingFilesMap=void 0),this.clearGeneratedFileWatch(),this.clearInvalidateResolutionOfFailedLookupTimer(),this.autoImportProviderHost&&this.autoImportProviderHost.close(),this.autoImportProviderHost=void 0,this.noDtsResolutionProject&&this.noDtsResolutionProject.close(),this.noDtsResolutionProject=void 0,this.languageService.dispose(),this.languageService=void 0}detachScriptInfoIfNotRoot(t){const r=this.projectService.getScriptInfo(t);r&&!this.isRoot(r)&&r.detachFromProject(this)}isClosed(){return this.rootFiles===void 0}hasRoots(){return this.rootFiles&&this.rootFiles.length>0}isOrphan(){return!1}getRootFiles(){return this.rootFiles&&this.rootFiles.map(t=>t.fileName)}getRootFilesMap(){return this.rootFilesMap}getRootScriptInfos(){return this.rootFiles}getScriptInfos(){return this.languageServiceEnabled?Yt(this.program.getSourceFiles(),t=>{const r=this.projectService.getScriptInfoForPath(t.resolvedPath);return E.assert(!!r,"getScriptInfo",()=>`scriptInfo for a file '${t.fileName}' Path: '${t.path}' / '${t.resolvedPath}' is missing.`),r}):this.rootFiles}getExcludedFiles(){return Gc}getFileNames(t,r){if(!this.program)return[];if(!this.languageServiceEnabled){let s=this.getRootFiles();if(this.compilerOptions){const o=Kce(this.compilerOptions);o&&(s||(s=[])).push(o)}return s}const i=[];for(const s of this.program.getSourceFiles())t&&this.program.isSourceFileFromExternalLibrary(s)||i.push(s.fileName);if(!r){const s=this.program.getCompilerOptions().configFile;if(s&&(i.push(s.fileName),s.extendedSourceFiles))for(const o of s.extendedSourceFiles)i.push(o)}return i}getFileNamesWithRedirectInfo(t){return this.getFileNames().map(r=>({fileName:r,isSourceOfProjectReferenceRedirect:t&&this.isSourceOfProjectReferenceRedirect(r)}))}hasConfigFile(t){if(this.program&&this.languageServiceEnabled){const r=this.program.getCompilerOptions().configFile;if(r){if(t===r.fileName)return!0;if(r.extendedSourceFiles){for(const i of r.extendedSourceFiles)if(t===i)return!0}}}return!1}containsScriptInfo(t){if(this.isRoot(t))return!0;if(!this.program)return!1;const r=this.program.getSourceFileByPath(t.path);return!!r&&r.resolvedPath===t.path}containsFile(t,r){const i=this.projectService.getScriptInfoForNormalizedPath(t);return i&&(i.isScriptOpen()||!r)?this.containsScriptInfo(i):!1}isRoot(t){var r;return this.rootFilesMap&&((r=this.rootFilesMap.get(t.path))==null?void 0:r.info)===t}addRoot(t,r){E.assert(!this.isRoot(t)),this.rootFiles.push(t),this.rootFilesMap.set(t.path,{fileName:r||t.fileName,info:t}),t.attachToProject(this),this.markAsDirty()}addMissingFileRoot(t){const r=this.projectService.toPath(t);this.rootFilesMap.set(r,{fileName:t}),this.markAsDirty()}removeFile(t,r,i){this.isRoot(t)&&this.removeRoot(t),r?this.resolutionCache.removeResolutionsOfFile(t.path):this.resolutionCache.invalidateResolutionOfFile(t.path),this.cachedUnresolvedImportsPerFile.delete(t.path),i&&t.detachFromProject(this),this.markAsDirty()}registerFileUpdate(t){(this.updatedFileNames||(this.updatedFileNames=new Set)).add(t)}markFileAsDirty(t){this.markAsDirty(),this.exportMapCache&&!this.exportMapCache.isEmpty()&&(this.changedFilesForExportMapCache||(this.changedFilesForExportMapCache=new Set)).add(t)}markAsDirty(){this.dirty||(this.projectStateVersion++,this.dirty=!0)}onAutoImportProviderSettingsChanged(){var t;this.autoImportProviderHost===!1?this.autoImportProviderHost=void 0:(t=this.autoImportProviderHost)==null||t.markAsDirty()}onPackageJsonChange(t){var r;(r=this.packageJsonsForAutoImport)!=null&&r.has(t)&&(this.moduleSpecifierCache.clear(),this.autoImportProviderHost&&this.autoImportProviderHost.markAsDirty())}onFileAddedOrRemoved(t){this.hasAddedorRemovedFiles=!0,t&&(this.hasAddedOrRemovedSymlinks=!0)}onDiscoveredSymlink(){this.hasAddedOrRemovedSymlinks=!0}updateGraph(){var t,r,i,s,o;(t=Jr)==null||t.push(Jr.Phase.Session,"updateGraph",{name:this.projectName,kind:X3[this.projectKind]}),(r=Pu)==null||r.logStartUpdateGraph(),this.resolutionCache.startRecordingFilesWithChangedResolutions();const c=this.updateGraphWorker(),u=this.hasAddedorRemovedFiles;this.hasAddedorRemovedFiles=!1,this.hasAddedOrRemovedSymlinks=!1;const f=this.resolutionCache.finishRecordingFilesWithChangedResolutions()||Gc;for(const p of f)this.cachedUnresolvedImportsPerFile.delete(p);this.languageServiceEnabled&&this.projectService.serverMode===0?((c||f.length)&&(this.lastCachedUnresolvedImportsList=LZe(this.program,this.cachedUnresolvedImportsPerFile)),this.projectService.typingsCache.enqueueInstallTypingsForProject(this,this.lastCachedUnresolvedImportsList,u)):this.lastCachedUnresolvedImportsList=void 0;const g=this.projectProgramVersion===0&&c;return c&&this.projectProgramVersion++,u&&(this.autoImportProviderHost||(this.autoImportProviderHost=void 0),(i=this.autoImportProviderHost)==null||i.markAsDirty()),g&&this.getPackageJsonAutoImportProvider(),(s=Pu)==null||s.logStopUpdateGraph(),(o=Jr)==null||o.pop(),!c}updateTypingFiles(t){N7(t,this.typingFiles,d4(!this.useCaseSensitiveFileNames()),Ca,r=>this.detachScriptInfoFromProject(r))&&(this.typingFiles=t,this.resolutionCache.setFilesWithInvalidatedNonRelativeUnresolvedImports(this.cachedUnresolvedImportsPerFile),this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this))}closeWatchingTypingLocations(){this.typingWatchers&&o_(this.typingWatchers,rd),this.typingWatchers=void 0}onTypingInstallerWatchInvoke(){this.typingWatchers.isInvoked=!0,this.projectService.updateTypingsForProject({projectName:this.getProjectName(),kind:P9})}watchTypingLocations(t){if(!t){this.typingWatchers.isInvoked=!1;return}if(!t.length){this.closeWatchingTypingLocations();return}const r=new Map(this.typingWatchers);this.typingWatchers||(this.typingWatchers=new Map),this.typingWatchers.isInvoked=!1;const i=(s,o)=>{const c=this.toPath(s);r.delete(c),this.typingWatchers.has(c)||this.typingWatchers.set(c,o==="FileWatcher"?this.projectService.watchFactory.watchFile(s,()=>this.typingWatchers.isInvoked?this.writeLog("TypingWatchers already invoked"):this.onTypingInstallerWatchInvoke(),2e3,this.projectService.getWatchOptions(this),al.TypingInstallerLocationFile,this):this.projectService.watchFactory.watchDirectory(s,u=>{if(this.typingWatchers.isInvoked)return this.writeLog("TypingWatchers already invoked");if(!Ho(u,".json"))return this.writeLog("Ignoring files that are not *.json");if(qy(u,Hn(this.projectService.typingsInstaller.globalTypingsCacheLocation,"package.json"),!this.useCaseSensitiveFileNames()))return this.writeLog("Ignoring package.json change at global typings location");this.onTypingInstallerWatchInvoke()},1,this.projectService.getWatchOptions(this),al.TypingInstallerLocationDirectory,this))};for(const s of t){const o=Pc(s);if(o==="package.json"||o==="bower.json"){i(s,"FileWatcher");continue}if(dm(this.currentDirectory,s,this.currentDirectory,!this.useCaseSensitiveFileNames())){const c=s.indexOf(Co,this.currentDirectory.length+1);i(c!==-1?s.substr(0,c):s,"DirectoryWatcher");continue}if(dm(this.projectService.typingsInstaller.globalTypingsCacheLocation,s,this.currentDirectory,!this.useCaseSensitiveFileNames())){i(this.projectService.typingsInstaller.globalTypingsCacheLocation,"DirectoryWatcher");continue}i(s,"DirectoryWatcher")}r.forEach((s,o)=>{s.close(),this.typingWatchers.delete(o)})}getCurrentProgram(){return this.program}removeExistingTypings(t){const r=yO(this.getCompilerOptions(),this.directoryStructureHost);return t.filter(i=>!r.includes(i))}updateGraphWorker(){var t,r;const i=this.languageService.getCurrentProgram();E.assert(i===this.program),E.assert(!this.isClosed(),"Called update graph worker of closed project"),this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`);const s=_o(),{hasInvalidatedResolutions:o,hasInvalidatedLibResolutions:c}=this.resolutionCache.createHasInvalidatedResolutions(Kp,Kp);this.hasInvalidatedResolutions=o,this.hasInvalidatedLibResolutions=c,this.resolutionCache.startCachingPerDirectoryResolution(),this.program=this.languageService.getProgram(),this.dirty=!1,(t=Jr)==null||t.push(Jr.Phase.Session,"finishCachingPerDirectoryResolution"),this.resolutionCache.finishCachingPerDirectoryResolution(this.program,i),(r=Jr)==null||r.pop(),E.assert(i===void 0||this.program!==void 0);let u=!1;if(this.program&&(!i||this.program!==i&&this.program.structureIsReused!==2)){if(u=!0,i){for(const p of i.getSourceFiles()){const y=this.program.getSourceFileByPath(p.resolvedPath);(!y||p.resolvedPath===p.path&&y.resolvedPath!==p.path)&&this.detachScriptInfoFromProject(p.fileName,!!this.program.getSourceFileByPath(p.path),!0)}i.forEachResolvedProjectReference(p=>{this.program.getResolvedProjectReferenceByPath(p.sourceFile.path)||this.detachScriptInfoFromProject(p.sourceFile.fileName,void 0,!0)})}if(IV(this.program,this.missingFilesMap||(this.missingFilesMap=new Map),p=>this.addMissingFileWatcher(p)),this.generatedFilesMap){const p=to(this.compilerOptions);npe(this.generatedFilesMap)?(!p||!this.isValidGeneratedFileWatcher(Ou(p)+".d.ts",this.generatedFilesMap))&&this.clearGeneratedFileWatch():p?this.clearGeneratedFileWatch():this.generatedFilesMap.forEach((y,S)=>{const T=this.program.getSourceFileByPath(S);(!T||T.resolvedPath!==S||!this.isValidGeneratedFileWatcher(f5(T.fileName,this.compilerOptions,this.currentDirectory,this.program.getCommonSourceDirectory(),this.getCanonicalFileName),y))&&(hf(y),this.generatedFilesMap.delete(S))})}this.languageServiceEnabled&&this.projectService.serverMode===0&&this.resolutionCache.updateTypeRootsWatch()}this.projectService.verifyProgram(this),this.exportMapCache&&!this.exportMapCache.isEmpty()&&(this.exportMapCache.releaseSymbols(),this.hasAddedorRemovedFiles||i&&!this.program.structureIsReused?this.exportMapCache.clear():this.changedFilesForExportMapCache&&i&&this.program&&ng(this.changedFilesForExportMapCache,p=>{const y=i.getSourceFileByPath(p),S=this.program.getSourceFileByPath(p);return!y||!S?(this.exportMapCache.clear(),!0):this.exportMapCache.onFileChanged(y,S,!!this.getTypeAcquisition().enable)})),this.changedFilesForExportMapCache&&this.changedFilesForExportMapCache.clear(),(this.hasAddedOrRemovedSymlinks||this.program&&!this.program.structureIsReused&&this.getCompilerOptions().preserveSymlinks)&&(this.symlinks=void 0,this.moduleSpecifierCache.clear());const f=this.externalFiles||Gc;this.externalFiles=this.getExternalFiles(),N7(this.externalFiles,f,d4(!this.useCaseSensitiveFileNames()),p=>{const y=this.projectService.getOrCreateScriptInfoNotOpenedByClient(p,this.currentDirectory,this.directoryStructureHost);y?.attachToProject(this)},p=>this.detachScriptInfoFromProject(p));const g=_o()-s;return this.sendPerformanceEvent("UpdateGraph",g),this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${u}${this.program?` structureIsReused:: ${z7[this.program.structureIsReused]}`:""} Elapsed: ${g}ms`),this.projectService.logger.isTestLogger?this.program!==i?this.print(!0,this.hasAddedorRemovedFiles,!0):this.writeLog("Same program as before"):this.hasAddedorRemovedFiles?this.print(!0,!0,!1):this.program!==i&&this.writeLog("Different program with same set of files"),this.projectService.verifyDocumentRegistry(),u}sendPerformanceEvent(t,r){this.projectService.sendPerformanceEvent(t,r)}detachScriptInfoFromProject(t,r,i){const s=this.projectService.getScriptInfo(t);s&&(s.detachFromProject(this),r||this.resolutionCache.removeResolutionsOfFile(s.path,i))}addMissingFileWatcher(t){var r;if(P1(this)){const s=this.projectService.configFileExistenceInfoCache.get(t);if((r=s?.config)!=null&&r.projects.has(this.canonicalConfigFilePath))return zC}const i=this.projectService.watchFactory.watchFile(t,(s,o)=>{P1(this)&&this.getCachedDirectoryStructureHost().addOrDeleteFile(s,t,o),o===0&&this.missingFilesMap.has(t)&&(this.missingFilesMap.delete(t),i.close(),this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this))},500,this.projectService.getWatchOptions(this),al.MissingFile,this);return i}isWatchedMissingFile(t){return!!this.missingFilesMap&&this.missingFilesMap.has(t)}addGeneratedFileWatch(t,r){if(to(this.compilerOptions))this.generatedFilesMap||(this.generatedFilesMap=this.createGeneratedFileWatcher(t));else{const i=this.toPath(r);if(this.generatedFilesMap){if(npe(this.generatedFilesMap)){E.fail(`${this.projectName} Expected to not have --out watcher for generated file with options: ${JSON.stringify(this.compilerOptions)}`);return}if(this.generatedFilesMap.has(i))return}else this.generatedFilesMap=new Map;this.generatedFilesMap.set(i,this.createGeneratedFileWatcher(t))}}createGeneratedFileWatcher(t){return{generatedFilePath:this.toPath(t),watcher:this.projectService.watchFactory.watchFile(t,()=>{this.clearSourceMapperCache(),this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)},2e3,this.projectService.getWatchOptions(this),al.MissingGeneratedFile,this)}}isValidGeneratedFileWatcher(t,r){return this.toPath(t)===r.generatedFilePath}clearGeneratedFileWatch(){this.generatedFilesMap&&(npe(this.generatedFilesMap)?hf(this.generatedFilesMap):o_(this.generatedFilesMap,hf),this.generatedFilesMap=void 0)}getScriptInfoForNormalizedPath(t){const r=this.projectService.getScriptInfoForPath(this.toPath(t));return r&&!r.isAttached(this)?r0.ThrowProjectDoesNotContainDocument(t,this):r}getScriptInfo(t){return this.projectService.getScriptInfo(t)}filesToString(t){return this.filesToStringWorker(t,!0,!1)}filesToStringWorker(t,r,i){if(this.isInitialLoadPending())return` Files (0) InitialLoadPending +`;if(!this.program)return` Files (0) NoProgram +`;const s=this.program.getSourceFiles();let o=` Files (${s.length}) +`;if(t){for(const c of s)o+=` ${c.fileName}${i?` ${c.version} ${JSON.stringify(c.text)}`:""} +`;r&&(o+=` + +`,fq(this.program,c=>o+=` ${c} +`))}return o}print(t,r,i){this.writeLog(`Project '${this.projectName}' (${X3[this.projectKind]})`),this.writeLog(this.filesToStringWorker(t&&this.projectService.logger.hasLevel(3),r&&this.projectService.logger.hasLevel(3),i&&this.projectService.logger.hasLevel(3))),this.writeLog("-----------------------------------------------"),this.autoImportProviderHost&&this.autoImportProviderHost.print(!1,!1,!1)}setCompilerOptions(t){var r;if(t){t.allowNonTsExtensions=!0;const i=this.compilerOptions;this.compilerOptions=t,this.setInternalCompilerOptionsForEmittingJsFiles(),(r=this.noDtsResolutionProject)==null||r.setCompilerOptions(this.getCompilerOptionsForNoDtsResolutionProject()),CI(i,t)&&(this.cachedUnresolvedImportsPerFile.clear(),this.lastCachedUnresolvedImportsList=void 0,this.resolutionCache.onChangesAffectModuleResolution(),this.moduleSpecifierCache.clear()),this.markAsDirty()}}setWatchOptions(t){this.watchOptions=t}getWatchOptions(){return this.watchOptions}setTypeAcquisition(t){t&&(this.typeAcquisition=this.removeLocalTypingsFromTypeAcquisition(t))}getTypeAcquisition(){return this.typeAcquisition||{}}getChangesSinceVersion(t,r){var i,s;const o=r?f=>fs(f.entries(),([g,p])=>({fileName:g,isSourceOfProjectReferenceRedirect:p})):f=>fs(f.keys());this.isInitialLoadPending()||Tf(this);const c={projectName:this.getProjectName(),version:this.projectProgramVersion,isInferred:p6(this),options:this.getCompilationSettings(),languageServiceDisabled:!this.languageServiceEnabled,lastFileExceededProgramSize:this.lastFileExceededProgramSize},u=this.updatedFileNames;if(this.updatedFileNames=void 0,this.lastReportedFileNames&&t===this.lastReportedVersion){if(this.projectProgramVersion===this.lastReportedVersion&&!u)return{info:c,projectErrors:this.getGlobalProjectErrors()};const f=this.lastReportedFileNames,g=((i=this.externalFiles)==null?void 0:i.map(w=>({fileName:Lo(w),isSourceOfProjectReferenceRedirect:!1})))||Gc,p=Ph(this.getFileNamesWithRedirectInfo(!!r).concat(g),w=>w.fileName,w=>w.isSourceOfProjectReferenceRedirect),y=new Map,S=new Map,T=u?fs(u.keys()):[],C=[];return zl(p,(w,D)=>{f.has(D)?r&&w!==f.get(D)&&C.push({fileName:D,isSourceOfProjectReferenceRedirect:w}):y.set(D,w)}),zl(f,(w,D)=>{p.has(D)||S.set(D,w)}),this.lastReportedFileNames=p,this.lastReportedVersion=this.projectProgramVersion,{info:c,changes:{added:o(y),removed:o(S),updated:r?T.map(w=>({fileName:w,isSourceOfProjectReferenceRedirect:this.isSourceOfProjectReferenceRedirect(w)})):T,updatedRedirects:r?C:void 0},projectErrors:this.getGlobalProjectErrors()}}else{const f=this.getFileNamesWithRedirectInfo(!!r),g=((s=this.externalFiles)==null?void 0:s.map(y=>({fileName:Lo(y),isSourceOfProjectReferenceRedirect:!1})))||Gc,p=f.concat(g);return this.lastReportedFileNames=Ph(p,y=>y.fileName,y=>y.isSourceOfProjectReferenceRedirect),this.lastReportedVersion=this.projectProgramVersion,{info:c,files:r?p:p.map(y=>y.fileName),projectErrors:this.getGlobalProjectErrors()}}}removeRoot(t){HD(this.rootFiles,t),this.rootFilesMap.delete(t.path)}isSourceOfProjectReferenceRedirect(t){return!!this.program&&this.program.isSourceOfProjectReferenceRedirect(t)}getGlobalPluginSearchPaths(){return[...this.projectService.pluginProbeLocations,Hn(this.projectService.getExecutingFilePath(),"../../..")]}enableGlobalPlugins(t){if(!this.projectService.globalPlugins.length)return;const r=this.projectService.host;if(!r.require&&!r.importPlugin){this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");return}const i=this.getGlobalPluginSearchPaths();for(const s of this.projectService.globalPlugins)s&&(t.plugins&&t.plugins.some(o=>o.name===s)||(this.projectService.logger.info(`Loading global plugin ${s}`),this.enablePlugin({name:s,global:!0},i)))}enablePlugin(t,r){this.projectService.requestEnablePlugin(this,t,r)}enableProxy(t,r){try{if(typeof t!="function"){this.projectService.logger.info(`Skipped loading plugin ${r.name} because it did not expose a proper factory function`);return}const i={config:r,project:this,languageService:this.languageService,languageServiceHost:this,serverHost:this.projectService.host,session:this.projectService.session},s=t({typescript:HDe}),o=s.create(i);for(const c of Object.keys(this.languageService))c in o||(this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${c} in created LS. Patching.`),o[c]=this.languageService[c]);this.projectService.logger.info("Plugin validation succeeded"),this.languageService=o,this.plugins.push({name:r.name,module:s})}catch(i){this.projectService.logger.info(`Plugin activation failed: ${i}`)}}onPluginConfigurationChanged(t,r){this.plugins.filter(i=>i.name===t).forEach(i=>{i.module.onConfigurationChanged&&i.module.onConfigurationChanged(r)})}refreshDiagnostics(){this.projectService.sendProjectsUpdatedInBackgroundEvent()}getPackageJsonsVisibleToFile(t,r){return this.projectService.serverMode!==0?Gc:this.projectService.getPackageJsonsVisibleToFile(t,r)}getNearestAncestorDirectoryWithPackageJson(t){return this.projectService.getNearestAncestorDirectoryWithPackageJson(t)}getPackageJsonsForAutoImport(t){const r=this.getPackageJsonsVisibleToFile(Hn(this.currentDirectory,jC),t);return this.packageJsonsForAutoImport=new Set(r.map(i=>i.fileName)),r}getPackageJsonCache(){return this.projectService.packageJsonCache}getCachedExportInfoMap(){return this.exportMapCache||(this.exportMapCache=QH(this))}clearCachedExportInfoMap(){var t;(t=this.exportMapCache)==null||t.clear()}getModuleSpecifierCache(){return this.moduleSpecifierCache}includePackageJsonAutoImports(){return this.projectService.includePackageJsonAutoImports()===0||!this.languageServiceEnabled||wA(this.currentDirectory)||!this.isDefaultProjectForOpenFiles()?0:this.projectService.includePackageJsonAutoImports()}getHostForAutoImportProvider(){var t,r;return this.program?{fileExists:this.program.fileExists,directoryExists:this.program.directoryExists,realpath:this.program.realpath||((t=this.projectService.host.realpath)==null?void 0:t.bind(this.projectService.host)),getCurrentDirectory:this.getCurrentDirectory.bind(this),readFile:this.projectService.host.readFile.bind(this.projectService.host),getDirectories:this.projectService.host.getDirectories.bind(this.projectService.host),trace:(r=this.projectService.host.trace)==null?void 0:r.bind(this.projectService.host),useCaseSensitiveFileNames:this.program.useCaseSensitiveFileNames(),readDirectory:this.projectService.host.readDirectory.bind(this.projectService.host)}:this.projectService.host}getPackageJsonAutoImportProvider(){var t,r,i;if(this.autoImportProviderHost===!1)return;if(this.projectService.serverMode!==0){this.autoImportProviderHost=!1;return}if(this.autoImportProviderHost){if(Tf(this.autoImportProviderHost),this.autoImportProviderHost.isEmpty()){this.autoImportProviderHost.close(),this.autoImportProviderHost=void 0;return}return this.autoImportProviderHost.getCurrentProgram()}const s=this.includePackageJsonAutoImports();if(s){(t=Jr)==null||t.push(Jr.Phase.Session,"getPackageJsonAutoImportProvider");const o=_o();if(this.autoImportProviderHost=TQ.create(s,this,this.getHostForAutoImportProvider(),this.documentRegistry),this.autoImportProviderHost)return Tf(this.autoImportProviderHost),this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider",_o()-o),(r=Jr)==null||r.pop(),this.autoImportProviderHost.getCurrentProgram();(i=Jr)==null||i.pop()}}isDefaultProjectForOpenFiles(){return!!zl(this.projectService.openFiles,(t,r)=>this.projectService.tryGetDefaultProjectForFile(Lo(r))===this)}watchNodeModulesForPackageJsonChanges(t){return this.projectService.watchPackageJsonsInNodeModules(this.toPath(t),this)}getIncompleteCompletionsCache(){return this.projectService.getIncompleteCompletionsCache()}getNoDtsResolutionProject(t){return E.assert(this.projectService.serverMode===0),this.noDtsResolutionProject||(this.noDtsResolutionProject=new bQ(this.projectService,this.documentRegistry,this.getCompilerOptionsForNoDtsResolutionProject(),this.currentDirectory)),this.noDtsResolutionProject.rootFile!==t&&(this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this.noDtsResolutionProject,[t]),this.noDtsResolutionProject.rootFile=t),this.noDtsResolutionProject}getCompilerOptionsForNoDtsResolutionProject(){return{...this.getCompilerOptions(),noDtsResolution:!0,allowJs:!0,maxNodeModuleJsDepth:3,diagnostics:!1,skipLibCheck:!0,sourceMap:!1,types:ze,lib:ze,noLib:!0}}},vQ=class extends Zb{constructor(e,t,r,i,s,o,c){super(e.newInferredProjectName(),0,e,t,void 0,void 0,r,!1,i,e.host,o),this._isJsInferredProject=!1,this.typeAcquisition=c,this.projectRootPath=s&&e.toCanonicalFileName(s),!s&&!e.useSingleInferredProject&&(this.canonicalCurrentDirectory=e.toCanonicalFileName(this.currentDirectory)),this.enableGlobalPlugins(this.getCompilerOptions())}toggleJsInferredProject(e){e!==this._isJsInferredProject&&(this._isJsInferredProject=e,this.setCompilerOptions())}setCompilerOptions(e){if(!e&&!this.getCompilationSettings())return;const t=dH(e||this.getCompilationSettings());this._isJsInferredProject&&typeof t.maxNodeModuleJsDepth!="number"?t.maxNodeModuleJsDepth=2:this._isJsInferredProject||(t.maxNodeModuleJsDepth=void 0),t.allowJs=!0,super.setCompilerOptions(t)}addRoot(e){E.assert(e.isScriptOpen()),this.projectService.startWatchingConfigFilesForInferredProjectRoot(e),!this._isJsInferredProject&&e.isJavaScript()?this.toggleJsInferredProject(!0):this.isOrphan()&&this._isJsInferredProject&&!e.isJavaScript()&&this.toggleJsInferredProject(!1),super.addRoot(e)}removeRoot(e){this.projectService.stopWatchingConfigFilesForInferredProjectRoot(e),super.removeRoot(e),!this.isOrphan()&&this._isJsInferredProject&&e.isJavaScript()&&qi(this.getRootScriptInfos(),t=>!t.isJavaScript())&&this.toggleJsInferredProject(!1)}isOrphan(){return!this.hasRoots()}isProjectWithSingleRoot(){return!this.projectRootPath&&!this.projectService.useSingleInferredProject||this.getRootScriptInfos().length===1}close(){Zt(this.getRootScriptInfos(),e=>this.projectService.stopWatchingConfigFilesForInferredProjectRoot(e)),super.close()}getTypeAcquisition(){return this.typeAcquisition||{enable:epe(this),include:ze,exclude:ze}}},bQ=class extends Zb{constructor(e,t,r,i){super(e.newAuxiliaryProjectName(),4,e,t,!1,void 0,r,!1,void 0,e.host,i)}isOrphan(){return!0}scheduleInvalidateResolutionsOfFailedLookupLocations(){}},SQ=class the extends Zb{constructor(t,r,i,s){super(t.projectService.newAutoImportProviderProjectName(),3,t.projectService,i,!1,void 0,s,!1,t.getWatchOptions(),t.projectService.host,t.currentDirectory),this.hostProject=t,this.rootFileNames=r,this.useSourceOfProjectReferenceRedirect=Os(this.hostProject,this.hostProject.useSourceOfProjectReferenceRedirect),this.getParsedCommandLine=Os(this.hostProject,this.hostProject.getParsedCommandLine)}static getRootFileNames(t,r,i,s){var o,c;if(!t)return ze;const u=r.getCurrentProgram();if(!u)return ze;const f=_o();let g,p;const y=Hn(r.currentDirectory,jC),S=r.getPackageJsonsForAutoImport(Hn(r.currentDirectory,y));for(const D of S)(o=D.dependencies)==null||o.forEach((O,z)=>C(z)),(c=D.peerDependencies)==null||c.forEach((O,z)=>C(z));let T=0;if(g){const D=r.getSymlinkCache();for(const O of fs(g.keys())){if(t===2&&T>this.maxDependencies)return r.log(`AutoImportProviderProject: attempted to add more than ${this.maxDependencies} dependencies. Aborting.`),ze;const z=MU(O,r.currentDirectory,s,i,u.getModuleResolutionCache());if(z){const X=w(z,u,D);if(X){p=Xi(p,X),T+=X.length?1:0;continue}}if(!Zt([r.currentDirectory,r.getGlobalTypingsCacheLocation()],X=>{if(X){const J=MU(`@types/${O}`,X,s,i,u.getModuleResolutionCache());if(J){const ie=w(J,u,D);return p=Xi(p,ie),T+=ie?.length?1:0,!0}}})&&z&&s.allowJs&&s.maxNodeModuleJsDepth){const X=w(z,u,D,!0);p=Xi(p,X),T+=X?.length?1:0}}}return p?.length&&r.log(`AutoImportProviderProject: found ${p.length} root files in ${T} dependencies in ${_o()-f} ms`),p||ze;function C(D){Qi(D,"@types/")||(g||(g=new Set)).add(D)}function w(D,O,z,W){var X;const J=zU(D,s,i,O.getModuleResolutionCache(),W);if(J){const ie=(X=i.realpath)==null?void 0:X.call(i,D.packageDirectory),B=ie?r.toPath(ie):void 0,Y=B&&B!==r.toPath(D.packageDirectory);return Y&&z.setSymlinkedDirectory(D.packageDirectory,{real:Sl(ie),realPath:Sl(B)}),Ii(J,ae=>{const _e=Y?ae.replace(D.packageDirectory,ie):ae;if(!O.getSourceFile(_e)&&!(Y&&O.getSourceFile(ae)))return _e})}}}static create(t,r,i,s){if(t===0)return;const o={...r.getCompilerOptions(),...this.compilerOptionsOverrides},c=this.getRootFileNames(t,r,i,o);if(c.length)return new the(r,c,s,o)}isEmpty(){return!ut(this.rootFileNames)}isOrphan(){return!0}updateGraph(){let t=this.rootFileNames;t||(t=the.getRootFileNames(this.hostProject.includePackageJsonAutoImports(),this.hostProject,this.hostProject.getHostForAutoImportProvider(),this.getCompilationSettings())),this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this,t),this.rootFileNames=t;const r=this.getCurrentProgram(),i=super.updateGraph();return r&&r!==this.getCurrentProgram()&&this.hostProject.clearCachedExportInfoMap(),i}scheduleInvalidateResolutionsOfFailedLookupLocations(){}hasRoots(){var t;return!!((t=this.rootFileNames)!=null&&t.length)}markAsDirty(){this.rootFileNames=void 0,super.markAsDirty()}getScriptFileNames(){return this.rootFileNames||ze}getLanguageService(){throw new Error("AutoImportProviderProject language service should never be used. To get the program, use `project.getCurrentProgram()`.")}onAutoImportProviderSettingsChanged(){throw new Error("AutoImportProviderProject is an auto import provider; use `markAsDirty()` instead.")}onPackageJsonChange(){throw new Error("package.json changes should be notified on an AutoImportProvider's host project")}getHostForAutoImportProvider(){throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead.")}getProjectReferences(){return this.hostProject.getProjectReferences()}includePackageJsonAutoImports(){return 0}getSymlinkCache(){return this.hostProject.getSymlinkCache()}getModuleResolutionCache(){var t;return(t=this.hostProject.getCurrentProgram())==null?void 0:t.getModuleResolutionCache()}},SQ.maxDependencies=10,SQ.compilerOptionsOverrides={diagnostics:!1,skipLibCheck:!0,sourceMap:!1,types:ze,lib:ze,noLib:!0},TQ=SQ,xQ=class extends Zb{constructor(e,t,r,i,s){super(e,1,r,i,!1,void 0,{},!1,void 0,s,qn(e)),this.canonicalConfigFilePath=t,this.openFileWatchTriggered=new Map,this.canConfigFileJsonReportNoInputFiles=!1,this.externalProjectRefCount=0,this.isInitialLoadPending=zg,this.sendLoadingProjectFinish=!1}setCompilerHost(e){this.compilerHost=e}getCompilerHost(){return this.compilerHost}useSourceOfProjectReferenceRedirect(){return this.languageServiceEnabled}getParsedCommandLine(e){const t=qs(e),r=this.projectService.toCanonicalFileName(t);let i=this.projectService.configFileExistenceInfoCache.get(r);return i||this.projectService.configFileExistenceInfoCache.set(r,i={exists:this.projectService.host.fileExists(t)}),this.projectService.ensureParsedConfigUptoDate(t,r,i,this),this.languageServiceEnabled&&this.projectService.serverMode===0&&this.projectService.watchWildcards(t,i,this),i.exists?i.config.parsedCommandLine:void 0}onReleaseParsedCommandLine(e){this.releaseParsedConfig(this.projectService.toCanonicalFileName(qs(e)))}releaseParsedConfig(e){this.projectService.stopWatchingWildCards(e,this),this.projectService.releaseParsedConfig(e,this)}updateGraph(){const e=this.isInitialLoadPending();this.isInitialLoadPending=Kp;const t=this.pendingUpdateLevel;this.pendingUpdateLevel=0;let r;switch(t){case 1:this.openFileWatchTriggered.clear(),r=this.projectService.reloadFileNamesOfConfiguredProject(this);break;case 2:this.openFileWatchTriggered.clear();const i=E.checkDefined(this.pendingUpdateReason);this.pendingUpdateReason=void 0,this.projectService.reloadConfiguredProject(this,i,e,!1),r=!0;break;default:r=super.updateGraph()}return this.compilerHost=void 0,this.projectService.sendProjectLoadingFinishEvent(this),this.projectService.sendProjectTelemetry(this),r}getCachedDirectoryStructureHost(){return this.directoryStructureHost}getConfigFilePath(){return this.getProjectName()}getProjectReferences(){return this.projectReferences}updateReferences(e){this.projectReferences=e,this.potentialProjectReferences=void 0}setPotentialProjectReference(e){E.assert(this.isInitialLoadPending()),(this.potentialProjectReferences||(this.potentialProjectReferences=new Set)).add(e)}getResolvedProjectReferenceToRedirect(e){const t=this.getCurrentProgram();return t&&t.getResolvedProjectReferenceToRedirect(e)}forEachResolvedProjectReference(e){var t;return(t=this.getCurrentProgram())==null?void 0:t.forEachResolvedProjectReference(e)}enablePluginsWithOptions(e){var t;if(this.plugins.length=0,!((t=e.plugins)!=null&&t.length)&&!this.projectService.globalPlugins.length)return;const r=this.projectService.host;if(!r.require&&!r.importPlugin){this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");return}const i=this.getGlobalPluginSearchPaths();if(this.projectService.allowLocalPluginLoads){const s=qn(this.canonicalConfigFilePath);this.projectService.logger.info(`Local plugin loading enabled; adding ${s} to search paths`),i.unshift(s)}if(e.plugins)for(const s of e.plugins)this.enablePlugin(s,i);return this.enableGlobalPlugins(e)}getGlobalProjectErrors(){return wn(this.projectErrors,e=>!e.file)||Gc}getAllProjectErrors(){return this.projectErrors||Gc}setProjectErrors(e){this.projectErrors=e}close(){this.projectService.configFileExistenceInfoCache.forEach((e,t)=>this.releaseParsedConfig(t)),this.projectErrors=void 0,this.openFileWatchTriggered.clear(),this.compilerHost=void 0,super.close()}addExternalProjectReference(){this.externalProjectRefCount++}deleteExternalProjectReference(){this.externalProjectRefCount--}isSolution(){return this.getRootFilesMap().size===0&&!this.canConfigFileJsonReportNoInputFiles}getDefaultChildProjectFromProjectWithReferences(e){return m6(this,e.path,t=>fx(t,e)?t:void 0,0)}hasOpenRef(){var e;if(this.externalProjectRefCount)return!0;if(this.isClosed())return!1;const t=this.projectService.configFileExistenceInfoCache.get(this.canonicalConfigFilePath);return this.projectService.hasPendingProjectUpdate(this)?!!((e=t.openFilesImpactedByConfigFile)!=null&&e.size):!!t.openFilesImpactedByConfigFile&&zl(t.openFilesImpactedByConfigFile,(r,i)=>{const s=this.projectService.getScriptInfoForPath(i);return this.containsScriptInfo(s)||!!m6(this,s.path,o=>o.containsScriptInfo(s),0)})||!1}hasExternalProjectRef(){return!!this.externalProjectRefCount}getEffectiveTypeRoots(){return r3(this.getCompilationSettings(),this)||[]}updateErrorOnNoInputFiles(e){oO(e,this.getConfigFilePath(),this.getCompilerOptions().configFile.configFileSpecs,this.projectErrors,this.canConfigFileJsonReportNoInputFiles)}},DM=class extends Zb{constructor(e,t,r,i,s,o,c,u){super(e,2,t,r,!0,s,i,o,u,t.host,qn(c||du(e))),this.externalProjectName=e,this.compileOnSaveEnabled=o,this.excludedFiles=[],this.enableGlobalPlugins(this.getCompilerOptions())}updateGraph(){const e=super.updateGraph();return this.projectService.sendProjectTelemetry(this),e}getExcludedFiles(){return this.excludedFiles}}}});function EDe(e){const t=new Map;for(const r of e)if(typeof r.type=="object"){const i=r.type;i.forEach(s=>{E.assert(typeof s=="number")}),t.set(r.name,i)}return t}function d6(e){return ns(e.indentStyle)&&(e.indentStyle=FDe.get(e.indentStyle.toLowerCase()),E.assert(e.indentStyle!==void 0)),e}function PM(e){return NDe.forEach((t,r)=>{const i=e[r];ns(i)&&(e[r]=t.get(i.toLowerCase()))}),e}function SN(e,t){let r,i;return DC.forEach(s=>{const o=e[s.name];if(o===void 0)return;const c=IDe.get(s.name);(r||(r={}))[s.name]=c?ns(o)?c.get(o.toLowerCase()):o:Mb(s,o,t||"",i||(i=[]))}),r&&{watchOptions:r,errors:i}}function ipe(e){let t;return Aw.forEach(r=>{const i=e[r.name];i!==void 0&&((t||(t={}))[r.name]=i)}),t}function kQ(e){return ns(e)?CQ(e):e}function CQ(e){switch(e){case"JS":return 1;case"JSX":return 2;case"TS":return 3;case"TSX":return 4;default:return 0}}function spe(e){const{lazyConfiguredProjectsFromExternalProject:t,...r}=e;return r}function DDe(e,t){for(const r of t)if(r.getProjectName()===e)return r}function wM(e){return!!e.containingProjects}function jZe(e){return!!e.configFileInfo}function m6(e,t,r,i,s){var o;const c=(o=e.getCurrentProgram())==null?void 0:o.getResolvedProjectReferences();if(!c)return;let u;const f=t?e.getResolvedProjectReferenceToRedirect(t):void 0;if(f){const p=Lo(f.sourceFile.fileName),y=e.projectService.findConfiguredProjectByProjectName(p);if(y){const S=r(y);if(S)return S}else if(i!==0){u=new Map;const S=ape(c,e.getCompilerOptions(),(T,C)=>f===T?g(T,C):void 0,i,e.projectService,u);if(S)return S;u.clear()}}return ape(c,e.getCompilerOptions(),(p,y)=>f!==p?g(p,y):void 0,i,e.projectService,u);function g(p,y){const S=Lo(p.sourceFile.fileName),T=e.projectService.findConfiguredProjectByProjectName(S)||(y===0?void 0:y===1?e.projectService.createConfiguredProject(S):y===2?e.projectService.createAndLoadConfiguredProject(S,s):E.assertNever(y));return T&&r(T)}}function ape(e,t,r,i,s,o){const c=t.disableReferencedProjectLoad?0:i;return Zt(e,u=>{if(!u)return;const f=Lo(u.sourceFile.fileName),g=s.toCanonicalFileName(f),p=o?.get(g);if(p!==void 0&&p>=c)return;const y=r(u,c);return y||((o||(o=new Map)).set(g,c),u.references&&ape(u.references,u.commandLine.options,r,c,s,o))})}function PDe(e,t){return e.potentialProjectReferences&&ng(e.potentialProjectReferences,t)}function BZe(e,t,r,i){return e.getCurrentProgram()?e.forEachResolvedProjectReference(t):e.isInitialLoadPending()?PDe(e,i):Zt(e.getProjectReferences(),r)}function ope(e,t,r){const i=r&&e.projectService.configuredProjects.get(r);return i&&t(i)}function wDe(e,t){return BZe(e,r=>ope(e,t,r.sourceFile.path),r=>ope(e,t,e.toPath(RC(r))),r=>ope(e,t,r))}function JZe(e,t){return`${ns(t)?`Config: ${t} `:t?`Project: ${t.getProjectName()} `:""}WatchType: ${e}`}function ADe(e){return!e.isScriptOpen()&&e.mTime!==void 0}function fx(e,t){return e.containsScriptInfo(t)&&!e.isSourceOfProjectReferenceRedirect(t.path)}function Tf(e){return e.invalidateResolutionsOfFailedLookupLocations(),e.dirty&&e.updateGraph()}function cpe(e){P1(e)&&(e.projectOptions=!0)}function lpe(e){let t=1;return()=>e(t++)}function upe(){return{idToCallbacks:new Map,pathToId:new Map}}function zZe(e,t){if(!t||!e.eventHandler||!e.session)return;const r=upe(),i=upe(),s=upe();let o=1;return e.session.addProtocolHandler("watchChange",S=>(g(S.arguments),{responseRequired:!1})),{watchFile:c,watchDirectory:u,getCurrentDirectory:()=>e.host.getCurrentDirectory(),useCaseSensitiveFileNames:e.host.useCaseSensitiveFileNames};function c(S,T){return f(r,S,T,C=>({eventName:jM,data:{id:C,path:S}}))}function u(S,T,C){return f(C?s:i,S,T,w=>({eventName:BM,data:{id:w,path:S,recursive:!!C}}))}function f({pathToId:S,idToCallbacks:T},C,w,D){const O=e.toPath(C);let z=S.get(O);z||S.set(O,z=o++);let W=T.get(z);return W||(T.set(z,W=new Set),e.eventHandler(D(z))),W.add(w),{close(){const X=T.get(z);X?.delete(w)&&(X.size||(T.delete(z),S.delete(O),e.eventHandler({eventName:JM,data:{id:z}})))}}}function g({id:S,path:T,eventType:C}){p(S,T,C),y(i,S,T,C),y(s,S,T,C)}function p(S,T,C){var w;(w=r.idToCallbacks.get(S))==null||w.forEach(D=>{D(T,C==="create"?0:C==="delete"?2:1)})}function y({idToCallbacks:S},T,C,w){var D;w!=="update"&&((D=S.get(T))==null||D.forEach(O=>{O(C)}))}}function WZe(){let e;return{get(){return e},set(t){e=t},clear(){e=void 0}}}function _pe(e){return e.kind!==void 0}function fpe(e){e.print(!1,!1,!1)}var AM,NM,TN,IM,FM,OM,LM,MM,RM,EQ,jM,BM,JM,ppe,NDe,IDe,FDe,DQ,zM,WM,PQ,wQ,dpe,AQ,UZe=Nt({"src/server/editorServices.ts"(){"use strict";w1(),mx(),Zfe(),AM=20*1024*1024,NM=4*1024*1024,TN="projectsUpdatedInBackground",IM="projectLoadingStart",FM="projectLoadingFinish",OM="largeFileReferenced",LM="configFileDiag",MM="projectLanguageServiceState",RM="projectInfo",EQ="openFileInfo",jM="createFileWatcher",BM="createDirectoryWatcher",JM="closeFileWatcher",ppe="*ensureProjectForOpenFiles*",NDe=EDe(mg),IDe=EDe(DC),FDe=new Map(Object.entries({none:0,block:1,smart:2})),DQ={jquery:{match:/jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,types:["jquery"]},WinJS:{match:/^(.*\/winjs-[.\d]+)\/js\/base\.js$/i,exclude:[["^",1,"/.*"]],types:["winjs"]},Kendo:{match:/^(.*\/kendo(-ui)?)\/kendo\.all(\.min)?\.js$/i,exclude:[["^",1,"/.*"]],types:["kendo-ui"]},"Office Nuget":{match:/^(.*\/office\/1)\/excel-\d+\.debug\.js$/i,exclude:[["^",1,"/.*"]],types:["office"]},References:{match:/^(.*\/_references\.js)$/i,exclude:[["^",1,"$"]]}},zM={getFileName:e=>e,getScriptKind:(e,t)=>{let r;if(t){const i=S4(e);i&&ut(t,s=>s.extension===i?(r=s.scriptKind,!0):!1)}return r},hasMixedContent:(e,t)=>ut(t,r=>r.isMixedContent&&Ho(e,r.extension))},WM={getFileName:e=>e.fileName,getScriptKind:e=>kQ(e.scriptKind),hasMixedContent:e=>!!e.hasMixedContent},PQ={close:Ca},wQ=(e=>(e[e.Find=0]="Find",e[e.FindCreate=1]="FindCreate",e[e.FindCreateLoad=2]="FindCreateLoad",e))(wQ||{}),dpe=class rhe{constructor(t){this.filenameToScriptInfo=new Map,this.nodeModulesWatchers=new Map,this.filenameToScriptInfoVersion=new Map,this.allJsFilesForOpenFileTelemetry=new Map,this.externalProjectToConfiguredProjectMap=new Map,this.externalProjects=[],this.inferredProjects=[],this.configuredProjects=new Map,this.newInferredProjectName=lpe(Lfe),this.newAutoImportProviderProjectName=lpe(Mfe),this.newAuxiliaryProjectName=lpe(Rfe),this.openFiles=new Map,this.configFileForOpenFiles=new Map,this.openFilesWithNonRootedDiskPath=new Map,this.compilerOptionsForInferredProjectsPerProjectRoot=new Map,this.watchOptionsForInferredProjectsPerProjectRoot=new Map,this.typeAcquisitionForInferredProjectsPerProjectRoot=new Map,this.projectToSizeMap=new Map,this.configFileExistenceInfoCache=new Map,this.safelist=DQ,this.legacySafelist=new Map,this.pendingProjectUpdates=new Map,this.pendingEnsureProjectForOpenFiles=!1,this.seenProjects=new Map,this.sharedExtendedConfigFileWatchers=new Map,this.extendedConfigCache=new Map,this.verifyDocumentRegistry=Ca,this.verifyProgram=Ca,this.onProjectCreation=Ca;var r;this.host=t.host,this.logger=t.logger,this.cancellationToken=t.cancellationToken,this.useSingleInferredProject=t.useSingleInferredProject,this.useInferredProjectPerProjectRoot=t.useInferredProjectPerProjectRoot,this.typingsInstaller=t.typingsInstaller||EM,this.throttleWaitMilliseconds=t.throttleWaitMilliseconds,this.eventHandler=t.eventHandler,this.suppressDiagnosticEvents=t.suppressDiagnosticEvents,this.globalPlugins=t.globalPlugins||Gc,this.pluginProbeLocations=t.pluginProbeLocations||Gc,this.allowLocalPluginLoads=!!t.allowLocalPluginLoads,this.typesMapLocation=t.typesMapLocation===void 0?Hn(qn(this.getExecutingFilePath()),"typesMap.json"):t.typesMapLocation,this.session=t.session,this.jsDocParsingMode=t.jsDocParsingMode,t.serverMode!==void 0?this.serverMode=t.serverMode:this.serverMode=0,this.host.realpath&&(this.realpathToScriptInfos=of()),this.currentDirectory=Lo(this.host.getCurrentDirectory()),this.toCanonicalFileName=tu(this.host.useCaseSensitiveFileNames),this.globalCacheLocationDirectoryPath=this.typingsInstaller.globalTypingsCacheLocation?Sl(this.toPath(this.typingsInstaller.globalTypingsCacheLocation)):void 0,this.throttledOperations=new fQ(this.host,this.logger),this.typesMapLocation?this.loadTypesMap():this.logger.info("No types map provided; using the default"),this.typingsInstaller.attach(this),this.typingsCache=new hQ(this.typingsInstaller),this.hostConfiguration={formatCodeOptions:A9(this.host.newLine),preferences:jf,hostInfo:"Unknown host",extraFileExtensions:[]},this.documentRegistry=nG(this.host.useCaseSensitiveFileNames,this.currentDirectory,this.jsDocParsingMode,this);const i=this.logger.hasLevel(3)?2:this.logger.loggingEnabled()?1:0,s=i!==0?o=>this.logger.info(o):Ca;this.packageJsonCache=gpe(this),this.watchFactory=this.serverMode!==0?{watchFile:WC,watchDirectory:WC}:FV(zZe(this,t.canUseWatchEvents)||this.host,i,s,JZe),(r=t.incrementalVerifier)==null||r.call(t,this)}toPath(t){return fo(t,this.currentDirectory,this.toCanonicalFileName)}getExecutingFilePath(){return this.getNormalizedAbsolutePath(this.host.getExecutingFilePath())}getNormalizedAbsolutePath(t){return is(t,this.host.getCurrentDirectory())}setDocument(t,r,i){const s=E.checkDefined(this.getScriptInfoForPath(r));s.cacheSourceFile={key:t,sourceFile:i}}getDocument(t,r){const i=this.getScriptInfoForPath(r);return i&&i.cacheSourceFile&&i.cacheSourceFile.key===t?i.cacheSourceFile.sourceFile:void 0}ensureInferredProjectsUpToDate_TestOnly(){this.ensureProjectStructuresUptoDate()}getCompilerOptionsForInferredProjects(){return this.compilerOptionsForInferredProjects}onUpdateLanguageServiceStateForProject(t,r){if(!this.eventHandler)return;const i={eventName:MM,data:{project:t,languageServiceEnabled:r}};this.eventHandler(i)}loadTypesMap(){try{const t=this.host.readFile(this.typesMapLocation);if(t===void 0){this.logger.info(`Provided types map file "${this.typesMapLocation}" doesn't exist`);return}const r=JSON.parse(t);for(const i of Object.keys(r.typesMap))r.typesMap[i].match=new RegExp(r.typesMap[i].match,"i");this.safelist=r.typesMap;for(const i in r.simpleMap)Ya(r.simpleMap,i)&&this.legacySafelist.set(i,r.simpleMap[i].toLowerCase())}catch(t){this.logger.info(`Error loading types map: ${t}`),this.safelist=DQ,this.legacySafelist.clear()}}updateTypingsForProject(t){const r=this.findProject(t.projectName);if(r)switch(t.kind){case D9:r.updateTypingFiles(this.typingsCache.updateTypingsForProject(t.projectName,t.compilerOptions,t.typeAcquisition,t.unresolvedImports,t.typings));return;case P9:this.typingsCache.enqueueInstallTypingsForProject(r,r.lastCachedUnresolvedImportsList,!0);return}}watchTypingLocations(t){var r;(r=this.findProject(t.projectName))==null||r.watchTypingLocations(t.files)}delayEnsureProjectForOpenFiles(){this.openFiles.size&&(this.pendingEnsureProjectForOpenFiles=!0,this.throttledOperations.schedule(ppe,2500,()=>{this.pendingProjectUpdates.size!==0?this.delayEnsureProjectForOpenFiles():this.pendingEnsureProjectForOpenFiles&&(this.ensureProjectForOpenFiles(),this.sendProjectsUpdatedInBackgroundEvent())}))}delayUpdateProjectGraph(t){if(t.markAsDirty(),bN(t))return;const r=t.getProjectName();this.pendingProjectUpdates.set(r,t),this.throttledOperations.schedule(r,250,()=>{this.pendingProjectUpdates.delete(r)&&Tf(t)})}hasPendingProjectUpdate(t){return this.pendingProjectUpdates.has(t.getProjectName())}sendProjectsUpdatedInBackgroundEvent(){if(!this.eventHandler)return;const t={eventName:TN,data:{openFiles:fs(this.openFiles.keys(),r=>this.getScriptInfoForPath(r).fileName)}};this.eventHandler(t)}sendLargeFileReferencedEvent(t,r){if(!this.eventHandler)return;const i={eventName:OM,data:{file:t,fileSize:r,maxFileSize:NM}};this.eventHandler(i)}sendProjectLoadingStartEvent(t,r){if(!this.eventHandler)return;t.sendLoadingProjectFinish=!0;const i={eventName:IM,data:{project:t,reason:r}};this.eventHandler(i)}sendProjectLoadingFinishEvent(t){if(!this.eventHandler||!t.sendLoadingProjectFinish)return;t.sendLoadingProjectFinish=!1;const r={eventName:FM,data:{project:t}};this.eventHandler(r)}sendPerformanceEvent(t,r){this.performanceEventHandler&&this.performanceEventHandler({kind:t,durationMs:r})}delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(t){this.delayUpdateProjectGraph(t),this.delayEnsureProjectForOpenFiles()}delayUpdateProjectGraphs(t,r){if(t.length){for(const i of t)r&&i.clearSourceMapperCache(),this.delayUpdateProjectGraph(i);this.delayEnsureProjectForOpenFiles()}}setCompilerOptionsForInferredProjects(t,r){E.assert(r===void 0||this.useInferredProjectPerProjectRoot,"Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled");const i=PM(t),s=SN(t,r),o=ipe(t);i.allowNonTsExtensions=!0;const c=r&&this.toCanonicalFileName(r);c?(this.compilerOptionsForInferredProjectsPerProjectRoot.set(c,i),this.watchOptionsForInferredProjectsPerProjectRoot.set(c,s||!1),this.typeAcquisitionForInferredProjectsPerProjectRoot.set(c,o)):(this.compilerOptionsForInferredProjects=i,this.watchOptionsForInferredProjects=s,this.typeAcquisitionForInferredProjects=o);for(const u of this.inferredProjects)(c?u.projectRootPath===c:!u.projectRootPath||!this.compilerOptionsForInferredProjectsPerProjectRoot.has(u.projectRootPath))&&(u.setCompilerOptions(i),u.setTypeAcquisition(o),u.setWatchOptions(s?.watchOptions),u.setProjectErrors(s?.errors),u.compileOnSaveEnabled=i.compileOnSave,u.markAsDirty(),this.delayUpdateProjectGraph(u));this.delayEnsureProjectForOpenFiles()}findProject(t){if(t!==void 0)return Ofe(t)?DDe(t,this.inferredProjects):this.findExternalProjectByProjectName(t)||this.findConfiguredProjectByProjectName(Lo(t))}forEachProject(t){this.externalProjects.forEach(t),this.configuredProjects.forEach(t),this.inferredProjects.forEach(t)}forEachEnabledProject(t){this.forEachProject(r=>{!r.isOrphan()&&r.languageServiceEnabled&&t(r)})}getDefaultProjectForFile(t,r){return r?this.ensureDefaultProjectForFile(t):this.tryGetDefaultProjectForFile(t)}tryGetDefaultProjectForFile(t){const r=ns(t)?this.getScriptInfoForNormalizedPath(t):t;return r&&!r.isOrphan()?r.getDefaultProject():void 0}ensureDefaultProjectForFile(t){return this.tryGetDefaultProjectForFile(t)||this.doEnsureDefaultProjectForFile(t)}doEnsureDefaultProjectForFile(t){this.ensureProjectStructuresUptoDate();const r=ns(t)?this.getScriptInfoForNormalizedPath(t):t;return r?r.getDefaultProject():(this.logErrorForScriptInfoNotFound(ns(t)?t:t.fileName),r0.ThrowNoProject())}getScriptInfoEnsuringProjectsUptoDate(t){return this.ensureProjectStructuresUptoDate(),this.getScriptInfo(t)}ensureProjectStructuresUptoDate(){let t=this.pendingEnsureProjectForOpenFiles;this.pendingProjectUpdates.clear();const r=i=>{t=Tf(i)||t};this.externalProjects.forEach(r),this.configuredProjects.forEach(r),this.inferredProjects.forEach(r),t&&this.ensureProjectForOpenFiles()}getFormatCodeOptions(t){const r=this.getScriptInfoForNormalizedPath(t);return r&&r.getFormatCodeSettings()||this.hostConfiguration.formatCodeOptions}getPreferences(t){const r=this.getScriptInfoForNormalizedPath(t);return{...this.hostConfiguration.preferences,...r&&r.getPreferences()}}getHostFormatCodeOptions(){return this.hostConfiguration.formatCodeOptions}getHostPreferences(){return this.hostConfiguration.preferences}onSourceFileChanged(t,r){r===2?this.handleDeletedFile(t):t.isScriptOpen()||(t.delayReloadNonMixedContentFile(),this.delayUpdateProjectGraphs(t.containingProjects,!1),this.handleSourceMapProjects(t))}handleSourceMapProjects(t){if(t.sourceMapFilePath)if(ns(t.sourceMapFilePath)){const r=this.getScriptInfoForPath(t.sourceMapFilePath);this.delayUpdateSourceInfoProjects(r&&r.sourceInfos)}else this.delayUpdateSourceInfoProjects(t.sourceMapFilePath.sourceInfos);this.delayUpdateSourceInfoProjects(t.sourceInfos),t.declarationInfoPath&&this.delayUpdateProjectsOfScriptInfoPath(t.declarationInfoPath)}delayUpdateSourceInfoProjects(t){t&&t.forEach((r,i)=>this.delayUpdateProjectsOfScriptInfoPath(i))}delayUpdateProjectsOfScriptInfoPath(t){const r=this.getScriptInfoForPath(t);r&&this.delayUpdateProjectGraphs(r.containingProjects,!0)}handleDeletedFile(t){if(this.stopWatchingScriptInfo(t),!t.isScriptOpen()){this.deleteScriptInfo(t);const r=t.containingProjects.slice();if(t.detachAllProjects(),this.delayUpdateProjectGraphs(r,!1),this.handleSourceMapProjects(t),t.closeSourceMapFileWatcher(),t.declarationInfoPath){const i=this.getScriptInfoForPath(t.declarationInfoPath);i&&(i.sourceMapFilePath=void 0)}}}watchWildcardDirectory(t,r,i,s){return this.watchFactory.watchDirectory(t,o=>{const c=this.toPath(o),u=s.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(o,c);Pc(c)==="package.json"&&!wA(c)&&(u&&u.fileExists||!u&&this.host.fileExists(c))&&(this.logger.info(`Config: ${i} Detected new package.json: ${o}`),this.onAddPackageJson(c));const f=this.findConfiguredProjectByProjectName(i);Xw({watchedDirPath:t,fileOrDirectory:o,fileOrDirectoryPath:c,configFileName:i,extraFileExtensions:this.hostConfiguration.extraFileExtensions,currentDirectory:this.currentDirectory,options:s.parsedCommandLine.options,program:f?.getCurrentProgram()||s.parsedCommandLine.fileNames,useCaseSensitiveFileNames:this.host.useCaseSensitiveFileNames,writeLog:g=>this.logger.info(g),toPath:g=>this.toPath(g),getScriptKind:f?g=>f.getScriptKind(g):void 0})||(s.updateLevel!==2&&(s.updateLevel=1),s.projects.forEach((g,p)=>{if(!g)return;const y=this.getConfiguredProjectByCanonicalConfigFilePath(p);if(!y)return;const S=f===y?1:0;if(!(y.pendingUpdateLevel!==void 0&&y.pendingUpdateLevel>S))if(this.openFiles.has(c))if(E.checkDefined(this.getScriptInfoForPath(c)).isAttached(y)){const C=Math.max(S,y.openFileWatchTriggered.get(c)||0);y.openFileWatchTriggered.set(c,C)}else y.pendingUpdateLevel=S,this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(y);else y.pendingUpdateLevel=S,this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(y)}))},r,this.getWatchOptionsFromProjectWatchOptions(s.parsedCommandLine.watchOptions),al.WildcardDirectory,i)}delayUpdateProjectsFromParsedConfigOnConfigFileChange(t,r){const i=this.configFileExistenceInfoCache.get(t);if(!i?.config)return!1;let s=!1;return i.config.updateLevel=2,i.config.projects.forEach((o,c)=>{const u=this.getConfiguredProjectByCanonicalConfigFilePath(c);if(u)if(s=!0,c===t){if(u.isInitialLoadPending())return;u.pendingUpdateLevel=2,u.pendingUpdateReason=r,this.delayUpdateProjectGraph(u)}else u.resolutionCache.removeResolutionsFromProjectReferenceRedirects(this.toPath(t)),this.delayUpdateProjectGraph(u)}),s}onConfigFileChanged(t,r){var i;const s=this.configFileExistenceInfoCache.get(t);if(r===2){s.exists=!1;const o=(i=s.config)!=null&&i.projects.has(t)?this.getConfiguredProjectByCanonicalConfigFilePath(t):void 0;o&&this.removeProject(o)}else s.exists=!0;this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(t,"Change in config file detected"),this.reloadConfiguredProjectForFiles(s.openFilesImpactedByConfigFile,!1,!0,r!==2?To:zg,"Change in config file detected"),this.delayEnsureProjectForOpenFiles()}removeProject(t){switch(this.logger.info("`remove Project::"),t.print(!0,!0,!1),t.close(),E.shouldAssert(1)&&this.filenameToScriptInfo.forEach(r=>E.assert(!r.isAttached(t),"Found script Info still attached to project",()=>`${t.projectName}: ScriptInfos still attached: ${JSON.stringify(fs(nk(this.filenameToScriptInfo.values(),i=>i.isAttached(t)?{fileName:i.fileName,projects:i.containingProjects.map(s=>s.projectName),hasMixedContent:i.hasMixedContent}:void 0)),void 0," ")}`)),this.pendingProjectUpdates.delete(t.getProjectName()),t.projectKind){case 2:X2(this.externalProjects,t),this.projectToSizeMap.delete(t.getProjectName());break;case 1:this.configuredProjects.delete(t.canonicalConfigFilePath),this.projectToSizeMap.delete(t.canonicalConfigFilePath);break;case 0:X2(this.inferredProjects,t);break}}assignOrphanScriptInfoToInferredProject(t,r){E.assert(t.isOrphan());const i=this.getOrCreateInferredProjectForProjectRootPathIfEnabled(t,r)||this.getOrCreateSingleInferredProjectIfEnabled()||this.getOrCreateSingleInferredWithoutProjectRoot(t.isDynamic?r||this.currentDirectory:qn(C_(t.fileName)?t.fileName:is(t.fileName,r?this.getNormalizedAbsolutePath(r):this.currentDirectory)));if(i.addRoot(t),t.containingProjects[0]!==i&&(t.detachFromProject(i),t.containingProjects.unshift(i)),i.updateGraph(),!this.useSingleInferredProject&&!i.projectRootPath)for(const s of this.inferredProjects){if(s===i||s.isOrphan())continue;const o=s.getRootScriptInfos();E.assert(o.length===1||!!s.projectRootPath),o.length===1&&Zt(o[0].containingProjects,c=>c!==o[0].containingProjects[0]&&!c.isOrphan())&&s.removeFile(o[0],!0,!0)}return i}assignOrphanScriptInfosToInferredProject(){this.openFiles.forEach((t,r)=>{const i=this.getScriptInfoForPath(r);i.isOrphan()&&this.assignOrphanScriptInfoToInferredProject(i,t)})}closeOpenFile(t,r){const i=t.isDynamic?!1:this.host.fileExists(t.fileName);t.close(i),this.stopWatchingConfigFilesForClosedScriptInfo(t);const s=this.toCanonicalFileName(t.fileName);this.openFilesWithNonRootedDiskPath.get(s)===t&&this.openFilesWithNonRootedDiskPath.delete(s);let o=!1;for(const c of t.containingProjects){if(P1(c)){t.hasMixedContent&&t.registerFileUpdate();const u=c.openFileWatchTriggered.get(t.path);u!==void 0&&(c.openFileWatchTriggered.delete(t.path),c.pendingUpdateLevel!==void 0&&c.pendingUpdateLevelthis.onConfigFileChanged(r,g),2e3,this.getWatchOptionsFromProjectWatchOptions((o=(s=c?.config)==null?void 0:s.parsedCommandLine)==null?void 0:o.watchOptions),al.ConfigFile,i));const u=c.config.projects;u.set(i.canonicalConfigFilePath,u.get(i.canonicalConfigFilePath)||!1)}configFileExistenceImpactsRootOfInferredProject(t){return t.openFilesImpactedByConfigFile&&zl(t.openFilesImpactedByConfigFile,To)}releaseParsedConfig(t,r){var i,s,o;const c=this.configFileExistenceInfoCache.get(t);(i=c.config)!=null&&i.projects.delete(r.canonicalConfigFilePath)&&((s=c.config)!=null&&s.projects.size||(c.config=void 0,NV(t,this.sharedExtendedConfigFileWatchers),E.checkDefined(c.watcher),(o=c.openFilesImpactedByConfigFile)!=null&&o.size?this.configFileExistenceImpactsRootOfInferredProject(c)?d9(fl(qn(t)))||(c.watcher.close(),c.watcher=PQ):(c.watcher.close(),c.watcher=void 0):(c.watcher.close(),this.configFileExistenceInfoCache.delete(t))))}closeConfigFileWatcherOnReleaseOfOpenFile(t){t.watcher&&!t.config&&!this.configFileExistenceImpactsRootOfInferredProject(t)&&(t.watcher.close(),t.watcher=void 0)}stopWatchingConfigFilesForClosedScriptInfo(t){E.assert(!t.isScriptOpen()),this.forEachConfigFileLocation(t,r=>{var i,s,o;const c=this.configFileExistenceInfoCache.get(r);if(c){const u=(i=c.openFilesImpactedByConfigFile)==null?void 0:i.get(t.path);(s=c.openFilesImpactedByConfigFile)==null||s.delete(t.path),u&&this.closeConfigFileWatcherOnReleaseOfOpenFile(c),!((o=c.openFilesImpactedByConfigFile)!=null&&o.size)&&!c.config&&(E.assert(!c.watcher),this.configFileExistenceInfoCache.delete(r))}})}startWatchingConfigFilesForInferredProjectRoot(t){E.assert(t.isScriptOpen()),this.forEachConfigFileLocation(t,(r,i)=>{let s=this.configFileExistenceInfoCache.get(r);s||(s={exists:this.host.fileExists(i)},this.configFileExistenceInfoCache.set(r,s)),(s.openFilesImpactedByConfigFile||(s.openFilesImpactedByConfigFile=new Map)).set(t.path,!0),s.watcher||(s.watcher=d9(fl(qn(r)))?this.watchFactory.watchFile(i,(o,c)=>this.onConfigFileChanged(r,c),2e3,this.hostConfiguration.watchOptions,al.ConfigFileForInferredRoot):PQ)})}stopWatchingConfigFilesForInferredProjectRoot(t){this.forEachConfigFileLocation(t,r=>{var i;const s=this.configFileExistenceInfoCache.get(r);(i=s?.openFilesImpactedByConfigFile)!=null&&i.has(t.path)&&(E.assert(t.isScriptOpen()),s.openFilesImpactedByConfigFile.set(t.path,!1),this.closeConfigFileWatcherOnReleaseOfOpenFile(s))})}forEachConfigFileLocation(t,r){if(this.serverMode!==0)return;E.assert(!wM(t)||this.openFiles.has(t.path));const i=this.openFiles.get(t.path);if(E.checkDefined(this.getScriptInfo(t.path)).isDynamic)return;let o=qn(t.fileName);const c=()=>dm(i,o,this.currentDirectory,!this.host.useCaseSensitiveFileNames),u=!i||!c();let f=!jZe(t);do{if(f){const p=hN(o,this.currentDirectory,this.toCanonicalFileName),y=Hn(o,"tsconfig.json");let S=r(Hn(p,"tsconfig.json"),y);if(S)return y;const T=Hn(o,"jsconfig.json");if(S=r(Hn(p,"jsconfig.json"),T),S)return T;if(eI(p))break}const g=qn(o);if(g===o)break;o=g,f=!0}while(u||c())}findDefaultConfiguredProject(t){if(!t.isScriptOpen())return;const r=this.getConfigFileNameForFile(t),i=r&&this.findConfiguredProjectByProjectName(r);return i&&fx(i,t)?i:i?.getDefaultChildProjectFromProjectWithReferences(t)}getConfigFileNameForFile(t){if(wM(t)){E.assert(t.isScriptOpen());const i=this.configFileForOpenFiles.get(t.path);if(i!==void 0)return i||void 0}this.logger.info(`Search path: ${qn(t.fileName)}`);const r=this.forEachConfigFileLocation(t,(i,s)=>this.configFileExists(s,i,t));return r?this.logger.info(`For info: ${t.fileName} :: Config file name: ${r}`):this.logger.info(`For info: ${t.fileName} :: No config files found.`),wM(t)&&this.configFileForOpenFiles.set(t.path,r||!1),r}printProjects(){this.logger.hasLevel(1)&&(this.logger.startGroup(),this.externalProjects.forEach(fpe),this.configuredProjects.forEach(fpe),this.inferredProjects.forEach(fpe),this.logger.info("Open files: "),this.openFiles.forEach((t,r)=>{const i=this.getScriptInfoForPath(r);this.logger.info(` FileName: ${i.fileName} ProjectRootPath: ${t}`),this.logger.info(` Projects: ${i.containingProjects.map(s=>s.getProjectName())}`)}),this.logger.endGroup())}findConfiguredProjectByProjectName(t){const r=this.toCanonicalFileName(t);return this.getConfiguredProjectByCanonicalConfigFilePath(r)}getConfiguredProjectByCanonicalConfigFilePath(t){return this.configuredProjects.get(t)}findExternalProjectByProjectName(t){return DDe(t,this.externalProjects)}getFilenameForExceededTotalSizeLimitForNonTsFiles(t,r,i,s){if(r&&r.disableSizeLimit||!this.host.getFileSize)return;let o=AM;this.projectToSizeMap.set(t,0),this.projectToSizeMap.forEach(u=>o-=u||0);let c=0;for(const u of i){const f=s.getFileName(u);if(!Tb(f)&&(c+=this.host.getFileSize(f),c>AM||c>o)){const g=i.map(p=>s.getFileName(p)).filter(p=>!Tb(p)).map(p=>({name:p,size:this.host.getFileSize(p)})).sort((p,y)=>y.size-p.size).slice(0,5);return this.logger.info(`Non TS file size exceeded limit (${c}). Largest files: ${g.map(p=>`${p.name}:${p.size}`).join(", ")}`),f}}this.projectToSizeMap.set(t,c)}createExternalProject(t,r,i,s,o){const c=PM(i),u=SN(i,qn(du(t))),f=new DM(t,this,this.documentRegistry,c,this.getFilenameForExceededTotalSizeLimitForNonTsFiles(t,c,r,WM),i.compileOnSave===void 0?!0:i.compileOnSave,void 0,u?.watchOptions);return f.setProjectErrors(u?.errors),f.excludedFiles=o,this.addFilesToNonInferredProject(f,r,WM,s),this.externalProjects.push(f),f}sendProjectTelemetry(t){if(this.seenProjects.has(t.projectName)){cpe(t);return}if(this.seenProjects.set(t.projectName,!0),!this.eventHandler||!this.host.createSHA256Hash){cpe(t);return}const r=P1(t)?t.projectOptions:void 0;cpe(t);const i={projectId:this.host.createSHA256Hash(t.projectName),fileStats:vN(t.getScriptInfos(),!0),compilerOptions:Zne(t.getCompilationSettings()),typeAcquisition:o(t.getTypeAcquisition()),extends:r&&r.configHasExtendsProperty,files:r&&r.configHasFilesProperty,include:r&&r.configHasIncludeProperty,exclude:r&&r.configHasExcludeProperty,compileOnSave:t.compileOnSaveEnabled,configFileName:s(),projectType:t instanceof DM?"external":"configured",languageServiceEnabled:t.languageServiceEnabled,version:Qm};this.eventHandler({eventName:RM,data:i});function s(){return P1(t)&&_Q(t.getConfigFilePath())||"other"}function o({enable:c,include:u,exclude:f}){return{enable:c,include:u!==void 0&&u.length!==0,exclude:f!==void 0&&f.length!==0}}}addFilesToNonInferredProject(t,r,i,s){this.updateNonInferredProjectFiles(t,r,i),t.setTypeAcquisition(s),t.markAsDirty()}createConfiguredProject(t){var r;(r=Jr)==null||r.instant(Jr.Phase.Session,"createConfiguredProject",{configFilePath:t}),this.logger.info(`Creating configuration project ${t}`);const i=this.toCanonicalFileName(t);let s=this.configFileExistenceInfoCache.get(i);s?s.exists=!0:this.configFileExistenceInfoCache.set(i,s={exists:!0}),s.config||(s.config={cachedDirectoryStructureHost:YO(this.host,this.host.getCurrentDirectory(),this.host.useCaseSensitiveFileNames),projects:new Map,updateLevel:2});const o=new xQ(t,i,this,this.documentRegistry,s.config.cachedDirectoryStructureHost);return this.configuredProjects.set(i,o),this.createConfigFileWatcherForParsedConfig(t,i,o),o}createConfiguredProjectWithDelayLoad(t,r){const i=this.createConfiguredProject(t);return i.pendingUpdateLevel=2,i.pendingUpdateReason=r,i}createAndLoadConfiguredProject(t,r){const i=this.createConfiguredProject(t);return this.loadConfiguredProject(i,r),i}createLoadAndUpdateConfiguredProject(t,r){const i=this.createAndLoadConfiguredProject(t,r);return i.updateGraph(),i}loadConfiguredProject(t,r){var i,s;(i=Jr)==null||i.push(Jr.Phase.Session,"loadConfiguredProject",{configFilePath:t.canonicalConfigFilePath}),this.sendProjectLoadingStartEvent(t,r);const o=qs(t.getConfigFilePath()),c=this.ensureParsedConfigUptoDate(o,t.canonicalConfigFilePath,this.configFileExistenceInfoCache.get(t.canonicalConfigFilePath),t),u=c.config.parsedCommandLine;E.assert(!!u.fileNames);const f=u.options;t.projectOptions||(t.projectOptions={configHasExtendsProperty:u.raw.extends!==void 0,configHasFilesProperty:u.raw.files!==void 0,configHasIncludeProperty:u.raw.include!==void 0,configHasExcludeProperty:u.raw.exclude!==void 0}),t.canConfigFileJsonReportNoInputFiles=ZE(u.raw),t.setProjectErrors(u.options.configFile.parseDiagnostics),t.updateReferences(u.projectReferences);const g=this.getFilenameForExceededTotalSizeLimitForNonTsFiles(t.canonicalConfigFilePath,f,u.fileNames,zM);g?(t.disableLanguageService(g),this.configFileExistenceInfoCache.forEach((y,S)=>this.stopWatchingWildCards(S,t))):(t.setCompilerOptions(f),t.setWatchOptions(u.watchOptions),t.enableLanguageService(),this.watchWildcards(o,c,t)),t.enablePluginsWithOptions(f);const p=u.fileNames.concat(t.getExternalFiles(2));this.updateRootAndOptionsOfNonInferredProject(t,p,zM,f,u.typeAcquisition,u.compileOnSave,u.watchOptions),(s=Jr)==null||s.pop()}ensureParsedConfigUptoDate(t,r,i,s){var o,c,u;if(i.config){if(!i.config.updateLevel)return i;if(i.config.updateLevel===1)return this.reloadFileNamesOfParsedConfig(t,i.config),i}const f=((o=i.config)==null?void 0:o.cachedDirectoryStructureHost)||YO(this.host,this.host.getCurrentDirectory(),this.host.useCaseSensitiveFileNames),g=YE(t,C=>this.host.readFile(C)),p=bw(t,ns(g)?g:""),y=p.parseDiagnostics;ns(g)||y.push(g);const S=kw(p,f,qn(t),{},t,[],this.hostConfiguration.extraFileExtensions,this.extendedConfigCache);S.errors.length&&y.push(...S.errors),this.logger.info(`Config: ${t} : ${JSON.stringify({rootNames:S.fileNames,options:S.options,watchOptions:S.watchOptions,projectReferences:S.projectReferences},void 0," ")}`);const T=(c=i.config)==null?void 0:c.parsedCommandLine;return i.config?(i.config.parsedCommandLine=S,i.config.watchedDirectoriesStale=!0,i.config.updateLevel=void 0):i.config={parsedCommandLine:S,cachedDirectoryStructureHost:f,projects:new Map},!T&&!W5(this.getWatchOptionsFromProjectWatchOptions(void 0),this.getWatchOptionsFromProjectWatchOptions(S.watchOptions))&&((u=i.watcher)==null||u.close(),i.watcher=void 0),this.createConfigFileWatcherForParsedConfig(t,r,s),ZO(r,S.options,this.sharedExtendedConfigFileWatchers,(C,w)=>this.watchFactory.watchFile(C,()=>{var D;KO(this.extendedConfigCache,w,z=>this.toPath(z));let O=!1;(D=this.sharedExtendedConfigFileWatchers.get(w))==null||D.projects.forEach(z=>{O=this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(z,`Change in extended config file ${C} detected`)||O}),O&&this.delayEnsureProjectForOpenFiles()},2e3,this.hostConfiguration.watchOptions,al.ExtendedConfigFile,t),C=>this.toPath(C)),i}watchWildcards(t,{exists:r,config:i},s){if(i.projects.set(s.canonicalConfigFilePath,!0),r){if(i.watchedDirectories&&!i.watchedDirectoriesStale)return;i.watchedDirectoriesStale=!1,$w(i.watchedDirectories||(i.watchedDirectories=new Map),new Map(Object.entries(i.parsedCommandLine.wildcardDirectories)),(o,c)=>this.watchWildcardDirectory(o,c,t,i))}else{if(i.watchedDirectoriesStale=!1,!i.watchedDirectories)return;o_(i.watchedDirectories,hf),i.watchedDirectories=void 0}}stopWatchingWildCards(t,r){const i=this.configFileExistenceInfoCache.get(t);!i.config||!i.config.projects.get(r.canonicalConfigFilePath)||(i.config.projects.set(r.canonicalConfigFilePath,!1),!zl(i.config.projects,To)&&(i.config.watchedDirectories&&(o_(i.config.watchedDirectories,hf),i.config.watchedDirectories=void 0),i.config.watchedDirectoriesStale=void 0))}updateNonInferredProjectFiles(t,r,i){const s=t.getRootFilesMap(),o=new Map;for(const c of r){const u=i.getFileName(c),f=Lo(u),g=yN(f);let p;if(!g&&!t.fileExists(u)){p=hN(f,this.currentDirectory,this.toCanonicalFileName);const y=s.get(p);y?(y.info&&(t.removeFile(y.info,!1,!0),y.info=void 0),y.fileName=f):s.set(p,{fileName:f})}else{const y=i.getScriptKind(c,this.hostConfiguration.extraFileExtensions),S=i.hasMixedContent(c,this.hostConfiguration.extraFileExtensions),T=E.checkDefined(this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(f,t.currentDirectory,y,S,t.directoryStructureHost));p=T.path;const C=s.get(p);!C||C.info!==T?(t.addRoot(T,f),T.isScriptOpen()&&this.removeRootOfInferredProjectIfNowPartOfOtherProject(T)):C.fileName=f}o.set(p,!0)}s.size>o.size&&s.forEach((c,u)=>{o.has(u)||(c.info?t.removeFile(c.info,t.fileExists(u),!0):s.delete(u))})}updateRootAndOptionsOfNonInferredProject(t,r,i,s,o,c,u){t.setCompilerOptions(s),t.setWatchOptions(u),c!==void 0&&(t.compileOnSaveEnabled=c),this.addFilesToNonInferredProject(t,r,i,o)}reloadFileNamesOfConfiguredProject(t){const r=this.reloadFileNamesOfParsedConfig(t.getConfigFilePath(),this.configFileExistenceInfoCache.get(t.canonicalConfigFilePath).config);return t.updateErrorOnNoInputFiles(r),this.updateNonInferredProjectFiles(t,r.concat(t.getExternalFiles(1)),zM),t.markAsDirty(),t.updateGraph()}reloadFileNamesOfParsedConfig(t,r){if(r.updateLevel===void 0)return r.parsedCommandLine.fileNames;E.assert(r.updateLevel===1);const i=r.parsedCommandLine.options.configFile.configFileSpecs,s=KE(i,qn(t),r.parsedCommandLine.options,r.cachedDirectoryStructureHost,this.hostConfiguration.extraFileExtensions);return r.parsedCommandLine={...r.parsedCommandLine,fileNames:s},s}setFileNamesOfAutpImportProviderOrAuxillaryProject(t,r){this.updateNonInferredProjectFiles(t,r,zM)}reloadConfiguredProject(t,r,i,s){const o=t.getCachedDirectoryStructureHost();s&&this.clearSemanticCache(t),o.clearCache();const c=t.getConfigFilePath();this.logger.info(`${i?"Loading":"Reloading"} configured project ${c}`),this.loadConfiguredProject(t,r),t.updateGraph(),this.sendConfigFileDiagEvent(t,c)}clearSemanticCache(t){t.resolutionCache.clear(),t.getLanguageService(!1).cleanupSemanticCache(),t.cleanupProgram(),t.markAsDirty()}sendConfigFileDiagEvent(t,r){if(!this.eventHandler||this.suppressDiagnosticEvents)return;const i=t.getLanguageService().getCompilerOptionsDiagnostics();i.push(...t.getAllProjectErrors()),this.eventHandler({eventName:LM,data:{configFileName:t.getConfigFilePath(),diagnostics:i,triggerFile:r}})}getOrCreateInferredProjectForProjectRootPathIfEnabled(t,r){if(!this.useInferredProjectPerProjectRoot||t.isDynamic&&r===void 0)return;if(r){const s=this.toCanonicalFileName(r);for(const o of this.inferredProjects)if(o.projectRootPath===s)return o;return this.createInferredProject(r,!1,r)}let i;for(const s of this.inferredProjects)s.projectRootPath&&dm(s.projectRootPath,t.path,this.host.getCurrentDirectory(),!this.host.useCaseSensitiveFileNames)&&(i&&i.projectRootPath.length>s.projectRootPath.length||(i=s));return i}getOrCreateSingleInferredProjectIfEnabled(){if(this.useSingleInferredProject)return this.inferredProjects.length>0&&this.inferredProjects[0].projectRootPath===void 0?this.inferredProjects[0]:this.createInferredProject("",!0)}getOrCreateSingleInferredWithoutProjectRoot(t){E.assert(!this.useSingleInferredProject);const r=this.toCanonicalFileName(this.getNormalizedAbsolutePath(t));for(const i of this.inferredProjects)if(!i.projectRootPath&&i.isOrphan()&&i.canonicalCurrentDirectory===r)return i;return this.createInferredProject(t)}createInferredProject(t,r,i){const s=i&&this.compilerOptionsForInferredProjectsPerProjectRoot.get(i)||this.compilerOptionsForInferredProjects;let o,c;i&&(o=this.watchOptionsForInferredProjectsPerProjectRoot.get(i),c=this.typeAcquisitionForInferredProjectsPerProjectRoot.get(i)),o===void 0&&(o=this.watchOptionsForInferredProjects),c===void 0&&(c=this.typeAcquisitionForInferredProjects),o=o||void 0;const u=new vQ(this,this.documentRegistry,s,o?.watchOptions,i,t,c);return u.setProjectErrors(o?.errors),r?this.inferredProjects.unshift(u):this.inferredProjects.push(u),u}getOrCreateScriptInfoNotOpenedByClient(t,r,i){return this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(Lo(t),r,void 0,void 0,i)}getScriptInfo(t){return this.getScriptInfoForNormalizedPath(Lo(t))}getScriptInfoOrConfig(t){const r=Lo(t),i=this.getScriptInfoForNormalizedPath(r);if(i)return i;const s=this.configuredProjects.get(this.toPath(t));return s&&s.getCompilerOptions().configFile}logErrorForScriptInfoNotFound(t){const r=fs(this.filenameToScriptInfo.entries(),([i,s])=>({path:i,fileName:s.fileName}));this.logger.msg(`Could not find file ${JSON.stringify(t)}. +All files are: ${JSON.stringify(r)}`,"Err")}getSymlinkedProjects(t){let r;if(this.realpathToScriptInfos){const s=t.getRealpathIfDifferent();s&&Zt(this.realpathToScriptInfos.get(s),i),Zt(this.realpathToScriptInfos.get(t.path),i)}return r;function i(s){if(s!==t)for(const o of s.containingProjects)o.languageServiceEnabled&&!o.isOrphan()&&!o.getCompilerOptions().preserveSymlinks&&!t.isAttached(o)&&(r?zl(r,(c,u)=>u===s.path?!1:_s(c,o))||r.add(s.path,o):(r=of(),r.add(s.path,o)))}}watchClosedScriptInfo(t){if(E.assert(!t.fileWatcher),!t.isDynamicOrHasMixedContent()&&(!this.globalCacheLocationDirectoryPath||!Qi(t.path,this.globalCacheLocationDirectoryPath))){const r=t.path.indexOf("/node_modules/");!this.host.getModifiedTime||r===-1?t.fileWatcher=this.watchFactory.watchFile(t.fileName,(i,s)=>this.onSourceFileChanged(t,s),500,this.hostConfiguration.watchOptions,al.ClosedScriptInfo):(t.mTime=this.getModifiedTime(t),t.fileWatcher=this.watchClosedScriptInfoInNodeModules(t.path.substr(0,r)))}}createNodeModulesWatcher(t){const r=this.watchFactory.watchDirectory(t,s=>{var o;const c=p9(this.toPath(s));if(!c)return;const u=Pc(c);if((o=i.affectedModuleSpecifierCacheProjects)!=null&&o.size&&(u==="package.json"||u==="node_modules")&&i.affectedModuleSpecifierCacheProjects.forEach(f=>{var g,p;(p=(g=this.findProject(f))==null?void 0:g.getModuleSpecifierCache())==null||p.clear()}),i.refreshScriptInfoRefCount)if(t===c)this.refreshScriptInfosInDirectory(t);else{const f=this.getScriptInfoForPath(c);f?ADe(f)&&this.refreshScriptInfo(f):ZS(c)||this.refreshScriptInfosInDirectory(c)}},1,this.hostConfiguration.watchOptions,al.NodeModules),i={refreshScriptInfoRefCount:0,affectedModuleSpecifierCacheProjects:void 0,close:()=>{var s;!i.refreshScriptInfoRefCount&&!((s=i.affectedModuleSpecifierCacheProjects)!=null&&s.size)&&(r.close(),this.nodeModulesWatchers.delete(t))}};return this.nodeModulesWatchers.set(t,i),i}watchPackageJsonsInNodeModules(t,r){const i=this.nodeModulesWatchers.get(t)||this.createNodeModulesWatcher(t);return(i.affectedModuleSpecifierCacheProjects||(i.affectedModuleSpecifierCacheProjects=new Set)).add(r.getProjectName()),{close:()=>{var s;(s=i.affectedModuleSpecifierCacheProjects)==null||s.delete(r.getProjectName()),i.close()}}}watchClosedScriptInfoInNodeModules(t){const r=t+"/node_modules",i=this.nodeModulesWatchers.get(r)||this.createNodeModulesWatcher(r);return i.refreshScriptInfoRefCount++,{close:()=>{i.refreshScriptInfoRefCount--,i.close()}}}getModifiedTime(t){return(this.host.getModifiedTime(t.path)||Zm).getTime()}refreshScriptInfo(t){const r=this.getModifiedTime(t);if(r!==t.mTime){const i=MB(t.mTime,r);t.mTime=r,this.onSourceFileChanged(t,i)}}refreshScriptInfosInDirectory(t){t=t+Co,this.filenameToScriptInfo.forEach(r=>{ADe(r)&&Qi(r.path,t)&&this.refreshScriptInfo(r)})}stopWatchingScriptInfo(t){t.fileWatcher&&(t.fileWatcher.close(),t.fileWatcher=void 0)}getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(t,r,i,s,o){if(C_(t)||yN(t))return this.getOrCreateScriptInfoWorker(t,r,!1,void 0,i,s,o);const c=this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(t));if(c)return c}getOrCreateScriptInfoOpenedByClientForNormalizedPath(t,r,i,s,o){return this.getOrCreateScriptInfoWorker(t,r,!0,i,s,o)}getOrCreateScriptInfoForNormalizedPath(t,r,i,s,o,c){return this.getOrCreateScriptInfoWorker(t,this.currentDirectory,r,i,s,o,c)}getOrCreateScriptInfoWorker(t,r,i,s,o,c,u){E.assert(s===void 0||i,"ScriptInfo needs to be opened by client to be able to set its user defined content");const f=hN(t,r,this.toCanonicalFileName);let g=this.getScriptInfoForPath(f);if(!g){const p=yN(t);if(E.assert(C_(t)||p||i,"",()=>`${JSON.stringify({fileName:t,currentDirectory:r,hostCurrentDirectory:this.currentDirectory,openKeys:fs(this.openFilesWithNonRootedDiskPath.keys())})} +Script info with non-dynamic relative file name can only be open script info or in context of host currentDirectory`),E.assert(!C_(t)||this.currentDirectory===r||!this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(t)),"",()=>`${JSON.stringify({fileName:t,currentDirectory:r,hostCurrentDirectory:this.currentDirectory,openKeys:fs(this.openFilesWithNonRootedDiskPath.keys())})} +Open script files with non rooted disk path opened with current directory context cannot have same canonical names`),E.assert(!p||this.currentDirectory===r||this.useInferredProjectPerProjectRoot,"",()=>`${JSON.stringify({fileName:t,currentDirectory:r,hostCurrentDirectory:this.currentDirectory,openKeys:fs(this.openFilesWithNonRootedDiskPath.keys())})} +Dynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath.`),!i&&!p&&!(u||this.host).fileExists(t))return;g=new gQ(this.host,t,o,!!c,f,this.filenameToScriptInfoVersion.get(f)),this.filenameToScriptInfo.set(g.path,g),this.filenameToScriptInfoVersion.delete(g.path),i?!C_(t)&&(!p||this.currentDirectory!==r)&&this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(t),g):this.watchClosedScriptInfo(g)}return i&&(this.stopWatchingScriptInfo(g),g.open(s),c&&g.registerFileUpdate()),g}getScriptInfoForNormalizedPath(t){return!C_(t)&&this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(t))||this.getScriptInfoForPath(hN(t,this.currentDirectory,this.toCanonicalFileName))}getScriptInfoForPath(t){return this.filenameToScriptInfo.get(t)}getDocumentPositionMapper(t,r,i){const s=this.getOrCreateScriptInfoNotOpenedByClient(r,t.currentDirectory,this.host);if(!s){i&&t.addGeneratedFileWatch(r,i);return}if(s.getSnapshot(),ns(s.sourceMapFilePath)){const p=this.getScriptInfoForPath(s.sourceMapFilePath);if(p&&(p.getSnapshot(),p.documentPositionMapper!==void 0))return p.sourceInfos=this.addSourceInfoToSourceMap(i,t,p.sourceInfos),p.documentPositionMapper?p.documentPositionMapper:void 0;s.sourceMapFilePath=void 0}else if(s.sourceMapFilePath){s.sourceMapFilePath.sourceInfos=this.addSourceInfoToSourceMap(i,t,s.sourceMapFilePath.sourceInfos);return}else if(s.sourceMapFilePath!==void 0)return;let o,c,u=(p,y)=>{const S=this.getOrCreateScriptInfoNotOpenedByClient(p,t.currentDirectory,this.host);if(!S){c=y;return}o=S;const T=S.getSnapshot();return S.documentPositionMapper!==void 0?S.documentPositionMapper:HC(T)};const f=t.projectName,g=oG({getCanonicalFileName:this.toCanonicalFileName,log:p=>this.logger.info(p),getSourceFileLike:p=>this.getSourceFileLike(p,f,s)},s.fileName,s.textStorage.getLineInfo(),u);return u=void 0,o?(s.sourceMapFilePath=o.path,o.declarationInfoPath=s.path,o.documentPositionMapper=g||!1,o.sourceInfos=this.addSourceInfoToSourceMap(i,t,o.sourceInfos)):c?s.sourceMapFilePath={watcher:this.addMissingSourceMapFile(t.currentDirectory===this.currentDirectory?c:is(c,t.currentDirectory),s.path),sourceInfos:this.addSourceInfoToSourceMap(i,t)}:s.sourceMapFilePath=!1,g}addSourceInfoToSourceMap(t,r,i){if(t){const s=this.getOrCreateScriptInfoNotOpenedByClient(t,r.currentDirectory,r.directoryStructureHost);(i||(i=new Set)).add(s.path)}return i}addMissingSourceMapFile(t,r){return this.watchFactory.watchFile(t,()=>{const s=this.getScriptInfoForPath(r);s&&s.sourceMapFilePath&&!ns(s.sourceMapFilePath)&&(this.delayUpdateProjectGraphs(s.containingProjects,!0),this.delayUpdateSourceInfoProjects(s.sourceMapFilePath.sourceInfos),s.closeSourceMapFileWatcher())},2e3,this.hostConfiguration.watchOptions,al.MissingSourceMapFile)}getSourceFileLike(t,r,i){const s=r.projectName?r:this.findProject(r);if(s){const c=s.toPath(t),u=s.getSourceFile(c);if(u&&u.resolvedPath===c)return u}const o=this.getOrCreateScriptInfoNotOpenedByClient(t,(s||this).currentDirectory,s?s.directoryStructureHost:this.host);if(o){if(i&&ns(i.sourceMapFilePath)&&o!==i){const c=this.getScriptInfoForPath(i.sourceMapFilePath);c&&(c.sourceInfos||(c.sourceInfos=new Set)).add(o.path)}return o.cacheSourceFile?o.cacheSourceFile.sourceFile:(o.sourceFileLike||(o.sourceFileLike={get text(){return E.fail("shouldnt need text"),""},getLineAndCharacterOfPosition:c=>{const u=o.positionToLineOffset(c);return{line:u.line-1,character:u.offset-1}},getPositionOfLineAndCharacter:(c,u,f)=>o.lineOffsetToPosition(c+1,u+1,f)}),o.sourceFileLike)}}setPerformanceEventHandler(t){this.performanceEventHandler=t}setHostConfiguration(t){var r;if(t.file){const i=this.getScriptInfoForNormalizedPath(Lo(t.file));i&&(i.setOptions(d6(t.formatOptions),t.preferences),this.logger.info(`Host configuration update for file ${t.file}`))}else{if(t.hostInfo!==void 0&&(this.hostConfiguration.hostInfo=t.hostInfo,this.logger.info(`Host information ${t.hostInfo}`)),t.formatOptions&&(this.hostConfiguration.formatCodeOptions={...this.hostConfiguration.formatCodeOptions,...d6(t.formatOptions)},this.logger.info("Format host information updated")),t.preferences){const{lazyConfiguredProjectsFromExternalProject:i,includePackageJsonAutoImports:s}=this.hostConfiguration.preferences;this.hostConfiguration.preferences={...this.hostConfiguration.preferences,...t.preferences},i&&!this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject&&this.configuredProjects.forEach(o=>{o.hasExternalProjectRef()&&o.pendingUpdateLevel===2&&!this.pendingProjectUpdates.has(o.getProjectName())&&o.updateGraph()}),s!==t.preferences.includePackageJsonAutoImports&&this.invalidateProjectPackageJson(void 0)}t.extraFileExtensions&&(this.hostConfiguration.extraFileExtensions=t.extraFileExtensions,this.reloadProjects(),this.logger.info("Host file extension mappings updated")),t.watchOptions&&(this.hostConfiguration.watchOptions=(r=SN(t.watchOptions))==null?void 0:r.watchOptions,this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`))}}getWatchOptions(t){return this.getWatchOptionsFromProjectWatchOptions(t.getWatchOptions())}getWatchOptionsFromProjectWatchOptions(t){return t&&this.hostConfiguration.watchOptions?{...this.hostConfiguration.watchOptions,...t}:t||this.hostConfiguration.watchOptions}closeLog(){this.logger.close()}reloadProjects(){this.logger.info("reload projects."),this.filenameToScriptInfo.forEach(t=>{this.openFiles.has(t.path)||t.fileWatcher&&this.onSourceFileChanged(t,this.host.fileExists(t.fileName)?1:2)}),this.pendingProjectUpdates.forEach((t,r)=>{this.throttledOperations.cancel(r),this.pendingProjectUpdates.delete(r)}),this.throttledOperations.cancel(ppe),this.pendingEnsureProjectForOpenFiles=!1,this.configFileExistenceInfoCache.forEach(t=>{t.config&&(t.config.updateLevel=2)}),this.reloadConfiguredProjectForFiles(this.openFiles,!0,!1,zg,"User requested reload projects"),this.externalProjects.forEach(t=>{this.clearSemanticCache(t),t.updateGraph()}),this.inferredProjects.forEach(t=>this.clearSemanticCache(t)),this.ensureProjectForOpenFiles()}reloadConfiguredProjectForFiles(t,r,i,s,o){const c=new Map,u=f=>{c.has(f.canonicalConfigFilePath)||(c.set(f.canonicalConfigFilePath,!0),this.reloadConfiguredProject(f,o,!1,r))};t?.forEach((f,g)=>{if(this.configFileForOpenFiles.delete(g),!s(f))return;const p=this.getScriptInfoForPath(g);E.assert(p.isScriptOpen());const y=this.getConfigFileNameForFile(p);if(y){const S=this.findConfiguredProjectByProjectName(y)||this.createConfiguredProject(y);c.has(S.canonicalConfigFilePath)||(c.set(S.canonicalConfigFilePath,!0),i?(S.pendingUpdateLevel=2,S.pendingUpdateReason=o,r&&this.clearSemanticCache(S),this.delayUpdateProjectGraph(S)):(this.reloadConfiguredProject(S,o,!1,r),fx(S,p)||m6(S,p.path,C=>(u(C),fx(C,p)),1)&&m6(S,void 0,u,0)))}})}removeRootOfInferredProjectIfNowPartOfOtherProject(t){E.assert(t.containingProjects.length>0);const r=t.containingProjects[0];!r.isOrphan()&&p6(r)&&r.isRoot(t)&&Zt(t.containingProjects,i=>i!==r&&!i.isOrphan())&&r.removeFile(t,!0,!0)}ensureProjectForOpenFiles(){this.logger.info("Before ensureProjectForOpenFiles:"),this.printProjects(),this.openFiles.forEach((t,r)=>{const i=this.getScriptInfoForPath(r);i.isOrphan()?this.assignOrphanScriptInfoToInferredProject(i,t):this.removeRootOfInferredProjectIfNowPartOfOtherProject(i)}),this.pendingEnsureProjectForOpenFiles=!1,this.inferredProjects.forEach(Tf),this.logger.info("After ensureProjectForOpenFiles:"),this.printProjects()}openClientFile(t,r,i,s){return this.openClientFileWithNormalizedPath(Lo(t),r,i,!1,s?Lo(s):void 0)}getOriginalLocationEnsuringConfiguredProject(t,r){const i=t.isSourceOfProjectReferenceRedirect(r.fileName),s=i?r:t.getSourceMapper().tryGetSourcePosition(r);if(!s)return;const{fileName:o}=s,c=this.getScriptInfo(o);if(!c&&!this.host.fileExists(o))return;const u={fileName:Lo(o),path:this.toPath(o)},f=this.getConfigFileNameForFile(u);if(!f)return;let g=this.findConfiguredProjectByProjectName(f);if(!g){if(t.getCompilerOptions().disableReferencedProjectLoad)return i?r:c?.containingProjects.length?s:r;g=this.createAndLoadConfiguredProject(f,`Creating project for original file: ${u.fileName}${r!==s?" for location: "+r.fileName:""}`)}Tf(g);const p=T=>{const C=this.getScriptInfo(o);return C&&fx(T,C)};if(g.isSolution()||!p(g)){if(g=m6(g,o,T=>(Tf(T),p(T)?T:void 0),2,`Creating project referenced in solution ${g.projectName} to find possible configured project for original file: ${u.fileName}${r!==s?" for location: "+r.fileName:""}`),!g)return;if(g===t)return s}S(g);const y=this.getScriptInfo(o);if(!y||!y.containingProjects.length)return;return y.containingProjects.forEach(T=>{P1(T)&&S(T)}),s;function S(T){t.originalConfiguredProjects||(t.originalConfiguredProjects=new Set),t.originalConfiguredProjects.add(T.canonicalConfigFilePath)}}fileExists(t){return!!this.getScriptInfoForNormalizedPath(t)||this.host.fileExists(t)}findExternalProjectContainingOpenScriptInfo(t){return kn(this.externalProjects,r=>(Tf(r),r.containsScriptInfo(t)))}getOrCreateOpenScriptInfo(t,r,i,s,o){const c=this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(t,o?this.getNormalizedAbsolutePath(o):this.currentDirectory,r,i,s);return this.openFiles.set(c.path,o),c}assignProjectToOpenedScriptInfo(t){let r,i,s=this.findExternalProjectContainingOpenScriptInfo(t),o,c,u=!1;return!s&&this.serverMode===0&&(r=this.getConfigFileNameForFile(t),r&&(s=this.findConfiguredProjectByProjectName(r),s?Tf(s):(s=this.createLoadAndUpdateConfiguredProject(r,`Creating possible configured project for ${t.fileName} to open`),u=!0),c=s.containsScriptInfo(t)?s:void 0,o=s,fx(s,t)||m6(s,t.path,f=>{if(Tf(f),es(o)?o.push(f):o=[s,f],fx(f,t))return c=f,f;!c&&f.containsScriptInfo(t)&&(c=f)},2,`Creating project referenced in solution ${s.projectName} to find possible configured project for ${t.fileName} to open`),c?(r=c.getConfigFilePath(),(c!==s||u)&&(i=c.getAllProjectErrors(),this.sendConfigFileDiagEvent(c,t.fileName))):r=void 0,this.createAncestorProjects(t,s))),t.containingProjects.forEach(Tf),t.isOrphan()&&(es(o)?o.forEach(f=>this.sendConfigFileDiagEvent(f,t.fileName)):o&&this.sendConfigFileDiagEvent(o,t.fileName),E.assert(this.openFiles.has(t.path)),this.assignOrphanScriptInfoToInferredProject(t,this.openFiles.get(t.path))),E.assert(!t.isOrphan()),{configFileName:r,configFileErrors:i,retainProjects:o}}createAncestorProjects(t,r){if(t.isAttached(r))for(;;){if(!r.isInitialLoadPending()&&(!r.getCompilerOptions().composite||r.getCompilerOptions().disableSolutionSearching))return;const i=this.getConfigFileNameForFile({fileName:r.getConfigFilePath(),path:t.path,configFileInfo:!0});if(!i)return;const s=this.findConfiguredProjectByProjectName(i)||this.createConfiguredProjectWithDelayLoad(i,`Creating project possibly referencing default composite project ${r.getProjectName()} of open file ${t.fileName}`);s.isInitialLoadPending()&&s.setPotentialProjectReference(r.canonicalConfigFilePath),r=s}}loadAncestorProjectTree(t){t=t||LZ(this.configuredProjects,(i,s)=>s.isInitialLoadPending()?void 0:[i,!0]);const r=new Set;for(const i of fs(this.configuredProjects.values()))PDe(i,s=>t.has(s))&&Tf(i),this.ensureProjectChildren(i,t,r)}ensureProjectChildren(t,r,i){var s;if(!zy(i,t.canonicalConfigFilePath)||t.getCompilerOptions().disableReferencedProjectLoad)return;const o=(s=t.getCurrentProgram())==null?void 0:s.getResolvedProjectReferences();if(o)for(const c of o){if(!c)continue;const u=VV(c.references,p=>r.has(p.sourceFile.path)?p:void 0);if(!u)continue;const f=Lo(c.sourceFile.fileName),g=t.projectService.findConfiguredProjectByProjectName(f)||t.projectService.createAndLoadConfiguredProject(f,`Creating project referenced by : ${t.projectName} as it references project ${u.sourceFile.fileName}`);Tf(g),this.ensureProjectChildren(g,r,i)}}cleanupAfterOpeningFile(t){this.removeOrphanConfiguredProjects(t);for(const r of this.inferredProjects.slice())r.isOrphan()&&this.removeProject(r);this.removeOrphanScriptInfos()}openClientFileWithNormalizedPath(t,r,i,s,o){const c=this.getOrCreateOpenScriptInfo(t,r,i,s,o),{retainProjects:u,...f}=this.assignProjectToOpenedScriptInfo(c);return this.cleanupAfterOpeningFile(u),this.telemetryOnOpenFile(c),this.printProjects(),f}removeOrphanConfiguredProjects(t){const r=new Map(this.configuredProjects),i=c=>{!c.isOrphan()&&c.originalConfiguredProjects&&c.originalConfiguredProjects.forEach((u,f)=>{const g=this.getConfiguredProjectByCanonicalConfigFilePath(f);return g&&o(g)})};t&&(es(t)?t.forEach(o):o(t)),this.inferredProjects.forEach(i),this.externalProjects.forEach(i),this.configuredProjects.forEach(c=>{c.hasOpenRef()?o(c):r.has(c.canonicalConfigFilePath)&&wDe(c,u=>s(u)&&o(c))}),r.forEach(c=>this.removeProject(c));function s(c){return c.hasOpenRef()||!r.has(c.canonicalConfigFilePath)}function o(c){r.delete(c.canonicalConfigFilePath)&&(i(c),wDe(c,o))}}removeOrphanScriptInfos(){const t=new Map(this.filenameToScriptInfo);this.filenameToScriptInfo.forEach(r=>{if(!r.isScriptOpen()&&r.isOrphan()&&!r.isContainedByBackgroundProject()){if(!r.sourceMapFilePath)return;let i;if(ns(r.sourceMapFilePath)){const s=this.getScriptInfoForPath(r.sourceMapFilePath);i=s&&s.sourceInfos}else i=r.sourceMapFilePath.sourceInfos;if(!i||!ng(i,s=>{const o=this.getScriptInfoForPath(s);return!!o&&(o.isScriptOpen()||!o.isOrphan())}))return}if(t.delete(r.path),r.sourceMapFilePath){let i;if(ns(r.sourceMapFilePath)){t.delete(r.sourceMapFilePath);const s=this.getScriptInfoForPath(r.sourceMapFilePath);i=s&&s.sourceInfos}else i=r.sourceMapFilePath.sourceInfos;i&&i.forEach((s,o)=>t.delete(o))}}),t.forEach(r=>{this.stopWatchingScriptInfo(r),this.deleteScriptInfo(r),r.closeSourceMapFileWatcher()})}telemetryOnOpenFile(t){if(this.serverMode!==0||!this.eventHandler||!t.isJavaScript()||!Rp(this.allJsFilesForOpenFileTelemetry,t.path))return;const r=this.ensureDefaultProjectForFile(t);if(!r.languageServiceEnabled)return;const i=r.getSourceFile(t.path),s=!!i&&!!i.checkJsDirective;this.eventHandler({eventName:EQ,data:{info:{checkJs:s}}})}closeClientFile(t,r){const i=this.getScriptInfoForNormalizedPath(Lo(t)),s=i?this.closeOpenFile(i,r):!1;return r||this.printProjects(),s}collectChanges(t,r,i,s){for(const o of r){const c=kn(t,u=>u.projectName===o.getProjectName());s.push(o.getChangesSinceVersion(c&&c.version,i))}}synchronizeProjectList(t,r){const i=[];return this.collectChanges(t,this.externalProjects,r,i),this.collectChanges(t,this.configuredProjects.values(),r,i),this.collectChanges(t,this.inferredProjects,r,i),i}applyChangesInOpenFiles(t,r,i){let s,o=!1;if(t)for(const u of t){const f=this.getOrCreateOpenScriptInfo(Lo(u.fileName),u.content,kQ(u.scriptKind),u.hasMixedContent,u.projectRootPath?Lo(u.projectRootPath):void 0);(s||(s=[])).push(f)}if(r)for(const u of r){const f=this.getScriptInfo(u.fileName);E.assert(!!f),this.applyChangesToFile(f,u.changes)}if(i)for(const u of i)o=this.closeClientFile(u,!0)||o;let c;s&&(c=ta(s,u=>this.assignProjectToOpenedScriptInfo(u).retainProjects)),o&&this.assignOrphanScriptInfosToInferredProject(),s?(this.cleanupAfterOpeningFile(c),s.forEach(u=>this.telemetryOnOpenFile(u)),this.printProjects()):Ir(i)&&this.printProjects()}applyChangesToFile(t,r){for(const i of r)t.editContent(i.span.start,i.span.start+i.span.length,i.newText)}closeConfiguredProjectReferencedFromExternalProject(t){const r=this.findConfiguredProjectByProjectName(t);if(r&&(r.deleteExternalProjectReference(),!r.hasOpenRef())){this.removeProject(r);return}}closeExternalProject(t){const r=Lo(t),i=this.externalProjectToConfiguredProjectMap.get(r);if(i){for(const s of i)this.closeConfiguredProjectReferencedFromExternalProject(s);this.externalProjectToConfiguredProjectMap.delete(r)}else{const s=this.findExternalProjectByProjectName(t);s&&this.removeProject(s)}}openExternalProjects(t){const r=Ph(this.externalProjects,i=>i.getProjectName(),i=>!0);ng(this.externalProjectToConfiguredProjectMap,i=>{r.set(i,!0)});for(const i of t)this.openExternalProject(i),r.delete(i.projectFileName);ng(r,i=>{this.closeExternalProject(i)})}static escapeFilenameForRegex(t){return t.replace(this.filenameEscapeRegexp,"\\$&")}resetSafeList(){this.safelist=DQ}applySafeList(t){const{rootFiles:r}=t,i=t.typeAcquisition;if(E.assert(!!i,"proj.typeAcquisition should be set by now"),i.enable===!1||i.disableFilenameBasedTypeAcquisition)return[];const s=i.include||(i.include=[]),o=[],c=r.map(p=>du(p.fileName)),u=[];for(const p of Object.keys(this.safelist)){const y=this.safelist[p];for(const S of c)if(y.match.test(S)){if(this.logger.info(`Excluding files based on rule ${p} matching file '${S}'`),y.types)for(const T of y.types)s.includes(T)||s.push(T);if(y.exclude)for(const T of y.exclude){const C=S.replace(y.match,(...w)=>T.map(D=>typeof D=="number"?ns(w[D])?rhe.escapeFilenameForRegex(w[D]):(this.logger.info(`Incorrect RegExp specification in safelist rule ${p} - not enough groups`),"\\*"):D).join(""));o.includes(C)||o.push(C)}else{const T=rhe.escapeFilenameForRegex(S);o.includes(T)||o.push(T)}}}const f=o.map(p=>new RegExp(p,"i")),g=[];for(let p=0;py.test(c[p])))u.push(c[p]);else{let y=!1;if(i.enable){const S=Pc(xd(c[p]));if(Ho(S,"js")){const T=Ou(S),C=kj(T),w=this.legacySafelist.get(C);w!==void 0&&(this.logger.info(`Excluded '${c[p]}' because it matched ${C} from the legacy safelist`),u.push(c[p]),y=!0,s.includes(w)||s.push(w))}}y||(/^.+[.-]min\.js$/.test(c[p])?u.push(c[p]):g.push(t.rootFiles[p]))}return t.rootFiles=g,u}openExternalProject(t){t.typeAcquisition=t.typeAcquisition||{},t.typeAcquisition.include=t.typeAcquisition.include||[],t.typeAcquisition.exclude=t.typeAcquisition.exclude||[],t.typeAcquisition.enable===void 0&&(t.typeAcquisition.enable=rpe(t.rootFiles.map(u=>u.fileName)));const r=this.applySafeList(t);let i;const s=[];for(const u of t.rootFiles){const f=Lo(u.fileName);_Q(f)?this.serverMode===0&&this.host.fileExists(f)&&(i||(i=[])).push(f):s.push(u)}i&&i.sort();const o=this.findExternalProjectByProjectName(t.projectFileName);let c;if(o){if(o.excludedFiles=r,!i){const u=PM(t.options),f=SN(t.options,o.getCurrentDirectory()),g=this.getFilenameForExceededTotalSizeLimitForNonTsFiles(t.projectFileName,u,t.rootFiles,WM);g?o.disableLanguageService(g):o.enableLanguageService(),o.setProjectErrors(f?.errors),this.updateRootAndOptionsOfNonInferredProject(o,t.rootFiles,WM,u,t.typeAcquisition,t.options.compileOnSave,f?.watchOptions),o.updateGraph();return}this.closeExternalProject(t.projectFileName)}else if(this.externalProjectToConfiguredProjectMap.get(t.projectFileName))if(!i)this.closeExternalProject(t.projectFileName);else{const u=this.externalProjectToConfiguredProjectMap.get(t.projectFileName);let f=0,g=0;for(;fp||((c||(c=[])).push(y),g++),f++)}for(let p=g;pthis.logger.info(c));this.pendingPluginEnablements??(this.pendingPluginEnablements=new Map);let o=this.pendingPluginEnablements.get(t);o||this.pendingPluginEnablements.set(t,o=[]),o.push(s);return}this.endEnablePlugin(t,Zb.importServicePluginSync(r,i,this.host,s=>this.logger.info(s)))}endEnablePlugin(t,{pluginConfigEntry:r,resolvedModule:i,errorLogs:s}){var o;if(i){const c=(o=this.currentPluginConfigOverrides)==null?void 0:o.get(r.name);if(c){const u=r.name;r=c,r.name=u}t.enableProxy(i,r)}else Zt(s,c=>this.logger.info(c)),this.logger.info(`Couldn't find ${r.name}`)}hasNewPluginEnablementRequests(){return!!this.pendingPluginEnablements}hasPendingPluginEnablements(){return!!this.currentPluginEnablementPromise}async waitForPendingPlugins(){for(;this.currentPluginEnablementPromise;)await this.currentPluginEnablementPromise}enableRequestedPlugins(){this.pendingPluginEnablements&&this.enableRequestedPluginsAsync()}async enableRequestedPluginsAsync(){if(this.currentPluginEnablementPromise&&await this.waitForPendingPlugins(),!this.pendingPluginEnablements)return;const t=fs(this.pendingPluginEnablements.entries());this.pendingPluginEnablements=void 0,this.currentPluginEnablementPromise=this.enableRequestedPluginsWorker(t),await this.currentPluginEnablementPromise}async enableRequestedPluginsWorker(t){E.assert(this.currentPluginEnablementPromise===void 0),await Promise.all(Yt(t,([r,i])=>this.enableRequestedPluginsForProjectAsync(r,i))),this.currentPluginEnablementPromise=void 0,this.sendProjectsUpdatedInBackgroundEvent()}async enableRequestedPluginsForProjectAsync(t,r){const i=await Promise.all(r);if(!t.isClosed()){for(const s of i)this.endEnablePlugin(t,s);this.delayUpdateProjectGraph(t)}}configurePlugin(t){this.forEachEnabledProject(r=>r.onPluginConfigurationChanged(t.pluginName,t.configuration)),this.currentPluginConfigOverrides=this.currentPluginConfigOverrides||new Map,this.currentPluginConfigOverrides.set(t.pluginName,t.configuration)}getPackageJsonsVisibleToFile(t,r){const i=this.packageJsonCache,s=r&&this.toPath(r),o=this.toPath(t),c=[],u=f=>{switch(i.directoryHasPackageJson(f)){case 3:return i.searchDirectoryAndAncestors(f),u(f);case-1:const g=Hn(f,"package.json");this.watchPackageJsonFile(g);const p=i.getInDirectory(f);p&&c.push(p)}if(s&&s===f)return!0};return kd(qn(o),u),c}getNearestAncestorDirectoryWithPackageJson(t){return kd(t,r=>{switch(this.packageJsonCache.directoryHasPackageJson(this.toPath(r))){case-1:return r;case 0:return;case 3:return this.host.fileExists(Hn(r,"package.json"))?r:void 0}})}watchPackageJsonFile(t){const r=this.packageJsonFilesMap||(this.packageJsonFilesMap=new Map);r.has(t)||(this.invalidateProjectPackageJson(t),r.set(t,this.watchFactory.watchFile(t,(i,s)=>{const o=this.toPath(i);switch(s){case 0:return E.fail();case 1:this.packageJsonCache.addOrUpdate(o),this.invalidateProjectPackageJson(o);break;case 2:this.packageJsonCache.delete(o),this.invalidateProjectPackageJson(o),r.get(o).close(),r.delete(o)}},250,this.hostConfiguration.watchOptions,al.PackageJson)))}onAddPackageJson(t){this.packageJsonCache.addOrUpdate(t),this.watchPackageJsonFile(t)}includePackageJsonAutoImports(){switch(this.hostConfiguration.preferences.includePackageJsonAutoImports){case"on":return 1;case"off":return 0;default:return 2}}invalidateProjectPackageJson(t){this.configuredProjects.forEach(r),this.inferredProjects.forEach(r),this.externalProjects.forEach(r);function r(i){t?i.onPackageJsonChange(t):i.onAutoImportProviderSettingsChanged()}}getIncompleteCompletionsCache(){return this.incompleteCompletionsCache||(this.incompleteCompletionsCache=WZe())}},dpe.filenameEscapeRegexp=/[-/\\^$*+?.()|[\]{}]/g,AQ=dpe}});function mpe(e){let t,r,i;const s={get(f,g,p,y){if(!(!r||i!==c(f,p,y)))return r.get(g)},set(f,g,p,y,S,T){if(o(f,p,y).set(g,u(S,T,!1)),T){for(const C of S)if(C.isInNodeModules){const w=C.path.substring(0,C.path.indexOf(Am)+Am.length-1);t?.has(w)||(t||(t=new Map)).set(w,e.watchNodeModulesForPackageJsonChanges(w))}}},setModulePaths(f,g,p,y,S){const T=o(f,p,y),C=T.get(g);C?C.modulePaths=S:T.set(g,u(S,void 0,void 0))},setBlockedByPackageJsonDependencies(f,g,p,y,S){const T=o(f,p,y),C=T.get(g);C?C.isBlockedByPackageJsonDependencies=S:T.set(g,u(void 0,void 0,S))},clear(){t?.forEach(f=>f.close()),r?.clear(),t?.clear(),i=void 0},count(){return r?r.size:0}};return E.isDebugging&&Object.defineProperty(s,"__cache",{get:()=>r}),s;function o(f,g,p){const y=c(f,g,p);return r&&i!==y&&s.clear(),i=y,r||(r=new Map)}function c(f,g,p){return`${f},${g.importModuleSpecifierEnding},${g.importModuleSpecifierPreference},${p.overrideImportMode}`}function u(f,g,p){return{modulePaths:f,moduleSpecifiers:g,isBlockedByPackageJsonDependencies:p}}}var VZe=Nt({"src/server/moduleSpecifierCache.ts"(){"use strict";w1()}});function gpe(e){const t=new Map,r=new Map;return{addOrUpdate:i,forEach:t.forEach.bind(t),get:t.get.bind(t),delete:o=>{t.delete(o),r.set(qn(o),!0)},getInDirectory:o=>t.get(Hn(o,"package.json"))||void 0,directoryHasPackageJson:s,searchDirectoryAndAncestors:o=>{kd(o,c=>{if(s(c)!==3)return!0;const u=e.toPath(Hn(c,"package.json"));PA(e,u)?i(u):r.set(c,!0)})}};function i(o){const c=E.checkDefined(jH(o,e.host));t.set(o,c),r.delete(qn(o))}function s(o){return t.has(Hn(o,"package.json"))?-1:r.has(o)?0:3}}var qZe=Nt({"src/server/packageJsonCache.ts"(){"use strict";w1()}});function HZe(e){const t=e[0],r=e[1];return(1e9*t+r)/1e6}function ODe(e,t){if((p6(e)||yQ(e))&&e.isJsOnlyProject()){const r=e.getScriptInfoForNormalizedPath(t);return r&&!r.isJavaScript()}return!1}function GZe(e){return Rf(e)||!!e.emitDecoratorMetadata}function LDe(e,t,r){const i=t.getScriptInfoForNormalizedPath(e);return{start:i.positionToLineOffset(r.start),end:i.positionToLineOffset(r.start+r.length),text:Bd(r.messageText,` +`),code:r.code,category:K2(r),reportsUnnecessary:r.reportsUnnecessary,reportsDeprecated:r.reportsDeprecated,source:r.source,relatedInformation:Yt(r.relatedInformation,NQ)}}function NQ(e){return e.file?{span:{start:xN(qa(e.file,e.start)),end:xN(qa(e.file,e.start+e.length)),file:e.file.fileName},message:Bd(e.messageText,` +`),category:K2(e),code:e.code}:{message:Bd(e.messageText,` +`),category:K2(e),code:e.code}}function xN(e){return{line:e.line+1,offset:e.character+1}}function kN(e,t){const r=e.file&&xN(qa(e.file,e.start)),i=e.file&&xN(qa(e.file,e.start+e.length)),s=Bd(e.messageText,` +`),{code:o,source:c}=e,u=K2(e),f={start:r,end:i,text:s,code:o,category:u,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,source:c,relatedInformation:Yt(e.relatedInformation,NQ)};return t?{...f,fileName:e.file&&e.file.fileName}:f}function $Ze(e,t){return e.every(r=>yc(r.span)i(o,e));return!es(r)&&r.symLinkedProjects&&r.symLinkedProjects.forEach((o,c)=>{const u=t(c);s.push(...ta(o,f=>i(f,u)))}),VS(s,w0)}function IQ(){return Tj(({textSpan:e})=>e.start+100003*e.length,eL)}function QZe(e,t,r,i,s,o){const c=MDe(e,t,r,!0,(g,p)=>g.getLanguageService().findRenameLocations(p.fileName,p.pos,i,s,o),(g,p)=>p(Q3(g)));if(es(c))return c;const u=[],f=IQ();return c.forEach((g,p)=>{for(const y of g)!f.has(y)&&!FQ(Q3(y),p)&&(u.push(y),f.add(y))}),u}function YZe(e,t,r){const i=e.getLanguageService().getDefinitionAtPosition(t.fileName,t.pos,!1,r),s=i&&bl(i);return s&&!s.isLocal?{fileName:s.fileName,pos:s.textSpan.start}:void 0}function ZZe(e,t,r,i){var s,o;const c=MDe(e,t,r,!1,(p,y)=>(i.info(`Finding references to ${y.fileName} position ${y.pos} in project ${p.getProjectName()}`),p.getLanguageService().findReferences(y.fileName,y.pos)),(p,y)=>{y(Q3(p.definition));for(const S of p.references)y(Q3(S))});if(es(c))return c;const u=c.get(t);if(((o=(s=u?.[0])==null?void 0:s.references[0])==null?void 0:o.isDefinition)===void 0)c.forEach(p=>{for(const y of p)for(const S of y.references)delete S.isDefinition});else{const p=IQ();for(const S of u)for(const T of S.references)if(T.isDefinition){p.add(T);break}const y=new Set;for(;;){let S=!1;if(c.forEach((T,C)=>{if(y.has(C))return;C.getLanguageService().updateIsDefinitionOfReferencedSymbols(T,p)&&(y.add(C),S=!0)}),!S)break}c.forEach((S,T)=>{if(!y.has(T))for(const C of S)for(const w of C.references)w.isDefinition=!1})}const f=[],g=IQ();return c.forEach((p,y)=>{for(const S of p){const T=FQ(Q3(S.definition),y),C=T===void 0?S.definition:{...S.definition,textSpan:Jl(T.pos,S.definition.textSpan.length),fileName:T.fileName,contextSpan:tKe(S.definition,y)};let w=kn(f,D=>eL(D.definition,C));w||(w={definition:C,references:[]},f.push(w));for(const D of S.references)!g.has(D)&&!FQ(Q3(D),y)&&(g.add(D),w.references.push(D))}}),f.filter(p=>p.references.length!==0)}function vpe(e,t,r){for(const i of es(e)?e:e.projects)r(i,t);!es(e)&&e.symLinkedProjects&&e.symLinkedProjects.forEach((i,s)=>{for(const o of i)r(o,s)})}function MDe(e,t,r,i,s,o){const c=new Map,u=C7();u.enqueue({project:t,location:r}),vpe(e,r.fileName,(w,D)=>{const O={fileName:D,pos:r.pos};u.enqueue({project:w,location:O})});const f=t.projectService,g=t.getCancellationToken(),p=YZe(t,r,i),y=Vu(()=>t.isSourceOfProjectReferenceRedirect(p.fileName)?p:t.getLanguageService().getSourceMapper().tryGetGeneratedPosition(p)),S=Vu(()=>t.isSourceOfProjectReferenceRedirect(p.fileName)?p:t.getLanguageService().getSourceMapper().tryGetSourcePosition(p)),T=new Set;e:for(;!u.isEmpty();){for(;!u.isEmpty();){if(g.isCancellationRequested())break e;const{project:w,location:D}=u.dequeue();if(c.has(w)||RDe(w,D)||(Tf(w),!w.containsFile(Lo(D.fileName))))continue;const O=C(w,D);c.set(w,O??Gc),T.add(eKe(w))}p&&(f.loadAncestorProjectTree(T),f.forEachEnabledProject(w=>{if(g.isCancellationRequested()||c.has(w))return;const D=KZe(p,w,y,S);D&&u.enqueue({project:w,location:D})}))}if(c.size===1)return hj(c.values());return c;function C(w,D){const O=s(w,D);if(O){for(const z of O)o(z,W=>{const X=f.getOriginalLocationEnsuringConfiguredProject(w,W);if(!X)return;const J=f.getScriptInfo(X.fileName);for(const B of J.containingProjects)!B.isOrphan()&&!c.has(B)&&u.enqueue({project:B,location:X});const ie=f.getSymlinkedProjects(J);ie&&ie.forEach((B,Y)=>{for(const ae of B)!ae.isOrphan()&&!c.has(ae)&&u.enqueue({project:ae,location:{fileName:Y,pos:X.pos}})})});return O}}}function KZe(e,t,r,i){if(t.containsFile(Lo(e.fileName))&&!RDe(t,e))return e;const s=r();if(s&&t.containsFile(Lo(s.fileName)))return s;const o=i();return o&&t.containsFile(Lo(o.fileName))?o:void 0}function RDe(e,t){if(!t)return!1;const r=e.getLanguageService().getProgram();if(!r)return!1;const i=r.getSourceFile(t.fileName);return!!i&&i.resolvedPath!==i.path&&i.resolvedPath!==e.toPath(t.fileName)}function eKe(e){return P1(e)?e.canonicalConfigFilePath:e.getProjectName()}function Q3({fileName:e,textSpan:t}){return{fileName:e,pos:t.start}}function FQ(e,t){return P3(e,t.getSourceMapper(),r=>t.projectService.fileExists(r))}function jDe(e,t){return tL(e,t.getSourceMapper(),r=>t.projectService.fileExists(r))}function tKe(e,t){return EH(e,t.getSourceMapper(),r=>t.projectService.fileExists(r))}function Im(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(yc(e))}}function bpe(e,t,r){const i=Im(e,r),s=t&&Im(t,r);return s?{...i,contextStart:s.start,contextEnd:s.end}:i}function rKe(e,t){return{start:BDe(t,e.span.start),end:BDe(t,yc(e.span)),newText:e.newText}}function BDe(e,t){return _pe(e)?iKe(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function nKe(e,t){const r=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:r,wordPattern:e.wordPattern}:{ranges:r}}function iKe(e){return{line:e.line+1,offset:e.character+1}}function sKe(e){E.assert(e.textChanges.length===1);const t=ba(e.textChanges);return E.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Spe(e,t,r,i){const s=aKe(e,t,i),{line:o,character:c}=_k(eT(s),r);return{line:o+1,offset:c+1}}function aKe(e,t,r){for(const{fileName:i,textChanges:s}of r)if(i===t)for(let o=s.length-1;o>=0;o--){const{newText:c,span:{start:u,length:f}}=s[o];e=e.slice(0,u)+c+e.slice(u+f)}return e}function JDe(e,{fileName:t,textSpan:r,contextSpan:i,isWriteAccess:s,isDefinition:o},{disableLineTextInReferences:c}){const u=E.checkDefined(e.getScriptInfo(t)),f=bpe(r,i,u),g=c?void 0:oKe(u,f);return{file:t,...f,lineText:g,isWriteAccess:s,isDefinition:o}}function oKe(e,t){const r=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(r.start,yc(r)).replace(/\r|\n/g,"")}function cKe(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var Tpe,xpe,zDe,kpe,WDe,Cpe,lKe=Nt({"src/server/session.ts"(){"use strict";w1(),mx(),Zfe(),Tpe={isCancellationRequested:()=>!1,setRequest:()=>{},resetRequest:()=>{}},xpe=dQ,zDe=class{constructor(e){this.operationHost=e}startNew(e){this.complete(),this.requestId=this.operationHost.getCurrentRequestId(),this.executeAction(e)}complete(){this.requestId!==void 0&&(this.operationHost.sendRequestCompletedEvent(this.requestId),this.requestId=void 0),this.setTimerHandle(void 0),this.setImmediateId(void 0)}immediate(e,t){const r=this.requestId;E.assert(r===this.operationHost.getCurrentRequestId(),"immediate: incorrect request id"),this.setImmediateId(this.operationHost.getServerHost().setImmediate(()=>{this.immediateId=void 0,this.operationHost.executeWithRequestId(r,()=>this.executeAction(t))},e))}delay(e,t,r){const i=this.requestId;E.assert(i===this.operationHost.getCurrentRequestId(),"delay: incorrect request id"),this.setTimerHandle(this.operationHost.getServerHost().setTimeout(()=>{this.timerHandle=void 0,this.operationHost.executeWithRequestId(i,()=>this.executeAction(r))},t,e))}executeAction(e){var t,r,i,s,o,c;let u=!1;try{this.operationHost.isCancellationRequested()?(u=!0,(t=Jr)==null||t.instant(Jr.Phase.Session,"stepCanceled",{seq:this.requestId,early:!0})):((r=Jr)==null||r.push(Jr.Phase.Session,"stepAction",{seq:this.requestId}),e(this),(i=Jr)==null||i.pop())}catch(f){(s=Jr)==null||s.popAll(),u=!0,f instanceof lk?(o=Jr)==null||o.instant(Jr.Phase.Session,"stepCanceled",{seq:this.requestId}):((c=Jr)==null||c.instant(Jr.Phase.Session,"stepError",{seq:this.requestId,message:f.message}),this.operationHost.logError(f,`delayed processing of request ${this.requestId}`))}(u||!this.hasPendingWork())&&this.complete()}setTimerHandle(e){this.timerHandle!==void 0&&this.operationHost.getServerHost().clearTimeout(this.timerHandle),this.timerHandle=e}setImmediateId(e){this.immediateId!==void 0&&this.operationHost.getServerHost().clearImmediate(this.immediateId),this.immediateId=e}hasPendingWork(){return!!this.timerHandle||!!this.immediateId}},kpe=["openExternalProject","openExternalProjects","closeExternalProject","synchronizeProjectList","emit-output","compileOnSaveAffectedFileList","compileOnSaveEmitFile","compilerOptionsDiagnostics-full","encodedSemanticClassifications-full","semanticDiagnosticsSync","suggestionDiagnosticsSync","geterrForProject","reload","reloadProjects","getCodeFixes","getCodeFixes-full","getCombinedCodeFix","getCombinedCodeFix-full","applyCodeActionCommand","getSupportedCodeFixes","getApplicableRefactors","getMoveToRefactoringFileSuggestions","getEditsForRefactor","getEditsForRefactor-full","organizeImports","organizeImports-full","getEditsForFileRename","getEditsForFileRename-full","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls"],WDe=[...kpe,"definition","definition-full","definitionAndBoundSpan","definitionAndBoundSpan-full","typeDefinition","implementation","implementation-full","references","references-full","rename","renameLocations-full","rename-full","quickinfo","quickinfo-full","completionInfo","completions","completions-full","completionEntryDetails","completionEntryDetails-full","signatureHelp","signatureHelp-full","navto","navto-full","documentHighlights","documentHighlights-full"],Cpe=class NZ{constructor(t){this.changeSeq=0,this.handlers=new Map(Object.entries({status:()=>{const o={version:Qm};return this.requiredResponse(o)},openExternalProject:o=>(this.projectService.openExternalProject(o.arguments),this.requiredResponse(!0)),openExternalProjects:o=>(this.projectService.openExternalProjects(o.arguments.projects),this.requiredResponse(!0)),closeExternalProject:o=>(this.projectService.closeExternalProject(o.arguments.projectFileName),this.requiredResponse(!0)),synchronizeProjectList:o=>{const c=this.projectService.synchronizeProjectList(o.arguments.knownProjects,o.arguments.includeProjectReferenceRedirectInfo);if(!c.some(f=>f.projectErrors&&f.projectErrors.length!==0))return this.requiredResponse(c);const u=Yt(c,f=>!f.projectErrors||f.projectErrors.length===0?f:{info:f.info,changes:f.changes,files:f.files,projectErrors:this.convertToDiagnosticsWithLinePosition(f.projectErrors,void 0)});return this.requiredResponse(u)},updateOpen:o=>(this.changeSeq++,this.projectService.applyChangesInOpenFiles(o.arguments.openFiles&&c4(o.arguments.openFiles,c=>({fileName:c.file,content:c.fileContent,scriptKind:c.scriptKindName,projectRootPath:c.projectRootPath})),o.arguments.changedFiles&&c4(o.arguments.changedFiles,c=>({fileName:c.fileName,changes:nk(mj(c.textChanges),u=>{const f=E.checkDefined(this.projectService.getScriptInfo(c.fileName)),g=f.lineOffsetToPosition(u.start.line,u.start.offset),p=f.lineOffsetToPosition(u.end.line,u.end.offset);return g>=0?{span:{start:g,length:p-g},newText:u.newText}:void 0})})),o.arguments.closedFiles),this.requiredResponse(!0)),applyChangedToOpenFiles:o=>(this.changeSeq++,this.projectService.applyChangesInOpenFiles(o.arguments.openFiles,o.arguments.changedFiles&&c4(o.arguments.changedFiles,c=>({fileName:c.fileName,changes:mj(c.changes)})),o.arguments.closedFiles),this.requiredResponse(!0)),exit:()=>(this.exit(),this.notRequired()),definition:o=>this.requiredResponse(this.getDefinition(o.arguments,!0)),"definition-full":o=>this.requiredResponse(this.getDefinition(o.arguments,!1)),definitionAndBoundSpan:o=>this.requiredResponse(this.getDefinitionAndBoundSpan(o.arguments,!0)),"definitionAndBoundSpan-full":o=>this.requiredResponse(this.getDefinitionAndBoundSpan(o.arguments,!1)),findSourceDefinition:o=>this.requiredResponse(this.findSourceDefinition(o.arguments)),"emit-output":o=>this.requiredResponse(this.getEmitOutput(o.arguments)),typeDefinition:o=>this.requiredResponse(this.getTypeDefinition(o.arguments)),implementation:o=>this.requiredResponse(this.getImplementation(o.arguments,!0)),"implementation-full":o=>this.requiredResponse(this.getImplementation(o.arguments,!1)),references:o=>this.requiredResponse(this.getReferences(o.arguments,!0)),"references-full":o=>this.requiredResponse(this.getReferences(o.arguments,!1)),rename:o=>this.requiredResponse(this.getRenameLocations(o.arguments,!0)),"renameLocations-full":o=>this.requiredResponse(this.getRenameLocations(o.arguments,!1)),"rename-full":o=>this.requiredResponse(this.getRenameInfo(o.arguments)),open:o=>(this.openClientFile(Lo(o.arguments.file),o.arguments.fileContent,CQ(o.arguments.scriptKindName),o.arguments.projectRootPath?Lo(o.arguments.projectRootPath):void 0),this.notRequired()),quickinfo:o=>this.requiredResponse(this.getQuickInfoWorker(o.arguments,!0)),"quickinfo-full":o=>this.requiredResponse(this.getQuickInfoWorker(o.arguments,!1)),getOutliningSpans:o=>this.requiredResponse(this.getOutliningSpans(o.arguments,!0)),outliningSpans:o=>this.requiredResponse(this.getOutliningSpans(o.arguments,!1)),todoComments:o=>this.requiredResponse(this.getTodoComments(o.arguments)),indentation:o=>this.requiredResponse(this.getIndentation(o.arguments)),nameOrDottedNameSpan:o=>this.requiredResponse(this.getNameOrDottedNameSpan(o.arguments)),breakpointStatement:o=>this.requiredResponse(this.getBreakpointStatement(o.arguments)),braceCompletion:o=>this.requiredResponse(this.isValidBraceCompletion(o.arguments)),docCommentTemplate:o=>this.requiredResponse(this.getDocCommentTemplate(o.arguments)),getSpanOfEnclosingComment:o=>this.requiredResponse(this.getSpanOfEnclosingComment(o.arguments)),fileReferences:o=>this.requiredResponse(this.getFileReferences(o.arguments,!0)),"fileReferences-full":o=>this.requiredResponse(this.getFileReferences(o.arguments,!1)),format:o=>this.requiredResponse(this.getFormattingEditsForRange(o.arguments)),formatonkey:o=>this.requiredResponse(this.getFormattingEditsAfterKeystroke(o.arguments)),"format-full":o=>this.requiredResponse(this.getFormattingEditsForDocumentFull(o.arguments)),"formatonkey-full":o=>this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(o.arguments)),"formatRange-full":o=>this.requiredResponse(this.getFormattingEditsForRangeFull(o.arguments)),completionInfo:o=>this.requiredResponse(this.getCompletions(o.arguments,"completionInfo")),completions:o=>this.requiredResponse(this.getCompletions(o.arguments,"completions")),"completions-full":o=>this.requiredResponse(this.getCompletions(o.arguments,"completions-full")),completionEntryDetails:o=>this.requiredResponse(this.getCompletionEntryDetails(o.arguments,!1)),"completionEntryDetails-full":o=>this.requiredResponse(this.getCompletionEntryDetails(o.arguments,!0)),compileOnSaveAffectedFileList:o=>this.requiredResponse(this.getCompileOnSaveAffectedFileList(o.arguments)),compileOnSaveEmitFile:o=>this.requiredResponse(this.emitFile(o.arguments)),signatureHelp:o=>this.requiredResponse(this.getSignatureHelpItems(o.arguments,!0)),"signatureHelp-full":o=>this.requiredResponse(this.getSignatureHelpItems(o.arguments,!1)),"compilerOptionsDiagnostics-full":o=>this.requiredResponse(this.getCompilerOptionsDiagnostics(o.arguments)),"encodedSyntacticClassifications-full":o=>this.requiredResponse(this.getEncodedSyntacticClassifications(o.arguments)),"encodedSemanticClassifications-full":o=>this.requiredResponse(this.getEncodedSemanticClassifications(o.arguments)),cleanup:()=>(this.cleanup(),this.requiredResponse(!0)),semanticDiagnosticsSync:o=>this.requiredResponse(this.getSemanticDiagnosticsSync(o.arguments)),syntacticDiagnosticsSync:o=>this.requiredResponse(this.getSyntacticDiagnosticsSync(o.arguments)),suggestionDiagnosticsSync:o=>this.requiredResponse(this.getSuggestionDiagnosticsSync(o.arguments)),geterr:o=>(this.errorCheck.startNew(c=>this.getDiagnostics(c,o.arguments.delay,o.arguments.files)),this.notRequired()),geterrForProject:o=>(this.errorCheck.startNew(c=>this.getDiagnosticsForProject(c,o.arguments.delay,o.arguments.file)),this.notRequired()),change:o=>(this.change(o.arguments),this.notRequired()),configure:o=>(this.projectService.setHostConfiguration(o.arguments),this.doOutput(void 0,"configure",o.seq,!0),this.notRequired()),reload:o=>(this.reload(o.arguments,o.seq),this.requiredResponse({reloadFinished:!0})),saveto:o=>{const c=o.arguments;return this.saveToTmp(c.file,c.tmpfile),this.notRequired()},close:o=>{const c=o.arguments;return this.closeClientFile(c.file),this.notRequired()},navto:o=>this.requiredResponse(this.getNavigateToItems(o.arguments,!0)),"navto-full":o=>this.requiredResponse(this.getNavigateToItems(o.arguments,!1)),brace:o=>this.requiredResponse(this.getBraceMatching(o.arguments,!0)),"brace-full":o=>this.requiredResponse(this.getBraceMatching(o.arguments,!1)),navbar:o=>this.requiredResponse(this.getNavigationBarItems(o.arguments,!0)),"navbar-full":o=>this.requiredResponse(this.getNavigationBarItems(o.arguments,!1)),navtree:o=>this.requiredResponse(this.getNavigationTree(o.arguments,!0)),"navtree-full":o=>this.requiredResponse(this.getNavigationTree(o.arguments,!1)),documentHighlights:o=>this.requiredResponse(this.getDocumentHighlights(o.arguments,!0)),"documentHighlights-full":o=>this.requiredResponse(this.getDocumentHighlights(o.arguments,!1)),compilerOptionsForInferredProjects:o=>(this.setCompilerOptionsForInferredProjects(o.arguments),this.requiredResponse(!0)),projectInfo:o=>this.requiredResponse(this.getProjectInfo(o.arguments)),reloadProjects:()=>(this.projectService.reloadProjects(),this.notRequired()),jsxClosingTag:o=>this.requiredResponse(this.getJsxClosingTag(o.arguments)),linkedEditingRange:o=>this.requiredResponse(this.getLinkedEditingRange(o.arguments)),getCodeFixes:o=>this.requiredResponse(this.getCodeFixes(o.arguments,!0)),"getCodeFixes-full":o=>this.requiredResponse(this.getCodeFixes(o.arguments,!1)),getCombinedCodeFix:o=>this.requiredResponse(this.getCombinedCodeFix(o.arguments,!0)),"getCombinedCodeFix-full":o=>this.requiredResponse(this.getCombinedCodeFix(o.arguments,!1)),applyCodeActionCommand:o=>this.requiredResponse(this.applyCodeActionCommand(o.arguments)),getSupportedCodeFixes:o=>this.requiredResponse(this.getSupportedCodeFixes(o.arguments)),getApplicableRefactors:o=>this.requiredResponse(this.getApplicableRefactors(o.arguments)),getEditsForRefactor:o=>this.requiredResponse(this.getEditsForRefactor(o.arguments,!0)),getMoveToRefactoringFileSuggestions:o=>this.requiredResponse(this.getMoveToRefactoringFileSuggestions(o.arguments)),"getEditsForRefactor-full":o=>this.requiredResponse(this.getEditsForRefactor(o.arguments,!1)),organizeImports:o=>this.requiredResponse(this.organizeImports(o.arguments,!0)),"organizeImports-full":o=>this.requiredResponse(this.organizeImports(o.arguments,!1)),getEditsForFileRename:o=>this.requiredResponse(this.getEditsForFileRename(o.arguments,!0)),"getEditsForFileRename-full":o=>this.requiredResponse(this.getEditsForFileRename(o.arguments,!1)),configurePlugin:o=>(this.configurePlugin(o.arguments),this.doOutput(void 0,"configurePlugin",o.seq,!0),this.notRequired()),selectionRange:o=>this.requiredResponse(this.getSmartSelectionRange(o.arguments,!0)),"selectionRange-full":o=>this.requiredResponse(this.getSmartSelectionRange(o.arguments,!1)),prepareCallHierarchy:o=>this.requiredResponse(this.prepareCallHierarchy(o.arguments)),provideCallHierarchyIncomingCalls:o=>this.requiredResponse(this.provideCallHierarchyIncomingCalls(o.arguments)),provideCallHierarchyOutgoingCalls:o=>this.requiredResponse(this.provideCallHierarchyOutgoingCalls(o.arguments)),toggleLineComment:o=>this.requiredResponse(this.toggleLineComment(o.arguments,!0)),"toggleLineComment-full":o=>this.requiredResponse(this.toggleLineComment(o.arguments,!1)),toggleMultilineComment:o=>this.requiredResponse(this.toggleMultilineComment(o.arguments,!0)),"toggleMultilineComment-full":o=>this.requiredResponse(this.toggleMultilineComment(o.arguments,!1)),commentSelection:o=>this.requiredResponse(this.commentSelection(o.arguments,!0)),"commentSelection-full":o=>this.requiredResponse(this.commentSelection(o.arguments,!1)),uncommentSelection:o=>this.requiredResponse(this.uncommentSelection(o.arguments,!0)),"uncommentSelection-full":o=>this.requiredResponse(this.uncommentSelection(o.arguments,!1)),provideInlayHints:o=>this.requiredResponse(this.provideInlayHints(o.arguments))})),this.host=t.host,this.cancellationToken=t.cancellationToken,this.typingsInstaller=t.typingsInstaller||EM,this.byteLength=t.byteLength,this.hrtime=t.hrtime,this.logger=t.logger,this.canUseEvents=t.canUseEvents,this.suppressDiagnosticEvents=t.suppressDiagnosticEvents,this.noGetErrOnBackgroundUpdate=t.noGetErrOnBackgroundUpdate;const{throttleWaitMilliseconds:r}=t;this.eventHandler=this.canUseEvents?t.eventHandler||(o=>this.defaultEventHandler(o)):void 0;const i={executeWithRequestId:(o,c)=>this.executeWithRequestId(o,c),getCurrentRequestId:()=>this.currentRequestId,getServerHost:()=>this.host,logError:(o,c)=>this.logError(o,c),sendRequestCompletedEvent:o=>this.sendRequestCompletedEvent(o),isCancellationRequested:()=>this.cancellationToken.isCancellationRequested()};this.errorCheck=new zDe(i);const s={host:this.host,logger:this.logger,cancellationToken:this.cancellationToken,useSingleInferredProject:t.useSingleInferredProject,useInferredProjectPerProjectRoot:t.useInferredProjectPerProjectRoot,typingsInstaller:this.typingsInstaller,throttleWaitMilliseconds:r,eventHandler:this.eventHandler,suppressDiagnosticEvents:this.suppressDiagnosticEvents,globalPlugins:t.globalPlugins,pluginProbeLocations:t.pluginProbeLocations,allowLocalPluginLoads:t.allowLocalPluginLoads,typesMapLocation:t.typesMapLocation,serverMode:t.serverMode,session:this,canUseWatchEvents:t.canUseWatchEvents,incrementalVerifier:t.incrementalVerifier};switch(this.projectService=new AQ(s),this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this)),this.gcTimer=new pQ(this.host,7e3,this.logger),this.projectService.serverMode){case 0:break;case 1:kpe.forEach(o=>this.handlers.set(o,c=>{throw new Error(`Request: ${c.command} not allowed in LanguageServiceMode.PartialSemantic`)}));break;case 2:WDe.forEach(o=>this.handlers.set(o,c=>{throw new Error(`Request: ${c.command} not allowed in LanguageServiceMode.Syntactic`)}));break;default:E.assertNever(this.projectService.serverMode)}}sendRequestCompletedEvent(t){this.event({request_seq:t},"requestCompleted")}addPerformanceData(t,r){this.performanceData||(this.performanceData={}),this.performanceData[t]=(this.performanceData[t]??0)+r}performanceEventHandler(t){switch(t.kind){case"UpdateGraph":this.addPerformanceData("updateGraphDurationMs",t.durationMs);break;case"CreatePackageJsonAutoImportProvider":this.addPerformanceData("createAutoImportProviderProgramDurationMs",t.durationMs);break}}defaultEventHandler(t){switch(t.eventName){case TN:this.projectsUpdatedInBackgroundEvent(t.data.openFiles);break;case IM:this.event({projectName:t.data.project.getProjectName(),reason:t.data.reason},t.eventName);break;case FM:this.event({projectName:t.data.project.getProjectName()},t.eventName);break;case OM:case jM:case BM:case JM:this.event(t.data,t.eventName);break;case LM:this.event({triggerFile:t.data.triggerFile,configFile:t.data.configFileName,diagnostics:Yt(t.data.diagnostics,r=>kN(r,!0))},t.eventName);break;case MM:{this.event({projectName:t.data.project.getProjectName(),languageServiceEnabled:t.data.languageServiceEnabled},t.eventName);break}case RM:{this.event({telemetryEventName:t.eventName,payload:t.data},"telemetry");break}}}projectsUpdatedInBackgroundEvent(t){this.projectService.logger.info(`got projects updated in background, updating diagnostics for ${t}`),t.length&&(!this.suppressDiagnosticEvents&&!this.noGetErrOnBackgroundUpdate&&this.errorCheck.startNew(r=>this.updateErrorCheck(r,t,100,!0)),this.event({openFiles:t},TN))}logError(t,r){this.logErrorWorker(t,r)}logErrorWorker(t,r,i){let s="Exception on executing command "+r;if(t.message&&(s+=`: +`+S3(t.message),t.stack&&(s+=` +`+S3(t.stack))),this.logger.hasLevel(3)){if(i)try{const{file:o,project:c}=this.getFileAndProject(i),u=c.getScriptInfoForNormalizedPath(o);if(u){const f=HC(u.getSnapshot());s+=` + +File text of ${i.file}:${S3(f)} +`}}catch{}if(t.ProgramFiles){s+=` + +Program files: ${JSON.stringify(t.ProgramFiles)} +`,s+=` + +Projects:: +`;let o=0;const c=u=>{s+=` +Project '${u.projectName}' (${X3[u.projectKind]}) ${o} +`,s+=u.filesToString(!0),s+=` +----------------------------------------------- +`,o++};this.projectService.externalProjects.forEach(c),this.projectService.configuredProjects.forEach(c),this.projectService.inferredProjects.forEach(c)}}this.logger.msg(s,"Err")}send(t){if(t.type==="event"&&!this.canUseEvents){this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${JSON.stringify(t)}`);return}this.writeMessage(t)}writeMessage(t){var r;const i=hpe(t,this.logger,this.byteLength,this.host.newLine);(r=Pu)==null||r.logEvent(`Response message size: ${i.length}`),this.host.write(i)}event(t,r){this.send(ype(r,t))}doOutput(t,r,i,s,o){const c={seq:0,type:"response",command:r,request_seq:i,success:s,performanceData:this.performanceData};if(s){let u;if(es(t))c.body=t,u=t.metadata,delete t.metadata;else if(typeof t=="object")if(t.metadata){const{metadata:f,...g}=t;c.body=g,u=f}else c.body=t;else c.body=t;u&&(c.metadata=u)}else E.assert(t===void 0);o&&(c.message=o),this.send(c)}semanticCheck(t,r){var i,s;(i=Jr)==null||i.push(Jr.Phase.Session,"semanticCheck",{file:t,configFilePath:r.canonicalConfigFilePath});const o=ODe(r,t)?Gc:r.getLanguageService().getSemanticDiagnostics(t).filter(c=>!!c.file);this.sendDiagnosticsEvent(t,r,o,"semanticDiag"),(s=Jr)==null||s.pop()}syntacticCheck(t,r){var i,s;(i=Jr)==null||i.push(Jr.Phase.Session,"syntacticCheck",{file:t,configFilePath:r.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,r,r.getLanguageService().getSyntacticDiagnostics(t),"syntaxDiag"),(s=Jr)==null||s.pop()}suggestionCheck(t,r){var i,s;(i=Jr)==null||i.push(Jr.Phase.Session,"suggestionCheck",{file:t,configFilePath:r.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,r,r.getLanguageService().getSuggestionDiagnostics(t),"suggestionDiag"),(s=Jr)==null||s.pop()}sendDiagnosticsEvent(t,r,i,s){try{this.event({file:t,diagnostics:i.map(o=>LDe(t,r,o))},s)}catch(o){this.logError(o,s)}}updateErrorCheck(t,r,i,s=!0){E.assert(!this.suppressDiagnosticEvents);const o=this.changeSeq,c=Math.min(i,200);let u=0;const f=()=>{u++,r.length>u&&t.delay("checkOne",c,g)},g=()=>{if(this.changeSeq!==o)return;let p=r[u];if(ns(p)&&(p=this.toPendingErrorCheck(p),!p)){f();return}const{fileName:y,project:S}=p;if(Tf(S),!!S.containsFile(y,s)&&(this.syntacticCheck(y,S),this.changeSeq===o)){if(S.projectService.serverMode!==0){f();return}t.immediate("semanticCheck",()=>{if(this.semanticCheck(y,S),this.changeSeq===o){if(this.getPreferences(y).disableSuggestions){f();return}t.immediate("suggestionCheck",()=>{this.suggestionCheck(y,S),f()})}})}};r.length>u&&this.changeSeq===o&&t.delay("checkOne",i,g)}cleanProjects(t,r){if(r){this.logger.info(`cleaning ${t}`);for(const i of r)i.getLanguageService(!1).cleanupSemanticCache(),i.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",fs(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc&&(this.logger.info("host.gc()"),this.host.gc())}getEncodedSyntacticClassifications(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t);return i.getEncodedSyntacticClassifications(r,t)}getEncodedSemanticClassifications(t){const{file:r,project:i}=this.getFileAndProject(t),s=t.format==="2020"?"2020":"original";return i.getLanguageService().getEncodedSemanticClassifications(r,t,s)}getProject(t){return t===void 0?void 0:this.projectService.findProject(t)}getConfigFileAndProject(t){const r=this.getProject(t.projectFileName),i=Lo(t.file);return{configFile:r&&r.hasConfigFile(i)?i:void 0,project:r}}getConfigFileDiagnostics(t,r,i){const s=r.getAllProjectErrors(),o=r.getLanguageService().getCompilerOptionsDiagnostics(),c=wn(Xi(s,o),u=>!!u.file&&u.file.fileName===t);return i?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):Yt(c,u=>kN(u,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(t){return t.map(r=>({message:Bd(r.messageText,this.host.newLine),start:r.start,length:r.length,category:K2(r),code:r.code,source:r.source,startLocation:r.file&&xN(qa(r.file,r.start)),endLocation:r.file&&xN(qa(r.file,r.start+r.length)),reportsUnnecessary:r.reportsUnnecessary,reportsDeprecated:r.reportsDeprecated,relatedInformation:Yt(r.relatedInformation,NQ)}))}getCompilerOptionsDiagnostics(t){const r=this.getProject(t.projectFileName);return this.convertToDiagnosticsWithLinePosition(wn(r.getLanguageService().getCompilerOptionsDiagnostics(),i=>!i.file),void 0)}convertToDiagnosticsWithLinePosition(t,r){return t.map(i=>({message:Bd(i.messageText,this.host.newLine),start:i.start,length:i.length,category:K2(i),code:i.code,source:i.source,startLocation:r&&r.positionToLineOffset(i.start),endLocation:r&&r.positionToLineOffset(i.start+i.length),reportsUnnecessary:i.reportsUnnecessary,reportsDeprecated:i.reportsDeprecated,relatedInformation:Yt(i.relatedInformation,NQ)}))}getDiagnosticsWorker(t,r,i,s){const{project:o,file:c}=this.getFileAndProject(t);if(r&&ODe(o,c))return Gc;const u=o.getScriptInfoForNormalizedPath(c),f=i(o,c);return s?this.convertToDiagnosticsWithLinePosition(f,u):f.map(g=>LDe(c,o,g))}getDefinition(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapDefinitionInfoLocations(s.getLanguageService().getDefinitionAtPosition(i,o)||Gc,s);return r?this.mapDefinitionInfo(c,s):c.map(NZ.mapToOriginalLocation)}mapDefinitionInfoLocations(t,r){return t.map(i=>{const s=jDe(i,r);return s?{...s,containerKind:i.containerKind,containerName:i.containerName,kind:i.kind,name:i.name,failedAliasResolution:i.failedAliasResolution,...i.unverified&&{unverified:i.unverified}}:i})}getDefinitionAndBoundSpan(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=E.checkDefined(s.getScriptInfo(i)),u=s.getLanguageService().getDefinitionAndBoundSpan(i,o);if(!u||!u.definitions)return{definitions:Gc,textSpan:void 0};const f=this.mapDefinitionInfoLocations(u.definitions,s),{textSpan:g}=u;return r?{definitions:this.mapDefinitionInfo(f,s),textSpan:Im(g,c)}:{definitions:f.map(NZ.mapToOriginalLocation),textSpan:g}}findSourceDefinition(t){var r;const{file:i,project:s}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=s.getLanguageService().getDefinitionAtPosition(i,o);let u=this.mapDefinitionInfoLocations(c||Gc,s).slice();if(this.projectService.serverMode===0&&(!ut(u,T=>Lo(T.fileName)!==i&&!T.isAmbient)||ut(u,T=>!!T.failedAliasResolution))){const T=Tj(O=>O.textSpan.start,eL);u?.forEach(O=>T.add(O));const C=s.getNoDtsResolutionProject(i),w=C.getLanguageService(),D=(r=w.getDefinitionAtPosition(i,o,!0,!1))==null?void 0:r.filter(O=>Lo(O.fileName)!==i);if(ut(D))for(const O of D){if(O.unverified){const z=y(O,s.getLanguageService().getProgram(),w.getProgram());if(ut(z)){for(const W of z)T.add(W);continue}}T.add(O)}else{const O=u.filter(z=>Lo(z.fileName)!==i&&z.isAmbient);for(const z of ut(O)?O:p()){const W=g(z.fileName,i,C);if(!W)continue;const X=this.projectService.getOrCreateScriptInfoNotOpenedByClient(W,C.currentDirectory,C.directoryStructureHost);if(!X)continue;C.containsScriptInfo(X)||(C.addRoot(X),C.updateGraph());const J=w.getProgram(),ie=E.checkDefined(J.getSourceFile(W));for(const B of S(z.name,ie,J))T.add(B)}}u=fs(T.values())}return u=u.filter(T=>!T.isAmbient&&!T.failedAliasResolution),this.mapDefinitionInfo(u,s);function g(T,C,w){var D,O,z;const W=H5(T);if(W&&T.lastIndexOf(Am)===W.topLevelNodeModulesIndex){const X=T.substring(0,W.packageRootIndex),J=(D=s.getModuleResolutionCache())==null?void 0:D.getPackageJsonInfoCache(),ie=s.getCompilationSettings(),B=Mw(is(X+"/package.json",s.getCurrentDirectory()),Lw(J,s,ie));if(!B)return;const Y=zU(B,{moduleResolution:2},s,s.getModuleResolutionCache()),ae=T.substring(W.topLevelPackageNameIndex+1,W.packageRootIndex),_e=i3(Bw(ae)),$=s.toPath(T);if(Y&&ut(Y,H=>s.toPath(H)===$))return(O=w.resolutionCache.resolveSingleModuleNameWithoutWatching(_e,C).resolvedModule)==null?void 0:O.resolvedFileName;{const H=T.substring(W.packageRootIndex+1),K=`${_e}/${Ou(H)}`;return(z=w.resolutionCache.resolveSingleModuleNameWithoutWatching(K,C).resolvedModule)==null?void 0:z.resolvedFileName}}}function p(){const T=s.getLanguageService(),C=T.getProgram(),w=c_(C.getSourceFile(i),o);return(Ja(w)||Ie(w))&&co(w.parent)&&$te(w,D=>{var O;if(D===w)return;const z=(O=T.getDefinitionAtPosition(i,D.getStart(),!0,!1))==null?void 0:O.filter(W=>Lo(W.fileName)!==i&&W.isAmbient).map(W=>({fileName:W.fileName,name:cp(w)}));if(ut(z))return z})||Gc}function y(T,C,w){var D;const O=w.getSourceFile(T.fileName);if(!O)return;const z=c_(C.getSourceFile(i),o),W=C.getTypeChecker().getSymbolAtLocation(z),X=W&&Wo(W,276);if(!X)return;const J=((D=X.propertyName)==null?void 0:D.text)||X.name.text;return S(J,O,w)}function S(T,C,w){const D=ho.Core.getTopMostDeclarationNamesInFile(T,C);return Ii(D,O=>{const z=w.getTypeChecker().getSymbolAtLocation(O),W=X4(O);if(z&&W)return c6.createDefinitionInfo(W,w.getTypeChecker(),z,W,!0)})}}getEmitOutput(t){const{file:r,project:i}=this.getFileAndProject(t);if(!i.shouldEmitFile(i.getScriptInfo(r)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};const s=i.getLanguageService().getEmitOutput(r);return t.richResponse?{...s,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(s.diagnostics):s.diagnostics.map(o=>kN(o,!0))}:s}mapJSDocTagInfo(t,r,i){return t?t.map(s=>{var o;return{...s,text:i?this.mapDisplayParts(s.text,r):(o=s.text)==null?void 0:o.map(c=>c.text).join("")}}):[]}mapDisplayParts(t,r){return t?t.map(i=>i.kind!=="linkName"?i:{...i,target:this.toFileSpan(i.target.fileName,i.target.textSpan,r)}):[]}mapSignatureHelpItems(t,r,i){return t.map(s=>({...s,documentation:this.mapDisplayParts(s.documentation,r),parameters:s.parameters.map(o=>({...o,documentation:this.mapDisplayParts(o.documentation,r)})),tags:this.mapJSDocTagInfo(s.tags,r,i)}))}mapDefinitionInfo(t,r){return t.map(i=>({...this.toFileSpanWithContext(i.fileName,i.textSpan,i.contextSpan,r),...i.unverified&&{unverified:i.unverified}}))}static mapToOriginalLocation(t){return t.originalFileName?(E.assert(t.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...t,fileName:t.originalFileName,textSpan:t.originalTextSpan,targetFileName:t.fileName,targetTextSpan:t.textSpan,contextSpan:t.originalContextSpan,targetContextSpan:t.contextSpan}):t}toFileSpan(t,r,i){const s=i.getLanguageService(),o=s.toLineColumnOffset(t,r.start),c=s.toLineColumnOffset(t,yc(r));return{file:t,start:{line:o.line+1,offset:o.character+1},end:{line:c.line+1,offset:c.character+1}}}toFileSpanWithContext(t,r,i,s){const o=this.toFileSpan(t,r,s),c=i&&this.toFileSpan(t,i,s);return c?{...o,contextStart:c.start,contextEnd:c.end}:o}getTypeDefinition(t){const{file:r,project:i}=this.getFileAndProject(t),s=this.getPositionInFile(t,r),o=this.mapDefinitionInfoLocations(i.getLanguageService().getTypeDefinitionAtPosition(r,s)||Gc,i);return this.mapDefinitionInfo(o,i)}mapImplementationLocations(t,r){return t.map(i=>{const s=jDe(i,r);return s?{...s,kind:i.kind,displayParts:i.displayParts}:i})}getImplementation(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapImplementationLocations(s.getLanguageService().getImplementationAtPosition(i,o)||Gc,s);return r?c.map(({fileName:u,textSpan:f,contextSpan:g})=>this.toFileSpanWithContext(u,f,g,s)):c.map(NZ.mapToOriginalLocation)}getSyntacticDiagnosticsSync(t){const{configFile:r}=this.getConfigFileAndProject(t);return r?Gc:this.getDiagnosticsWorker(t,!1,(i,s)=>i.getLanguageService().getSyntacticDiagnostics(s),!!t.includeLinePosition)}getSemanticDiagnosticsSync(t){const{configFile:r,project:i}=this.getConfigFileAndProject(t);return r?this.getConfigFileDiagnostics(r,i,!!t.includeLinePosition):this.getDiagnosticsWorker(t,!0,(s,o)=>s.getLanguageService().getSemanticDiagnostics(o).filter(c=>!!c.file),!!t.includeLinePosition)}getSuggestionDiagnosticsSync(t){const{configFile:r}=this.getConfigFileAndProject(t);return r?Gc:this.getDiagnosticsWorker(t,!0,(i,s)=>i.getLanguageService().getSuggestionDiagnostics(s),!!t.includeLinePosition)}getJsxClosingTag(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.getPositionInFile(t,r),o=i.getJsxClosingTagAtPosition(r,s);return o===void 0?void 0:{newText:o.newText,caretOffset:0}}getLinkedEditingRange(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.getPositionInFile(t,r),o=i.getLinkedEditingRangeAtPosition(r,s),c=this.projectService.getScriptInfoForNormalizedPath(r);if(!(c===void 0||o===void 0))return nKe(o,c)}getDocumentHighlights(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=s.getLanguageService().getDocumentHighlights(i,o,t.filesToSearch);return c?r?c.map(({fileName:u,highlightSpans:f})=>{const g=s.getScriptInfo(u);return{file:u,highlightSpans:f.map(({textSpan:p,kind:y,contextSpan:S})=>({...bpe(p,S,g),kind:y}))}}):c:Gc}provideInlayHints(t){const{file:r,project:i}=this.getFileAndProject(t),s=this.projectService.getScriptInfoForNormalizedPath(r);return i.getLanguageService().provideInlayHints(r,t,this.getPreferences(r)).map(c=>{const{position:u,displayParts:f}=c;return{...c,position:s.positionToLineOffset(u),displayParts:f?.map(({text:g,span:p,file:y})=>{if(p){E.assertIsDefined(y,"Target file should be defined together with its span.");const S=this.projectService.getScriptInfo(y);return{text:g,span:{start:S.positionToLineOffset(p.start),end:S.positionToLineOffset(p.start+p.length),file:y}}}else return{text:g}})}})}setCompilerOptionsForInferredProjects(t){this.projectService.setCompilerOptionsForInferredProjects(t.options,t.projectRootPath)}getProjectInfo(t){return this.getProjectInfoWorker(t.file,t.projectFileName,t.needFileNameList,!1)}getProjectInfoWorker(t,r,i,s){const{project:o}=this.getFileAndProjectWorker(t,r);return Tf(o),{configFileName:o.getProjectName(),languageServiceDisabled:!o.languageServiceEnabled,fileNames:i?o.getFileNames(!1,s):void 0}}getRenameInfo(t){const{file:r,project:i}=this.getFileAndProject(t),s=this.getPositionInFile(t,r),o=this.getPreferences(r);return i.getLanguageService().getRenameInfo(r,s,o)}getProjects(t,r,i){let s,o;if(t.projectFileName){const c=this.getProject(t.projectFileName);c&&(s=[c])}else{const c=r?this.projectService.getScriptInfoEnsuringProjectsUptoDate(t.file):this.projectService.getScriptInfo(t.file);if(c)r||this.projectService.ensureDefaultProjectForFile(c);else return i?Gc:(this.projectService.logErrorForScriptInfoNotFound(t.file),r0.ThrowNoProject());s=c.containingProjects,o=this.projectService.getSymlinkedProjects(c)}return s=wn(s,c=>c.languageServiceEnabled&&!c.isOrphan()),!i&&(!s||!s.length)&&!o?(this.projectService.logErrorForScriptInfoNotFound(t.file??t.projectFileName),r0.ThrowNoProject()):o?{projects:s,symLinkedProjects:o}:s}getDefaultProject(t){if(t.projectFileName){const i=this.getProject(t.projectFileName);if(i)return i;if(!t.file)return r0.ThrowNoProject()}return this.projectService.getScriptInfo(t.file).getDefaultProject()}getRenameLocations(t,r){const i=Lo(t.file),s=this.getPositionInFile(t,i),o=this.getProjects(t),c=this.getDefaultProject(t),u=this.getPreferences(i),f=this.mapRenameInfo(c.getLanguageService().getRenameInfo(i,s,u),E.checkDefined(this.projectService.getScriptInfo(i)));if(!f.canRename)return r?{info:f,locs:[]}:[];const g=QZe(o,c,{fileName:t.file,pos:s},!!t.findInStrings,!!t.findInComments,u);return r?{info:f,locs:this.toSpanGroups(g)}:g}mapRenameInfo(t,r){if(t.canRename){const{canRename:i,fileToRename:s,displayName:o,fullDisplayName:c,kind:u,kindModifiers:f,triggerSpan:g}=t;return{canRename:i,fileToRename:s,displayName:o,fullDisplayName:c,kind:u,kindModifiers:f,triggerSpan:Im(g,r)}}else return t}toSpanGroups(t){const r=new Map;for(const{fileName:i,textSpan:s,contextSpan:o,originalContextSpan:c,originalTextSpan:u,originalFileName:f,...g}of t){let p=r.get(i);p||r.set(i,p={file:i,locs:[]});const y=E.checkDefined(this.projectService.getScriptInfo(i));p.locs.push({...bpe(s,o,y),...g})}return fs(r.values())}getReferences(t,r){const i=Lo(t.file),s=this.getProjects(t),o=this.getPositionInFile(t,i),c=ZZe(s,this.getDefaultProject(t),{fileName:t.file,pos:o},this.logger);if(!r)return c;const u=this.getPreferences(i),f=this.getDefaultProject(t),g=f.getScriptInfoForNormalizedPath(i),p=f.getLanguageService().getQuickInfoAtPosition(i,o),y=p?GA(p.displayParts):"",S=p&&p.textSpan,T=S?g.positionToLineOffset(S.start).offset:0,C=S?g.getSnapshot().getText(S.start,yc(S)):"";return{refs:ta(c,D=>D.references.map(O=>JDe(this.projectService,O,u))),symbolName:C,symbolStartOffset:T,symbolDisplayString:y}}getFileReferences(t,r){const i=this.getProjects(t),s=t.file,o=this.getPreferences(Lo(s)),c=[],u=IQ();return vpe(i,void 0,g=>{if(g.getCancellationToken().isCancellationRequested())return;const p=g.getLanguageService().getFileReferences(s);if(p)for(const y of p)u.has(y)||(c.push(y),u.add(y))}),r?{refs:c.map(g=>JDe(this.projectService,g,o)),symbolName:`"${t.file}"`}:c}openClientFile(t,r,i,s){this.projectService.openClientFileWithNormalizedPath(t,r,i,!1,s)}getPosition(t,r){return t.position!==void 0?t.position:r.lineOffsetToPosition(t.line,t.offset)}getPositionInFile(t,r){const i=this.projectService.getScriptInfoForNormalizedPath(r);return this.getPosition(t,i)}getFileAndProject(t){return this.getFileAndProjectWorker(t.file,t.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(t){const{file:r,project:i}=this.getFileAndProject(t);return{file:r,languageService:i.getLanguageService(!1)}}getFileAndProjectWorker(t,r){const i=Lo(t),s=this.getProject(r)||this.projectService.ensureDefaultProjectForFile(i);return{file:i,project:s}}getOutliningSpans(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=s.getOutliningSpans(i);if(r){const c=this.projectService.getScriptInfoForNormalizedPath(i);return o.map(u=>({textSpan:Im(u.textSpan,c),hintSpan:Im(u.hintSpan,c),bannerText:u.bannerText,autoCollapse:u.autoCollapse,kind:u.kind}))}else return o}getTodoComments(t){const{file:r,project:i}=this.getFileAndProject(t);return i.getLanguageService().getTodoComments(r,t.descriptors)}getDocCommentTemplate(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.getPositionInFile(t,r);return i.getDocCommentTemplateAtPosition(r,s,this.getPreferences(r),this.getFormatOptions(r))}getSpanOfEnclosingComment(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=t.onlyMultiLine,o=this.getPositionInFile(t,r);return i.getSpanOfEnclosingComment(r,o,s)}getIndentation(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.getPositionInFile(t,r),o=t.options?d6(t.options):this.getFormatOptions(r),c=i.getIndentationAtPosition(r,s,o);return{position:s,indentation:c}}getBreakpointStatement(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.getPositionInFile(t,r);return i.getBreakpointStatementAtPosition(r,s)}getNameOrDottedNameSpan(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.getPositionInFile(t,r);return i.getNameOrDottedNameSpan(r,s,s)}isValidBraceCompletion(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.getPositionInFile(t,r);return i.isValidBraceCompletionAtPosition(r,s,t.openingBrace.charCodeAt(0))}getQuickInfoWorker(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=s.getLanguageService().getQuickInfoAtPosition(i,this.getPosition(t,o));if(!c)return;const u=!!this.getPreferences(i).displayPartsForJSDoc;if(r){const f=GA(c.displayParts);return{kind:c.kind,kindModifiers:c.kindModifiers,start:o.positionToLineOffset(c.textSpan.start),end:o.positionToLineOffset(yc(c.textSpan)),displayString:f,documentation:u?this.mapDisplayParts(c.documentation,s):GA(c.documentation),tags:this.mapJSDocTagInfo(c.tags,s,u)}}else return u?c:{...c,tags:this.mapJSDocTagInfo(c.tags,s,!1)}}getFormattingEditsForRange(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.projectService.getScriptInfoForNormalizedPath(r),o=s.lineOffsetToPosition(t.line,t.offset),c=s.lineOffsetToPosition(t.endLine,t.endOffset),u=i.getFormattingEditsForRange(r,o,c,this.getFormatOptions(r));if(u)return u.map(f=>this.convertTextChangeToCodeEdit(f,s))}getFormattingEditsForRangeFull(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=t.options?d6(t.options):this.getFormatOptions(r);return i.getFormattingEditsForRange(r,t.position,t.endPosition,s)}getFormattingEditsForDocumentFull(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=t.options?d6(t.options):this.getFormatOptions(r);return i.getFormattingEditsForDocument(r,s)}getFormattingEditsAfterKeystrokeFull(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=t.options?d6(t.options):this.getFormatOptions(r);return i.getFormattingEditsAfterKeystroke(r,t.position,t.key,s)}getFormattingEditsAfterKeystroke(t){const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),s=this.projectService.getScriptInfoForNormalizedPath(r),o=s.lineOffsetToPosition(t.line,t.offset),c=this.getFormatOptions(r),u=i.getFormattingEditsAfterKeystroke(r,o,t.key,c);if(t.key===` +`&&(!u||u.length===0||$Ze(u,o))){const{lineText:f,absolutePosition:g}=s.textStorage.getAbsolutePositionAndLineText(t.line);if(f&&f.search("\\S")<0){const p=i.getIndentationAtPosition(r,o,c);let y=0,S,T;for(S=0,T=f.length;S({start:s.positionToLineOffset(f.span.start),end:s.positionToLineOffset(yc(f.span)),newText:f.newText?f.newText:""}))}getCompletions(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),u=s.getLanguageService().getCompletionsAtPosition(i,c,{...spe(this.getPreferences(i)),triggerCharacter:t.triggerCharacter,triggerKind:t.triggerKind,includeExternalModuleExports:t.includeExternalModuleExports,includeInsertTextCompletions:t.includeInsertTextCompletions},s.projectService.getFormatCodeOptions(i));if(u===void 0)return;if(r==="completions-full")return u;const f=t.prefix||"",g=Ii(u.entries,y=>{if(u.isMemberCompletion||Qi(y.name.toLowerCase(),f.toLowerCase())){const{name:S,kind:T,kindModifiers:C,sortText:w,insertText:D,filterText:O,replacementSpan:z,hasAction:W,source:X,sourceDisplay:J,labelDetails:ie,isSnippet:B,isRecommended:Y,isPackageJsonImport:ae,isImportStatementCompletion:_e,data:$}=y,H=z?Im(z,o):void 0;return{name:S,kind:T,kindModifiers:C,sortText:w,insertText:D,filterText:O,replacementSpan:H,isSnippet:B,hasAction:W||void 0,source:X,sourceDisplay:J,labelDetails:ie,isRecommended:Y,isPackageJsonImport:ae,isImportStatementCompletion:_e,data:$}}});return r==="completions"?(u.metadata&&(g.metadata=u.metadata),g):{...u,optionalReplacementSpan:u.optionalReplacementSpan&&Im(u.optionalReplacementSpan,o),entries:g}}getCompletionEntryDetails(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),u=s.projectService.getFormatCodeOptions(i),f=!!this.getPreferences(i).displayPartsForJSDoc,g=Ii(t.entryNames,p=>{const{name:y,source:S,data:T}=typeof p=="string"?{name:p,source:void 0,data:void 0}:p;return s.getLanguageService().getCompletionEntryDetails(i,c,y,u,S,this.getPreferences(i),T?Ms(T,cKe):void 0)});return r?f?g:g.map(p=>({...p,tags:this.mapJSDocTagInfo(p.tags,s,!1)})):g.map(p=>({...p,codeActions:Yt(p.codeActions,y=>this.mapCodeAction(y)),documentation:this.mapDisplayParts(p.documentation,s),tags:this.mapJSDocTagInfo(p.tags,s,f)}))}getCompileOnSaveAffectedFileList(t){const r=this.getProjects(t,!0,!0),i=this.projectService.getScriptInfo(t.file);return i?XZe(i,s=>this.projectService.getScriptInfoForPath(s),r,(s,o)=>{if(!s.compileOnSaveEnabled||!s.languageServiceEnabled||s.isOrphan())return;const c=s.getCompilationSettings();if(!(c.noEmit||Il(o.fileName)&&!GZe(c)))return{projectFileName:s.getProjectName(),fileNames:s.getCompileOnSaveAffectedFileList(o),projectUsesOutFile:!!to(c)}}):Gc}emitFile(t){const{file:r,project:i}=this.getFileAndProject(t);if(i||r0.ThrowNoProject(),!i.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;const s=i.getScriptInfo(r),{emitSkipped:o,diagnostics:c}=i.emitFile(s,(u,f,g)=>this.host.writeFile(u,f,g));return t.richResponse?{emitSkipped:o,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):c.map(u=>kN(u,!0))}:!o}getSignatureHelpItems(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),u=s.getLanguageService().getSignatureHelpItems(i,c,t),f=!!this.getPreferences(i).displayPartsForJSDoc;if(u&&r){const g=u.applicableSpan;return{...u,applicableSpan:{start:o.positionToLineOffset(g.start),end:o.positionToLineOffset(g.start+g.length)},items:this.mapSignatureHelpItems(u.items,s,f)}}else return f||!u?u:{...u,items:u.items.map(g=>({...g,tags:this.mapJSDocTagInfo(g.tags,s,!1)}))}}toPendingErrorCheck(t){const r=Lo(t),i=this.projectService.tryGetDefaultProjectForFile(r);return i&&{fileName:r,project:i}}getDiagnostics(t,r,i){this.suppressDiagnosticEvents||i.length>0&&this.updateErrorCheck(t,i,r)}change(t){const r=this.projectService.getScriptInfo(t.file);E.assert(!!r),r.textStorage.switchToScriptVersionCache();const i=r.lineOffsetToPosition(t.line,t.offset),s=r.lineOffsetToPosition(t.endLine,t.endOffset);i>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(r,MZ({span:{start:i,length:s-i},newText:t.insertString})))}reload(t,r){const i=Lo(t.file),s=t.tmpfile===void 0?void 0:Lo(t.tmpfile),o=this.projectService.getScriptInfoForNormalizedPath(i);o&&(this.changeSeq++,o.reloadFromFile(s)&&this.doOutput(void 0,"reload",r,!0))}saveToTmp(t,r){const i=this.projectService.getScriptInfo(t);i&&i.saveTo(r)}closeClientFile(t){if(!t)return;const r=qs(t);this.projectService.closeClientFile(r)}mapLocationNavigationBarItems(t,r){return Yt(t,i=>({text:i.text,kind:i.kind,kindModifiers:i.kindModifiers,spans:i.spans.map(s=>Im(s,r)),childItems:this.mapLocationNavigationBarItems(i.childItems,r),indent:i.indent}))}getNavigationBarItems(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=s.getNavigationBarItems(i);return o?r?this.mapLocationNavigationBarItems(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}toLocationNavigationTree(t,r){return{text:t.text,kind:t.kind,kindModifiers:t.kindModifiers,spans:t.spans.map(i=>Im(i,r)),nameSpan:t.nameSpan&&Im(t.nameSpan,r),childItems:Yt(t.childItems,i=>this.toLocationNavigationTree(i,r))}}getNavigationTree(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=s.getNavigationTree(i);return o?r?this.toLocationNavigationTree(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}getNavigateToItems(t,r){const i=this.getFullNavigateToItems(t);return r?ta(i,({project:s,navigateToItems:o})=>o.map(c=>{const u=s.getScriptInfo(c.fileName),f={name:c.name,kind:c.kind,kindModifiers:c.kindModifiers,isCaseSensitive:c.isCaseSensitive,matchKind:c.matchKind,file:c.fileName,start:u.positionToLineOffset(c.textSpan.start),end:u.positionToLineOffset(yc(c.textSpan))};return c.kindModifiers&&c.kindModifiers!==""&&(f.kindModifiers=c.kindModifiers),c.containerName&&c.containerName.length>0&&(f.containerName=c.containerName),c.containerKind&&c.containerKind.length>0&&(f.containerKind=c.containerKind),f})):ta(i,({navigateToItems:s})=>s)}getFullNavigateToItems(t){const{currentFileOnly:r,searchValue:i,maxResultCount:s,projectFileName:o}=t;if(r){E.assertIsDefined(t.file);const{file:S,project:T}=this.getFileAndProject(t);return[{project:T,navigateToItems:T.getLanguageService().getNavigateToItems(i,s,S)}]}const c=this.getHostPreferences(),u=[],f=new Map;if(!t.file&&!o)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(S=>g(S));else{const S=this.getProjects(t);vpe(S,void 0,T=>g(T))}return u;function g(S){const T=S.getLanguageService().getNavigateToItems(i,s,void 0,S.isNonTsProject(),c.excludeLibrarySymbolsInNavTo),C=wn(T,w=>p(w)&&!FQ(Q3(w),S));C.length&&u.push({project:S,navigateToItems:C})}function p(S){const T=S.name;if(!f.has(T))return f.set(T,[S]),!0;const C=f.get(T);for(const w of C)if(y(w,S))return!1;return C.push(S),!0}function y(S,T){return S===T?!0:!S||!T?!1:S.containerKind===T.containerKind&&S.containerName===T.containerName&&S.fileName===T.fileName&&S.isCaseSensitive===T.isCaseSensitive&&S.kind===T.kind&&S.kindModifiers===T.kindModifiers&&S.matchKind===T.matchKind&&S.name===T.name&&S.textSpan.start===T.textSpan.start&&S.textSpan.length===T.textSpan.length}}getSupportedCodeFixes(t){if(!t)return qG();if(t.file){const{file:i,project:s}=this.getFileAndProject(t);return s.getLanguageService().getSupportedCodeFixes(i)}const r=this.getProject(t.projectFileName);return r||r0.ThrowNoProject(),r.getLanguageService().getSupportedCodeFixes()}isLocation(t){return t.line!==void 0}extractPositionOrRange(t,r){let i,s;return this.isLocation(t)?i=o(t):s=this.getRange(t,r),E.checkDefined(i===void 0?s:i);function o(c){return c.position!==void 0?c.position:r.lineOffsetToPosition(c.line,c.offset)}}getRange(t,r){const{startPosition:i,endPosition:s}=this.getStartAndEndPosition(t,r);return{pos:i,end:s}}getApplicableRefactors(t){const{file:r,project:i}=this.getFileAndProject(t),s=i.getScriptInfoForNormalizedPath(r);return i.getLanguageService().getApplicableRefactors(r,this.extractPositionOrRange(t,s),this.getPreferences(r),t.triggerReason,t.kind,t.includeInteractiveActions)}getEditsForRefactor(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=s.getScriptInfoForNormalizedPath(i),c=s.getLanguageService().getEditsForRefactor(i,this.getFormatOptions(i),this.extractPositionOrRange(t,o),t.refactor,t.action,this.getPreferences(i),t.interactiveRefactorArguments);if(c===void 0)return{edits:[]};if(r){const{renameFilename:u,renameLocation:f,edits:g}=c;let p;if(u!==void 0&&f!==void 0){const y=s.getScriptInfoForNormalizedPath(Lo(u));p=Spe(HC(y.getSnapshot()),u,f,g)}return{renameLocation:p,renameFilename:u,edits:this.mapTextChangesToCodeEdits(g),notApplicableReason:c.notApplicableReason}}return c}getMoveToRefactoringFileSuggestions(t){const{file:r,project:i}=this.getFileAndProject(t),s=i.getScriptInfoForNormalizedPath(r);return i.getLanguageService().getMoveToRefactoringFileSuggestions(r,this.extractPositionOrRange(t,s),this.getPreferences(r))}organizeImports(t,r){E.assert(t.scope.type==="file");const{file:i,project:s}=this.getFileAndProject(t.scope.args),o=s.getLanguageService().organizeImports({fileName:i,mode:t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(i),this.getPreferences(i));return r?this.mapTextChangesToCodeEdits(o):o}getEditsForFileRename(t,r){const i=Lo(t.oldFilePath),s=Lo(t.newFilePath),o=this.getHostFormatOptions(),c=this.getHostPreferences(),u=new Set,f=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(g=>{const p=g.getLanguageService().getEditsForFileRename(i,s,o,c),y=[];for(const S of p)u.has(S.fileName)||(f.push(S),y.push(S.fileName));for(const S of y)u.add(S)}),r?f.map(g=>this.mapTextChangeToCodeEdit(g)):f}getCodeFixes(t,r){const{file:i,project:s}=this.getFileAndProject(t),o=s.getScriptInfoForNormalizedPath(i),{startPosition:c,endPosition:u}=this.getStartAndEndPosition(t,o);let f;try{f=s.getLanguageService().getCodeFixesAtPosition(i,c,u,t.errorCodes,this.getFormatOptions(i),this.getPreferences(i))}catch(g){const p=s.getLanguageService(),y=[...p.getSyntacticDiagnostics(i),...p.getSemanticDiagnostics(i),...p.getSuggestionDiagnostics(i)].map(T=>dP(c,u-c,T.start,T.length)&&T.code),S=t.errorCodes.find(T=>!y.includes(T));throw S!==void 0&&(g.message=`BADCLIENT: Bad error code, ${S} not found in range ${c}..${u} (found: ${y.join(", ")}); could have caused this error: +${g.message}`),g}return r?f.map(g=>this.mapCodeFixAction(g)):f}getCombinedCodeFix({scope:t,fixId:r},i){E.assert(t.type==="file");const{file:s,project:o}=this.getFileAndProject(t.args),c=o.getLanguageService().getCombinedCodeFix({type:"file",fileName:s},r,this.getFormatOptions(s),this.getPreferences(s));return i?{changes:this.mapTextChangesToCodeEdits(c.changes),commands:c.commands}:c}applyCodeActionCommand(t){const r=t.command;for(const i of $S(r)){const{file:s,project:o}=this.getFileAndProject(i);o.getLanguageService().applyCodeActionCommand(i,this.getFormatOptions(s)).then(c=>{},c=>{})}return{}}getStartAndEndPosition(t,r){let i,s;return t.startPosition!==void 0?i=t.startPosition:(i=r.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=i),t.endPosition!==void 0?s=t.endPosition:(s=r.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=s),{startPosition:i,endPosition:s}}mapCodeAction({description:t,changes:r,commands:i}){return{description:t,changes:this.mapTextChangesToCodeEdits(r),commands:i}}mapCodeFixAction({fixName:t,description:r,changes:i,commands:s,fixId:o,fixAllDescription:c}){return{fixName:t,description:r,changes:this.mapTextChangesToCodeEdits(i),commands:s,fixId:o,fixAllDescription:c}}mapTextChangesToCodeEdits(t){return t.map(r=>this.mapTextChangeToCodeEdit(r))}mapTextChangeToCodeEdit(t){const r=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!r&&(r||this.projectService.logErrorForScriptInfoNotFound(t.fileName),E.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!r}))),r?{fileName:t.fileName,textChanges:t.textChanges.map(i=>rKe(i,r))}:sKe(t)}convertTextChangeToCodeEdit(t,r){return{start:r.positionToLineOffset(t.span.start),end:r.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:""}}getBraceMatching(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),u=s.getBraceMatchingAtPosition(i,c);return u?r?u.map(f=>Im(f,o)):u:void 0}getDiagnosticsForProject(t,r,i){if(this.suppressDiagnosticEvents)return;const{fileNames:s,languageServiceDisabled:o}=this.getProjectInfoWorker(i,void 0,!0,!0);if(o)return;const c=s.filter(w=>!w.includes("lib.d.ts"));if(c.length===0)return;const u=[],f=[],g=[],p=[],y=Lo(i),S=this.projectService.ensureDefaultProjectForFile(y);for(const w of c)this.getCanonicalFileName(w)===this.getCanonicalFileName(i)?u.push(w):this.projectService.getScriptInfo(w).isScriptOpen()?f.push(w):Il(w)?p.push(w):g.push(w);const C=[...u,...f,...g,...p].map(w=>({fileName:w,project:S}));this.updateErrorCheck(t,C,r,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,r){const{locations:i}=t,{file:s,languageService:o}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=E.checkDefined(this.projectService.getScriptInfo(s));return Yt(i,u=>{const f=this.getPosition(u,c),g=o.getSmartSelectionRange(s,f);return r?this.mapSelectionRange(g,c):g})}toggleLineComment(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfo(i),c=this.getRange(t,o),u=s.toggleLineComment(i,c);if(r){const f=this.projectService.getScriptInfoForNormalizedPath(i);return u.map(g=>this.convertTextChangeToCodeEdit(g,f))}return u}toggleMultilineComment(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),u=s.toggleMultilineComment(i,c);if(r){const f=this.projectService.getScriptInfoForNormalizedPath(i);return u.map(g=>this.convertTextChangeToCodeEdit(g,f))}return u}commentSelection(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),u=s.commentSelection(i,c);if(r){const f=this.projectService.getScriptInfoForNormalizedPath(i);return u.map(g=>this.convertTextChangeToCodeEdit(g,f))}return u}uncommentSelection(t,r){const{file:i,languageService:s}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),u=s.uncommentSelection(i,c);if(r){const f=this.projectService.getScriptInfoForNormalizedPath(i);return u.map(g=>this.convertTextChangeToCodeEdit(g,f))}return u}mapSelectionRange(t,r){const i={textSpan:Im(t.textSpan,r)};return t.parent&&(i.parent=this.mapSelectionRange(t.parent,r)),i}getScriptInfoFromProjectService(t){const r=Lo(t),i=this.projectService.getScriptInfoForNormalizedPath(r);return i||(this.projectService.logErrorForScriptInfoNotFound(r),r0.ThrowNoProject())}toProtocolCallHierarchyItem(t){const r=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:Im(t.span,r),selectionSpan:Im(t.selectionSpan,r)}}toProtocolCallHierarchyIncomingCall(t){const r=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(i=>Im(i,r))}}toProtocolCallHierarchyOutgoingCall(t,r){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(i=>Im(i,r))}}prepareCallHierarchy(t){const{file:r,project:i}=this.getFileAndProject(t),s=this.projectService.getScriptInfoForNormalizedPath(r);if(s){const o=this.getPosition(t,s),c=i.getLanguageService().prepareCallHierarchy(r,o);return c&&zH(c,u=>this.toProtocolCallHierarchyItem(u))}}provideCallHierarchyIncomingCalls(t){const{file:r,project:i}=this.getFileAndProject(t),s=this.getScriptInfoFromProjectService(r);return i.getLanguageService().provideCallHierarchyIncomingCalls(r,this.getPosition(t,s)).map(c=>this.toProtocolCallHierarchyIncomingCall(c))}provideCallHierarchyOutgoingCalls(t){const{file:r,project:i}=this.getFileAndProject(t),s=this.getScriptInfoFromProjectService(r);return i.getLanguageService().provideCallHierarchyOutgoingCalls(r,this.getPosition(t,s)).map(c=>this.toProtocolCallHierarchyOutgoingCall(c,s))}getCanonicalFileName(t){const r=this.host.useCaseSensitiveFileNames?t:xd(t);return qs(r)}exit(){}notRequired(){return{responseRequired:!1}}requiredResponse(t){return{response:t,responseRequired:!0}}addProtocolHandler(t,r){if(this.handlers.has(t))throw new Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,r)}setCurrentRequest(t){E.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){E.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,r){try{return this.setCurrentRequest(t),r()}finally{this.resetCurrentRequest(t)}}executeCommand(t){const r=this.handlers.get(t.command);if(r){const i=this.executeWithRequestId(t.seq,()=>r(t));return this.projectService.enableRequestedPlugins(),i}else return this.logger.msg(`Unrecognized JSON command:${UC(t)}`,"Err"),this.doOutput(void 0,"unknown",t.seq,!1,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var r,i,s,o,c,u,f,g,p,y,S;this.gcTimer.scheduleCollect(),this.performanceData=void 0;let T;this.logger.hasLevel(2)&&(T=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${S3(this.toStringMessage(t))}`));let C,w;try{C=this.parseMessage(t),w=C.arguments&&C.arguments.file?C.arguments:void 0,(r=Jr)==null||r.instant(Jr.Phase.Session,"request",{seq:C.seq,command:C.command}),(i=Pu)==null||i.logStartCommand(""+C.command,this.toStringMessage(t).substring(0,100)),(s=Jr)==null||s.push(Jr.Phase.Session,"executeCommand",{seq:C.seq,command:C.command},!0);const{response:D,responseRequired:O}=this.executeCommand(C);if((o=Jr)==null||o.pop(),this.logger.hasLevel(2)){const z=HZe(this.hrtime(T)).toFixed(4);O?this.logger.perftrc(`${C.seq}::${C.command}: elapsed time (in milliseconds) ${z}`):this.logger.perftrc(`${C.seq}::${C.command}: async elapsed time (in milliseconds) ${z}`)}(c=Pu)==null||c.logStopCommand(""+C.command,"Success"),(u=Jr)==null||u.instant(Jr.Phase.Session,"response",{seq:C.seq,command:C.command,success:!!D}),D?this.doOutput(D,C.command,C.seq,!0):O&&this.doOutput(void 0,C.command,C.seq,!1,"No content available.")}catch(D){if((f=Jr)==null||f.popAll(),D instanceof lk){(g=Pu)==null||g.logStopCommand(""+(C&&C.command),"Canceled: "+D),(p=Jr)==null||p.instant(Jr.Phase.Session,"commandCanceled",{seq:C?.seq,command:C?.command}),this.doOutput({canceled:!0},C.command,C.seq,!0);return}this.logErrorWorker(D,this.toStringMessage(t),w),(y=Pu)==null||y.logStopCommand(""+(C&&C.command),"Error: "+D),(S=Jr)==null||S.instant(Jr.Phase.Session,"commandError",{seq:C?.seq,command:C?.command,message:D.message}),this.doOutput(void 0,C?C.command:"unknown",C?C.seq:0,!1,"Error processing request. "+D.message+` +`+D.stack)}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}}}}),px,OQ,UDe,VDe,UM,VM,Epe,Y3,dx,CN,uKe=Nt({"src/server/scriptVersionCache.ts"(){"use strict";w1(),mx(),px=4,OQ=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(OQ||{}),UDe=class{constructor(){this.goSubtree=!0,this.lineIndex=new Y3,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new dx,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;const i=Y3.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let s,o;for(let u=this.endBranch.length-1;u>=0;u--)this.endBranch[u].updateCounts(),this.endBranch[u].charCount()===0&&(o=this.endBranch[u],u>0?s=this.endBranch[u-1]:s=this.branchNode);o&&s.remove(o);const c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let u=new Array(i.length-1),f=c;for(let y=1;y=0;){const y=this.startPath[g];u=y.insertAt(f,u),g--,f=y}let p=u.length;for(;p>0;){const y=new dx;y.add(this.lineIndex.root),u=y.insertAt(this.lineIndex.root,u),p=u.length,this.lineIndex.root=y}this.lineIndex.root.updateCounts()}else for(let u=this.startPath.length-2;u>=0;u--)this.startPath[u].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let f=this.startPath.length-2;f>=0;f--)this.startPath[f].updateCounts()}return this.lineIndex}post(e,t,r){r===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,r,i,s){const o=this.stack[this.stack.length-1];this.state===2&&s===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=r);let c;function u(f){return f.isLeaf()?new CN(""):new dx}switch(s){case 0:this.goSubtree=!1,this.state!==4&&o.add(r);break;case 1:this.state===4?this.goSubtree=!1:(c=u(r),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=u(r),o.add(c),this.startPath.push(c)):r.isLeaf()||(c=u(r),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:r.isLeaf()||(c=u(r),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(r);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,r){this.state===1?this.initialText=r.text.substring(0,e):this.state===2?(this.initialText=r.text.substring(0,e),this.trailingText=r.text.substring(e+t)):this.trailingText=r.text.substring(e+t)}},VDe=class{constructor(e,t,r){this.pos=e,this.deleteLen=t,this.insertedText=r}getTextChangeRange(){return mP(Jl(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},UM=class WS{constructor(){this.changes=[],this.versions=new Array(WS.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(tthis.currentVersion))return t%WS.maxVersions}currentVersionToIndex(){return this.currentVersion%WS.maxVersions}edit(t,r,i){this.changes.push(new VDe(t,r,i)),(this.changes.length>WS.changeNumberThreshold||r>WS.changeLengthThreshold||i&&i.length>WS.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let r=t.index;for(const i of this.changes)r=r.edit(i.pos,i.deleteLen,i.insertedText);t=new Epe(this.currentVersion+1,this,r,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=WS.maxVersions&&(this.minVersion=this.currentVersion-WS.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,r){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(r-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){const r=this._getSnapshot().index,{lineText:i,absolutePosition:s}=r.lineNumberToInfo(t+1),o=i!==void 0?i.length:r.absolutePositionOfStartOfLine(t+2)-s;return Jl(s,o)}getTextChangesBetweenVersions(t,r){if(t=this.minVersion){const i=[];for(let s=t+1;s<=r;s++){const o=this.versions[this.versionToIndex(s)];for(const c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return IK(i)}else return;else return NP}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const r=new WS,i=new Epe(0,r,new Y3);r.versions[r.currentVersion]=i;const s=Y3.linesFromText(t);return i.index.load(s.lines),r}},UM.changeNumberThreshold=8,UM.changeLengthThreshold=256,UM.maxVersions=8,VM=UM,Epe=class pIe{constructor(t,r,i,s=Gc){this.version=t,this.cache=r,this.index=i,this.changesSincePreviousVersion=s}getText(t,r){return this.index.getText(t,r-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof pIe&&this.cache===t.cache)return this.version<=t.version?NP:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},Y3=class nhe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){const{oneBasedLine:r,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:r,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){const r=this.getLineCount();if(t<=r){const{position:i,leaf:s}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:s&&s.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const r=[];for(let i=0;i0&&t{i=i.concat(c.text.substring(s,s+o))}}),i}getLength(){return this.root.charCount()}every(t,r,i){i||(i=this.root.charCount());const s={goSubtree:!0,done:!1,leaf(o,c,u){t(u,o,c)||(this.done=!0)}};return this.walk(r,i-r,s),!s.done}edit(t,r,i){if(this.root.charCount()===0)return E.assert(r===0),i!==void 0?(this.load(nhe.linesFromText(i).lines),this):void 0;{let s;if(this.checkEdits){const u=this.getText(0,this.root.charCount());s=u.slice(0,t)+i+u.slice(t+r)}const o=new UDe;let c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const u=this.getText(t,1);i?i=u+i:i=u,r=0,c=!0}else if(r>0){const u=t+r,{zeroBasedColumn:f,lineText:g}=this.positionToColumnAndLineText(u);f===0&&(r+=g.length,i=i?i+g:g)}if(this.root.walk(t,r,o),o.insertLines(i,c),this.checkEdits){const u=o.lineIndex.getText(0,o.lineIndex.getLength());E.assert(s===u,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length0?i[s]=o:i.pop(),{lines:i,lineMap:r}}},dx=class ihe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,r,i,s,o){return i.pre&&i.pre(t,r,this.children[s],this,o),i.goSubtree?(this.children[s].walk(t,r,i),i.post&&i.post(t,r,this.children[s],this,o)):i.goSubtree=!0,i.done}skipChild(t,r,i,s,o){s.pre&&!s.done&&(s.pre(t,r,this.children[i],this,o),s.goSubtree=!0)}walk(t,r,i){let s=0,o=this.children[s].charCount(),c=t;for(;c>=o;)this.skipChild(c,r,s,i,0),c-=o,s++,o=this.children[s].charCount();if(c+r<=o){if(this.execWalk(c,r,i,s,2))return}else{if(this.execWalk(c,o-c,i,s,1))return;let u=r-(o-c);for(s++,o=this.children[s].charCount();u>o;){if(this.execWalk(0,o,i,s,3))return;u-=o,s++,o=this.children[s].charCount()}if(u>0&&this.execWalk(0,u,i,s,4))return}if(i.pre){const u=this.children.length;if(sr)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:r,lineText:o.text}:o.charOffsetToLineInfo(t,r);r-=o.charCount(),t+=o.lineCount()}const i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};const s=E.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:s.charCount(),lineText:void 0}}lineNumberToInfo(t,r){for(const i of this.children){const s=i.lineCount();if(s>=t)return i.isLeaf()?{position:r,leaf:i}:i.lineNumberToInfo(t,r);t-=s,r+=i.charCount()}return{position:r,leaf:void 0}}splitAfter(t){let r;const i=this.children.length;t++;const s=t;if(t=0;S--)f[S].children.length===0&&f.pop()}c&&f.push(c),this.updateCounts();for(let p=0;pP9,ActionPackageInstalled:()=>wae,ActionSet:()=>D9,ActionWatchTypingLocations:()=>iA,Arguments:()=>Aq,AutoImportProviderProject:()=>TQ,AuxiliaryProject:()=>bQ,CharRangeSection:()=>OQ,CloseFileWatcherEvent:()=>JM,CommandNames:()=>xpe,ConfigFileDiagEvent:()=>LM,ConfiguredProject:()=>xQ,CreateDirectoryWatcherEvent:()=>BM,CreateFileWatcherEvent:()=>jM,Errors:()=>r0,EventBeginInstallTypes:()=>Pq,EventEndInstallTypes:()=>wq,EventInitializationFailed:()=>Nae,EventTypesRegistry:()=>Aae,ExternalProject:()=>DM,GcTimer:()=>pQ,InferredProject:()=>vQ,LargeFileReferencedEvent:()=>OM,LineIndex:()=>Y3,LineLeaf:()=>CN,LineNode:()=>dx,LogLevel:()=>lQ,Msg:()=>uQ,OpenFileInfoTelemetryEvent:()=>EQ,Project:()=>Zb,ProjectInfoTelemetryEvent:()=>RM,ProjectKind:()=>X3,ProjectLanguageServiceStateEvent:()=>MM,ProjectLoadingFinishEvent:()=>FM,ProjectLoadingStartEvent:()=>IM,ProjectReferenceProjectLoadKind:()=>wQ,ProjectService:()=>AQ,ProjectsUpdatedInBackgroundEvent:()=>TN,ScriptInfo:()=>gQ,ScriptVersionCache:()=>VM,Session:()=>Cpe,TextStorage:()=>mQ,ThrottledOperations:()=>fQ,TypingsCache:()=>hQ,allFilesAreJsOrDts:()=>tpe,allRootFilesAreJsOrDts:()=>epe,asNormalizedPath:()=>SDe,convertCompilerOptions:()=>PM,convertFormatOptions:()=>d6,convertScriptKindName:()=>CQ,convertTypeAcquisition:()=>ipe,convertUserPreferences:()=>spe,convertWatchOptions:()=>SN,countEachFileTypes:()=>vN,createInstallTypingsRequest:()=>bDe,createModuleSpecifierCache:()=>mpe,createNormalizedPathMap:()=>TDe,createPackageJsonCache:()=>gpe,createSortedArray:()=>jfe,emptyArray:()=>Gc,findArgument:()=>pSe,forEachResolvedProjectReferenceProject:()=>m6,formatDiagnosticToProtocol:()=>kN,formatMessage:()=>hpe,getBaseConfigFileName:()=>_Q,getLocationInNewDocument:()=>Spe,hasArgument:()=>fSe,hasNoTypeScriptSource:()=>rpe,indent:()=>S3,isBackgroundProject:()=>bN,isConfigFile:()=>_pe,isConfiguredProject:()=>P1,isDynamicFileName:()=>yN,isExternalProject:()=>yQ,isInferredProject:()=>p6,isInferredProjectName:()=>Ofe,makeAutoImportProviderProjectName:()=>Mfe,makeAuxiliaryProjectName:()=>Rfe,makeInferredProjectName:()=>Lfe,maxFileSize:()=>NM,maxProgramSizeForNonTsFiles:()=>AM,normalizedPathToPath:()=>hN,nowString:()=>dSe,nullCancellationToken:()=>Tpe,nullTypingsInstaller:()=>EM,projectContainsInfoDirectly:()=>fx,protocol:()=>Kfe,removeSorted:()=>xDe,stringifyIndented:()=>UC,toEvent:()=>ype,toNormalizedPath:()=>Lo,tryConvertScriptKindName:()=>kQ,typingsInstaller:()=>Ife,updateProjectIfDirty:()=>Tf});var mx=Nt({"src/server/_namespaces/ts.server.ts"(){"use strict";w9(),Ffe(),xZe(),kZe(),CZe(),EZe(),wZe(),FZe(),RZe(),UZe(),VZe(),qZe(),lKe(),uKe()}}),HDe={};jl(HDe,{ANONYMOUS:()=>bL,AccessFlags:()=>sB,AssertionLevel:()=>Aj,AssignmentDeclarationKind:()=>dB,AssignmentKind:()=>sW,Associativity:()=>oW,BreakpointResolver:()=>KG,BuilderFileEmit:()=>sq,BuilderProgramKind:()=>aq,BuilderState:()=>Vp,BundleFileSectionKind:()=>IB,CallHierarchy:()=>ix,CharacterCodes:()=>CB,CheckFlags:()=>eB,CheckMode:()=>AO,ClassificationType:()=>Xq,ClassificationTypeNames:()=>$q,CommentDirectiveType:()=>Bj,Comparison:()=>aj,CompletionInfoFlags:()=>zq,CompletionTriggerKind:()=>Mq,Completions:()=>lx,ContainerFlags:()=>QU,ContextFlags:()=>qj,Debug:()=>E,DiagnosticCategory:()=>YD,Diagnostics:()=>d,DocumentHighlights:()=>xL,ElementFlags:()=>iB,EmitFlags:()=>X7,EmitHint:()=>wB,EmitOnly:()=>zj,EndOfLineState:()=>Vq,EnumKind:()=>Kj,ExitStatus:()=>Wj,ExportKind:()=>eG,Extension:()=>EB,ExternalEmitHelpers:()=>PB,FileIncludeKind:()=>J7,FilePreprocessingDiagnosticsKind:()=>Jj,FileSystemEntryKind:()=>jB,FileWatcherEventKind:()=>RB,FindAllReferences:()=>ho,FlattenLevel:()=>mV,FlowFlags:()=>QD,ForegroundColorEscapeSequences:()=>YV,FunctionFlags:()=>aW,GeneratedIdentifierFlags:()=>B7,GetLiteralTextFlags:()=>rW,GoToDefinition:()=>c6,HighlightSpanKind:()=>jq,IdentifierNameMap:()=>$T,IdentifierNameMultiMap:()=>dV,ImportKind:()=>KH,ImportsNotUsedAsValues:()=>bB,IndentStyle:()=>Bq,IndexFlags:()=>aB,IndexKind:()=>lB,InferenceFlags:()=>fB,InferencePriority:()=>_B,InlayHintKind:()=>Rq,InlayHints:()=>VX,InternalEmitFlags:()=>DB,InternalSymbolName:()=>tB,InvalidatedProjectKind:()=>Dq,JSDocParsingMode:()=>LB,JsDoc:()=>D1,JsTyping:()=>gg,JsxEmit:()=>vB,JsxFlags:()=>Rj,JsxReferenceKind:()=>oB,LanguageServiceMode:()=>Fq,LanguageVariant:()=>xB,LexicalEnvironmentFlags:()=>NB,ListFormat:()=>FB,LogLevel:()=>Ij,MemberOverrideStatus:()=>Uj,ModifierFlags:()=>R7,ModuleDetectionKind:()=>mB,ModuleInstanceState:()=>XU,ModuleKind:()=>y4,ModuleResolutionKind:()=>uk,ModuleSpecifierEnding:()=>dW,NavigateTo:()=>tce,NavigationBar:()=>_ce,NewLineKind:()=>SB,NodeBuilderFlags:()=>Hj,NodeCheckFlags:()=>rB,NodeFactoryFlags:()=>TW,NodeFlags:()=>M7,NodeResolutionFeatures:()=>HU,ObjectFlags:()=>V7,OperationCanceledException:()=>lk,OperatorPrecedence:()=>cW,OrganizeImports:()=>qp,OrganizeImportsMode:()=>Lq,OuterExpressionKinds:()=>AB,OutliningElementsCollector:()=>$X,OutliningSpanKind:()=>Wq,OutputFileType:()=>Uq,PackageJsonAutoImportPreference:()=>Iq,PackageJsonDependencyGroup:()=>Nq,PatternMatchKind:()=>kL,PollingInterval:()=>Q7,PollingWatchKind:()=>yB,PragmaKindFlags:()=>OB,PrivateIdentifierKind:()=>wW,ProcessLevel:()=>vV,ProgramUpdateLevel:()=>OV,QuotePreference:()=>GH,RelationComparisonResult:()=>j7,Rename:()=>vM,ScriptElementKind:()=>Hq,ScriptElementKindModifier:()=>Gq,ScriptKind:()=>H7,ScriptSnapshot:()=>N9,ScriptTarget:()=>TB,SemanticClassificationFormat:()=>Oq,SemanticMeaning:()=>HH,SemicolonPreference:()=>Jq,SignatureCheckMode:()=>NO,SignatureFlags:()=>q7,SignatureHelp:()=>lN,SignatureKind:()=>cB,SmartSelectionRange:()=>YX,SnippetKind:()=>$7,SortKind:()=>wj,StructureIsReused:()=>z7,SymbolAccessibility:()=>Xj,SymbolDisplay:()=>t0,SymbolDisplayPartKind:()=>aA,SymbolFlags:()=>W7,SymbolFormatFlags:()=>$j,SyntaxKind:()=>L7,SyntheticSymbolKind:()=>Qj,Ternary:()=>pB,ThrottledCancellationToken:()=>ZG,TokenClass:()=>qq,TokenFlags:()=>jj,TransformFlags:()=>G7,TypeFacts:()=>wO,TypeFlags:()=>U7,TypeFormatFlags:()=>Gj,TypeMapKind:()=>uB,TypePredicateKind:()=>Yj,TypeReferenceSerializationKind:()=>Zj,UnionReduction:()=>Vj,UpToDateStatusType:()=>xq,VarianceFlags:()=>nB,Version:()=>Ip,VersionRange:()=>GD,WatchDirectoryFlags:()=>kB,WatchDirectoryKind:()=>hB,WatchFileKind:()=>gB,WatchLogLevel:()=>LV,WatchType:()=>al,accessPrivateIdentifier:()=>$ie,addDisposableResourceHelper:()=>NF,addEmitFlags:()=>Cm,addEmitHelper:()=>CT,addEmitHelpers:()=>Yg,addInternalEmitFlags:()=>xT,addNodeFactoryPatcher:()=>Iye,addObjectAllocatorPatcher:()=>Qte,addRange:()=>Dn,addRelatedInfo:()=>ua,addSyntheticLeadingComment:()=>NE,addSyntheticTrailingComment:()=>iF,addToSeen:()=>Rp,advancedAsyncSuperHelper:()=>K8,affectsDeclarationPathOptionDeclarations:()=>AU,affectsEmitOptionDeclarations:()=>wU,allKeysStartWithDot:()=>xO,altDirectorySeparator:()=>sP,and:()=>w7,append:()=>lr,appendIfUnique:()=>Bg,arrayFrom:()=>fs,arrayIsEqualTo:()=>Zp,arrayIsHomogeneous:()=>mre,arrayIsSorted:()=>jZ,arrayOf:()=>zZ,arrayReverseIterator:()=>mj,arrayToMap:()=>Ph,arrayToMultiMap:()=>VD,arrayToNumericMap:()=>UZ,arraysEqual:()=>zD,assertType:()=>phe,assign:()=>f4,assignHelper:()=>_F,asyncDelegator:()=>pF,asyncGeneratorHelper:()=>fF,asyncSuperHelper:()=>Z8,asyncValues:()=>dF,attachFileToDiagnostics:()=>yT,awaitHelper:()=>ET,awaiterHelper:()=>gF,base64decode:()=>jte,base64encode:()=>Rte,binarySearch:()=>Dh,binarySearchKey:()=>HS,bindSourceFile:()=>Eie,breakIntoCharacterSpans:()=>$oe,breakIntoWordSpans:()=>Xoe,buildLinkParts:()=>hoe,buildOpts:()=>fO,buildOverload:()=>dDe,bundlerModuleNameResolver:()=>die,canBeConvertedToAsync:()=>_G,canHaveDecorators:()=>Lb,canHaveExportModifier:()=>L8,canHaveFlowNode:()=>s8,canHaveIllegalDecorators:()=>iU,canHaveIllegalModifiers:()=>Ane,canHaveIllegalType:()=>c1e,canHaveIllegalTypeParameters:()=>wne,canHaveJSDoc:()=>a8,canHaveLocals:()=>hm,canHaveModifiers:()=>Wp,canHaveSymbol:()=>Ed,canJsonReportNoInputFiles:()=>ZE,canProduceDiagnostics:()=>qO,canUsePropertyAccess:()=>Zz,canWatchAffectingLocation:()=>tae,canWatchAtTypes:()=>eae,canWatchDirectoryOrFile:()=>d9,cartesianProduct:()=>eK,cast:()=>Ms,chainBundle:()=>Up,chainDiagnosticMessages:()=>ps,changeAnyExtension:()=>nP,changeCompilerHostLikeToUseCache:()=>Yw,changeExtension:()=>a1,changesAffectModuleResolution:()=>CI,changesAffectingProgramStructure:()=>See,childIsDecorated:()=>V4,classElementOrClassElementParameterIsDecorated:()=>VJ,classHasClassThisAssignment:()=>gV,classHasDeclaredOrExplicitlyAssignedName:()=>hV,classHasExplicitlyAssignedName:()=>WO,classOrConstructorParameterIsDecorated:()=>Mh,classPrivateFieldGetHelper:()=>PF,classPrivateFieldInHelper:()=>AF,classPrivateFieldSetHelper:()=>wF,classicNameResolver:()=>Tie,classifier:()=>ile,cleanExtendedConfigCache:()=>KO,clear:()=>Ym,clearMap:()=>o_,clearSharedExtendedConfigFileWatcher:()=>NV,climbPastPropertyAccess:()=>F9,climbPastPropertyOrElementAccess:()=>Vae,clone:()=>bj,cloneCompilerOptions:()=>dH,closeFileWatcher:()=>rd,closeFileWatcherOf:()=>hf,codefix:()=>su,collapseTextChangeRangesAcrossMultipleVersions:()=>IK,collectExternalModuleInfo:()=>uV,combine:()=>ik,combinePaths:()=>Hn,commentPragmas:()=>ZD,commonOptionsWithBuild:()=>Pw,commonPackageFolders:()=>uW,compact:()=>UD,compareBooleans:()=>pv,compareDataObjects:()=>Iz,compareDiagnostics:()=>mE,compareDiagnosticsSkipRelatedInformation:()=>D5,compareEmitHelpers:()=>Hre,compareNumberOfDirectorySeparators:()=>I8,comparePaths:()=>qy,comparePathsCaseInsensitive:()=>Jhe,comparePathsCaseSensitive:()=>Bhe,comparePatternKeys:()=>VU,compareProperties:()=>QZ,compareStringsCaseInsensitive:()=>D7,compareStringsCaseInsensitiveEslintCompatible:()=>GZ,compareStringsCaseSensitive:()=>Du,compareStringsCaseSensitiveUI:()=>qD,compareTextSpans:()=>E7,compareValues:()=>xo,compileOnSaveCommandLineOption:()=>Ew,compilerOptionsAffectDeclarationPath:()=>ore,compilerOptionsAffectEmit:()=>are,compilerOptionsAffectSemanticDiagnostics:()=>sre,compilerOptionsDidYouMeanDiagnostics:()=>Nw,compilerOptionsIndicateEsModules:()=>bH,compose:()=>_he,computeCommonSourceDirectoryOfFilenames:()=>Ise,computeLineAndCharacterOfPosition:()=>_k,computeLineOfPosition:()=>x4,computeLineStarts:()=>eT,computePositionOfLineAndCharacter:()=>nI,computeSignature:()=>zb,computeSignatureWithDiagnostics:()=>tq,computeSuggestionDiagnostics:()=>cG,concatenate:()=>Xi,concatenateDiagnosticMessageChains:()=>ere,consumesNodeCoreModules:()=>pL,contains:()=>_s,containsIgnoredPath:()=>xE,containsObjectRestOrSpread:()=>hw,containsParseError:()=>Ck,containsPath:()=>dm,convertCompilerOptionsForTelemetry:()=>Zne,convertCompilerOptionsFromJson:()=>_ve,convertJsonOption:()=>Mb,convertToBase64:()=>Mte,convertToJson:()=>xw,convertToObject:()=>$ne,convertToOptionsWithAbsolutePaths:()=>xU,convertToRelativePath:()=>T4,convertToTSConfig:()=>Y1e,convertTypeAcquisitionFromJson:()=>fve,copyComments:()=>Hb,copyEntries:()=>EI,copyLeadingComments:()=>QC,copyProperties:()=>Sj,copyTrailingAsLeadingComments:()=>EA,copyTrailingComments:()=>N3,couldStartTrivia:()=>TK,countWhere:()=>Ch,createAbstractBuilder:()=>bbe,createAccessorPropertyBackingField:()=>aU,createAccessorPropertyGetRedirector:()=>jne,createAccessorPropertySetRedirector:()=>Bne,createBaseNodeFactory:()=>Are,createBinaryExpressionTrampoline:()=>rO,createBindingHelper:()=>aC,createBuildInfo:()=>Hw,createBuilderProgram:()=>rq,createBuilderProgramUsingProgramBuildInfo:()=>Zse,createBuilderStatusReporter:()=>mae,createCacheWithRedirects:()=>jU,createCacheableExportInfoMap:()=>QH,createCachedDirectoryStructureHost:()=>YO,createClassNamedEvaluationHelperBlock:()=>Kie,createClassThisAssignmentBlock:()=>Yie,createClassifier:()=>RSe,createCommentDirectivesMap:()=>Dee,createCompilerDiagnostic:()=>dc,createCompilerDiagnosticForInvalidCustomType:()=>Une,createCompilerDiagnosticFromMessageChain:()=>E5,createCompilerHost:()=>Fse,createCompilerHostFromProgramHost:()=>vq,createCompilerHostWorker:()=>jV,createDetachedDiagnostic:()=>Zk,createDiagnosticCollection:()=>qk,createDiagnosticForFileFromMessageChain:()=>BJ,createDiagnosticForNode:()=>mn,createDiagnosticForNodeArray:()=>Pk,createDiagnosticForNodeArrayFromMessageChain:()=>jP,createDiagnosticForNodeFromMessageChain:()=>Hg,createDiagnosticForNodeInSourceFile:()=>sp,createDiagnosticForRange:()=>Bee,createDiagnosticMessageChainFromDiagnostic:()=>jee,createDiagnosticReporter:()=>tA,createDocumentPositionMapper:()=>Wie,createDocumentRegistry:()=>Roe,createDocumentRegistryInternal:()=>nG,createEmitAndSemanticDiagnosticsBuilderProgram:()=>oq,createEmitHelperFactory:()=>qre,createEmptyExports:()=>lw,createExpressionForJsxElement:()=>Tne,createExpressionForJsxFragment:()=>xne,createExpressionForObjectLiteralElementLike:()=>kne,createExpressionForPropertyName:()=>ZW,createExpressionFromEntityName:()=>uw,createExternalHelpersImportDeclarationIfNeeded:()=>tU,createFileDiagnostic:()=>xl,createFileDiagnosticFromMessageChain:()=>OI,createForOfBindingStatement:()=>YW,createGetCanonicalFileName:()=>tu,createGetSourceFile:()=>MV,createGetSymbolAccessibilityDiagnosticForNode:()=>Gh,createGetSymbolAccessibilityDiagnosticForNodeName:()=>xse,createGetSymbolWalker:()=>Die,createIncrementalCompilerHost:()=>Sq,createIncrementalProgram:()=>pae,createInputFiles:()=>Oye,createInputFilesWithFilePaths:()=>bW,createInputFilesWithFileTexts:()=>SW,createJsxFactoryExpression:()=>QW,createLanguageService:()=>Zce,createLanguageServiceSourceFile:()=>$L,createMemberAccessForPropertyName:()=>Ob,createModeAwareCache:()=>qT,createModeAwareCacheKey:()=>n3,createModuleNotFoundChain:()=>xJ,createModuleResolutionCache:()=>wC,createModuleResolutionLoader:()=>UV,createModuleResolutionLoaderUsingGlobalCache:()=>sae,createModuleSpecifierResolutionHost:()=>qb,createMultiMap:()=>of,createNodeConverters:()=>Ire,createNodeFactory:()=>V8,createOptionNameMap:()=>sO,createOverload:()=>oQ,createPackageJsonImportFilter:()=>O3,createPackageJsonInfo:()=>jH,createParenthesizerRules:()=>Nre,createPatternMatcher:()=>Woe,createPrependNodes:()=>XV,createPrinter:()=>S1,createPrinterWithDefaults:()=>wV,createPrinterWithRemoveComments:()=>t2,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>AV,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>Gw,createProgram:()=>s9,createProgramHost:()=>bq,createPropertyNameNodeForIdentifierOrLiteral:()=>q5,createQueue:()=>C7,createRange:()=>Lf,createRedirectedBuilderProgram:()=>iq,createResolutionCache:()=>lq,createRuntimeTypeSerializer:()=>ise,createScanner:()=>Ih,createSemanticDiagnosticsBuilderProgram:()=>vbe,createSet:()=>Tj,createSolutionBuilder:()=>Mbe,createSolutionBuilderHost:()=>Obe,createSolutionBuilderWithWatch:()=>Rbe,createSolutionBuilderWithWatchHost:()=>Lbe,createSortedArray:()=>dj,createSourceFile:()=>vw,createSourceMapGenerator:()=>jie,createSourceMapSource:()=>Lye,createSuperAccessVariableStatement:()=>VO,createSymbolTable:()=>zs,createSymlinkCache:()=>Bz,createSystemWatchFunctions:()=>mK,createTextChange:()=>hA,createTextChangeFromStartLength:()=>G9,createTextChangeRange:()=>mP,createTextRangeFromNode:()=>hH,createTextRangeFromSpan:()=>H9,createTextSpan:()=>Jl,createTextSpanFromBounds:()=>zc,createTextSpanFromNode:()=>l_,createTextSpanFromRange:()=>ry,createTextSpanFromStringLiteralLikeContent:()=>gH,createTextWriter:()=>h8,createTokenRange:()=>wz,createTypeChecker:()=>Iie,createTypeReferenceDirectiveResolutionCache:()=>vO,createTypeReferenceResolutionLoader:()=>r9,createUnparsedSourceFile:()=>vW,createWatchCompilerHost:()=>Nbe,createWatchCompilerHostOfConfigFile:()=>uae,createWatchCompilerHostOfFilesAndCompilerOptions:()=>_ae,createWatchFactory:()=>yq,createWatchHost:()=>hq,createWatchProgram:()=>Ibe,createWatchStatusReporter:()=>aae,createWriteFileMeasuringIO:()=>RV,declarationNameToString:()=>eo,decodeMappings:()=>oV,decodedTextSpanIntersectsWith:()=>dP,decorateHelper:()=>aF,deduplicate:()=>VS,defaultIncludeSpec:()=>mO,defaultInitCompilerOptions:()=>pO,defaultMaximumTruncationLength:()=>B8,detectSortCaseSensitivity:()=>S7,diagnosticCategoryName:()=>K2,diagnosticToString:()=>$b,directoryProbablyExists:()=>td,directorySeparator:()=>Co,displayPart:()=>b_,displayPartsToString:()=>GA,disposeEmitNodes:()=>xW,disposeResourcesHelper:()=>IF,documentSpansEqual:()=>eL,dumpTracingLegend:()=>fK,elementAt:()=>Ah,elideNodes:()=>Rne,emitComments:()=>Cte,emitDetachedComments:()=>Ete,emitFiles:()=>$O,emitFilesAndReportErrors:()=>y9,emitFilesAndReportErrorsAndGetExitStatus:()=>lae,emitModuleKindIsNonNodeESM:()=>P5,emitNewLineBeforeLeadingCommentOfPosition:()=>kte,emitNewLineBeforeLeadingComments:()=>Tte,emitNewLineBeforeLeadingCommentsOfPosition:()=>xte,emitSkippedWithNoDiagnostics:()=>_9,emitUsingBuildInfo:()=>Pse,emptyArray:()=>ze,emptyFileSystemEntries:()=>eF,emptyMap:()=>F7,emptyOptions:()=>jf,emptySet:()=>rK,endsWith:()=>fc,ensurePathIsNonModuleName:()=>dv,ensureScriptKind:()=>j5,ensureTrailingDirectorySeparator:()=>Sl,entityNameToString:()=>D_,enumerateInsertsAndDeletes:()=>N7,equalOwnProperties:()=>WZ,equateStringsCaseInsensitive:()=>XS,equateStringsCaseSensitive:()=>QS,equateValues:()=>w0,esDecorateHelper:()=>lF,escapeJsxAttributeString:()=>mz,escapeLeadingUnderscores:()=>zo,escapeNonAsciiString:()=>g8,escapeSnippetText:()=>zv,escapeString:()=>n1,every:()=>qi,expandPreOrPostfixIncrementOrDecrementExpression:()=>QF,explainFiles:()=>fq,explainIfFileIsRedirectAndImpliedFormat:()=>pq,exportAssignmentIsAlias:()=>zk,exportStarHelper:()=>DF,expressionResultIsUnused:()=>hre,extend:()=>k7,extendsHelper:()=>hF,extensionFromPath:()=>ST,extensionIsTS:()=>z5,extensionsNotSupportingExtensionlessResolution:()=>U8,externalHelpersModuleNameText:()=>X0,factory:()=>I,fileExtensionIs:()=>Ho,fileExtensionIsOneOf:()=>Jc,fileIncludeReasonToDiagnostics:()=>gq,fileShouldUseJavaScriptRequire:()=>qH,filter:()=>wn,filterMutate:()=>lj,filterSemanticDiagnostics:()=>a9,find:()=>kn,findAncestor:()=>Ar,findBestPatternMatch:()=>Ej,findChildOfKind:()=>Ua,findComputedPropertyNameCacheAssignment:()=>nO,findConfigFile:()=>Nse,findContainingList:()=>j9,findDiagnosticForNode:()=>woe,findFirstNonJsxWhitespaceToken:()=>Xae,findIndex:()=>Dc,findLast:()=>US,findLastIndex:()=>b7,findListItemInfo:()=>$ae,findMap:()=>ohe,findModifier:()=>GC,findNextToken:()=>i2,findPackageJson:()=>Doe,findPackageJsons:()=>RH,findPrecedingMatchingToken:()=>V9,findPrecedingToken:()=>Kc,findSuperStatementIndexPath:()=>BO,findTokenOnLeftOfPosition:()=>z9,findUseStrictPrologue:()=>eU,first:()=>ba,firstDefined:()=>ic,firstDefinedIterator:()=>JD,firstIterator:()=>hj,firstOrOnly:()=>WH,firstOrUndefined:()=>bl,firstOrUndefinedIterator:()=>T7,fixupCompilerOptions:()=>pG,flatMap:()=>ta,flatMapIterator:()=>uj,flatMapToMutable:()=>l4,flatten:()=>Np,flattenCommaList:()=>Jne,flattenDestructuringAssignment:()=>jb,flattenDestructuringBinding:()=>e2,flattenDiagnosticMessageText:()=>Bd,forEach:()=>Zt,forEachAncestor:()=>Tee,forEachAncestorDirectory:()=>kd,forEachChild:()=>ds,forEachChildRecursively:()=>QE,forEachEmittedFile:()=>DV,forEachEnclosingBlockScopeContainer:()=>Lee,forEachEntry:()=>zl,forEachExternalModuleToImportFrom:()=>ZH,forEachImportClauseDeclaration:()=>n5,forEachKey:()=>ng,forEachLeadingCommentRange:()=>lP,forEachNameInAccessChainWalkingLeft:()=>$te,forEachPropertyAssignment:()=>Ik,forEachResolvedProjectReference:()=>VV,forEachReturnStatement:()=>Ev,forEachRight:()=>IZ,forEachTrailingCommentRange:()=>uP,forEachTsConfigPropArray:()=>WP,forEachUnique:()=>CH,forEachYieldExpression:()=>zee,forSomeAncestorDirectory:()=>rye,formatColorAndReset:()=>r2,formatDiagnostic:()=>BV,formatDiagnostics:()=>tbe,formatDiagnosticsWithColorAndContext:()=>Ose,formatGeneratedName:()=>g1,formatGeneratedNamePart:()=>kC,formatLocation:()=>JV,formatMessage:()=>Lz,formatStringFromArgs:()=>lg,formatting:()=>ol,fullTripleSlashAMDReferencePathRegEx:()=>iW,fullTripleSlashReferencePathRegEx:()=>nW,generateDjb2Hash:()=>v4,generateTSConfig:()=>rve,generatorHelper:()=>kF,getAdjustedReferenceLocation:()=>cH,getAdjustedRenameLocation:()=>J9,getAliasDeclarationFromName:()=>iz,getAllAccessorDeclarations:()=>vb,getAllDecoratorsOfClass:()=>fV,getAllDecoratorsOfClassElement:()=>zO,getAllJSDocTags:()=>nJ,getAllJSDocTagsOfKind:()=>m0e,getAllKeys:()=>lhe,getAllProjectOutputs:()=>GO,getAllSuperTypeNodes:()=>Q4,getAllUnscopedEmitHelpers:()=>PW,getAllowJSCompilerOption:()=>s1,getAllowSyntheticDefaultImports:()=>vT,getAncestor:()=>r1,getAnyExtensionFromPath:()=>S4,getAreDeclarationMapsEnabled:()=>A5,getAssignedExpandoInitializer:()=>aT,getAssignedName:()=>ZB,getAssignedNameOfIdentifier:()=>u3,getAssignmentDeclarationKind:()=>ac,getAssignmentDeclarationPropertyAccessKind:()=>e8,getAssignmentTargetKind:()=>uT,getAutomaticTypeDirectiveNames:()=>yO,getBaseFileName:()=>Pc,getBinaryOperatorPrecedence:()=>m8,getBuildInfo:()=>XO,getBuildInfoFileVersionMap:()=>nq,getBuildInfoText:()=>Dse,getBuildOrderFromAnyBuildOrder:()=>x9,getBuilderCreationParameters:()=>f9,getBuilderFileEmit:()=>ty,getCheckFlags:()=>Ko,getClassExtendsHeritageElement:()=>Nv,getClassLikeDeclarationOfSymbol:()=>Qg,getCombinedLocalAndExportSymbolFlags:()=>fE,getCombinedModifierFlags:()=>gv,getCombinedNodeFlags:()=>Fh,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>QB,getCommentRange:()=>Fd,getCommonSourceDirectory:()=>g3,getCommonSourceDirectoryOfConfig:()=>h3,getCompilerOptionValue:()=>I5,getCompilerOptionsDiffValue:()=>eve,getConditions:()=>Xv,getConfigFileParsingDiagnostics:()=>Jb,getConstantValue:()=>jre,getContainerFlags:()=>$U,getContainerNode:()=>Ub,getContainingClass:()=>wl,getContainingClassExcludingClassDecorators:()=>UI,getContainingClassStaticBlock:()=>Qee,getContainingFunction:()=>uf,getContainingFunctionDeclaration:()=>Xee,getContainingFunctionOrClassStaticBlock:()=>WI,getContainingNodeArray:()=>yre,getContainingObjectLiteralElement:()=>$A,getContextualTypeFromParent:()=>sL,getContextualTypeFromParentOrAncestorTypeNode:()=>B9,getCurrentTime:()=>nA,getDeclarationDiagnostics:()=>kse,getDeclarationEmitExtensionForPath:()=>v8,getDeclarationEmitOutputFilePath:()=>hte,getDeclarationEmitOutputFilePathWorker:()=>f5,getDeclarationFromName:()=>X4,getDeclarationModifierFlagsFromSymbol:()=>Mf,getDeclarationOfKind:()=>Wo,getDeclarationsOfKind:()=>vee,getDeclaredExpandoInitializer:()=>QP,getDecorators:()=>O0,getDefaultCompilerOptions:()=>GL,getDefaultExportInfoWorker:()=>TL,getDefaultFormatCodeSettings:()=>A9,getDefaultLibFileName:()=>fP,getDefaultLibFilePath:()=>Kce,getDefaultLikeExportInfo:()=>SL,getDiagnosticText:()=>V1e,getDiagnosticsWithinSpan:()=>Aoe,getDirectoryPath:()=>qn,getDirectoryToWatchFailedLookupLocation:()=>cq,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>nae,getDocumentPositionMapper:()=>oG,getESModuleInterop:()=>xm,getEditsForFileRename:()=>Boe,getEffectiveBaseTypeNode:()=>Pd,getEffectiveConstraintOfTypeParameter:()=>gk,getEffectiveContainerForJSDocTemplateTag:()=>i5,getEffectiveImplementsTypeNodes:()=>Wk,getEffectiveInitializer:()=>XP,getEffectiveJSDocHost:()=>mb,getEffectiveModifierFlags:()=>Fu,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>Ate,getEffectiveModifierFlagsNoCache:()=>Nte,getEffectiveReturnTypeNode:()=>up,getEffectiveSetAccessorTypeAnnotationNode:()=>Ste,getEffectiveTypeAnnotationNode:()=>Wl,getEffectiveTypeParameterDeclarations:()=>L0,getEffectiveTypeRoots:()=>r3,getElementOrPropertyAccessArgumentExpressionOrName:()=>r5,getElementOrPropertyAccessName:()=>Gg,getElementsOfBindingOrAssignmentPattern:()=>xC,getEmitDeclarations:()=>Rf,getEmitFlags:()=>da,getEmitHelpers:()=>sF,getEmitModuleDetectionKind:()=>tre,getEmitModuleKind:()=>Ul,getEmitModuleResolutionKind:()=>Vl,getEmitScriptTarget:()=>Da,getEmitStandardClassFields:()=>ire,getEnclosingBlockScopeContainer:()=>bm,getEnclosingContainer:()=>jJ,getEncodedSemanticClassifications:()=>tG,getEncodedSyntacticClassifications:()=>rG,getEndLinePosition:()=>OP,getEntityNameFromTypeNode:()=>qP,getEntrypointsFromPackageJsonInfo:()=>zU,getErrorCountForSummary:()=>g9,getErrorSpanForNode:()=>kv,getErrorSummaryText:()=>oae,getEscapedTextOfIdentifierOrLiteral:()=>K4,getEscapedTextOfJsxAttributeName:()=>DE,getEscapedTextOfJsxNamespacedName:()=>TT,getExpandoInitializer:()=>e1,getExportAssignmentExpression:()=>sz,getExportInfoMap:()=>NA,getExportNeedsImportStarHelper:()=>Uie,getExpressionAssociativity:()=>_z,getExpressionPrecedence:()=>tE,getExternalHelpersModuleName:()=>fw,getExternalModuleImportEqualsDeclarationExpression:()=>q4,getExternalModuleName:()=>Rk,getExternalModuleNameFromDeclaration:()=>mte,getExternalModuleNameFromPath:()=>hz,getExternalModuleNameLiteral:()=>zT,getExternalModuleRequireArgument:()=>HJ,getFallbackOptions:()=>Qw,getFileEmitOutput:()=>zse,getFileMatcherPatterns:()=>R5,getFileNamesFromConfigSpecs:()=>KE,getFileWatcherEventKind:()=>MB,getFilesInErrorForSummary:()=>h9,getFirstConstructorWithBody:()=>cg,getFirstIdentifier:()=>$_,getFirstNonSpaceCharacterPosition:()=>Soe,getFirstProjectOutput:()=>PV,getFixableErrorSpanExpression:()=>JH,getFormatCodeSettingsForWriting:()=>hL,getFullWidth:()=>IP,getFunctionFlags:()=>pl,getHeritageClause:()=>_8,getHostSignatureFromJSDoc:()=>t1,getIdentifierAutoGenerate:()=>Jye,getIdentifierGeneratedImportReference:()=>Vre,getIdentifierTypeArguments:()=>kb,getImmediatelyInvokedFunctionExpression:()=>_b,getImpliedNodeFormatForFile:()=>Kw,getImpliedNodeFormatForFileWorker:()=>GV,getImportNeedsImportDefaultHelper:()=>lV,getImportNeedsImportStarHelper:()=>RO,getIndentSize:()=>Gk,getIndentString:()=>u5,getInferredLibraryNameResolveFrom:()=>i9,getInitializedVariables:()=>_E,getInitializerOfBinaryExpression:()=>YJ,getInitializerOfBindingOrAssignmentElement:()=>dw,getInterfaceBaseTypeNodes:()=>Y4,getInternalEmitFlags:()=>Op,getInvokedExpression:()=>HI,getIsolatedModules:()=>nd,getJSDocAugmentsTag:()=>zK,getJSDocClassTag:()=>KB,getJSDocCommentRanges:()=>zJ,getJSDocCommentsAndTags:()=>KJ,getJSDocDeprecatedTag:()=>eJ,getJSDocDeprecatedTagNoCache:()=>$K,getJSDocEnumTag:()=>tJ,getJSDocHost:()=>lT,getJSDocImplementsTags:()=>WK,getJSDocOverrideTagNoCache:()=>GK,getJSDocParameterTags:()=>mk,getJSDocParameterTagsNoCache:()=>RK,getJSDocPrivateTag:()=>u0e,getJSDocPrivateTagNoCache:()=>VK,getJSDocProtectedTag:()=>_0e,getJSDocProtectedTagNoCache:()=>qK,getJSDocPublicTag:()=>l0e,getJSDocPublicTagNoCache:()=>UK,getJSDocReadonlyTag:()=>f0e,getJSDocReadonlyTagNoCache:()=>HK,getJSDocReturnTag:()=>XK,getJSDocReturnType:()=>hP,getJSDocRoot:()=>$4,getJSDocSatisfiesExpressionType:()=>eW,getJSDocSatisfiesTag:()=>rJ,getJSDocTags:()=>Zy,getJSDocTagsNoCache:()=>d0e,getJSDocTemplateTag:()=>p0e,getJSDocThisTag:()=>lI,getJSDocType:()=>Yy,getJSDocTypeAliasName:()=>nU,getJSDocTypeAssertionType:()=>ZF,getJSDocTypeParameterDeclarations:()=>g5,getJSDocTypeParameterTags:()=>jK,getJSDocTypeParameterTagsNoCache:()=>BK,getJSDocTypeTag:()=>Qy,getJSXImplicitImportBase:()=>O5,getJSXRuntimeImport:()=>L5,getJSXTransformEnabled:()=>F5,getKeyForCompilerOptions:()=>RU,getLanguageVariant:()=>D8,getLastChild:()=>Fz,getLeadingCommentRanges:()=>Km,getLeadingCommentRangesOfNode:()=>JJ,getLeftmostAccessExpression:()=>dE,getLeftmostExpression:()=>Yk,getLibraryNameFromLibFileName:()=>qV,getLineAndCharacterOfPosition:()=>qa,getLineInfo:()=>sV,getLineOfLocalPosition:()=>nE,getLineOfLocalPositionFromLineMap:()=>hb,getLineStartPositionForPosition:()=>hp,getLineStarts:()=>Wg,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>Ute,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>Wte,getLinesBetweenPositions:()=>k4,getLinesBetweenRangeEndAndRangeStart:()=>Az,getLinesBetweenRangeEndPositions:()=>eye,getLiteralText:()=>Pee,getLocalNameForExternalImport:()=>TC,getLocalSymbolForExportDefault:()=>Xk,getLocaleSpecificMessage:()=>ls,getLocaleTimeString:()=>rA,getMappedContextSpan:()=>EH,getMappedDocumentSpan:()=>tL,getMappedLocation:()=>P3,getMatchedFileSpec:()=>dq,getMatchedIncludeSpec:()=>mq,getMeaningFromDeclaration:()=>oA,getMeaningFromLocation:()=>Wb,getMembersOfDeclaration:()=>Wee,getModeForFileReference:()=>t9,getModeForResolutionAtIndex:()=>zV,getModeForUsageLocation:()=>ld,getModifiedTime:()=>YS,getModifiers:()=>hv,getModuleInstanceState:()=>rh,getModuleNameStringLiteralAt:()=>c9,getModuleSpecifierEndingPreference:()=>Vz,getModuleSpecifierResolverHost:()=>SH,getNameForExportedSymbol:()=>dL,getNameFromIndexInfo:()=>Mee,getNameFromPropertyName:()=>bA,getNameOfAccessExpression:()=>Hte,getNameOfCompilerOptionValue:()=>SU,getNameOfDeclaration:()=>as,getNameOfExpando:()=>XJ,getNameOfJSDocTypedef:()=>MK,getNameOrArgument:()=>KP,getNameTable:()=>GG,getNamesForExportedSymbol:()=>Noe,getNamespaceDeclarationNode:()=>jk,getNewLineCharacter:()=>zh,getNewLineKind:()=>AA,getNewLineOrDefaultFromHost:()=>Zh,getNewTargetContainer:()=>Zee,getNextJSDocCommentLocation:()=>ez,getNodeForGeneratedName:()=>gw,getNodeId:()=>Oa,getNodeKind:()=>n2,getNodeModifiers:()=>C3,getNodeModulePathParts:()=>H5,getNonAssignedNameOfDeclaration:()=>cI,getNonAssignmentOperatorForCompoundAssignment:()=>o3,getNonAugmentationDeclaration:()=>IJ,getNonDecoratorTokenPosOfNode:()=>DJ,getNormalizedAbsolutePath:()=>is,getNormalizedAbsolutePathWithoutRoot:()=>WB,getNormalizedPathComponents:()=>rP,getObjectFlags:()=>Pn,getOperator:()=>pz,getOperatorAssociativity:()=>fz,getOperatorPrecedence:()=>d8,getOptionFromName:()=>gU,getOptionsForLibraryResolution:()=>BU,getOptionsNameMap:()=>EC,getOrCreateEmitNode:()=>nu,getOrCreateExternalHelpersModuleNameIfNeeded:()=>Pne,getOrUpdate:()=>u4,getOriginalNode:()=>Zo,getOriginalNodeId:()=>iu,getOriginalSourceFile:()=>V0e,getOutputDeclarationFileName:()=>m3,getOutputExtension:()=>HO,getOutputFileNames:()=>Z2e,getOutputPathsFor:()=>d3,getOutputPathsForBundle:()=>p3,getOwnEmitOutputFilePath:()=>gte,getOwnKeys:()=>Jg,getOwnValues:()=>GS,getPackageJsonInfo:()=>Qv,getPackageJsonTypesVersionsPaths:()=>hO,getPackageJsonsVisibleToFile:()=>Poe,getPackageNameFromTypesPackageName:()=>i3,getPackageScopeForPath:()=>Mw,getParameterSymbolFromJSDoc:()=>o8,getParameterTypeNode:()=>pye,getParentNodeInSpan:()=>TA,getParseTreeNode:()=>ss,getParsedCommandLineOfConfigFile:()=>Sw,getPathComponents:()=>fl,getPathComponentsRelativeTo:()=>VB,getPathFromPathComponents:()=>N0,getPathUpdater:()=>sG,getPathsBasePath:()=>p5,getPatternFromSpec:()=>Wz,getPendingEmitKind:()=>BC,getPositionOfLineAndCharacter:()=>oP,getPossibleGenericSignatures:()=>uH,getPossibleOriginalInputExtensionForExtension:()=>yte,getPossibleTypeArgumentsInfo:()=>_H,getPreEmitDiagnostics:()=>ebe,getPrecedingNonSpaceCharacterPosition:()=>nL,getPrivateIdentifier:()=>pV,getProperties:()=>_V,getProperty:()=>x7,getPropertyArrayElementValue:()=>$ee,getPropertyAssignmentAliasLikeExpression:()=>_te,getPropertyNameForPropertyNameNode:()=>gb,getPropertyNameForUniqueESSymbol:()=>W0e,getPropertyNameFromType:()=>dp,getPropertyNameOfBindingOrAssignmentElement:()=>rU,getPropertySymbolFromBindingElement:()=>K9,getPropertySymbolsFromContextualType:()=>XL,getQuoteFromPreference:()=>xH,getQuotePreference:()=>vf,getRangesWhere:()=>pj,getRefactorContextSpan:()=>tx,getReferencedFileLocation:()=>y3,getRegexFromPattern:()=>G0,getRegularExpressionForWildcard:()=>gE,getRegularExpressionsForWildcards:()=>M5,getRelativePathFromDirectory:()=>mm,getRelativePathFromFile:()=>iP,getRelativePathToDirectoryOrUrl:()=>KS,getRenameLocation:()=>CA,getReplacementSpanForContextToken:()=>mH,getResolutionDiagnostic:()=>QV,getResolutionModeOverride:()=>LC,getResolveJsonModule:()=>Rv,getResolvePackageJsonExports:()=>Rz,getResolvePackageJsonImports:()=>oye,getResolvedExternalModuleName:()=>_5,getRestIndicatorOfBindingOrAssignmentElement:()=>eO,getRestParameterElementType:()=>WJ,getRightMostAssignedExpression:()=>YP,getRootDeclaration:()=>Tm,getRootDirectoryOfResolutionCache:()=>iae,getRootLength:()=>pm,getRootPathSplitLength:()=>kbe,getScriptKind:()=>NH,getScriptKindFromFileName:()=>B5,getScriptTargetFeatures:()=>Y5,getSelectedEffectiveModifierFlags:()=>dT,getSelectedSyntacticModifierFlags:()=>Pte,getSemanticClassifications:()=>Loe,getSemanticJsxChildren:()=>Vk,getSetAccessorTypeAnnotationNode:()=>vte,getSetAccessorValueParameter:()=>iE,getSetExternalModuleIndicator:()=>P8,getShebang:()=>sI,getSingleInitializerOfVariableStatementOrPropertyDeclaration:()=>ZJ,getSingleVariableOfVariableStatement:()=>Jk,getSnapshotText:()=>HC,getSnippetElement:()=>kW,getSourceFileOfModule:()=>PI,getSourceFileOfNode:()=>Or,getSourceFilePathInNewDir:()=>d5,getSourceFilePathInNewDirWorker:()=>m5,getSourceFileVersionAsHashFromText:()=>v9,getSourceFilesToEmit:()=>yz,getSourceMapRange:()=>c1,getSourceMapper:()=>Yoe,getSourceTextOfNodeFromSourceFile:()=>Tv,getSpanOfTokenAtPosition:()=>Sm,getSpellingSuggestion:()=>m4,getStartPositionOfLine:()=>W0,getStartPositionOfRange:()=>uE,getStartsOnNewLine:()=>AE,getStaticPropertiesAndClassStaticBlock:()=>JO,getStrictOptionValue:()=>fp,getStringComparer:()=>d4,getSuperCallFromStatement:()=>jO,getSuperContainer:()=>UP,getSupportedCodeFixes:()=>qG,getSupportedExtensions:()=>hE,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>N8,getSwitchedType:()=>LH,getSymbolId:()=>Xs,getSymbolNameForPrivateIdentifier:()=>f8,getSymbolTarget:()=>voe,getSyntacticClassifications:()=>Moe,getSyntacticModifierFlags:()=>q0,getSyntacticModifierFlagsNoCache:()=>Tz,getSynthesizedDeepClone:()=>wo,getSynthesizedDeepCloneWithReplacements:()=>kA,getSynthesizedDeepClones:()=>s2,getSynthesizedDeepClonesWithReplacements:()=>IH,getSyntheticLeadingComments:()=>sC,getSyntheticTrailingComments:()=>X8,getTargetLabel:()=>O9,getTargetOfBindingOrAssignmentElement:()=>ey,getTemporaryModuleResolutionState:()=>Lw,getTextOfConstantValue:()=>wee,getTextOfIdentifierOrLiteral:()=>cp,getTextOfJSDocComment:()=>vP,getTextOfJsxAttributeName:()=>j8,getTextOfJsxNamespacedName:()=>PE,getTextOfNode:()=>Wc,getTextOfNodeFromSourceText:()=>j4,getTextOfPropertyName:()=>Dk,getThisContainer:()=>i_,getThisParameter:()=>Fv,getTokenAtPosition:()=>Ji,getTokenPosOfNode:()=>cb,getTokenSourceMapRange:()=>jye,getTouchingPropertyName:()=>c_,getTouchingToken:()=>k3,getTrailingCommentRanges:()=>Hy,getTrailingSemicolonDeferringWriter:()=>gz,getTransformFlagsSubtreeExclusions:()=>Fre,getTransformers:()=>CV,getTsBuildInfoEmitOutputFilePath:()=>$h,getTsConfigObjectLiteralExpression:()=>W4,getTsConfigPropArrayElementValue:()=>zI,getTypeAnnotationNode:()=>bte,getTypeArgumentOrTypeParameterList:()=>noe,getTypeKeywordOfTypeOnlyImport:()=>kH,getTypeNode:()=>Wre,getTypeNodeIfAccessible:()=>F3,getTypeParameterFromJsDoc:()=>ste,getTypeParameterOwner:()=>i0e,getTypesPackageName:()=>kO,getUILocale:()=>$Z,getUniqueName:()=>Gb,getUniqueSymbolId:()=>boe,getUseDefineForClassFields:()=>A8,getWatchErrorSummaryDiagnosticMessage:()=>uq,getWatchFactory:()=>FV,group:()=>p4,groupBy:()=>VZ,guessIndentation:()=>hee,handleNoEmitOptions:()=>$V,hasAbstractModifier:()=>Mv,hasAccessorModifier:()=>Ad,hasAmbientModifier:()=>Sz,hasChangesInResolutions:()=>kJ,hasChildOfKind:()=>dA,hasContextSensitiveParameters:()=>V5,hasDecorators:()=>Of,hasDocComment:()=>toe,hasDynamicName:()=>V0,hasEffectiveModifier:()=>w_,hasEffectiveModifiers:()=>h5,hasEffectiveReadonlyModifier:()=>sE,hasExtension:()=>ZS,hasIndexSignature:()=>OH,hasInitializer:()=>J0,hasInvalidEscape:()=>dz,hasJSDocNodes:()=>q_,hasJSDocParameterTags:()=>JK,hasJSFileExtension:()=>jv,hasJsonModuleEmitEnabled:()=>w5,hasOnlyExpressionInitializer:()=>ab,hasOverrideModifier:()=>y5,hasPossibleExternalModuleReference:()=>Oee,hasProperty:()=>Ya,hasPropertyAccessExpressionWithName:()=>lA,hasQuestionToken:()=>cT,hasRecordedExternalHelpers:()=>Dne,hasResolutionModeOverride:()=>xre,hasRestParameter:()=>bJ,hasScopeMarker:()=>lee,hasStaticModifier:()=>Uc,hasSyntacticModifier:()=>In,hasSyntacticModifiers:()=>Dte,hasTSFileExtension:()=>Tb,hasTabstop:()=>bre,hasTrailingDirectorySeparator:()=>Nh,hasType:()=>xI,hasTypeArguments:()=>R0e,hasZeroOrOneAsteriskCharacter:()=>jz,helperString:()=>DW,hostGetCanonicalFileName:()=>jh,hostUsesCaseSensitiveFileNames:()=>y8,idText:()=>an,identifierIsThisKeyword:()=>bz,identifierToKeywordKind:()=>Xy,identity:()=>To,identitySourceMapConsumer:()=>MO,ignoreSourceNewlines:()=>EW,ignoredPaths:()=>tP,importDefaultHelper:()=>EF,importFromModuleSpecifier:()=>G4,importNameElisionDisabled:()=>Mz,importStarHelper:()=>Y8,indexOfAnyCharCode:()=>FZ,indexOfNode:()=>Ek,indicesOf:()=>WD,inferredTypesContainingFile:()=>jC,injectClassNamedEvaluationHelperBlockIfMissing:()=>UO,injectClassThisAssignmentIfMissing:()=>Zie,insertImports:()=>D3,insertLeadingStatement:()=>i1e,insertSorted:()=>P0,insertStatementAfterCustomPrologue:()=>ob,insertStatementAfterStandardPrologue:()=>D0e,insertStatementsAfterCustomPrologue:()=>CJ,insertStatementsAfterStandardPrologue:()=>vm,intersperse:()=>cj,intrinsicTagNameToString:()=>tW,introducesArgumentsExoticObject:()=>Hee,inverseJsxOptionMap:()=>e3,isAbstractConstructorSymbol:()=>Vte,isAbstractModifier:()=>Kre,isAccessExpression:()=>co,isAccessibilityModifier:()=>pH,isAccessor:()=>R0,isAccessorModifier:()=>tne,isAliasSymbolDeclaration:()=>B0e,isAliasableExpression:()=>u8,isAmbientModule:()=>ru,isAmbientPropertyDeclaration:()=>OJ,isAnonymousFunctionDefinition:()=>eE,isAnyDirectorySeparator:()=>BB,isAnyImportOrBareOrAccessedRequire:()=>Fee,isAnyImportOrReExport:()=>MP,isAnyImportSyntax:()=>lb,isAnySupportedFileExtension:()=>fye,isApplicableVersionedTypesKey:()=>jw,isArgumentExpressionOfElementAccess:()=>rH,isArray:()=>es,isArrayBindingElement:()=>hI,isArrayBindingOrAssignmentElement:()=>EP,isArrayBindingOrAssignmentPattern:()=>dJ,isArrayBindingPattern:()=>Eb,isArrayLiteralExpression:()=>Lu,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>Qh,isArrayTypeNode:()=>jF,isArrowFunction:()=>go,isAsExpression:()=>nw,isAssertClause:()=>lne,isAssertEntry:()=>Qye,isAssertionExpression:()=>sb,isAssertsKeyword:()=>Yre,isAssignmentDeclaration:()=>H4,isAssignmentExpression:()=>sl,isAssignmentOperator:()=>Bh,isAssignmentPattern:()=>L4,isAssignmentTarget:()=>og,isAsteriskToken:()=>ew,isAsyncFunction:()=>Z4,isAsyncModifier:()=>FE,isAutoAccessorPropertyDeclaration:()=>n_,isAwaitExpression:()=>Z0,isAwaitKeyword:()=>OW,isBigIntLiteral:()=>FF,isBinaryExpression:()=>Gr,isBinaryOperatorToken:()=>Mne,isBindableObjectDefinePropertyCall:()=>pb,isBindableStaticAccessExpression:()=>wv,isBindableStaticElementAccessExpression:()=>t5,isBindableStaticNameExpression:()=>db,isBindingElement:()=>Pa,isBindingElementOfBareOrAccessedRequire:()=>tte,isBindingName:()=>nb,isBindingOrAssignmentElement:()=>nee,isBindingOrAssignmentPattern:()=>kP,isBindingPattern:()=>As,isBlock:()=>Ss,isBlockOrCatchScoped:()=>PJ,isBlockScope:()=>LJ,isBlockScopedContainerTopLevel:()=>Iee,isBooleanLiteral:()=>O4,isBreakOrContinueStatement:()=>N4,isBreakStatement:()=>Gye,isBuildInfoFile:()=>Ese,isBuilderProgram:()=>cae,isBundle:()=>zW,isBundleFileTextLike:()=>Gte,isCallChain:()=>tb,isCallExpression:()=>Rs,isCallExpressionTarget:()=>Qq,isCallLikeExpression:()=>Sv,isCallLikeOrFunctionLikeExpression:()=>mJ,isCallOrNewExpression:()=>gm,isCallOrNewExpressionTarget:()=>Yq,isCallSignatureDeclaration:()=>cC,isCallToHelper:()=>IE,isCaseBlock:()=>WE,isCaseClause:()=>mC,isCaseKeyword:()=>rne,isCaseOrDefaultClause:()=>SI,isCatchClause:()=>Gv,isCatchClauseVariableDeclaration:()=>vre,isCatchClauseVariableDeclarationOrBindingElement:()=>wJ,isCheckJsEnabledForFile:()=>O8,isChildOfNodeWithKind:()=>P0e,isCircularBuildOrder:()=>YT,isClassDeclaration:()=>Vc,isClassElement:()=>Pl,isClassExpression:()=>Nl,isClassInstanceProperty:()=>eee,isClassLike:()=>Qn,isClassMemberModifier:()=>_J,isClassNamedEvaluationHelperBlock:()=>QT,isClassOrTypeElement:()=>gI,isClassStaticBlockDeclaration:()=>Go,isClassThisAssignmentBlock:()=>l3,isCollapsedRange:()=>K0e,isColonToken:()=>Xre,isCommaExpression:()=>_w,isCommaListExpression:()=>JE,isCommaSequence:()=>HE,isCommaToken:()=>$re,isComment:()=>q9,isCommonJsExportPropertyAssignment:()=>BI,isCommonJsExportedExpression:()=>Vee,isCompoundAssignment:()=>a3,isComputedNonLiteralName:()=>RP,isComputedPropertyName:()=>xa,isConciseBody:()=>vI,isConditionalExpression:()=>dC,isConditionalTypeNode:()=>fC,isConstTypeReference:()=>Vg,isConstructSignatureDeclaration:()=>rw,isConstructorDeclaration:()=>gc,isConstructorTypeNode:()=>ME,isContextualKeyword:()=>a5,isContinueStatement:()=>Hye,isCustomPrologue:()=>zP,isDebuggerStatement:()=>$ye,isDeclaration:()=>hu,isDeclarationBindingElement:()=>xP,isDeclarationFileName:()=>Il,isDeclarationName:()=>$g,isDeclarationNameOfEnumOrNamespace:()=>Nz,isDeclarationReadonly:()=>LI,isDeclarationStatement:()=>pee,isDeclarationWithTypeParameterChildren:()=>RJ,isDeclarationWithTypeParameters:()=>MJ,isDecorator:()=>ql,isDecoratorTarget:()=>Wae,isDefaultClause:()=>ow,isDefaultImport:()=>oT,isDefaultModifier:()=>MF,isDefaultedExpandoInitializer:()=>rte,isDeleteExpression:()=>sne,isDeleteTarget:()=>nz,isDeprecatedDeclaration:()=>mL,isDestructuringAssignment:()=>Jh,isDiagnosticWithLocation:()=>BH,isDiskPathRoot:()=>JB,isDoStatement:()=>Vye,isDocumentRegistryEntry:()=>IA,isDotDotDotToken:()=>OF,isDottedName:()=>oE,isDynamicName:()=>l5,isESSymbolIdentifier:()=>U0e,isEffectiveExternalModule:()=>sT,isEffectiveModuleDeclaration:()=>Nee,isEffectiveStrictModeSourceFile:()=>FJ,isElementAccessChain:()=>iJ,isElementAccessExpression:()=>mo,isEmittedFileOfProgram:()=>Ase,isEmptyArrayLiteral:()=>Lte,isEmptyBindingElement:()=>OK,isEmptyBindingPattern:()=>FK,isEmptyObjectLiteral:()=>Dz,isEmptyStatement:()=>jW,isEmptyStringLiteral:()=>qJ,isEntityName:()=>V_,isEntityNameExpression:()=>oc,isEnumConst:()=>Cv,isEnumDeclaration:()=>p1,isEnumMember:()=>$v,isEqualityOperatorKind:()=>aL,isEqualsGreaterThanToken:()=>Qre,isExclamationToken:()=>tw,isExcludedFile:()=>Qne,isExclusivelyTypeOnlyImportOrExport:()=>WV,isExpandoPropertyDeclaration:()=>$5,isExportAssignment:()=>cc,isExportDeclaration:()=>qc,isExportModifier:()=>wT,isExportName:()=>YF,isExportNamespaceAsDefaultDeclaration:()=>NI,isExportOrDefaultModifier:()=>mw,isExportSpecifier:()=>vu,isExportsIdentifier:()=>fb,isExportsOrModuleExportsOrAlias:()=>Yv,isExpression:()=>ct,isExpressionNode:()=>sg,isExpressionOfExternalModuleImportEqualsDeclaration:()=>Hae,isExpressionOfOptionalChainRoot:()=>fI,isExpressionStatement:()=>kl,isExpressionWithTypeArguments:()=>qh,isExpressionWithTypeArgumentsInClassExtendsClause:()=>T8,isExternalModule:()=>Nc,isExternalModuleAugmentation:()=>xv,isExternalModuleImportEqualsDeclaration:()=>Ky,isExternalModuleIndicator:()=>DP,isExternalModuleNameRelative:()=>Tl,isExternalModuleReference:()=>Pm,isExternalModuleSymbol:()=>yA,isExternalOrCommonJsModule:()=>H_,isFileLevelReservedGeneratedIdentifier:()=>TP,isFileLevelUniqueName:()=>wI,isFileProbablyExternalModule:()=>yw,isFirstDeclarationOfSymbolParameter:()=>DH,isFixablePromiseHandler:()=>uG,isForInOrOfStatement:()=>Sk,isForInStatement:()=>UF,isForInitializer:()=>Ff,isForOfStatement:()=>iw,isForStatement:()=>wb,isFunctionBlock:()=>Dv,isFunctionBody:()=>hJ,isFunctionDeclaration:()=>Zc,isFunctionExpression:()=>ro,isFunctionExpressionOrArrowFunction:()=>Jv,isFunctionLike:()=>ks,isFunctionLikeDeclaration:()=>po,isFunctionLikeKind:()=>nT,isFunctionLikeOrClassStaticBlockDeclaration:()=>yk,isFunctionOrConstructorTypeNode:()=>ree,isFunctionOrModuleBlock:()=>fJ,isFunctionSymbol:()=>ite,isFunctionTypeNode:()=>pg,isFutureReservedKeyword:()=>J0e,isGeneratedIdentifier:()=>Eo,isGeneratedPrivateIdentifier:()=>rb,isGetAccessor:()=>B0,isGetAccessorDeclaration:()=>pf,isGetOrSetAccessorDeclaration:()=>uI,isGlobalDeclaration:()=>ISe,isGlobalScopeAugmentation:()=>Dd,isGrammarError:()=>Eee,isHeritageClause:()=>Q_,isHoistedFunction:()=>RI,isHoistedVariableStatement:()=>jI,isIdentifier:()=>Ie,isIdentifierANonContextualKeyword:()=>o5,isIdentifierName:()=>ute,isIdentifierOrThisTypeNode:()=>Ine,isIdentifierPart:()=>Gy,isIdentifierStart:()=>eg,isIdentifierText:()=>lf,isIdentifierTypePredicate:()=>Gee,isIdentifierTypeReference:()=>dre,isIfStatement:()=>Pb,isIgnoredFileFromWildCardWatching:()=>Xw,isImplicitGlob:()=>zz,isImportAttribute:()=>une,isImportAttributeName:()=>KK,isImportAttributes:()=>VF,isImportCall:()=>G_,isImportClause:()=>Em,isImportDeclaration:()=>gl,isImportEqualsDeclaration:()=>Hl,isImportKeyword:()=>LE,isImportMeta:()=>Ak,isImportOrExportSpecifier:()=>rT,isImportOrExportSpecifierName:()=>yoe,isImportSpecifier:()=>v_,isImportTypeAssertionContainer:()=>Xye,isImportTypeNode:()=>Zg,isImportableFile:()=>YH,isInComment:()=>Xh,isInCompoundLikeAssignment:()=>tz,isInExpressionContext:()=>$I,isInJSDoc:()=>GP,isInJSFile:()=>Hr,isInJSXText:()=>Kae,isInJsonFile:()=>QI,isInNonReferenceComment:()=>aoe,isInReferenceComment:()=>soe,isInRightSideOfInternalImportEqualsDeclaration:()=>I9,isInString:()=>Vb,isInTemplateString:()=>lH,isInTopLevelContext:()=>VI,isInTypeQuery:()=>yb,isIncrementalCompilation:()=>w8,isIndexSignatureDeclaration:()=>Cb,isIndexedAccessTypeNode:()=>OT,isInferTypeNode:()=>NT,isInfinityOrNaNString:()=>kE,isInitializedProperty:()=>Uw,isInitializedVariable:()=>E8,isInsideJsxElement:()=>U9,isInsideJsxElementOrAttribute:()=>Zae,isInsideNodeModules:()=>wA,isInsideTemplateLiteral:()=>gA,isInstanceOfExpression:()=>v5,isInstantiatedModule:()=>eV,isInterfaceDeclaration:()=>Mu,isInternalDeclaration:()=>xV,isInternalModuleImportEqualsDeclaration:()=>Ok,isInternalName:()=>KW,isIntersectionTypeNode:()=>_C,isIntrinsicJsxName:()=>Hk,isIterationStatement:()=>j0,isJSDoc:()=>zp,isJSDocAllType:()=>mne,isJSDocAugmentsTag:()=>yC,isJSDocAuthorTag:()=>e1e,isJSDocCallbackTag:()=>UW,isJSDocClassTag:()=>hne,isJSDocCommentContainingNode:()=>TI,isJSDocConstructSignature:()=>Bk,isJSDocDeprecatedTag:()=>$W,isJSDocEnumTag:()=>cw,isJSDocFunctionType:()=>hC,isJSDocImplementsTag:()=>XW,isJSDocIndexSignature:()=>YI,isJSDocLikeText:()=>cU,isJSDocLink:()=>pne,isJSDocLinkCode:()=>dne,isJSDocLinkLike:()=>iT,isJSDocLinkPlain:()=>Zye,isJSDocMemberName:()=>d1,isJSDocNameReference:()=>VE,isJSDocNamepathType:()=>Kye,isJSDocNamespaceBody:()=>T0e,isJSDocNode:()=>Tk,isJSDocNonNullableType:()=>qF,isJSDocNullableType:()=>gC,isJSDocOptionalParameter:()=>R8,isJSDocOptionalType:()=>WW,isJSDocOverloadTag:()=>vC,isJSDocOverrideTag:()=>GF,isJSDocParameterTag:()=>ad,isJSDocPrivateTag:()=>qW,isJSDocPropertyLikeTag:()=>bP,isJSDocPropertyTag:()=>vne,isJSDocProtectedTag:()=>HW,isJSDocPublicTag:()=>VW,isJSDocReadonlyTag:()=>GW,isJSDocReturnTag:()=>$F,isJSDocSatisfiesExpression:()=>Kz,isJSDocSatisfiesTag:()=>XF,isJSDocSeeTag:()=>t1e,isJSDocSignature:()=>m1,isJSDocTag:()=>xk,isJSDocTemplateTag:()=>od,isJSDocThisTag:()=>yne,isJSDocThrowsTag:()=>n1e,isJSDocTypeAlias:()=>op,isJSDocTypeAssertion:()=>GE,isJSDocTypeExpression:()=>Fb,isJSDocTypeLiteral:()=>JT,isJSDocTypeTag:()=>qE,isJSDocTypedefTag:()=>bC,isJSDocUnknownTag:()=>r1e,isJSDocUnknownType:()=>gne,isJSDocVariadicType:()=>HF,isJSXTagName:()=>Fk,isJsonEqual:()=>W5,isJsonSourceFile:()=>ap,isJsxAttribute:()=>Rd,isJsxAttributeLike:()=>bI,isJsxAttributeName:()=>Tre,isJsxAttributes:()=>Hv,isJsxChild:()=>AP,isJsxClosingElement:()=>Vv,isJsxClosingFragment:()=>_ne,isJsxElement:()=>dg,isJsxExpression:()=>UE,isJsxFragment:()=>qv,isJsxNamespacedName:()=>sd,isJsxOpeningElement:()=>Md,isJsxOpeningFragment:()=>jT,isJsxOpeningLikeElement:()=>qu,isJsxOpeningLikeElementTagName:()=>Uae,isJsxSelfClosingElement:()=>Nb,isJsxSpreadAttribute:()=>BT,isJsxTagNameExpression:()=>M4,isJsxText:()=>DT,isJumpStatementTarget:()=>uA,isKeyword:()=>a_,isKeywordOrPunctuation:()=>s5,isKnownSymbol:()=>p8,isLabelName:()=>eH,isLabelOfLabeledStatement:()=>Kq,isLabeledStatement:()=>Uv,isLateVisibilityPaintedStatement:()=>FI,isLeftHandSideExpression:()=>m_,isLeftHandSideOfAssignment:()=>Z0e,isLet:()=>MI,isLineBreak:()=>mu,isLiteralComputedPropertyDeclarationName:()=>l8,isLiteralExpression:()=>vv,isLiteralExpressionOfObject:()=>lJ,isLiteralImportTypeNode:()=>U0,isLiteralKind:()=>I4,isLiteralLikeAccess:()=>e5,isLiteralLikeElementAccess:()=>ZP,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>L9,isLiteralTypeLikeExpression:()=>l1e,isLiteralTypeLiteral:()=>oee,isLiteralTypeNode:()=>_1,isLocalName:()=>eh,isLogicalOperator:()=>Ite,isLogicalOrCoalescingAssignmentExpression:()=>xz,isLogicalOrCoalescingAssignmentOperator:()=>aE,isLogicalOrCoalescingBinaryExpression:()=>S8,isLogicalOrCoalescingBinaryOperator:()=>b8,isMappedTypeNode:()=>jE,isMemberName:()=>tg,isMetaProperty:()=>BE,isMethodDeclaration:()=>mc,isMethodOrAccessor:()=>vk,isMethodSignature:()=>fg,isMinusToken:()=>FW,isMissingDeclaration:()=>Yye,isModifier:()=>Ys,isModifierKind:()=>Oh,isModifierLike:()=>Do,isModuleAugmentationExternal:()=>NJ,isModuleBlock:()=>Ld,isModuleBody:()=>uee,isModuleDeclaration:()=>vc,isModuleExportsAccessExpression:()=>ag,isModuleIdentifier:()=>QJ,isModuleName:()=>Lne,isModuleOrEnumDeclaration:()=>PP,isModuleReference:()=>mee,isModuleSpecifierLike:()=>Z9,isModuleWithStringLiteralName:()=>II,isNameOfFunctionDeclaration:()=>iH,isNameOfModuleDeclaration:()=>nH,isNamedClassElement:()=>tee,isNamedDeclaration:()=>Au,isNamedEvaluation:()=>P_,isNamedEvaluationSource:()=>cz,isNamedExportBindings:()=>aJ,isNamedExports:()=>gp,isNamedImportBindings:()=>yJ,isNamedImports:()=>Kg,isNamedImportsOrExports:()=>C5,isNamedTupleMember:()=>RE,isNamespaceBody:()=>S0e,isNamespaceExport:()=>Dm,isNamespaceExportDeclaration:()=>aw,isNamespaceImport:()=>K0,isNamespaceReexportDeclaration:()=>ete,isNewExpression:()=>Wv,isNewExpressionTarget:()=>T3,isNoSubstitutionTemplateLiteral:()=>PT,isNode:()=>g0e,isNodeArray:()=>yv,isNodeArrayMultiLine:()=>zte,isNodeDescendantOf:()=>Av,isNodeKind:()=>SP,isNodeLikeSystem:()=>Pj,isNodeModulesDirectory:()=>eI,isNodeWithPossibleHoistedDeclaration:()=>ote,isNonContextualKeyword:()=>oz,isNonExportDefaultModifier:()=>_1e,isNonGlobalAmbientModule:()=>AJ,isNonGlobalDeclaration:()=>Ooe,isNonNullAccess:()=>Sre,isNonNullChain:()=>pI,isNonNullExpression:()=>MT,isNonStaticMethodOrAccessorWithPrivateName:()=>Vie,isNotEmittedOrPartiallyEmittedNode:()=>b0e,isNotEmittedStatement:()=>JW,isNullishCoalesce:()=>sJ,isNumber:()=>wh,isNumericLiteral:()=>A_,isNumericLiteralName:()=>_g,isObjectBindingElementWithoutPropertyName:()=>SA,isObjectBindingOrAssignmentElement:()=>CP,isObjectBindingOrAssignmentPattern:()=>pJ,isObjectBindingPattern:()=>jp,isObjectLiteralElement:()=>vJ,isObjectLiteralElementLike:()=>qg,isObjectLiteralExpression:()=>ma,isObjectLiteralMethod:()=>Mp,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>JI,isObjectTypeDeclaration:()=>hT,isOctalDigit:()=>iI,isOmittedExpression:()=>dl,isOptionalChain:()=>gu,isOptionalChainRoot:()=>w4,isOptionalDeclaration:()=>EE,isOptionalJSDocPropertyLikeTag:()=>M8,isOptionalTypeNode:()=>LW,isOuterExpression:()=>KF,isOutermostOptionalChain:()=>A4,isOverrideModifier:()=>ene,isPackedArrayLiteral:()=>Qz,isParameter:()=>us,isParameterDeclaration:()=>Iv,isParameterOrCatchClauseVariable:()=>Yz,isParameterPropertyDeclaration:()=>E_,isParameterPropertyModifier:()=>F4,isParenthesizedExpression:()=>y_,isParenthesizedTypeNode:()=>IT,isParseTreeNode:()=>P4,isPartOfTypeNode:()=>ig,isPartOfTypeQuery:()=>XI,isPartiallyEmittedExpression:()=>WF,isPatternMatch:()=>P7,isPinnedComment:()=>AI,isPlainJsFile:()=>FP,isPlusToken:()=>IW,isPossiblyTypeArgumentPosition:()=>mA,isPostfixUnaryExpression:()=>RW,isPrefixUnaryExpression:()=>f1,isPrivateIdentifier:()=>Ti,isPrivateIdentifierClassElementDeclaration:()=>Nu,isPrivateIdentifierPropertyAccessExpression:()=>hk,isPrivateIdentifierSymbol:()=>fte,isProgramBundleEmitBuildInfo:()=>Hse,isProgramUptoDate:()=>HV,isPrologueDirective:()=>Lp,isPropertyAccessChain:()=>_I,isPropertyAccessEntityNameExpression:()=>x8,isPropertyAccessExpression:()=>bn,isPropertyAccessOrQualifiedName:()=>see,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>iee,isPropertyAssignment:()=>Hc,isPropertyDeclaration:()=>Es,isPropertyName:()=>wc,isPropertyNameLiteral:()=>wd,isPropertySignature:()=>ff,isProtoSetter:()=>pte,isPrototypeAccess:()=>H0,isPrototypePropertyAssignment:()=>t8,isPunctuation:()=>az,isPushOrUnshiftIdentifier:()=>lz,isQualifiedName:()=>h_,isQuestionDotToken:()=>LF,isQuestionOrExclamationToken:()=>Nne,isQuestionOrPlusOrMinusToken:()=>One,isQuestionToken:()=>Y0,isRawSourceMap:()=>Jie,isReadonlyKeyword:()=>Zre,isReadonlyKeywordOrPlusOrMinusToken:()=>Fne,isRecognizedTripleSlashComment:()=>EJ,isReferenceFileLocation:()=>MC,isReferencedFile:()=>T1,isRegularExpressionLiteral:()=>AW,isRequireCall:()=>g_,isRequireVariableStatement:()=>$J,isRestParameter:()=>rg,isRestTypeNode:()=>MW,isReturnStatement:()=>Bp,isReturnStatementWithFixablePromiseHandler:()=>CL,isRightSideOfAccessExpression:()=>Ez,isRightSideOfInstanceofExpression:()=>Ote,isRightSideOfPropertyAccess:()=>VC,isRightSideOfQualifiedName:()=>qae,isRightSideOfQualifiedNameOrPropertyAccess:()=>cE,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>Fte,isRootedDiskPath:()=>C_,isSameEntityName:()=>Lk,isSatisfiesExpression:()=>ane,isScopeMarker:()=>cee,isSemicolonClassElement:()=>one,isSetAccessor:()=>Lh,isSetAccessorDeclaration:()=>N_,isShebangTrivia:()=>qB,isShiftOperatorOrHigher:()=>sU,isShorthandAmbientModuleSymbol:()=>B4,isShorthandPropertyAssignment:()=>Y_,isSignedNumericLiteral:()=>c5,isSimpleCopiableExpression:()=>Kv,isSimpleInlineableExpression:()=>jd,isSingleOrDoubleQuote:()=>$P,isSourceFile:()=>Ai,isSourceFileFromLibrary:()=>L3,isSourceFileJS:()=>Iu,isSourceFileNotJS:()=>N0e,isSourceFileNotJson:()=>GJ,isSourceMapping:()=>zie,isSpecialPropertyDeclaration:()=>nte,isSpreadAssignment:()=>Hh,isSpreadElement:()=>Od,isStatement:()=>Ci,isStatementButNotDeclaration:()=>wP,isStatementOrBlock:()=>dee,isStatementWithLocals:()=>Cee,isStatic:()=>Ls,isStaticModifier:()=>AT,isString:()=>ns,isStringAKeyword:()=>z0e,isStringANonContextualKeyword:()=>_T,isStringAndEmptyAnonymousObjectIntersection:()=>ioe,isStringDoubleQuoted:()=>KI,isStringLiteral:()=>ra,isStringLiteralLike:()=>Ja,isStringLiteralOrJsxExpression:()=>gee,isStringLiteralOrTemplate:()=>Coe,isStringOrNumericLiteralLike:()=>_f,isStringOrRegularExpressionOrTemplateLiteral:()=>fH,isStringTextContainingNode:()=>uJ,isSuperCall:()=>ub,isSuperKeyword:()=>OE,isSuperOrSuperProperty:()=>A0e,isSuperProperty:()=>s_,isSupportedSourceFileName:()=>ure,isSwitchStatement:()=>sw,isSyntaxList:()=>SC,isSyntheticExpression:()=>Uye,isSyntheticReference:()=>RT,isTagName:()=>tH,isTaggedTemplateExpression:()=>Db,isTaggedTemplateTag:()=>zae,isTemplateExpression:()=>JF,isTemplateHead:()=>oC,isTemplateLiteral:()=>bk,isTemplateLiteralKind:()=>M0,isTemplateLiteralToken:()=>YK,isTemplateLiteralTypeNode:()=>Wye,isTemplateLiteralTypeSpan:()=>nne,isTemplateMiddle:()=>Gre,isTemplateMiddleOrTemplateTail:()=>dI,isTemplateSpan:()=>zE,isTemplateTail:()=>NW,isTextWhiteSpaceLike:()=>uoe,isThis:()=>qC,isThisContainerOrFunctionBlock:()=>Yee,isThisIdentifier:()=>Lv,isThisInTypeQuery:()=>pT,isThisInitializedDeclaration:()=>qI,isThisInitializedObjectBindingExpression:()=>Kee,isThisProperty:()=>VP,isThisTypeNode:()=>BF,isThisTypeParameter:()=>CE,isThisTypePredicate:()=>w0e,isThrowStatement:()=>BW,isToken:()=>tT,isTokenKind:()=>cJ,isTraceEnabled:()=>th,isTransientSymbol:()=>ym,isTrivia:()=>Uk,isTryStatement:()=>Ab,isTupleTypeNode:()=>uC,isTypeAlias:()=>i8,isTypeAliasDeclaration:()=>Jp,isTypeAssertionExpression:()=>ine,isTypeDeclaration:()=>rC,isTypeElement:()=>ib,isTypeKeyword:()=>E3,isTypeKeywordToken:()=>yH,isTypeKeywordTokenOrIdentifier:()=>$9,isTypeLiteralNode:()=>X_,isTypeNode:()=>Si,isTypeNodeKind:()=>Oz,isTypeOfExpression:()=>pC,isTypeOnlyExportDeclaration:()=>ZK,isTypeOnlyImportDeclaration:()=>mI,isTypeOnlyImportOrExportDeclaration:()=>bv,isTypeOperatorNode:()=>FT,isTypeParameterDeclaration:()=>Uo,isTypePredicateNode:()=>RF,isTypeQueryNode:()=>lC,isTypeReferenceNode:()=>mp,isTypeReferenceType:()=>kI,isTypeUsableAsPropertyName:()=>pp,isUMDExportSymbol:()=>k5,isUnaryExpression:()=>gJ,isUnaryExpressionWithWrite:()=>aee,isUnicodeIdentifierStart:()=>rI,isUnionTypeNode:()=>u1,isUnparsedNode:()=>oJ,isUnparsedPrepend:()=>fne,isUnparsedSource:()=>Ib,isUnparsedTextLike:()=>QK,isUrl:()=>yK,isValidBigIntString:()=>U5,isValidESSymbolDeclaration:()=>qee,isValidTypeOnlyAliasUseSite:()=>o1,isValueSignatureDeclaration:()=>cte,isVarAwaitUsing:()=>BP,isVarConst:()=>wk,isVarUsing:()=>JP,isVariableDeclaration:()=>Ei,isVariableDeclarationInVariableStatement:()=>z4,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>Pv,isVariableDeclarationInitializedToRequire:()=>ZI,isVariableDeclarationList:()=>ml,isVariableLike:()=>Nk,isVariableLikeOrAccessor:()=>Uee,isVariableStatement:()=>ec,isVoidExpression:()=>LT,isWatchSet:()=>tye,isWhileStatement:()=>qye,isWhiteSpaceLike:()=>Ug,isWhiteSpaceSingleLine:()=>Cd,isWithStatement:()=>cne,isWriteAccess:()=>gT,isWriteOnlyAccess:()=>x5,isYieldExpression:()=>zF,jsxModeNeedsExplicitImport:()=>VH,keywordPart:()=>F_,last:()=>Sa,lastOrUndefined:()=>Mo,length:()=>Ir,libMap:()=>lO,libs:()=>Dw,lineBreakPart:()=>XC,linkNamePart:()=>goe,linkPart:()=>wH,linkTextPart:()=>rL,listFiles:()=>_q,loadModuleFromGlobalCache:()=>xie,loadWithModeAwareCache:()=>Zw,makeIdentifierFromModuleName:()=>Aee,makeImport:()=>Yh,makeImportIfNecessary:()=>loe,makeStringLiteral:()=>ex,mangleScopedPackageName:()=>IC,map:()=>Yt,mapAllOrFail:()=>_j,mapDefined:()=>Ii,mapDefinedEntries:()=>LZ,mapDefinedIterator:()=>nk,mapEntries:()=>RZ,mapIterator:()=>c4,mapOneOrMany:()=>zH,mapToDisplayParts:()=>ny,matchFiles:()=>Uz,matchPatternOrExact:()=>qz,matchedText:()=>KZ,matchesExclude:()=>cO,maybeBind:()=>Os,maybeSetLocalizedDiagnosticMessages:()=>Kte,memoize:()=>Vu,memoizeCached:()=>HZ,memoizeOne:()=>_m,memoizeWeak:()=>uhe,metadataHelper:()=>oF,min:()=>xj,minAndMax:()=>fre,missingFileModifiedTime:()=>Zm,modifierToFlag:()=>mT,modifiersToFlags:()=>Nd,moduleOptionDeclaration:()=>EU,moduleResolutionIsEqualTo:()=>xee,moduleResolutionNameAndModeGetter:()=>eA,moduleResolutionOptionDeclarations:()=>uO,moduleResolutionSupportsPackageJsonExportsAndImports:()=>bT,moduleResolutionUsesNodeModules:()=>X9,moduleSpecifiers:()=>Zv,moveEmitHelpers:()=>Jre,moveRangeEnd:()=>S5,moveRangePastDecorators:()=>Wh,moveRangePastModifiers:()=>Id,moveRangePos:()=>i1,moveSyntheticComments:()=>Rre,mutateMap:()=>Qk,mutateMapSkippingNewValues:()=>Xg,needsParentheses:()=>iL,needsScopeMarker:()=>yI,newCaseClauseTracker:()=>yL,newPrivateEnvironment:()=>Gie,noEmitNotification:()=>Vw,noEmitSubstitution:()=>f3,noTransformers:()=>EV,noTruncationMaximumTruncationLength:()=>Q5,nodeCanBeDecorated:()=>GI,nodeHasName:()=>gP,nodeIsDecorated:()=>U4,nodeIsMissing:()=>sc,nodeIsPresent:()=>ip,nodeIsSynthesized:()=>Po,nodeModuleNameResolver:()=>mie,nodeModulesPathPart:()=>Am,nodeNextJsonConfigResolver:()=>gie,nodeOrChildIsDecorated:()=>HP,nodeOverlapsWithStartEnd:()=>M9,nodePosToString:()=>x0e,nodeSeenTracker:()=>KT,nodeStartsNewLexicalEnvironment:()=>uz,nodeToDisplayParts:()=>ESe,noop:()=>Ca,noopFileWatcher:()=>zC,normalizePath:()=>qs,normalizeSlashes:()=>du,not:()=>A7,notImplemented:()=>ys,notImplementedResolver:()=>QO,nullNodeConverters:()=>hW,nullParenthesizerRules:()=>gW,nullTransformationContext:()=>cd,objectAllocator:()=>Al,operatorPart:()=>w3,optionDeclarations:()=>mg,optionMapToObject:()=>bU,optionsAffectingProgramStructure:()=>NU,optionsForBuild:()=>FU,optionsForWatch:()=>DC,optionsHaveChanges:()=>kk,optionsHaveModuleResolutionChanges:()=>bee,or:()=>ed,orderedRemoveItem:()=>HD,orderedRemoveItemAt:()=>Uy,outFile:()=>to,packageIdToPackageName:()=>DI,packageIdToString:()=>z0,paramHelper:()=>cF,parameterIsThisKeyword:()=>Ov,parameterNamePart:()=>foe,parseBaseNodeFactory:()=>fU,parseBigInt:()=>pre,parseBuildCommand:()=>U1e,parseCommandLine:()=>z1e,parseCommandLineWorker:()=>mU,parseConfigFileTextToJson:()=>hU,parseConfigFileWithSystem:()=>Ebe,parseConfigHostFromCompilerHostLike:()=>o9,parseCustomTypeOption:()=>aO,parseIsolatedEntityName:()=>WT,parseIsolatedJSDocComment:()=>Wne,parseJSDocTypeExpressionForTests:()=>P1e,parseJsonConfigFileContent:()=>nve,parseJsonSourceFileConfigFileContent:()=>kw,parseJsonText:()=>bw,parseListTypeOption:()=>Vne,parseNodeFactory:()=>wm,parseNodeModuleFromPath:()=>Ow,parsePackageName:()=>Rw,parsePseudoBigInt:()=>bE,parseValidBigInt:()=>Xz,patchWriteFileEnsuringDirectory:()=>gK,pathContainsNodeModules:()=>HT,pathIsAbsolute:()=>b4,pathIsBareSpecifier:()=>zB,pathIsRelative:()=>U_,patternText:()=>ZZ,perfLogger:()=>Pu,performIncrementalCompilation:()=>Abe,performance:()=>uK,plainJSErrors:()=>u9,positionBelongsToNode:()=>aH,positionIsASICandidate:()=>cL,positionIsSynthesized:()=>id,positionsAreOnSameLine:()=>_p,preProcessFile:()=>KSe,probablyUsesSemicolons:()=>DA,processCommentPragmas:()=>uU,processPragmasIntoFields:()=>_U,processTaggedTemplateExpression:()=>yV,programContainsEsModules:()=>coe,programContainsModules:()=>ooe,projectReferenceIsEqualTo:()=>TJ,propKeyHelper:()=>SF,propertyNamePart:()=>poe,pseudoBigIntToString:()=>Bv,punctuationPart:()=>Su,pushIfUnique:()=>tp,quote:()=>I3,quotePreferenceFromString:()=>TH,rangeContainsPosition:()=>_A,rangeContainsPositionExclusive:()=>fA,rangeContainsRange:()=>yf,rangeContainsRangeExclusive:()=>Gae,rangeContainsStartEnd:()=>pA,rangeEndIsOnSameLineAsRangeStart:()=>C8,rangeEndPositionsAreOnSameLine:()=>Bte,rangeEquals:()=>gj,rangeIsOnSingleLine:()=>bb,rangeOfNode:()=>Gz,rangeOfTypeParameters:()=>$z,rangeOverlapsWithStartEnd:()=>x3,rangeStartIsOnSameLineAsRangeEnd:()=>Jte,rangeStartPositionsAreOnSameLine:()=>T5,readBuilderProgram:()=>T9,readConfigFile:()=>Tw,readHelper:()=>vF,readJson:()=>lE,readJsonConfigFile:()=>Gne,readJsonOrUndefined:()=>Pz,reduceEachLeadingCommentRange:()=>xK,reduceEachTrailingCommentRange:()=>kK,reduceLeft:()=>Eu,reduceLeftIterator:()=>ahe,reducePathComponents:()=>eb,refactor:()=>nx,regExpEscape:()=>lye,relativeComplement:()=>BZ,removeAllComments:()=>G8,removeEmitHelper:()=>Bye,removeExtension:()=>F8,removeFileExtension:()=>Ou,removeIgnoredPath:()=>p9,removeMinAndVersionNumbers:()=>kj,removeOptionality:()=>eoe,removePrefix:()=>g4,removeSuffix:()=>sk,removeTrailingDirectorySeparator:()=>Vy,repeatString:()=>vA,replaceElement:()=>vj,resolutionExtensionIsTSOrJson:()=>yE,resolveConfigFileProjectName:()=>Tq,resolveJSModule:()=>pie,resolveLibrary:()=>bO,resolveModuleName:()=>AC,resolveModuleNameFromCache:()=>Jve,resolvePackageNameToPackageJson:()=>MU,resolvePath:()=>I0,resolveProjectReferencePath:()=>RC,resolveTripleslashReference:()=>e9,resolveTypeReferenceDirective:()=>uie,resolvingEmptyArray:()=>X5,restHelper:()=>mF,returnFalse:()=>Kp,returnNoopFileWatcher:()=>WC,returnTrue:()=>zg,returnUndefined:()=>Wy,returnsPromise:()=>lG,runInitializersHelper:()=>uF,sameFlatMap:()=>OZ,sameMap:()=>Yc,sameMapping:()=>P2e,scanShebangTrivia:()=>HB,scanTokenAtPosition:()=>Jee,scanner:()=>Tu,screenStartingMessageCodes:()=>S9,semanticDiagnosticsOptionDeclarations:()=>PU,serializeCompilerOptions:()=>TU,server:()=>qDe,servicesVersion:()=>ele,setCommentRange:()=>Ac,setConfigFileInOptions:()=>kU,setConstantValue:()=>Bre,setEachParent:()=>tC,setEmitFlags:()=>Vr,setFunctionNameHelper:()=>TF,setGetSourceFileAsHashVersioned:()=>b9,setIdentifierAutoGenerate:()=>Q8,setIdentifierGeneratedImportReference:()=>Ure,setIdentifierTypeArguments:()=>Vh,setInternalEmitFlags:()=>$8,setLocalizedDiagnosticMessages:()=>Zte,setModuleDefaultHelper:()=>CF,setNodeFlags:()=>gre,setObjectAllocator:()=>Yte,setOriginalNode:()=>rn,setParent:()=>ga,setParentRecursive:()=>$0,setPrivateIdentifier:()=>Rb,setSnippetElement:()=>CW,setSourceMapRange:()=>ya,setStackTraceLimit:()=>Nhe,setStartsOnNewLine:()=>nF,setSyntheticLeadingComments:()=>l1,setSyntheticTrailingComments:()=>kT,setSys:()=>Mhe,setSysLog:()=>dK,setTextRange:()=>tt,setTextRangeEnd:()=>eC,setTextRangePos:()=>SE,setTextRangePosEnd:()=>km,setTextRangePosWidth:()=>TE,setTokenSourceMapRange:()=>Mre,setTypeNode:()=>zre,setUILocale:()=>XZ,setValueDeclaration:()=>r8,shouldAllowImportingTsExtension:()=>FC,shouldPreserveConstEnums:()=>Sb,shouldResolveJsRequire:()=>N5,shouldUseUriStyleNodeCoreModules:()=>gL,showModuleSpecifier:()=>qte,signatureHasLiteralTypes:()=>tV,signatureHasRestParameter:()=>bu,signatureToDisplayParts:()=>AH,single:()=>yj,singleElementArray:()=>Q2,singleIterator:()=>MZ,singleOrMany:()=>um,singleOrUndefined:()=>lm,skipAlias:()=>yu,skipAssertions:()=>a1e,skipConstraint:()=>vH,skipOuterExpressions:()=>bc,skipParentheses:()=>Ha,skipPartiallyEmittedExpressions:()=>Fp,skipTrivia:()=>la,skipTypeChecking:()=>vE,skipTypeParentheses:()=>rz,skipWhile:()=>tK,sliceAfter:()=>Hz,some:()=>ut,sort:()=>qS,sortAndDeduplicate:()=>_4,sortAndDeduplicateDiagnostics:()=>pk,sourceFileAffectingCompilerOptions:()=>_O,sourceFileMayBeEmitted:()=>fT,sourceMapCommentRegExp:()=>OO,sourceMapCommentRegExpDontCareLineStart:()=>cV,spacePart:()=>tc,spanMap:()=>fj,spreadArrayHelper:()=>bF,stableSort:()=>Eh,startEndContainsRange:()=>sH,startEndOverlapsWithStartEnd:()=>R9,startOnNewLine:()=>Ru,startTracing:()=>_K,startsWith:()=>Qi,startsWithDirectory:()=>UB,startsWithUnderscore:()=>UH,startsWithUseStrict:()=>Cne,stringContainsAt:()=>Foe,stringToToken:()=>mv,stripQuotes:()=>lp,supportedDeclarationExtensions:()=>z8,supportedJSExtensions:()=>pW,supportedJSExtensionsFlat:()=>iC,supportedLocaleDirectories:()=>SJ,supportedTSExtensions:()=>nC,supportedTSExtensionsFlat:()=>fW,supportedTSImplementationExtensions:()=>W8,suppressLeadingAndTrailingTrivia:()=>O_,suppressLeadingTrivia:()=>FH,suppressTrailingTrivia:()=>Toe,symbolEscapedNameNoDefault:()=>Y9,symbolName:()=>pc,symbolNameNoDefault:()=>Q9,symbolPart:()=>_oe,symbolToDisplayParts:()=>A3,syntaxMayBeASICandidate:()=>XH,syntaxRequiresTrailingSemicolonOrASI:()=>oL,sys:()=>Bl,sysLog:()=>KD,tagNamesAreEquivalent:()=>h1,takeWhile:()=>I7,targetOptionDeclaration:()=>ww,templateObjectHelper:()=>yF,testFormatSettings:()=>Jae,textChangeRangeIsUnchanged:()=>NK,textChangeRangeNewSpan:()=>D4,textChanges:()=>Qr,textOrKeywordPart:()=>PH,textPart:()=>bf,textRangeContainsPositionInclusive:()=>pP,textSpanContainsPosition:()=>XB,textSpanContainsTextSpan:()=>DK,textSpanEnd:()=>yc,textSpanIntersection:()=>AK,textSpanIntersectsWith:()=>oI,textSpanIntersectsWithPosition:()=>wK,textSpanIntersectsWithTextSpan:()=>n0e,textSpanIsEmpty:()=>EK,textSpanOverlap:()=>PK,textSpanOverlapsWith:()=>r0e,textSpansEqual:()=>$C,textToKeywordObj:()=>_P,timestamp:()=>_o,toArray:()=>$S,toBuilderFileEmit:()=>Qse,toBuilderStateFileInfoForMultiEmit:()=>Xse,toEditorSettings:()=>HA,toFileNameLowerCase:()=>xd,toLowerCase:()=>qZ,toPath:()=>fo,toProgramEmitPending:()=>Yse,tokenIsIdentifierOrKeyword:()=>wu,tokenIsIdentifierOrKeywordOrGreaterThan:()=>SK,tokenToString:()=>Hs,trace:()=>Gi,tracing:()=>Jr,tracingEnabled:()=>XD,transform:()=>Zxe,transformClassFields:()=>nse,transformDeclarations:()=>kV,transformECMAScriptModule:()=>TV,transformES2015:()=>yse,transformES2016:()=>hse,transformES2017:()=>ose,transformES2018:()=>cse,transformES2019:()=>lse,transformES2020:()=>use,transformES2021:()=>_se,transformES5:()=>vse,transformESDecorators:()=>ase,transformESNext:()=>fse,transformGenerators:()=>bse,transformJsx:()=>gse,transformLegacyDecorators:()=>sse,transformModule:()=>SV,transformNamedEvaluation:()=>I_,transformNodeModule:()=>Tse,transformNodes:()=>qw,transformSystemModule:()=>Sse,transformTypeScript:()=>rse,transpile:()=>oTe,transpileModule:()=>Zoe,transpileOptionValueCompilerOptions:()=>IU,tryAddToSet:()=>zy,tryAndIgnoreErrors:()=>_L,tryCast:()=>Jn,tryDirectoryExists:()=>uL,tryExtractTSExtension:()=>b5,tryFileExists:()=>PA,tryGetClassExtendingExpressionWithTypeArguments:()=>kz,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>Cz,tryGetDirectories:()=>lL,tryGetExtensionFromPath:()=>ug,tryGetImportFromModuleSpecifier:()=>n8,tryGetJSDocSatisfiesTypeNode:()=>G5,tryGetModuleNameFromFile:()=>pw,tryGetModuleSpecifierFromDeclaration:()=>Mk,tryGetNativePerformanceHooks:()=>oK,tryGetPropertyAccessOrIdentifierToString:()=>k8,tryGetPropertyNameOfBindingOrAssignmentElement:()=>tO,tryGetSourceMappingURL:()=>Bie,tryGetTextOfPropertyName:()=>J4,tryIOAndConsumeErrors:()=>fL,tryParsePattern:()=>Kk,tryParsePatterns:()=>J5,tryParseRawSourceMap:()=>aV,tryReadDirectory:()=>MH,tryReadFile:()=>YE,tryRemoveDirectoryPrefix:()=>Jz,tryRemoveExtension:()=>_re,tryRemovePrefix:()=>Dj,tryRemoveSuffix:()=>YZ,typeAcquisitionDeclarations:()=>Aw,typeAliasNamePart:()=>doe,typeDirectiveIsEqualTo:()=>kee,typeKeywords:()=>vL,typeParameterNamePart:()=>moe,typeReferenceResolutionNameAndModeGetter:()=>l9,typeToDisplayParts:()=>xA,unchangedPollThresholds:()=>eP,unchangedTextChangeRange:()=>NP,unescapeLeadingUnderscores:()=>bi,unmangleScopedPackageName:()=>Bw,unorderedRemoveItem:()=>X2,unorderedRemoveItemAt:()=>Cj,unreachableCodeIsError:()=>rre,unusedLabelIsError:()=>nre,unwrapInnermostStatementOfLabel:()=>UJ,updateErrorForNoInputFiles:()=>oO,updateLanguageServiceSourceFile:()=>HG,updateMissingFilePathsWatch:()=>IV,updatePackageJsonWatch:()=>K2e,updateResolutionField:()=>PC,updateSharedExtendedConfigFileWatcher:()=>ZO,updateSourceFile:()=>lU,updateWatchingWildcardDirectories:()=>$w,usesExtensionsOnImports:()=>lre,usingSingleLineStringWriter:()=>R4,utf16EncodeAsString:()=>fk,validateLocaleAndSetLanguage:()=>s0e,valuesHelper:()=>xF,version:()=>Qm,versionMajorMinor:()=>rk,visitArray:()=>zw,visitCommaListElements:()=>Ww,visitEachChild:()=>sr,visitFunctionBody:()=>gf,visitIterationBody:()=>Hu,visitLexicalEnvironment:()=>FO,visitNode:()=>He,visitNodes:()=>kr,visitParameterList:()=>Sc,walkUpBindingElementsAndPatterns:()=>dk,walkUpLexicalEnvironments:()=>Hie,walkUpOuterExpressions:()=>Ene,walkUpParenthesizedExpressions:()=>Rh,walkUpParenthesizedTypes:()=>c8,walkUpParenthesizedTypesAndGetParentAndChild:()=>lte,whitespaceOrMapCommentRegExp:()=>LO,writeCommentRange:()=>$k,writeFile:()=>rE,writeFileEnsuringDirectories:()=>vz,zipWith:()=>oj});var w1=Nt({"src/server/_namespaces/ts.ts"(){"use strict";Ns(),sA(),zn(),cQ(),mx()}}),GDe={};jl(GDe,{ActionInvalidate:()=>P9,ActionPackageInstalled:()=>wae,ActionSet:()=>D9,ActionWatchTypingLocations:()=>iA,Arguments:()=>Aq,AutoImportProviderProject:()=>TQ,AuxiliaryProject:()=>bQ,CharRangeSection:()=>OQ,CloseFileWatcherEvent:()=>JM,CommandNames:()=>xpe,ConfigFileDiagEvent:()=>LM,ConfiguredProject:()=>xQ,CreateDirectoryWatcherEvent:()=>BM,CreateFileWatcherEvent:()=>jM,Errors:()=>r0,EventBeginInstallTypes:()=>Pq,EventEndInstallTypes:()=>wq,EventInitializationFailed:()=>Nae,EventTypesRegistry:()=>Aae,ExternalProject:()=>DM,GcTimer:()=>pQ,InferredProject:()=>vQ,LargeFileReferencedEvent:()=>OM,LineIndex:()=>Y3,LineLeaf:()=>CN,LineNode:()=>dx,LogLevel:()=>lQ,Msg:()=>uQ,OpenFileInfoTelemetryEvent:()=>EQ,Project:()=>Zb,ProjectInfoTelemetryEvent:()=>RM,ProjectKind:()=>X3,ProjectLanguageServiceStateEvent:()=>MM,ProjectLoadingFinishEvent:()=>FM,ProjectLoadingStartEvent:()=>IM,ProjectReferenceProjectLoadKind:()=>wQ,ProjectService:()=>AQ,ProjectsUpdatedInBackgroundEvent:()=>TN,ScriptInfo:()=>gQ,ScriptVersionCache:()=>VM,Session:()=>Cpe,TextStorage:()=>mQ,ThrottledOperations:()=>fQ,TypingsCache:()=>hQ,allFilesAreJsOrDts:()=>tpe,allRootFilesAreJsOrDts:()=>epe,asNormalizedPath:()=>SDe,convertCompilerOptions:()=>PM,convertFormatOptions:()=>d6,convertScriptKindName:()=>CQ,convertTypeAcquisition:()=>ipe,convertUserPreferences:()=>spe,convertWatchOptions:()=>SN,countEachFileTypes:()=>vN,createInstallTypingsRequest:()=>bDe,createModuleSpecifierCache:()=>mpe,createNormalizedPathMap:()=>TDe,createPackageJsonCache:()=>gpe,createSortedArray:()=>jfe,emptyArray:()=>Gc,findArgument:()=>pSe,forEachResolvedProjectReferenceProject:()=>m6,formatDiagnosticToProtocol:()=>kN,formatMessage:()=>hpe,getBaseConfigFileName:()=>_Q,getLocationInNewDocument:()=>Spe,hasArgument:()=>fSe,hasNoTypeScriptSource:()=>rpe,indent:()=>S3,isBackgroundProject:()=>bN,isConfigFile:()=>_pe,isConfiguredProject:()=>P1,isDynamicFileName:()=>yN,isExternalProject:()=>yQ,isInferredProject:()=>p6,isInferredProjectName:()=>Ofe,makeAutoImportProviderProjectName:()=>Mfe,makeAuxiliaryProjectName:()=>Rfe,makeInferredProjectName:()=>Lfe,maxFileSize:()=>NM,maxProgramSizeForNonTsFiles:()=>AM,normalizedPathToPath:()=>hN,nowString:()=>dSe,nullCancellationToken:()=>Tpe,nullTypingsInstaller:()=>EM,projectContainsInfoDirectly:()=>fx,protocol:()=>Kfe,removeSorted:()=>xDe,stringifyIndented:()=>UC,toEvent:()=>ype,toNormalizedPath:()=>Lo,tryConvertScriptKindName:()=>kQ,typingsInstaller:()=>Ife,updateProjectIfDirty:()=>Tf});var _Ke=Nt({"src/typescript/_namespaces/ts.server.ts"(){"use strict";w9(),mx()}}),$De={};jl($De,{ANONYMOUS:()=>bL,AccessFlags:()=>sB,AssertionLevel:()=>Aj,AssignmentDeclarationKind:()=>dB,AssignmentKind:()=>sW,Associativity:()=>oW,BreakpointResolver:()=>KG,BuilderFileEmit:()=>sq,BuilderProgramKind:()=>aq,BuilderState:()=>Vp,BundleFileSectionKind:()=>IB,CallHierarchy:()=>ix,CharacterCodes:()=>CB,CheckFlags:()=>eB,CheckMode:()=>AO,ClassificationType:()=>Xq,ClassificationTypeNames:()=>$q,CommentDirectiveType:()=>Bj,Comparison:()=>aj,CompletionInfoFlags:()=>zq,CompletionTriggerKind:()=>Mq,Completions:()=>lx,ContainerFlags:()=>QU,ContextFlags:()=>qj,Debug:()=>E,DiagnosticCategory:()=>YD,Diagnostics:()=>d,DocumentHighlights:()=>xL,ElementFlags:()=>iB,EmitFlags:()=>X7,EmitHint:()=>wB,EmitOnly:()=>zj,EndOfLineState:()=>Vq,EnumKind:()=>Kj,ExitStatus:()=>Wj,ExportKind:()=>eG,Extension:()=>EB,ExternalEmitHelpers:()=>PB,FileIncludeKind:()=>J7,FilePreprocessingDiagnosticsKind:()=>Jj,FileSystemEntryKind:()=>jB,FileWatcherEventKind:()=>RB,FindAllReferences:()=>ho,FlattenLevel:()=>mV,FlowFlags:()=>QD,ForegroundColorEscapeSequences:()=>YV,FunctionFlags:()=>aW,GeneratedIdentifierFlags:()=>B7,GetLiteralTextFlags:()=>rW,GoToDefinition:()=>c6,HighlightSpanKind:()=>jq,IdentifierNameMap:()=>$T,IdentifierNameMultiMap:()=>dV,ImportKind:()=>KH,ImportsNotUsedAsValues:()=>bB,IndentStyle:()=>Bq,IndexFlags:()=>aB,IndexKind:()=>lB,InferenceFlags:()=>fB,InferencePriority:()=>_B,InlayHintKind:()=>Rq,InlayHints:()=>VX,InternalEmitFlags:()=>DB,InternalSymbolName:()=>tB,InvalidatedProjectKind:()=>Dq,JSDocParsingMode:()=>LB,JsDoc:()=>D1,JsTyping:()=>gg,JsxEmit:()=>vB,JsxFlags:()=>Rj,JsxReferenceKind:()=>oB,LanguageServiceMode:()=>Fq,LanguageVariant:()=>xB,LexicalEnvironmentFlags:()=>NB,ListFormat:()=>FB,LogLevel:()=>Ij,MemberOverrideStatus:()=>Uj,ModifierFlags:()=>R7,ModuleDetectionKind:()=>mB,ModuleInstanceState:()=>XU,ModuleKind:()=>y4,ModuleResolutionKind:()=>uk,ModuleSpecifierEnding:()=>dW,NavigateTo:()=>tce,NavigationBar:()=>_ce,NewLineKind:()=>SB,NodeBuilderFlags:()=>Hj,NodeCheckFlags:()=>rB,NodeFactoryFlags:()=>TW,NodeFlags:()=>M7,NodeResolutionFeatures:()=>HU,ObjectFlags:()=>V7,OperationCanceledException:()=>lk,OperatorPrecedence:()=>cW,OrganizeImports:()=>qp,OrganizeImportsMode:()=>Lq,OuterExpressionKinds:()=>AB,OutliningElementsCollector:()=>$X,OutliningSpanKind:()=>Wq,OutputFileType:()=>Uq,PackageJsonAutoImportPreference:()=>Iq,PackageJsonDependencyGroup:()=>Nq,PatternMatchKind:()=>kL,PollingInterval:()=>Q7,PollingWatchKind:()=>yB,PragmaKindFlags:()=>OB,PrivateIdentifierKind:()=>wW,ProcessLevel:()=>vV,ProgramUpdateLevel:()=>OV,QuotePreference:()=>GH,RelationComparisonResult:()=>j7,Rename:()=>vM,ScriptElementKind:()=>Hq,ScriptElementKindModifier:()=>Gq,ScriptKind:()=>H7,ScriptSnapshot:()=>N9,ScriptTarget:()=>TB,SemanticClassificationFormat:()=>Oq,SemanticMeaning:()=>HH,SemicolonPreference:()=>Jq,SignatureCheckMode:()=>NO,SignatureFlags:()=>q7,SignatureHelp:()=>lN,SignatureKind:()=>cB,SmartSelectionRange:()=>YX,SnippetKind:()=>$7,SortKind:()=>wj,StructureIsReused:()=>z7,SymbolAccessibility:()=>Xj,SymbolDisplay:()=>t0,SymbolDisplayPartKind:()=>aA,SymbolFlags:()=>W7,SymbolFormatFlags:()=>$j,SyntaxKind:()=>L7,SyntheticSymbolKind:()=>Qj,Ternary:()=>pB,ThrottledCancellationToken:()=>ZG,TokenClass:()=>qq,TokenFlags:()=>jj,TransformFlags:()=>G7,TypeFacts:()=>wO,TypeFlags:()=>U7,TypeFormatFlags:()=>Gj,TypeMapKind:()=>uB,TypePredicateKind:()=>Yj,TypeReferenceSerializationKind:()=>Zj,UnionReduction:()=>Vj,UpToDateStatusType:()=>xq,VarianceFlags:()=>nB,Version:()=>Ip,VersionRange:()=>GD,WatchDirectoryFlags:()=>kB,WatchDirectoryKind:()=>hB,WatchFileKind:()=>gB,WatchLogLevel:()=>LV,WatchType:()=>al,accessPrivateIdentifier:()=>$ie,addDisposableResourceHelper:()=>NF,addEmitFlags:()=>Cm,addEmitHelper:()=>CT,addEmitHelpers:()=>Yg,addInternalEmitFlags:()=>xT,addNodeFactoryPatcher:()=>Iye,addObjectAllocatorPatcher:()=>Qte,addRange:()=>Dn,addRelatedInfo:()=>ua,addSyntheticLeadingComment:()=>NE,addSyntheticTrailingComment:()=>iF,addToSeen:()=>Rp,advancedAsyncSuperHelper:()=>K8,affectsDeclarationPathOptionDeclarations:()=>AU,affectsEmitOptionDeclarations:()=>wU,allKeysStartWithDot:()=>xO,altDirectorySeparator:()=>sP,and:()=>w7,append:()=>lr,appendIfUnique:()=>Bg,arrayFrom:()=>fs,arrayIsEqualTo:()=>Zp,arrayIsHomogeneous:()=>mre,arrayIsSorted:()=>jZ,arrayOf:()=>zZ,arrayReverseIterator:()=>mj,arrayToMap:()=>Ph,arrayToMultiMap:()=>VD,arrayToNumericMap:()=>UZ,arraysEqual:()=>zD,assertType:()=>phe,assign:()=>f4,assignHelper:()=>_F,asyncDelegator:()=>pF,asyncGeneratorHelper:()=>fF,asyncSuperHelper:()=>Z8,asyncValues:()=>dF,attachFileToDiagnostics:()=>yT,awaitHelper:()=>ET,awaiterHelper:()=>gF,base64decode:()=>jte,base64encode:()=>Rte,binarySearch:()=>Dh,binarySearchKey:()=>HS,bindSourceFile:()=>Eie,breakIntoCharacterSpans:()=>$oe,breakIntoWordSpans:()=>Xoe,buildLinkParts:()=>hoe,buildOpts:()=>fO,buildOverload:()=>dDe,bundlerModuleNameResolver:()=>die,canBeConvertedToAsync:()=>_G,canHaveDecorators:()=>Lb,canHaveExportModifier:()=>L8,canHaveFlowNode:()=>s8,canHaveIllegalDecorators:()=>iU,canHaveIllegalModifiers:()=>Ane,canHaveIllegalType:()=>c1e,canHaveIllegalTypeParameters:()=>wne,canHaveJSDoc:()=>a8,canHaveLocals:()=>hm,canHaveModifiers:()=>Wp,canHaveSymbol:()=>Ed,canJsonReportNoInputFiles:()=>ZE,canProduceDiagnostics:()=>qO,canUsePropertyAccess:()=>Zz,canWatchAffectingLocation:()=>tae,canWatchAtTypes:()=>eae,canWatchDirectoryOrFile:()=>d9,cartesianProduct:()=>eK,cast:()=>Ms,chainBundle:()=>Up,chainDiagnosticMessages:()=>ps,changeAnyExtension:()=>nP,changeCompilerHostLikeToUseCache:()=>Yw,changeExtension:()=>a1,changesAffectModuleResolution:()=>CI,changesAffectingProgramStructure:()=>See,childIsDecorated:()=>V4,classElementOrClassElementParameterIsDecorated:()=>VJ,classHasClassThisAssignment:()=>gV,classHasDeclaredOrExplicitlyAssignedName:()=>hV,classHasExplicitlyAssignedName:()=>WO,classOrConstructorParameterIsDecorated:()=>Mh,classPrivateFieldGetHelper:()=>PF,classPrivateFieldInHelper:()=>AF,classPrivateFieldSetHelper:()=>wF,classicNameResolver:()=>Tie,classifier:()=>ile,cleanExtendedConfigCache:()=>KO,clear:()=>Ym,clearMap:()=>o_,clearSharedExtendedConfigFileWatcher:()=>NV,climbPastPropertyAccess:()=>F9,climbPastPropertyOrElementAccess:()=>Vae,clone:()=>bj,cloneCompilerOptions:()=>dH,closeFileWatcher:()=>rd,closeFileWatcherOf:()=>hf,codefix:()=>su,collapseTextChangeRangesAcrossMultipleVersions:()=>IK,collectExternalModuleInfo:()=>uV,combine:()=>ik,combinePaths:()=>Hn,commentPragmas:()=>ZD,commonOptionsWithBuild:()=>Pw,commonPackageFolders:()=>uW,compact:()=>UD,compareBooleans:()=>pv,compareDataObjects:()=>Iz,compareDiagnostics:()=>mE,compareDiagnosticsSkipRelatedInformation:()=>D5,compareEmitHelpers:()=>Hre,compareNumberOfDirectorySeparators:()=>I8,comparePaths:()=>qy,comparePathsCaseInsensitive:()=>Jhe,comparePathsCaseSensitive:()=>Bhe,comparePatternKeys:()=>VU,compareProperties:()=>QZ,compareStringsCaseInsensitive:()=>D7,compareStringsCaseInsensitiveEslintCompatible:()=>GZ,compareStringsCaseSensitive:()=>Du,compareStringsCaseSensitiveUI:()=>qD,compareTextSpans:()=>E7,compareValues:()=>xo,compileOnSaveCommandLineOption:()=>Ew,compilerOptionsAffectDeclarationPath:()=>ore,compilerOptionsAffectEmit:()=>are,compilerOptionsAffectSemanticDiagnostics:()=>sre,compilerOptionsDidYouMeanDiagnostics:()=>Nw,compilerOptionsIndicateEsModules:()=>bH,compose:()=>_he,computeCommonSourceDirectoryOfFilenames:()=>Ise,computeLineAndCharacterOfPosition:()=>_k,computeLineOfPosition:()=>x4,computeLineStarts:()=>eT,computePositionOfLineAndCharacter:()=>nI,computeSignature:()=>zb,computeSignatureWithDiagnostics:()=>tq,computeSuggestionDiagnostics:()=>cG,concatenate:()=>Xi,concatenateDiagnosticMessageChains:()=>ere,consumesNodeCoreModules:()=>pL,contains:()=>_s,containsIgnoredPath:()=>xE,containsObjectRestOrSpread:()=>hw,containsParseError:()=>Ck,containsPath:()=>dm,convertCompilerOptionsForTelemetry:()=>Zne,convertCompilerOptionsFromJson:()=>_ve,convertJsonOption:()=>Mb,convertToBase64:()=>Mte,convertToJson:()=>xw,convertToObject:()=>$ne,convertToOptionsWithAbsolutePaths:()=>xU,convertToRelativePath:()=>T4,convertToTSConfig:()=>Y1e,convertTypeAcquisitionFromJson:()=>fve,copyComments:()=>Hb,copyEntries:()=>EI,copyLeadingComments:()=>QC,copyProperties:()=>Sj,copyTrailingAsLeadingComments:()=>EA,copyTrailingComments:()=>N3,couldStartTrivia:()=>TK,countWhere:()=>Ch,createAbstractBuilder:()=>bbe,createAccessorPropertyBackingField:()=>aU,createAccessorPropertyGetRedirector:()=>jne,createAccessorPropertySetRedirector:()=>Bne,createBaseNodeFactory:()=>Are,createBinaryExpressionTrampoline:()=>rO,createBindingHelper:()=>aC,createBuildInfo:()=>Hw,createBuilderProgram:()=>rq,createBuilderProgramUsingProgramBuildInfo:()=>Zse,createBuilderStatusReporter:()=>mae,createCacheWithRedirects:()=>jU,createCacheableExportInfoMap:()=>QH,createCachedDirectoryStructureHost:()=>YO,createClassNamedEvaluationHelperBlock:()=>Kie,createClassThisAssignmentBlock:()=>Yie,createClassifier:()=>RSe,createCommentDirectivesMap:()=>Dee,createCompilerDiagnostic:()=>dc,createCompilerDiagnosticForInvalidCustomType:()=>Une,createCompilerDiagnosticFromMessageChain:()=>E5,createCompilerHost:()=>Fse,createCompilerHostFromProgramHost:()=>vq,createCompilerHostWorker:()=>jV,createDetachedDiagnostic:()=>Zk,createDiagnosticCollection:()=>qk,createDiagnosticForFileFromMessageChain:()=>BJ,createDiagnosticForNode:()=>mn,createDiagnosticForNodeArray:()=>Pk,createDiagnosticForNodeArrayFromMessageChain:()=>jP,createDiagnosticForNodeFromMessageChain:()=>Hg,createDiagnosticForNodeInSourceFile:()=>sp,createDiagnosticForRange:()=>Bee,createDiagnosticMessageChainFromDiagnostic:()=>jee,createDiagnosticReporter:()=>tA,createDocumentPositionMapper:()=>Wie,createDocumentRegistry:()=>Roe,createDocumentRegistryInternal:()=>nG,createEmitAndSemanticDiagnosticsBuilderProgram:()=>oq,createEmitHelperFactory:()=>qre,createEmptyExports:()=>lw,createExpressionForJsxElement:()=>Tne,createExpressionForJsxFragment:()=>xne,createExpressionForObjectLiteralElementLike:()=>kne,createExpressionForPropertyName:()=>ZW,createExpressionFromEntityName:()=>uw,createExternalHelpersImportDeclarationIfNeeded:()=>tU,createFileDiagnostic:()=>xl,createFileDiagnosticFromMessageChain:()=>OI,createForOfBindingStatement:()=>YW,createGetCanonicalFileName:()=>tu,createGetSourceFile:()=>MV,createGetSymbolAccessibilityDiagnosticForNode:()=>Gh,createGetSymbolAccessibilityDiagnosticForNodeName:()=>xse,createGetSymbolWalker:()=>Die,createIncrementalCompilerHost:()=>Sq,createIncrementalProgram:()=>pae,createInputFiles:()=>Oye,createInputFilesWithFilePaths:()=>bW,createInputFilesWithFileTexts:()=>SW,createJsxFactoryExpression:()=>QW,createLanguageService:()=>Zce,createLanguageServiceSourceFile:()=>$L,createMemberAccessForPropertyName:()=>Ob,createModeAwareCache:()=>qT,createModeAwareCacheKey:()=>n3,createModuleNotFoundChain:()=>xJ,createModuleResolutionCache:()=>wC,createModuleResolutionLoader:()=>UV,createModuleResolutionLoaderUsingGlobalCache:()=>sae,createModuleSpecifierResolutionHost:()=>qb,createMultiMap:()=>of,createNodeConverters:()=>Ire,createNodeFactory:()=>V8,createOptionNameMap:()=>sO,createOverload:()=>oQ,createPackageJsonImportFilter:()=>O3,createPackageJsonInfo:()=>jH,createParenthesizerRules:()=>Nre,createPatternMatcher:()=>Woe,createPrependNodes:()=>XV,createPrinter:()=>S1,createPrinterWithDefaults:()=>wV,createPrinterWithRemoveComments:()=>t2,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>AV,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>Gw,createProgram:()=>s9,createProgramHost:()=>bq,createPropertyNameNodeForIdentifierOrLiteral:()=>q5,createQueue:()=>C7,createRange:()=>Lf,createRedirectedBuilderProgram:()=>iq,createResolutionCache:()=>lq,createRuntimeTypeSerializer:()=>ise,createScanner:()=>Ih,createSemanticDiagnosticsBuilderProgram:()=>vbe,createSet:()=>Tj,createSolutionBuilder:()=>Mbe,createSolutionBuilderHost:()=>Obe,createSolutionBuilderWithWatch:()=>Rbe,createSolutionBuilderWithWatchHost:()=>Lbe,createSortedArray:()=>dj,createSourceFile:()=>vw,createSourceMapGenerator:()=>jie,createSourceMapSource:()=>Lye,createSuperAccessVariableStatement:()=>VO,createSymbolTable:()=>zs,createSymlinkCache:()=>Bz,createSystemWatchFunctions:()=>mK,createTextChange:()=>hA,createTextChangeFromStartLength:()=>G9,createTextChangeRange:()=>mP,createTextRangeFromNode:()=>hH,createTextRangeFromSpan:()=>H9,createTextSpan:()=>Jl,createTextSpanFromBounds:()=>zc,createTextSpanFromNode:()=>l_,createTextSpanFromRange:()=>ry,createTextSpanFromStringLiteralLikeContent:()=>gH,createTextWriter:()=>h8,createTokenRange:()=>wz,createTypeChecker:()=>Iie,createTypeReferenceDirectiveResolutionCache:()=>vO,createTypeReferenceResolutionLoader:()=>r9,createUnparsedSourceFile:()=>vW,createWatchCompilerHost:()=>Nbe,createWatchCompilerHostOfConfigFile:()=>uae,createWatchCompilerHostOfFilesAndCompilerOptions:()=>_ae,createWatchFactory:()=>yq,createWatchHost:()=>hq,createWatchProgram:()=>Ibe,createWatchStatusReporter:()=>aae,createWriteFileMeasuringIO:()=>RV,declarationNameToString:()=>eo,decodeMappings:()=>oV,decodedTextSpanIntersectsWith:()=>dP,decorateHelper:()=>aF,deduplicate:()=>VS,defaultIncludeSpec:()=>mO,defaultInitCompilerOptions:()=>pO,defaultMaximumTruncationLength:()=>B8,detectSortCaseSensitivity:()=>S7,diagnosticCategoryName:()=>K2,diagnosticToString:()=>$b,directoryProbablyExists:()=>td,directorySeparator:()=>Co,displayPart:()=>b_,displayPartsToString:()=>GA,disposeEmitNodes:()=>xW,disposeResourcesHelper:()=>IF,documentSpansEqual:()=>eL,dumpTracingLegend:()=>fK,elementAt:()=>Ah,elideNodes:()=>Rne,emitComments:()=>Cte,emitDetachedComments:()=>Ete,emitFiles:()=>$O,emitFilesAndReportErrors:()=>y9,emitFilesAndReportErrorsAndGetExitStatus:()=>lae,emitModuleKindIsNonNodeESM:()=>P5,emitNewLineBeforeLeadingCommentOfPosition:()=>kte,emitNewLineBeforeLeadingComments:()=>Tte,emitNewLineBeforeLeadingCommentsOfPosition:()=>xte,emitSkippedWithNoDiagnostics:()=>_9,emitUsingBuildInfo:()=>Pse,emptyArray:()=>ze,emptyFileSystemEntries:()=>eF,emptyMap:()=>F7,emptyOptions:()=>jf,emptySet:()=>rK,endsWith:()=>fc,ensurePathIsNonModuleName:()=>dv,ensureScriptKind:()=>j5,ensureTrailingDirectorySeparator:()=>Sl,entityNameToString:()=>D_,enumerateInsertsAndDeletes:()=>N7,equalOwnProperties:()=>WZ,equateStringsCaseInsensitive:()=>XS,equateStringsCaseSensitive:()=>QS,equateValues:()=>w0,esDecorateHelper:()=>lF,escapeJsxAttributeString:()=>mz,escapeLeadingUnderscores:()=>zo,escapeNonAsciiString:()=>g8,escapeSnippetText:()=>zv,escapeString:()=>n1,every:()=>qi,expandPreOrPostfixIncrementOrDecrementExpression:()=>QF,explainFiles:()=>fq,explainIfFileIsRedirectAndImpliedFormat:()=>pq,exportAssignmentIsAlias:()=>zk,exportStarHelper:()=>DF,expressionResultIsUnused:()=>hre,extend:()=>k7,extendsHelper:()=>hF,extensionFromPath:()=>ST,extensionIsTS:()=>z5,extensionsNotSupportingExtensionlessResolution:()=>U8,externalHelpersModuleNameText:()=>X0,factory:()=>I,fileExtensionIs:()=>Ho,fileExtensionIsOneOf:()=>Jc,fileIncludeReasonToDiagnostics:()=>gq,fileShouldUseJavaScriptRequire:()=>qH,filter:()=>wn,filterMutate:()=>lj,filterSemanticDiagnostics:()=>a9,find:()=>kn,findAncestor:()=>Ar,findBestPatternMatch:()=>Ej,findChildOfKind:()=>Ua,findComputedPropertyNameCacheAssignment:()=>nO,findConfigFile:()=>Nse,findContainingList:()=>j9,findDiagnosticForNode:()=>woe,findFirstNonJsxWhitespaceToken:()=>Xae,findIndex:()=>Dc,findLast:()=>US,findLastIndex:()=>b7,findListItemInfo:()=>$ae,findMap:()=>ohe,findModifier:()=>GC,findNextToken:()=>i2,findPackageJson:()=>Doe,findPackageJsons:()=>RH,findPrecedingMatchingToken:()=>V9,findPrecedingToken:()=>Kc,findSuperStatementIndexPath:()=>BO,findTokenOnLeftOfPosition:()=>z9,findUseStrictPrologue:()=>eU,first:()=>ba,firstDefined:()=>ic,firstDefinedIterator:()=>JD,firstIterator:()=>hj,firstOrOnly:()=>WH,firstOrUndefined:()=>bl,firstOrUndefinedIterator:()=>T7,fixupCompilerOptions:()=>pG,flatMap:()=>ta,flatMapIterator:()=>uj,flatMapToMutable:()=>l4,flatten:()=>Np,flattenCommaList:()=>Jne,flattenDestructuringAssignment:()=>jb,flattenDestructuringBinding:()=>e2,flattenDiagnosticMessageText:()=>Bd,forEach:()=>Zt,forEachAncestor:()=>Tee,forEachAncestorDirectory:()=>kd,forEachChild:()=>ds,forEachChildRecursively:()=>QE,forEachEmittedFile:()=>DV,forEachEnclosingBlockScopeContainer:()=>Lee,forEachEntry:()=>zl,forEachExternalModuleToImportFrom:()=>ZH,forEachImportClauseDeclaration:()=>n5,forEachKey:()=>ng,forEachLeadingCommentRange:()=>lP,forEachNameInAccessChainWalkingLeft:()=>$te,forEachPropertyAssignment:()=>Ik,forEachResolvedProjectReference:()=>VV,forEachReturnStatement:()=>Ev,forEachRight:()=>IZ,forEachTrailingCommentRange:()=>uP,forEachTsConfigPropArray:()=>WP,forEachUnique:()=>CH,forEachYieldExpression:()=>zee,forSomeAncestorDirectory:()=>rye,formatColorAndReset:()=>r2,formatDiagnostic:()=>BV,formatDiagnostics:()=>tbe,formatDiagnosticsWithColorAndContext:()=>Ose,formatGeneratedName:()=>g1,formatGeneratedNamePart:()=>kC,formatLocation:()=>JV,formatMessage:()=>Lz,formatStringFromArgs:()=>lg,formatting:()=>ol,fullTripleSlashAMDReferencePathRegEx:()=>iW,fullTripleSlashReferencePathRegEx:()=>nW,generateDjb2Hash:()=>v4,generateTSConfig:()=>rve,generatorHelper:()=>kF,getAdjustedReferenceLocation:()=>cH,getAdjustedRenameLocation:()=>J9,getAliasDeclarationFromName:()=>iz,getAllAccessorDeclarations:()=>vb,getAllDecoratorsOfClass:()=>fV,getAllDecoratorsOfClassElement:()=>zO,getAllJSDocTags:()=>nJ,getAllJSDocTagsOfKind:()=>m0e,getAllKeys:()=>lhe,getAllProjectOutputs:()=>GO,getAllSuperTypeNodes:()=>Q4,getAllUnscopedEmitHelpers:()=>PW,getAllowJSCompilerOption:()=>s1,getAllowSyntheticDefaultImports:()=>vT,getAncestor:()=>r1,getAnyExtensionFromPath:()=>S4,getAreDeclarationMapsEnabled:()=>A5,getAssignedExpandoInitializer:()=>aT,getAssignedName:()=>ZB,getAssignedNameOfIdentifier:()=>u3,getAssignmentDeclarationKind:()=>ac,getAssignmentDeclarationPropertyAccessKind:()=>e8,getAssignmentTargetKind:()=>uT,getAutomaticTypeDirectiveNames:()=>yO,getBaseFileName:()=>Pc,getBinaryOperatorPrecedence:()=>m8,getBuildInfo:()=>XO,getBuildInfoFileVersionMap:()=>nq,getBuildInfoText:()=>Dse,getBuildOrderFromAnyBuildOrder:()=>x9,getBuilderCreationParameters:()=>f9,getBuilderFileEmit:()=>ty,getCheckFlags:()=>Ko,getClassExtendsHeritageElement:()=>Nv,getClassLikeDeclarationOfSymbol:()=>Qg,getCombinedLocalAndExportSymbolFlags:()=>fE,getCombinedModifierFlags:()=>gv,getCombinedNodeFlags:()=>Fh,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>QB,getCommentRange:()=>Fd,getCommonSourceDirectory:()=>g3,getCommonSourceDirectoryOfConfig:()=>h3,getCompilerOptionValue:()=>I5,getCompilerOptionsDiffValue:()=>eve,getConditions:()=>Xv,getConfigFileParsingDiagnostics:()=>Jb,getConstantValue:()=>jre,getContainerFlags:()=>$U,getContainerNode:()=>Ub,getContainingClass:()=>wl,getContainingClassExcludingClassDecorators:()=>UI,getContainingClassStaticBlock:()=>Qee,getContainingFunction:()=>uf,getContainingFunctionDeclaration:()=>Xee,getContainingFunctionOrClassStaticBlock:()=>WI,getContainingNodeArray:()=>yre,getContainingObjectLiteralElement:()=>$A,getContextualTypeFromParent:()=>sL,getContextualTypeFromParentOrAncestorTypeNode:()=>B9,getCurrentTime:()=>nA,getDeclarationDiagnostics:()=>kse,getDeclarationEmitExtensionForPath:()=>v8,getDeclarationEmitOutputFilePath:()=>hte,getDeclarationEmitOutputFilePathWorker:()=>f5,getDeclarationFromName:()=>X4,getDeclarationModifierFlagsFromSymbol:()=>Mf,getDeclarationOfKind:()=>Wo,getDeclarationsOfKind:()=>vee,getDeclaredExpandoInitializer:()=>QP,getDecorators:()=>O0,getDefaultCompilerOptions:()=>GL,getDefaultExportInfoWorker:()=>TL,getDefaultFormatCodeSettings:()=>A9,getDefaultLibFileName:()=>fP,getDefaultLibFilePath:()=>Kce,getDefaultLikeExportInfo:()=>SL,getDiagnosticText:()=>V1e,getDiagnosticsWithinSpan:()=>Aoe,getDirectoryPath:()=>qn,getDirectoryToWatchFailedLookupLocation:()=>cq,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>nae,getDocumentPositionMapper:()=>oG,getESModuleInterop:()=>xm,getEditsForFileRename:()=>Boe,getEffectiveBaseTypeNode:()=>Pd,getEffectiveConstraintOfTypeParameter:()=>gk,getEffectiveContainerForJSDocTemplateTag:()=>i5,getEffectiveImplementsTypeNodes:()=>Wk,getEffectiveInitializer:()=>XP,getEffectiveJSDocHost:()=>mb,getEffectiveModifierFlags:()=>Fu,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>Ate,getEffectiveModifierFlagsNoCache:()=>Nte,getEffectiveReturnTypeNode:()=>up,getEffectiveSetAccessorTypeAnnotationNode:()=>Ste,getEffectiveTypeAnnotationNode:()=>Wl,getEffectiveTypeParameterDeclarations:()=>L0,getEffectiveTypeRoots:()=>r3,getElementOrPropertyAccessArgumentExpressionOrName:()=>r5,getElementOrPropertyAccessName:()=>Gg,getElementsOfBindingOrAssignmentPattern:()=>xC,getEmitDeclarations:()=>Rf,getEmitFlags:()=>da,getEmitHelpers:()=>sF,getEmitModuleDetectionKind:()=>tre,getEmitModuleKind:()=>Ul,getEmitModuleResolutionKind:()=>Vl,getEmitScriptTarget:()=>Da,getEmitStandardClassFields:()=>ire,getEnclosingBlockScopeContainer:()=>bm,getEnclosingContainer:()=>jJ,getEncodedSemanticClassifications:()=>tG,getEncodedSyntacticClassifications:()=>rG,getEndLinePosition:()=>OP,getEntityNameFromTypeNode:()=>qP,getEntrypointsFromPackageJsonInfo:()=>zU,getErrorCountForSummary:()=>g9,getErrorSpanForNode:()=>kv,getErrorSummaryText:()=>oae,getEscapedTextOfIdentifierOrLiteral:()=>K4,getEscapedTextOfJsxAttributeName:()=>DE,getEscapedTextOfJsxNamespacedName:()=>TT,getExpandoInitializer:()=>e1,getExportAssignmentExpression:()=>sz,getExportInfoMap:()=>NA,getExportNeedsImportStarHelper:()=>Uie,getExpressionAssociativity:()=>_z,getExpressionPrecedence:()=>tE,getExternalHelpersModuleName:()=>fw,getExternalModuleImportEqualsDeclarationExpression:()=>q4,getExternalModuleName:()=>Rk,getExternalModuleNameFromDeclaration:()=>mte,getExternalModuleNameFromPath:()=>hz,getExternalModuleNameLiteral:()=>zT,getExternalModuleRequireArgument:()=>HJ,getFallbackOptions:()=>Qw,getFileEmitOutput:()=>zse,getFileMatcherPatterns:()=>R5,getFileNamesFromConfigSpecs:()=>KE,getFileWatcherEventKind:()=>MB,getFilesInErrorForSummary:()=>h9,getFirstConstructorWithBody:()=>cg,getFirstIdentifier:()=>$_,getFirstNonSpaceCharacterPosition:()=>Soe,getFirstProjectOutput:()=>PV,getFixableErrorSpanExpression:()=>JH,getFormatCodeSettingsForWriting:()=>hL,getFullWidth:()=>IP,getFunctionFlags:()=>pl,getHeritageClause:()=>_8,getHostSignatureFromJSDoc:()=>t1,getIdentifierAutoGenerate:()=>Jye,getIdentifierGeneratedImportReference:()=>Vre,getIdentifierTypeArguments:()=>kb,getImmediatelyInvokedFunctionExpression:()=>_b,getImpliedNodeFormatForFile:()=>Kw,getImpliedNodeFormatForFileWorker:()=>GV,getImportNeedsImportDefaultHelper:()=>lV,getImportNeedsImportStarHelper:()=>RO,getIndentSize:()=>Gk,getIndentString:()=>u5,getInferredLibraryNameResolveFrom:()=>i9,getInitializedVariables:()=>_E,getInitializerOfBinaryExpression:()=>YJ,getInitializerOfBindingOrAssignmentElement:()=>dw,getInterfaceBaseTypeNodes:()=>Y4,getInternalEmitFlags:()=>Op,getInvokedExpression:()=>HI,getIsolatedModules:()=>nd,getJSDocAugmentsTag:()=>zK,getJSDocClassTag:()=>KB,getJSDocCommentRanges:()=>zJ,getJSDocCommentsAndTags:()=>KJ,getJSDocDeprecatedTag:()=>eJ,getJSDocDeprecatedTagNoCache:()=>$K,getJSDocEnumTag:()=>tJ,getJSDocHost:()=>lT,getJSDocImplementsTags:()=>WK,getJSDocOverrideTagNoCache:()=>GK,getJSDocParameterTags:()=>mk,getJSDocParameterTagsNoCache:()=>RK,getJSDocPrivateTag:()=>u0e,getJSDocPrivateTagNoCache:()=>VK,getJSDocProtectedTag:()=>_0e,getJSDocProtectedTagNoCache:()=>qK,getJSDocPublicTag:()=>l0e,getJSDocPublicTagNoCache:()=>UK,getJSDocReadonlyTag:()=>f0e,getJSDocReadonlyTagNoCache:()=>HK,getJSDocReturnTag:()=>XK,getJSDocReturnType:()=>hP,getJSDocRoot:()=>$4,getJSDocSatisfiesExpressionType:()=>eW,getJSDocSatisfiesTag:()=>rJ,getJSDocTags:()=>Zy,getJSDocTagsNoCache:()=>d0e,getJSDocTemplateTag:()=>p0e,getJSDocThisTag:()=>lI,getJSDocType:()=>Yy,getJSDocTypeAliasName:()=>nU,getJSDocTypeAssertionType:()=>ZF,getJSDocTypeParameterDeclarations:()=>g5,getJSDocTypeParameterTags:()=>jK,getJSDocTypeParameterTagsNoCache:()=>BK,getJSDocTypeTag:()=>Qy,getJSXImplicitImportBase:()=>O5,getJSXRuntimeImport:()=>L5,getJSXTransformEnabled:()=>F5,getKeyForCompilerOptions:()=>RU,getLanguageVariant:()=>D8,getLastChild:()=>Fz,getLeadingCommentRanges:()=>Km,getLeadingCommentRangesOfNode:()=>JJ,getLeftmostAccessExpression:()=>dE,getLeftmostExpression:()=>Yk,getLibraryNameFromLibFileName:()=>qV,getLineAndCharacterOfPosition:()=>qa,getLineInfo:()=>sV,getLineOfLocalPosition:()=>nE,getLineOfLocalPositionFromLineMap:()=>hb,getLineStartPositionForPosition:()=>hp,getLineStarts:()=>Wg,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>Ute,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>Wte,getLinesBetweenPositions:()=>k4,getLinesBetweenRangeEndAndRangeStart:()=>Az,getLinesBetweenRangeEndPositions:()=>eye,getLiteralText:()=>Pee,getLocalNameForExternalImport:()=>TC,getLocalSymbolForExportDefault:()=>Xk,getLocaleSpecificMessage:()=>ls,getLocaleTimeString:()=>rA,getMappedContextSpan:()=>EH,getMappedDocumentSpan:()=>tL,getMappedLocation:()=>P3,getMatchedFileSpec:()=>dq,getMatchedIncludeSpec:()=>mq,getMeaningFromDeclaration:()=>oA,getMeaningFromLocation:()=>Wb,getMembersOfDeclaration:()=>Wee,getModeForFileReference:()=>t9,getModeForResolutionAtIndex:()=>zV,getModeForUsageLocation:()=>ld,getModifiedTime:()=>YS,getModifiers:()=>hv,getModuleInstanceState:()=>rh,getModuleNameStringLiteralAt:()=>c9,getModuleSpecifierEndingPreference:()=>Vz,getModuleSpecifierResolverHost:()=>SH,getNameForExportedSymbol:()=>dL,getNameFromIndexInfo:()=>Mee,getNameFromPropertyName:()=>bA,getNameOfAccessExpression:()=>Hte,getNameOfCompilerOptionValue:()=>SU,getNameOfDeclaration:()=>as,getNameOfExpando:()=>XJ,getNameOfJSDocTypedef:()=>MK,getNameOrArgument:()=>KP,getNameTable:()=>GG,getNamesForExportedSymbol:()=>Noe,getNamespaceDeclarationNode:()=>jk,getNewLineCharacter:()=>zh,getNewLineKind:()=>AA,getNewLineOrDefaultFromHost:()=>Zh,getNewTargetContainer:()=>Zee,getNextJSDocCommentLocation:()=>ez,getNodeForGeneratedName:()=>gw,getNodeId:()=>Oa,getNodeKind:()=>n2,getNodeModifiers:()=>C3,getNodeModulePathParts:()=>H5,getNonAssignedNameOfDeclaration:()=>cI,getNonAssignmentOperatorForCompoundAssignment:()=>o3,getNonAugmentationDeclaration:()=>IJ,getNonDecoratorTokenPosOfNode:()=>DJ,getNormalizedAbsolutePath:()=>is,getNormalizedAbsolutePathWithoutRoot:()=>WB,getNormalizedPathComponents:()=>rP,getObjectFlags:()=>Pn,getOperator:()=>pz,getOperatorAssociativity:()=>fz,getOperatorPrecedence:()=>d8,getOptionFromName:()=>gU,getOptionsForLibraryResolution:()=>BU,getOptionsNameMap:()=>EC,getOrCreateEmitNode:()=>nu,getOrCreateExternalHelpersModuleNameIfNeeded:()=>Pne,getOrUpdate:()=>u4,getOriginalNode:()=>Zo,getOriginalNodeId:()=>iu,getOriginalSourceFile:()=>V0e,getOutputDeclarationFileName:()=>m3,getOutputExtension:()=>HO,getOutputFileNames:()=>Z2e,getOutputPathsFor:()=>d3,getOutputPathsForBundle:()=>p3,getOwnEmitOutputFilePath:()=>gte,getOwnKeys:()=>Jg,getOwnValues:()=>GS,getPackageJsonInfo:()=>Qv,getPackageJsonTypesVersionsPaths:()=>hO,getPackageJsonsVisibleToFile:()=>Poe,getPackageNameFromTypesPackageName:()=>i3,getPackageScopeForPath:()=>Mw,getParameterSymbolFromJSDoc:()=>o8,getParameterTypeNode:()=>pye,getParentNodeInSpan:()=>TA,getParseTreeNode:()=>ss,getParsedCommandLineOfConfigFile:()=>Sw,getPathComponents:()=>fl,getPathComponentsRelativeTo:()=>VB,getPathFromPathComponents:()=>N0,getPathUpdater:()=>sG,getPathsBasePath:()=>p5,getPatternFromSpec:()=>Wz,getPendingEmitKind:()=>BC,getPositionOfLineAndCharacter:()=>oP,getPossibleGenericSignatures:()=>uH,getPossibleOriginalInputExtensionForExtension:()=>yte,getPossibleTypeArgumentsInfo:()=>_H,getPreEmitDiagnostics:()=>ebe,getPrecedingNonSpaceCharacterPosition:()=>nL,getPrivateIdentifier:()=>pV,getProperties:()=>_V,getProperty:()=>x7,getPropertyArrayElementValue:()=>$ee,getPropertyAssignmentAliasLikeExpression:()=>_te,getPropertyNameForPropertyNameNode:()=>gb,getPropertyNameForUniqueESSymbol:()=>W0e,getPropertyNameFromType:()=>dp,getPropertyNameOfBindingOrAssignmentElement:()=>rU,getPropertySymbolFromBindingElement:()=>K9,getPropertySymbolsFromContextualType:()=>XL,getQuoteFromPreference:()=>xH,getQuotePreference:()=>vf,getRangesWhere:()=>pj,getRefactorContextSpan:()=>tx,getReferencedFileLocation:()=>y3,getRegexFromPattern:()=>G0,getRegularExpressionForWildcard:()=>gE,getRegularExpressionsForWildcards:()=>M5,getRelativePathFromDirectory:()=>mm,getRelativePathFromFile:()=>iP,getRelativePathToDirectoryOrUrl:()=>KS,getRenameLocation:()=>CA,getReplacementSpanForContextToken:()=>mH,getResolutionDiagnostic:()=>QV,getResolutionModeOverride:()=>LC,getResolveJsonModule:()=>Rv,getResolvePackageJsonExports:()=>Rz,getResolvePackageJsonImports:()=>oye,getResolvedExternalModuleName:()=>_5,getRestIndicatorOfBindingOrAssignmentElement:()=>eO,getRestParameterElementType:()=>WJ,getRightMostAssignedExpression:()=>YP,getRootDeclaration:()=>Tm,getRootDirectoryOfResolutionCache:()=>iae,getRootLength:()=>pm,getRootPathSplitLength:()=>kbe,getScriptKind:()=>NH,getScriptKindFromFileName:()=>B5,getScriptTargetFeatures:()=>Y5,getSelectedEffectiveModifierFlags:()=>dT,getSelectedSyntacticModifierFlags:()=>Pte,getSemanticClassifications:()=>Loe,getSemanticJsxChildren:()=>Vk,getSetAccessorTypeAnnotationNode:()=>vte,getSetAccessorValueParameter:()=>iE,getSetExternalModuleIndicator:()=>P8,getShebang:()=>sI,getSingleInitializerOfVariableStatementOrPropertyDeclaration:()=>ZJ,getSingleVariableOfVariableStatement:()=>Jk,getSnapshotText:()=>HC,getSnippetElement:()=>kW,getSourceFileOfModule:()=>PI,getSourceFileOfNode:()=>Or,getSourceFilePathInNewDir:()=>d5,getSourceFilePathInNewDirWorker:()=>m5,getSourceFileVersionAsHashFromText:()=>v9,getSourceFilesToEmit:()=>yz,getSourceMapRange:()=>c1,getSourceMapper:()=>Yoe,getSourceTextOfNodeFromSourceFile:()=>Tv,getSpanOfTokenAtPosition:()=>Sm,getSpellingSuggestion:()=>m4,getStartPositionOfLine:()=>W0,getStartPositionOfRange:()=>uE,getStartsOnNewLine:()=>AE,getStaticPropertiesAndClassStaticBlock:()=>JO,getStrictOptionValue:()=>fp,getStringComparer:()=>d4,getSuperCallFromStatement:()=>jO,getSuperContainer:()=>UP,getSupportedCodeFixes:()=>qG,getSupportedExtensions:()=>hE,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>N8,getSwitchedType:()=>LH,getSymbolId:()=>Xs,getSymbolNameForPrivateIdentifier:()=>f8,getSymbolTarget:()=>voe,getSyntacticClassifications:()=>Moe,getSyntacticModifierFlags:()=>q0,getSyntacticModifierFlagsNoCache:()=>Tz,getSynthesizedDeepClone:()=>wo,getSynthesizedDeepCloneWithReplacements:()=>kA,getSynthesizedDeepClones:()=>s2,getSynthesizedDeepClonesWithReplacements:()=>IH,getSyntheticLeadingComments:()=>sC,getSyntheticTrailingComments:()=>X8,getTargetLabel:()=>O9,getTargetOfBindingOrAssignmentElement:()=>ey,getTemporaryModuleResolutionState:()=>Lw,getTextOfConstantValue:()=>wee,getTextOfIdentifierOrLiteral:()=>cp,getTextOfJSDocComment:()=>vP,getTextOfJsxAttributeName:()=>j8,getTextOfJsxNamespacedName:()=>PE,getTextOfNode:()=>Wc,getTextOfNodeFromSourceText:()=>j4,getTextOfPropertyName:()=>Dk,getThisContainer:()=>i_,getThisParameter:()=>Fv,getTokenAtPosition:()=>Ji,getTokenPosOfNode:()=>cb,getTokenSourceMapRange:()=>jye,getTouchingPropertyName:()=>c_,getTouchingToken:()=>k3,getTrailingCommentRanges:()=>Hy,getTrailingSemicolonDeferringWriter:()=>gz,getTransformFlagsSubtreeExclusions:()=>Fre,getTransformers:()=>CV,getTsBuildInfoEmitOutputFilePath:()=>$h,getTsConfigObjectLiteralExpression:()=>W4,getTsConfigPropArrayElementValue:()=>zI,getTypeAnnotationNode:()=>bte,getTypeArgumentOrTypeParameterList:()=>noe,getTypeKeywordOfTypeOnlyImport:()=>kH,getTypeNode:()=>Wre,getTypeNodeIfAccessible:()=>F3,getTypeParameterFromJsDoc:()=>ste,getTypeParameterOwner:()=>i0e,getTypesPackageName:()=>kO,getUILocale:()=>$Z,getUniqueName:()=>Gb,getUniqueSymbolId:()=>boe,getUseDefineForClassFields:()=>A8,getWatchErrorSummaryDiagnosticMessage:()=>uq,getWatchFactory:()=>FV,group:()=>p4,groupBy:()=>VZ,guessIndentation:()=>hee,handleNoEmitOptions:()=>$V,hasAbstractModifier:()=>Mv,hasAccessorModifier:()=>Ad,hasAmbientModifier:()=>Sz,hasChangesInResolutions:()=>kJ,hasChildOfKind:()=>dA,hasContextSensitiveParameters:()=>V5,hasDecorators:()=>Of,hasDocComment:()=>toe,hasDynamicName:()=>V0,hasEffectiveModifier:()=>w_,hasEffectiveModifiers:()=>h5,hasEffectiveReadonlyModifier:()=>sE,hasExtension:()=>ZS,hasIndexSignature:()=>OH,hasInitializer:()=>J0,hasInvalidEscape:()=>dz,hasJSDocNodes:()=>q_,hasJSDocParameterTags:()=>JK,hasJSFileExtension:()=>jv,hasJsonModuleEmitEnabled:()=>w5,hasOnlyExpressionInitializer:()=>ab,hasOverrideModifier:()=>y5,hasPossibleExternalModuleReference:()=>Oee,hasProperty:()=>Ya,hasPropertyAccessExpressionWithName:()=>lA,hasQuestionToken:()=>cT,hasRecordedExternalHelpers:()=>Dne,hasResolutionModeOverride:()=>xre,hasRestParameter:()=>bJ,hasScopeMarker:()=>lee,hasStaticModifier:()=>Uc,hasSyntacticModifier:()=>In,hasSyntacticModifiers:()=>Dte,hasTSFileExtension:()=>Tb,hasTabstop:()=>bre,hasTrailingDirectorySeparator:()=>Nh,hasType:()=>xI,hasTypeArguments:()=>R0e,hasZeroOrOneAsteriskCharacter:()=>jz,helperString:()=>DW,hostGetCanonicalFileName:()=>jh,hostUsesCaseSensitiveFileNames:()=>y8,idText:()=>an,identifierIsThisKeyword:()=>bz,identifierToKeywordKind:()=>Xy,identity:()=>To,identitySourceMapConsumer:()=>MO,ignoreSourceNewlines:()=>EW,ignoredPaths:()=>tP,importDefaultHelper:()=>EF,importFromModuleSpecifier:()=>G4,importNameElisionDisabled:()=>Mz,importStarHelper:()=>Y8,indexOfAnyCharCode:()=>FZ,indexOfNode:()=>Ek,indicesOf:()=>WD,inferredTypesContainingFile:()=>jC,injectClassNamedEvaluationHelperBlockIfMissing:()=>UO,injectClassThisAssignmentIfMissing:()=>Zie,insertImports:()=>D3,insertLeadingStatement:()=>i1e,insertSorted:()=>P0,insertStatementAfterCustomPrologue:()=>ob,insertStatementAfterStandardPrologue:()=>D0e,insertStatementsAfterCustomPrologue:()=>CJ,insertStatementsAfterStandardPrologue:()=>vm,intersperse:()=>cj,intrinsicTagNameToString:()=>tW,introducesArgumentsExoticObject:()=>Hee,inverseJsxOptionMap:()=>e3,isAbstractConstructorSymbol:()=>Vte,isAbstractModifier:()=>Kre,isAccessExpression:()=>co,isAccessibilityModifier:()=>pH,isAccessor:()=>R0,isAccessorModifier:()=>tne,isAliasSymbolDeclaration:()=>B0e,isAliasableExpression:()=>u8,isAmbientModule:()=>ru,isAmbientPropertyDeclaration:()=>OJ,isAnonymousFunctionDefinition:()=>eE,isAnyDirectorySeparator:()=>BB,isAnyImportOrBareOrAccessedRequire:()=>Fee,isAnyImportOrReExport:()=>MP,isAnyImportSyntax:()=>lb,isAnySupportedFileExtension:()=>fye,isApplicableVersionedTypesKey:()=>jw,isArgumentExpressionOfElementAccess:()=>rH,isArray:()=>es,isArrayBindingElement:()=>hI,isArrayBindingOrAssignmentElement:()=>EP,isArrayBindingOrAssignmentPattern:()=>dJ,isArrayBindingPattern:()=>Eb,isArrayLiteralExpression:()=>Lu,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>Qh,isArrayTypeNode:()=>jF,isArrowFunction:()=>go,isAsExpression:()=>nw,isAssertClause:()=>lne,isAssertEntry:()=>Qye,isAssertionExpression:()=>sb,isAssertsKeyword:()=>Yre,isAssignmentDeclaration:()=>H4,isAssignmentExpression:()=>sl,isAssignmentOperator:()=>Bh,isAssignmentPattern:()=>L4,isAssignmentTarget:()=>og,isAsteriskToken:()=>ew,isAsyncFunction:()=>Z4,isAsyncModifier:()=>FE,isAutoAccessorPropertyDeclaration:()=>n_,isAwaitExpression:()=>Z0,isAwaitKeyword:()=>OW,isBigIntLiteral:()=>FF,isBinaryExpression:()=>Gr,isBinaryOperatorToken:()=>Mne,isBindableObjectDefinePropertyCall:()=>pb,isBindableStaticAccessExpression:()=>wv,isBindableStaticElementAccessExpression:()=>t5,isBindableStaticNameExpression:()=>db,isBindingElement:()=>Pa,isBindingElementOfBareOrAccessedRequire:()=>tte,isBindingName:()=>nb,isBindingOrAssignmentElement:()=>nee,isBindingOrAssignmentPattern:()=>kP,isBindingPattern:()=>As,isBlock:()=>Ss,isBlockOrCatchScoped:()=>PJ,isBlockScope:()=>LJ,isBlockScopedContainerTopLevel:()=>Iee,isBooleanLiteral:()=>O4,isBreakOrContinueStatement:()=>N4,isBreakStatement:()=>Gye,isBuildInfoFile:()=>Ese,isBuilderProgram:()=>cae,isBundle:()=>zW,isBundleFileTextLike:()=>Gte,isCallChain:()=>tb,isCallExpression:()=>Rs,isCallExpressionTarget:()=>Qq,isCallLikeExpression:()=>Sv,isCallLikeOrFunctionLikeExpression:()=>mJ,isCallOrNewExpression:()=>gm,isCallOrNewExpressionTarget:()=>Yq,isCallSignatureDeclaration:()=>cC,isCallToHelper:()=>IE,isCaseBlock:()=>WE,isCaseClause:()=>mC,isCaseKeyword:()=>rne,isCaseOrDefaultClause:()=>SI,isCatchClause:()=>Gv,isCatchClauseVariableDeclaration:()=>vre,isCatchClauseVariableDeclarationOrBindingElement:()=>wJ,isCheckJsEnabledForFile:()=>O8,isChildOfNodeWithKind:()=>P0e,isCircularBuildOrder:()=>YT,isClassDeclaration:()=>Vc,isClassElement:()=>Pl,isClassExpression:()=>Nl,isClassInstanceProperty:()=>eee,isClassLike:()=>Qn,isClassMemberModifier:()=>_J,isClassNamedEvaluationHelperBlock:()=>QT,isClassOrTypeElement:()=>gI,isClassStaticBlockDeclaration:()=>Go,isClassThisAssignmentBlock:()=>l3,isCollapsedRange:()=>K0e,isColonToken:()=>Xre,isCommaExpression:()=>_w,isCommaListExpression:()=>JE,isCommaSequence:()=>HE,isCommaToken:()=>$re,isComment:()=>q9,isCommonJsExportPropertyAssignment:()=>BI,isCommonJsExportedExpression:()=>Vee,isCompoundAssignment:()=>a3,isComputedNonLiteralName:()=>RP,isComputedPropertyName:()=>xa,isConciseBody:()=>vI,isConditionalExpression:()=>dC,isConditionalTypeNode:()=>fC,isConstTypeReference:()=>Vg,isConstructSignatureDeclaration:()=>rw,isConstructorDeclaration:()=>gc,isConstructorTypeNode:()=>ME,isContextualKeyword:()=>a5,isContinueStatement:()=>Hye,isCustomPrologue:()=>zP,isDebuggerStatement:()=>$ye,isDeclaration:()=>hu,isDeclarationBindingElement:()=>xP,isDeclarationFileName:()=>Il,isDeclarationName:()=>$g,isDeclarationNameOfEnumOrNamespace:()=>Nz,isDeclarationReadonly:()=>LI,isDeclarationStatement:()=>pee,isDeclarationWithTypeParameterChildren:()=>RJ,isDeclarationWithTypeParameters:()=>MJ,isDecorator:()=>ql,isDecoratorTarget:()=>Wae,isDefaultClause:()=>ow,isDefaultImport:()=>oT,isDefaultModifier:()=>MF,isDefaultedExpandoInitializer:()=>rte,isDeleteExpression:()=>sne,isDeleteTarget:()=>nz,isDeprecatedDeclaration:()=>mL,isDestructuringAssignment:()=>Jh,isDiagnosticWithLocation:()=>BH,isDiskPathRoot:()=>JB,isDoStatement:()=>Vye,isDocumentRegistryEntry:()=>IA,isDotDotDotToken:()=>OF,isDottedName:()=>oE,isDynamicName:()=>l5,isESSymbolIdentifier:()=>U0e,isEffectiveExternalModule:()=>sT,isEffectiveModuleDeclaration:()=>Nee,isEffectiveStrictModeSourceFile:()=>FJ,isElementAccessChain:()=>iJ,isElementAccessExpression:()=>mo,isEmittedFileOfProgram:()=>Ase,isEmptyArrayLiteral:()=>Lte,isEmptyBindingElement:()=>OK,isEmptyBindingPattern:()=>FK,isEmptyObjectLiteral:()=>Dz,isEmptyStatement:()=>jW,isEmptyStringLiteral:()=>qJ,isEntityName:()=>V_,isEntityNameExpression:()=>oc,isEnumConst:()=>Cv,isEnumDeclaration:()=>p1,isEnumMember:()=>$v,isEqualityOperatorKind:()=>aL,isEqualsGreaterThanToken:()=>Qre,isExclamationToken:()=>tw,isExcludedFile:()=>Qne,isExclusivelyTypeOnlyImportOrExport:()=>WV,isExpandoPropertyDeclaration:()=>$5,isExportAssignment:()=>cc,isExportDeclaration:()=>qc,isExportModifier:()=>wT,isExportName:()=>YF,isExportNamespaceAsDefaultDeclaration:()=>NI,isExportOrDefaultModifier:()=>mw,isExportSpecifier:()=>vu,isExportsIdentifier:()=>fb,isExportsOrModuleExportsOrAlias:()=>Yv,isExpression:()=>ct,isExpressionNode:()=>sg,isExpressionOfExternalModuleImportEqualsDeclaration:()=>Hae,isExpressionOfOptionalChainRoot:()=>fI,isExpressionStatement:()=>kl,isExpressionWithTypeArguments:()=>qh,isExpressionWithTypeArgumentsInClassExtendsClause:()=>T8,isExternalModule:()=>Nc,isExternalModuleAugmentation:()=>xv,isExternalModuleImportEqualsDeclaration:()=>Ky,isExternalModuleIndicator:()=>DP,isExternalModuleNameRelative:()=>Tl,isExternalModuleReference:()=>Pm,isExternalModuleSymbol:()=>yA,isExternalOrCommonJsModule:()=>H_,isFileLevelReservedGeneratedIdentifier:()=>TP,isFileLevelUniqueName:()=>wI,isFileProbablyExternalModule:()=>yw,isFirstDeclarationOfSymbolParameter:()=>DH,isFixablePromiseHandler:()=>uG,isForInOrOfStatement:()=>Sk,isForInStatement:()=>UF,isForInitializer:()=>Ff,isForOfStatement:()=>iw,isForStatement:()=>wb,isFunctionBlock:()=>Dv,isFunctionBody:()=>hJ,isFunctionDeclaration:()=>Zc,isFunctionExpression:()=>ro,isFunctionExpressionOrArrowFunction:()=>Jv,isFunctionLike:()=>ks,isFunctionLikeDeclaration:()=>po,isFunctionLikeKind:()=>nT,isFunctionLikeOrClassStaticBlockDeclaration:()=>yk,isFunctionOrConstructorTypeNode:()=>ree,isFunctionOrModuleBlock:()=>fJ,isFunctionSymbol:()=>ite,isFunctionTypeNode:()=>pg,isFutureReservedKeyword:()=>J0e,isGeneratedIdentifier:()=>Eo,isGeneratedPrivateIdentifier:()=>rb,isGetAccessor:()=>B0,isGetAccessorDeclaration:()=>pf,isGetOrSetAccessorDeclaration:()=>uI,isGlobalDeclaration:()=>ISe,isGlobalScopeAugmentation:()=>Dd,isGrammarError:()=>Eee,isHeritageClause:()=>Q_,isHoistedFunction:()=>RI,isHoistedVariableStatement:()=>jI,isIdentifier:()=>Ie,isIdentifierANonContextualKeyword:()=>o5,isIdentifierName:()=>ute,isIdentifierOrThisTypeNode:()=>Ine,isIdentifierPart:()=>Gy,isIdentifierStart:()=>eg,isIdentifierText:()=>lf,isIdentifierTypePredicate:()=>Gee,isIdentifierTypeReference:()=>dre,isIfStatement:()=>Pb,isIgnoredFileFromWildCardWatching:()=>Xw,isImplicitGlob:()=>zz,isImportAttribute:()=>une,isImportAttributeName:()=>KK,isImportAttributes:()=>VF,isImportCall:()=>G_,isImportClause:()=>Em,isImportDeclaration:()=>gl,isImportEqualsDeclaration:()=>Hl,isImportKeyword:()=>LE,isImportMeta:()=>Ak,isImportOrExportSpecifier:()=>rT,isImportOrExportSpecifierName:()=>yoe,isImportSpecifier:()=>v_,isImportTypeAssertionContainer:()=>Xye,isImportTypeNode:()=>Zg,isImportableFile:()=>YH,isInComment:()=>Xh,isInCompoundLikeAssignment:()=>tz,isInExpressionContext:()=>$I,isInJSDoc:()=>GP,isInJSFile:()=>Hr,isInJSXText:()=>Kae,isInJsonFile:()=>QI,isInNonReferenceComment:()=>aoe,isInReferenceComment:()=>soe,isInRightSideOfInternalImportEqualsDeclaration:()=>I9,isInString:()=>Vb,isInTemplateString:()=>lH,isInTopLevelContext:()=>VI,isInTypeQuery:()=>yb,isIncrementalCompilation:()=>w8,isIndexSignatureDeclaration:()=>Cb,isIndexedAccessTypeNode:()=>OT,isInferTypeNode:()=>NT,isInfinityOrNaNString:()=>kE,isInitializedProperty:()=>Uw,isInitializedVariable:()=>E8,isInsideJsxElement:()=>U9,isInsideJsxElementOrAttribute:()=>Zae,isInsideNodeModules:()=>wA,isInsideTemplateLiteral:()=>gA,isInstanceOfExpression:()=>v5,isInstantiatedModule:()=>eV,isInterfaceDeclaration:()=>Mu,isInternalDeclaration:()=>xV,isInternalModuleImportEqualsDeclaration:()=>Ok,isInternalName:()=>KW,isIntersectionTypeNode:()=>_C,isIntrinsicJsxName:()=>Hk,isIterationStatement:()=>j0,isJSDoc:()=>zp,isJSDocAllType:()=>mne,isJSDocAugmentsTag:()=>yC,isJSDocAuthorTag:()=>e1e,isJSDocCallbackTag:()=>UW,isJSDocClassTag:()=>hne,isJSDocCommentContainingNode:()=>TI,isJSDocConstructSignature:()=>Bk,isJSDocDeprecatedTag:()=>$W,isJSDocEnumTag:()=>cw,isJSDocFunctionType:()=>hC,isJSDocImplementsTag:()=>XW,isJSDocIndexSignature:()=>YI,isJSDocLikeText:()=>cU,isJSDocLink:()=>pne,isJSDocLinkCode:()=>dne,isJSDocLinkLike:()=>iT,isJSDocLinkPlain:()=>Zye,isJSDocMemberName:()=>d1,isJSDocNameReference:()=>VE,isJSDocNamepathType:()=>Kye,isJSDocNamespaceBody:()=>T0e,isJSDocNode:()=>Tk,isJSDocNonNullableType:()=>qF,isJSDocNullableType:()=>gC,isJSDocOptionalParameter:()=>R8,isJSDocOptionalType:()=>WW,isJSDocOverloadTag:()=>vC,isJSDocOverrideTag:()=>GF,isJSDocParameterTag:()=>ad,isJSDocPrivateTag:()=>qW,isJSDocPropertyLikeTag:()=>bP,isJSDocPropertyTag:()=>vne,isJSDocProtectedTag:()=>HW,isJSDocPublicTag:()=>VW,isJSDocReadonlyTag:()=>GW,isJSDocReturnTag:()=>$F,isJSDocSatisfiesExpression:()=>Kz,isJSDocSatisfiesTag:()=>XF,isJSDocSeeTag:()=>t1e,isJSDocSignature:()=>m1,isJSDocTag:()=>xk,isJSDocTemplateTag:()=>od,isJSDocThisTag:()=>yne,isJSDocThrowsTag:()=>n1e,isJSDocTypeAlias:()=>op,isJSDocTypeAssertion:()=>GE,isJSDocTypeExpression:()=>Fb,isJSDocTypeLiteral:()=>JT,isJSDocTypeTag:()=>qE,isJSDocTypedefTag:()=>bC,isJSDocUnknownTag:()=>r1e,isJSDocUnknownType:()=>gne,isJSDocVariadicType:()=>HF,isJSXTagName:()=>Fk,isJsonEqual:()=>W5,isJsonSourceFile:()=>ap,isJsxAttribute:()=>Rd,isJsxAttributeLike:()=>bI,isJsxAttributeName:()=>Tre,isJsxAttributes:()=>Hv,isJsxChild:()=>AP,isJsxClosingElement:()=>Vv,isJsxClosingFragment:()=>_ne,isJsxElement:()=>dg,isJsxExpression:()=>UE,isJsxFragment:()=>qv,isJsxNamespacedName:()=>sd,isJsxOpeningElement:()=>Md,isJsxOpeningFragment:()=>jT,isJsxOpeningLikeElement:()=>qu,isJsxOpeningLikeElementTagName:()=>Uae,isJsxSelfClosingElement:()=>Nb,isJsxSpreadAttribute:()=>BT,isJsxTagNameExpression:()=>M4,isJsxText:()=>DT,isJumpStatementTarget:()=>uA,isKeyword:()=>a_,isKeywordOrPunctuation:()=>s5,isKnownSymbol:()=>p8,isLabelName:()=>eH,isLabelOfLabeledStatement:()=>Kq,isLabeledStatement:()=>Uv,isLateVisibilityPaintedStatement:()=>FI,isLeftHandSideExpression:()=>m_,isLeftHandSideOfAssignment:()=>Z0e,isLet:()=>MI,isLineBreak:()=>mu,isLiteralComputedPropertyDeclarationName:()=>l8,isLiteralExpression:()=>vv,isLiteralExpressionOfObject:()=>lJ,isLiteralImportTypeNode:()=>U0,isLiteralKind:()=>I4,isLiteralLikeAccess:()=>e5,isLiteralLikeElementAccess:()=>ZP,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>L9,isLiteralTypeLikeExpression:()=>l1e,isLiteralTypeLiteral:()=>oee,isLiteralTypeNode:()=>_1,isLocalName:()=>eh,isLogicalOperator:()=>Ite,isLogicalOrCoalescingAssignmentExpression:()=>xz,isLogicalOrCoalescingAssignmentOperator:()=>aE,isLogicalOrCoalescingBinaryExpression:()=>S8,isLogicalOrCoalescingBinaryOperator:()=>b8,isMappedTypeNode:()=>jE,isMemberName:()=>tg,isMetaProperty:()=>BE,isMethodDeclaration:()=>mc,isMethodOrAccessor:()=>vk,isMethodSignature:()=>fg,isMinusToken:()=>FW,isMissingDeclaration:()=>Yye,isModifier:()=>Ys,isModifierKind:()=>Oh,isModifierLike:()=>Do,isModuleAugmentationExternal:()=>NJ,isModuleBlock:()=>Ld,isModuleBody:()=>uee,isModuleDeclaration:()=>vc,isModuleExportsAccessExpression:()=>ag,isModuleIdentifier:()=>QJ,isModuleName:()=>Lne,isModuleOrEnumDeclaration:()=>PP,isModuleReference:()=>mee,isModuleSpecifierLike:()=>Z9,isModuleWithStringLiteralName:()=>II,isNameOfFunctionDeclaration:()=>iH,isNameOfModuleDeclaration:()=>nH,isNamedClassElement:()=>tee,isNamedDeclaration:()=>Au,isNamedEvaluation:()=>P_,isNamedEvaluationSource:()=>cz,isNamedExportBindings:()=>aJ,isNamedExports:()=>gp,isNamedImportBindings:()=>yJ,isNamedImports:()=>Kg,isNamedImportsOrExports:()=>C5,isNamedTupleMember:()=>RE,isNamespaceBody:()=>S0e,isNamespaceExport:()=>Dm,isNamespaceExportDeclaration:()=>aw,isNamespaceImport:()=>K0,isNamespaceReexportDeclaration:()=>ete,isNewExpression:()=>Wv,isNewExpressionTarget:()=>T3,isNoSubstitutionTemplateLiteral:()=>PT,isNode:()=>g0e,isNodeArray:()=>yv,isNodeArrayMultiLine:()=>zte,isNodeDescendantOf:()=>Av,isNodeKind:()=>SP,isNodeLikeSystem:()=>Pj,isNodeModulesDirectory:()=>eI,isNodeWithPossibleHoistedDeclaration:()=>ote,isNonContextualKeyword:()=>oz,isNonExportDefaultModifier:()=>_1e,isNonGlobalAmbientModule:()=>AJ,isNonGlobalDeclaration:()=>Ooe,isNonNullAccess:()=>Sre,isNonNullChain:()=>pI,isNonNullExpression:()=>MT,isNonStaticMethodOrAccessorWithPrivateName:()=>Vie,isNotEmittedOrPartiallyEmittedNode:()=>b0e,isNotEmittedStatement:()=>JW,isNullishCoalesce:()=>sJ,isNumber:()=>wh,isNumericLiteral:()=>A_,isNumericLiteralName:()=>_g,isObjectBindingElementWithoutPropertyName:()=>SA,isObjectBindingOrAssignmentElement:()=>CP,isObjectBindingOrAssignmentPattern:()=>pJ,isObjectBindingPattern:()=>jp,isObjectLiteralElement:()=>vJ,isObjectLiteralElementLike:()=>qg,isObjectLiteralExpression:()=>ma,isObjectLiteralMethod:()=>Mp,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>JI,isObjectTypeDeclaration:()=>hT,isOctalDigit:()=>iI,isOmittedExpression:()=>dl,isOptionalChain:()=>gu,isOptionalChainRoot:()=>w4,isOptionalDeclaration:()=>EE,isOptionalJSDocPropertyLikeTag:()=>M8,isOptionalTypeNode:()=>LW,isOuterExpression:()=>KF,isOutermostOptionalChain:()=>A4,isOverrideModifier:()=>ene,isPackedArrayLiteral:()=>Qz,isParameter:()=>us,isParameterDeclaration:()=>Iv,isParameterOrCatchClauseVariable:()=>Yz,isParameterPropertyDeclaration:()=>E_,isParameterPropertyModifier:()=>F4,isParenthesizedExpression:()=>y_,isParenthesizedTypeNode:()=>IT,isParseTreeNode:()=>P4,isPartOfTypeNode:()=>ig,isPartOfTypeQuery:()=>XI,isPartiallyEmittedExpression:()=>WF,isPatternMatch:()=>P7,isPinnedComment:()=>AI,isPlainJsFile:()=>FP,isPlusToken:()=>IW,isPossiblyTypeArgumentPosition:()=>mA,isPostfixUnaryExpression:()=>RW,isPrefixUnaryExpression:()=>f1,isPrivateIdentifier:()=>Ti,isPrivateIdentifierClassElementDeclaration:()=>Nu,isPrivateIdentifierPropertyAccessExpression:()=>hk,isPrivateIdentifierSymbol:()=>fte,isProgramBundleEmitBuildInfo:()=>Hse,isProgramUptoDate:()=>HV,isPrologueDirective:()=>Lp,isPropertyAccessChain:()=>_I,isPropertyAccessEntityNameExpression:()=>x8,isPropertyAccessExpression:()=>bn,isPropertyAccessOrQualifiedName:()=>see,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>iee,isPropertyAssignment:()=>Hc,isPropertyDeclaration:()=>Es,isPropertyName:()=>wc,isPropertyNameLiteral:()=>wd,isPropertySignature:()=>ff,isProtoSetter:()=>pte,isPrototypeAccess:()=>H0,isPrototypePropertyAssignment:()=>t8,isPunctuation:()=>az,isPushOrUnshiftIdentifier:()=>lz,isQualifiedName:()=>h_,isQuestionDotToken:()=>LF,isQuestionOrExclamationToken:()=>Nne,isQuestionOrPlusOrMinusToken:()=>One,isQuestionToken:()=>Y0,isRawSourceMap:()=>Jie,isReadonlyKeyword:()=>Zre,isReadonlyKeywordOrPlusOrMinusToken:()=>Fne,isRecognizedTripleSlashComment:()=>EJ,isReferenceFileLocation:()=>MC,isReferencedFile:()=>T1,isRegularExpressionLiteral:()=>AW,isRequireCall:()=>g_,isRequireVariableStatement:()=>$J,isRestParameter:()=>rg,isRestTypeNode:()=>MW,isReturnStatement:()=>Bp,isReturnStatementWithFixablePromiseHandler:()=>CL,isRightSideOfAccessExpression:()=>Ez,isRightSideOfInstanceofExpression:()=>Ote,isRightSideOfPropertyAccess:()=>VC,isRightSideOfQualifiedName:()=>qae,isRightSideOfQualifiedNameOrPropertyAccess:()=>cE,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>Fte,isRootedDiskPath:()=>C_,isSameEntityName:()=>Lk,isSatisfiesExpression:()=>ane,isScopeMarker:()=>cee,isSemicolonClassElement:()=>one,isSetAccessor:()=>Lh,isSetAccessorDeclaration:()=>N_,isShebangTrivia:()=>qB,isShiftOperatorOrHigher:()=>sU,isShorthandAmbientModuleSymbol:()=>B4,isShorthandPropertyAssignment:()=>Y_,isSignedNumericLiteral:()=>c5,isSimpleCopiableExpression:()=>Kv,isSimpleInlineableExpression:()=>jd,isSingleOrDoubleQuote:()=>$P,isSourceFile:()=>Ai,isSourceFileFromLibrary:()=>L3,isSourceFileJS:()=>Iu,isSourceFileNotJS:()=>N0e,isSourceFileNotJson:()=>GJ,isSourceMapping:()=>zie,isSpecialPropertyDeclaration:()=>nte,isSpreadAssignment:()=>Hh,isSpreadElement:()=>Od,isStatement:()=>Ci,isStatementButNotDeclaration:()=>wP,isStatementOrBlock:()=>dee,isStatementWithLocals:()=>Cee,isStatic:()=>Ls,isStaticModifier:()=>AT,isString:()=>ns,isStringAKeyword:()=>z0e,isStringANonContextualKeyword:()=>_T,isStringAndEmptyAnonymousObjectIntersection:()=>ioe,isStringDoubleQuoted:()=>KI,isStringLiteral:()=>ra,isStringLiteralLike:()=>Ja,isStringLiteralOrJsxExpression:()=>gee,isStringLiteralOrTemplate:()=>Coe,isStringOrNumericLiteralLike:()=>_f,isStringOrRegularExpressionOrTemplateLiteral:()=>fH,isStringTextContainingNode:()=>uJ,isSuperCall:()=>ub,isSuperKeyword:()=>OE,isSuperOrSuperProperty:()=>A0e,isSuperProperty:()=>s_,isSupportedSourceFileName:()=>ure,isSwitchStatement:()=>sw,isSyntaxList:()=>SC,isSyntheticExpression:()=>Uye,isSyntheticReference:()=>RT,isTagName:()=>tH,isTaggedTemplateExpression:()=>Db,isTaggedTemplateTag:()=>zae,isTemplateExpression:()=>JF,isTemplateHead:()=>oC,isTemplateLiteral:()=>bk,isTemplateLiteralKind:()=>M0,isTemplateLiteralToken:()=>YK,isTemplateLiteralTypeNode:()=>Wye,isTemplateLiteralTypeSpan:()=>nne,isTemplateMiddle:()=>Gre,isTemplateMiddleOrTemplateTail:()=>dI,isTemplateSpan:()=>zE,isTemplateTail:()=>NW,isTextWhiteSpaceLike:()=>uoe,isThis:()=>qC,isThisContainerOrFunctionBlock:()=>Yee,isThisIdentifier:()=>Lv,isThisInTypeQuery:()=>pT,isThisInitializedDeclaration:()=>qI,isThisInitializedObjectBindingExpression:()=>Kee,isThisProperty:()=>VP,isThisTypeNode:()=>BF,isThisTypeParameter:()=>CE,isThisTypePredicate:()=>w0e,isThrowStatement:()=>BW,isToken:()=>tT,isTokenKind:()=>cJ,isTraceEnabled:()=>th,isTransientSymbol:()=>ym,isTrivia:()=>Uk,isTryStatement:()=>Ab,isTupleTypeNode:()=>uC,isTypeAlias:()=>i8,isTypeAliasDeclaration:()=>Jp,isTypeAssertionExpression:()=>ine,isTypeDeclaration:()=>rC,isTypeElement:()=>ib,isTypeKeyword:()=>E3,isTypeKeywordToken:()=>yH,isTypeKeywordTokenOrIdentifier:()=>$9,isTypeLiteralNode:()=>X_,isTypeNode:()=>Si,isTypeNodeKind:()=>Oz,isTypeOfExpression:()=>pC,isTypeOnlyExportDeclaration:()=>ZK,isTypeOnlyImportDeclaration:()=>mI,isTypeOnlyImportOrExportDeclaration:()=>bv,isTypeOperatorNode:()=>FT,isTypeParameterDeclaration:()=>Uo,isTypePredicateNode:()=>RF,isTypeQueryNode:()=>lC,isTypeReferenceNode:()=>mp,isTypeReferenceType:()=>kI,isTypeUsableAsPropertyName:()=>pp,isUMDExportSymbol:()=>k5,isUnaryExpression:()=>gJ,isUnaryExpressionWithWrite:()=>aee,isUnicodeIdentifierStart:()=>rI,isUnionTypeNode:()=>u1,isUnparsedNode:()=>oJ,isUnparsedPrepend:()=>fne,isUnparsedSource:()=>Ib,isUnparsedTextLike:()=>QK,isUrl:()=>yK,isValidBigIntString:()=>U5,isValidESSymbolDeclaration:()=>qee,isValidTypeOnlyAliasUseSite:()=>o1,isValueSignatureDeclaration:()=>cte,isVarAwaitUsing:()=>BP,isVarConst:()=>wk,isVarUsing:()=>JP,isVariableDeclaration:()=>Ei,isVariableDeclarationInVariableStatement:()=>z4,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>Pv,isVariableDeclarationInitializedToRequire:()=>ZI,isVariableDeclarationList:()=>ml,isVariableLike:()=>Nk,isVariableLikeOrAccessor:()=>Uee,isVariableStatement:()=>ec,isVoidExpression:()=>LT,isWatchSet:()=>tye,isWhileStatement:()=>qye,isWhiteSpaceLike:()=>Ug,isWhiteSpaceSingleLine:()=>Cd,isWithStatement:()=>cne,isWriteAccess:()=>gT,isWriteOnlyAccess:()=>x5,isYieldExpression:()=>zF,jsxModeNeedsExplicitImport:()=>VH,keywordPart:()=>F_,last:()=>Sa,lastOrUndefined:()=>Mo,length:()=>Ir,libMap:()=>lO,libs:()=>Dw,lineBreakPart:()=>XC,linkNamePart:()=>goe,linkPart:()=>wH,linkTextPart:()=>rL,listFiles:()=>_q,loadModuleFromGlobalCache:()=>xie,loadWithModeAwareCache:()=>Zw,makeIdentifierFromModuleName:()=>Aee,makeImport:()=>Yh,makeImportIfNecessary:()=>loe,makeStringLiteral:()=>ex,mangleScopedPackageName:()=>IC,map:()=>Yt,mapAllOrFail:()=>_j,mapDefined:()=>Ii,mapDefinedEntries:()=>LZ,mapDefinedIterator:()=>nk,mapEntries:()=>RZ,mapIterator:()=>c4,mapOneOrMany:()=>zH,mapToDisplayParts:()=>ny,matchFiles:()=>Uz,matchPatternOrExact:()=>qz,matchedText:()=>KZ,matchesExclude:()=>cO,maybeBind:()=>Os,maybeSetLocalizedDiagnosticMessages:()=>Kte,memoize:()=>Vu,memoizeCached:()=>HZ,memoizeOne:()=>_m,memoizeWeak:()=>uhe,metadataHelper:()=>oF,min:()=>xj,minAndMax:()=>fre,missingFileModifiedTime:()=>Zm,modifierToFlag:()=>mT,modifiersToFlags:()=>Nd,moduleOptionDeclaration:()=>EU,moduleResolutionIsEqualTo:()=>xee,moduleResolutionNameAndModeGetter:()=>eA,moduleResolutionOptionDeclarations:()=>uO,moduleResolutionSupportsPackageJsonExportsAndImports:()=>bT,moduleResolutionUsesNodeModules:()=>X9,moduleSpecifiers:()=>Zv,moveEmitHelpers:()=>Jre,moveRangeEnd:()=>S5,moveRangePastDecorators:()=>Wh,moveRangePastModifiers:()=>Id,moveRangePos:()=>i1,moveSyntheticComments:()=>Rre,mutateMap:()=>Qk,mutateMapSkippingNewValues:()=>Xg,needsParentheses:()=>iL,needsScopeMarker:()=>yI,newCaseClauseTracker:()=>yL,newPrivateEnvironment:()=>Gie,noEmitNotification:()=>Vw,noEmitSubstitution:()=>f3,noTransformers:()=>EV,noTruncationMaximumTruncationLength:()=>Q5,nodeCanBeDecorated:()=>GI,nodeHasName:()=>gP,nodeIsDecorated:()=>U4,nodeIsMissing:()=>sc,nodeIsPresent:()=>ip,nodeIsSynthesized:()=>Po,nodeModuleNameResolver:()=>mie,nodeModulesPathPart:()=>Am,nodeNextJsonConfigResolver:()=>gie,nodeOrChildIsDecorated:()=>HP,nodeOverlapsWithStartEnd:()=>M9,nodePosToString:()=>x0e,nodeSeenTracker:()=>KT,nodeStartsNewLexicalEnvironment:()=>uz,nodeToDisplayParts:()=>ESe,noop:()=>Ca,noopFileWatcher:()=>zC,normalizePath:()=>qs,normalizeSlashes:()=>du,not:()=>A7,notImplemented:()=>ys,notImplementedResolver:()=>QO,nullNodeConverters:()=>hW,nullParenthesizerRules:()=>gW,nullTransformationContext:()=>cd,objectAllocator:()=>Al,operatorPart:()=>w3,optionDeclarations:()=>mg,optionMapToObject:()=>bU,optionsAffectingProgramStructure:()=>NU,optionsForBuild:()=>FU,optionsForWatch:()=>DC,optionsHaveChanges:()=>kk,optionsHaveModuleResolutionChanges:()=>bee,or:()=>ed,orderedRemoveItem:()=>HD,orderedRemoveItemAt:()=>Uy,outFile:()=>to,packageIdToPackageName:()=>DI,packageIdToString:()=>z0,paramHelper:()=>cF,parameterIsThisKeyword:()=>Ov,parameterNamePart:()=>foe,parseBaseNodeFactory:()=>fU,parseBigInt:()=>pre,parseBuildCommand:()=>U1e,parseCommandLine:()=>z1e,parseCommandLineWorker:()=>mU,parseConfigFileTextToJson:()=>hU,parseConfigFileWithSystem:()=>Ebe,parseConfigHostFromCompilerHostLike:()=>o9,parseCustomTypeOption:()=>aO,parseIsolatedEntityName:()=>WT,parseIsolatedJSDocComment:()=>Wne,parseJSDocTypeExpressionForTests:()=>P1e,parseJsonConfigFileContent:()=>nve,parseJsonSourceFileConfigFileContent:()=>kw,parseJsonText:()=>bw,parseListTypeOption:()=>Vne,parseNodeFactory:()=>wm,parseNodeModuleFromPath:()=>Ow,parsePackageName:()=>Rw,parsePseudoBigInt:()=>bE,parseValidBigInt:()=>Xz,patchWriteFileEnsuringDirectory:()=>gK,pathContainsNodeModules:()=>HT,pathIsAbsolute:()=>b4,pathIsBareSpecifier:()=>zB,pathIsRelative:()=>U_,patternText:()=>ZZ,perfLogger:()=>Pu,performIncrementalCompilation:()=>Abe,performance:()=>uK,plainJSErrors:()=>u9,positionBelongsToNode:()=>aH,positionIsASICandidate:()=>cL,positionIsSynthesized:()=>id,positionsAreOnSameLine:()=>_p,preProcessFile:()=>KSe,probablyUsesSemicolons:()=>DA,processCommentPragmas:()=>uU,processPragmasIntoFields:()=>_U,processTaggedTemplateExpression:()=>yV,programContainsEsModules:()=>coe,programContainsModules:()=>ooe,projectReferenceIsEqualTo:()=>TJ,propKeyHelper:()=>SF,propertyNamePart:()=>poe,pseudoBigIntToString:()=>Bv,punctuationPart:()=>Su,pushIfUnique:()=>tp,quote:()=>I3,quotePreferenceFromString:()=>TH,rangeContainsPosition:()=>_A,rangeContainsPositionExclusive:()=>fA,rangeContainsRange:()=>yf,rangeContainsRangeExclusive:()=>Gae,rangeContainsStartEnd:()=>pA,rangeEndIsOnSameLineAsRangeStart:()=>C8,rangeEndPositionsAreOnSameLine:()=>Bte,rangeEquals:()=>gj,rangeIsOnSingleLine:()=>bb,rangeOfNode:()=>Gz,rangeOfTypeParameters:()=>$z,rangeOverlapsWithStartEnd:()=>x3,rangeStartIsOnSameLineAsRangeEnd:()=>Jte,rangeStartPositionsAreOnSameLine:()=>T5,readBuilderProgram:()=>T9,readConfigFile:()=>Tw,readHelper:()=>vF,readJson:()=>lE,readJsonConfigFile:()=>Gne,readJsonOrUndefined:()=>Pz,reduceEachLeadingCommentRange:()=>xK,reduceEachTrailingCommentRange:()=>kK,reduceLeft:()=>Eu,reduceLeftIterator:()=>ahe,reducePathComponents:()=>eb,refactor:()=>nx,regExpEscape:()=>lye,relativeComplement:()=>BZ,removeAllComments:()=>G8,removeEmitHelper:()=>Bye,removeExtension:()=>F8,removeFileExtension:()=>Ou,removeIgnoredPath:()=>p9,removeMinAndVersionNumbers:()=>kj,removeOptionality:()=>eoe,removePrefix:()=>g4,removeSuffix:()=>sk,removeTrailingDirectorySeparator:()=>Vy,repeatString:()=>vA,replaceElement:()=>vj,resolutionExtensionIsTSOrJson:()=>yE,resolveConfigFileProjectName:()=>Tq,resolveJSModule:()=>pie,resolveLibrary:()=>bO,resolveModuleName:()=>AC,resolveModuleNameFromCache:()=>Jve,resolvePackageNameToPackageJson:()=>MU,resolvePath:()=>I0,resolveProjectReferencePath:()=>RC,resolveTripleslashReference:()=>e9,resolveTypeReferenceDirective:()=>uie,resolvingEmptyArray:()=>X5,restHelper:()=>mF,returnFalse:()=>Kp,returnNoopFileWatcher:()=>WC,returnTrue:()=>zg,returnUndefined:()=>Wy,returnsPromise:()=>lG,runInitializersHelper:()=>uF,sameFlatMap:()=>OZ,sameMap:()=>Yc,sameMapping:()=>P2e,scanShebangTrivia:()=>HB,scanTokenAtPosition:()=>Jee,scanner:()=>Tu,screenStartingMessageCodes:()=>S9,semanticDiagnosticsOptionDeclarations:()=>PU,serializeCompilerOptions:()=>TU,server:()=>GDe,servicesVersion:()=>ele,setCommentRange:()=>Ac,setConfigFileInOptions:()=>kU,setConstantValue:()=>Bre,setEachParent:()=>tC,setEmitFlags:()=>Vr,setFunctionNameHelper:()=>TF,setGetSourceFileAsHashVersioned:()=>b9,setIdentifierAutoGenerate:()=>Q8,setIdentifierGeneratedImportReference:()=>Ure,setIdentifierTypeArguments:()=>Vh,setInternalEmitFlags:()=>$8,setLocalizedDiagnosticMessages:()=>Zte,setModuleDefaultHelper:()=>CF,setNodeFlags:()=>gre,setObjectAllocator:()=>Yte,setOriginalNode:()=>rn,setParent:()=>ga,setParentRecursive:()=>$0,setPrivateIdentifier:()=>Rb,setSnippetElement:()=>CW,setSourceMapRange:()=>ya,setStackTraceLimit:()=>Nhe,setStartsOnNewLine:()=>nF,setSyntheticLeadingComments:()=>l1,setSyntheticTrailingComments:()=>kT,setSys:()=>Mhe,setSysLog:()=>dK,setTextRange:()=>tt,setTextRangeEnd:()=>eC,setTextRangePos:()=>SE,setTextRangePosEnd:()=>km,setTextRangePosWidth:()=>TE,setTokenSourceMapRange:()=>Mre,setTypeNode:()=>zre,setUILocale:()=>XZ,setValueDeclaration:()=>r8,shouldAllowImportingTsExtension:()=>FC,shouldPreserveConstEnums:()=>Sb,shouldResolveJsRequire:()=>N5,shouldUseUriStyleNodeCoreModules:()=>gL,showModuleSpecifier:()=>qte,signatureHasLiteralTypes:()=>tV,signatureHasRestParameter:()=>bu,signatureToDisplayParts:()=>AH,single:()=>yj,singleElementArray:()=>Q2,singleIterator:()=>MZ,singleOrMany:()=>um,singleOrUndefined:()=>lm,skipAlias:()=>yu,skipAssertions:()=>a1e,skipConstraint:()=>vH,skipOuterExpressions:()=>bc,skipParentheses:()=>Ha,skipPartiallyEmittedExpressions:()=>Fp,skipTrivia:()=>la,skipTypeChecking:()=>vE,skipTypeParentheses:()=>rz,skipWhile:()=>tK,sliceAfter:()=>Hz,some:()=>ut,sort:()=>qS,sortAndDeduplicate:()=>_4,sortAndDeduplicateDiagnostics:()=>pk,sourceFileAffectingCompilerOptions:()=>_O,sourceFileMayBeEmitted:()=>fT,sourceMapCommentRegExp:()=>OO,sourceMapCommentRegExpDontCareLineStart:()=>cV,spacePart:()=>tc,spanMap:()=>fj,spreadArrayHelper:()=>bF,stableSort:()=>Eh,startEndContainsRange:()=>sH,startEndOverlapsWithStartEnd:()=>R9,startOnNewLine:()=>Ru,startTracing:()=>_K,startsWith:()=>Qi,startsWithDirectory:()=>UB,startsWithUnderscore:()=>UH,startsWithUseStrict:()=>Cne,stringContainsAt:()=>Foe,stringToToken:()=>mv,stripQuotes:()=>lp,supportedDeclarationExtensions:()=>z8,supportedJSExtensions:()=>pW,supportedJSExtensionsFlat:()=>iC,supportedLocaleDirectories:()=>SJ,supportedTSExtensions:()=>nC,supportedTSExtensionsFlat:()=>fW,supportedTSImplementationExtensions:()=>W8,suppressLeadingAndTrailingTrivia:()=>O_,suppressLeadingTrivia:()=>FH,suppressTrailingTrivia:()=>Toe,symbolEscapedNameNoDefault:()=>Y9,symbolName:()=>pc,symbolNameNoDefault:()=>Q9,symbolPart:()=>_oe,symbolToDisplayParts:()=>A3,syntaxMayBeASICandidate:()=>XH,syntaxRequiresTrailingSemicolonOrASI:()=>oL,sys:()=>Bl,sysLog:()=>KD,tagNamesAreEquivalent:()=>h1,takeWhile:()=>I7,targetOptionDeclaration:()=>ww,templateObjectHelper:()=>yF,testFormatSettings:()=>Jae,textChangeRangeIsUnchanged:()=>NK,textChangeRangeNewSpan:()=>D4,textChanges:()=>Qr,textOrKeywordPart:()=>PH,textPart:()=>bf,textRangeContainsPositionInclusive:()=>pP,textSpanContainsPosition:()=>XB,textSpanContainsTextSpan:()=>DK,textSpanEnd:()=>yc,textSpanIntersection:()=>AK,textSpanIntersectsWith:()=>oI,textSpanIntersectsWithPosition:()=>wK,textSpanIntersectsWithTextSpan:()=>n0e,textSpanIsEmpty:()=>EK,textSpanOverlap:()=>PK,textSpanOverlapsWith:()=>r0e,textSpansEqual:()=>$C,textToKeywordObj:()=>_P,timestamp:()=>_o,toArray:()=>$S,toBuilderFileEmit:()=>Qse,toBuilderStateFileInfoForMultiEmit:()=>Xse,toEditorSettings:()=>HA,toFileNameLowerCase:()=>xd,toLowerCase:()=>qZ,toPath:()=>fo,toProgramEmitPending:()=>Yse,tokenIsIdentifierOrKeyword:()=>wu,tokenIsIdentifierOrKeywordOrGreaterThan:()=>SK,tokenToString:()=>Hs,trace:()=>Gi,tracing:()=>Jr,tracingEnabled:()=>XD,transform:()=>Zxe,transformClassFields:()=>nse,transformDeclarations:()=>kV,transformECMAScriptModule:()=>TV,transformES2015:()=>yse,transformES2016:()=>hse,transformES2017:()=>ose,transformES2018:()=>cse,transformES2019:()=>lse,transformES2020:()=>use,transformES2021:()=>_se,transformES5:()=>vse,transformESDecorators:()=>ase,transformESNext:()=>fse,transformGenerators:()=>bse,transformJsx:()=>gse,transformLegacyDecorators:()=>sse,transformModule:()=>SV,transformNamedEvaluation:()=>I_,transformNodeModule:()=>Tse,transformNodes:()=>qw,transformSystemModule:()=>Sse,transformTypeScript:()=>rse,transpile:()=>oTe,transpileModule:()=>Zoe,transpileOptionValueCompilerOptions:()=>IU,tryAddToSet:()=>zy,tryAndIgnoreErrors:()=>_L,tryCast:()=>Jn,tryDirectoryExists:()=>uL,tryExtractTSExtension:()=>b5,tryFileExists:()=>PA,tryGetClassExtendingExpressionWithTypeArguments:()=>kz,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>Cz,tryGetDirectories:()=>lL,tryGetExtensionFromPath:()=>ug,tryGetImportFromModuleSpecifier:()=>n8,tryGetJSDocSatisfiesTypeNode:()=>G5,tryGetModuleNameFromFile:()=>pw,tryGetModuleSpecifierFromDeclaration:()=>Mk,tryGetNativePerformanceHooks:()=>oK,tryGetPropertyAccessOrIdentifierToString:()=>k8,tryGetPropertyNameOfBindingOrAssignmentElement:()=>tO,tryGetSourceMappingURL:()=>Bie,tryGetTextOfPropertyName:()=>J4,tryIOAndConsumeErrors:()=>fL,tryParsePattern:()=>Kk,tryParsePatterns:()=>J5,tryParseRawSourceMap:()=>aV,tryReadDirectory:()=>MH,tryReadFile:()=>YE,tryRemoveDirectoryPrefix:()=>Jz,tryRemoveExtension:()=>_re,tryRemovePrefix:()=>Dj,tryRemoveSuffix:()=>YZ,typeAcquisitionDeclarations:()=>Aw,typeAliasNamePart:()=>doe,typeDirectiveIsEqualTo:()=>kee,typeKeywords:()=>vL,typeParameterNamePart:()=>moe,typeReferenceResolutionNameAndModeGetter:()=>l9,typeToDisplayParts:()=>xA,unchangedPollThresholds:()=>eP,unchangedTextChangeRange:()=>NP,unescapeLeadingUnderscores:()=>bi,unmangleScopedPackageName:()=>Bw,unorderedRemoveItem:()=>X2,unorderedRemoveItemAt:()=>Cj,unreachableCodeIsError:()=>rre,unusedLabelIsError:()=>nre,unwrapInnermostStatementOfLabel:()=>UJ,updateErrorForNoInputFiles:()=>oO,updateLanguageServiceSourceFile:()=>HG,updateMissingFilePathsWatch:()=>IV,updatePackageJsonWatch:()=>K2e,updateResolutionField:()=>PC,updateSharedExtendedConfigFileWatcher:()=>ZO,updateSourceFile:()=>lU,updateWatchingWildcardDirectories:()=>$w,usesExtensionsOnImports:()=>lre,usingSingleLineStringWriter:()=>R4,utf16EncodeAsString:()=>fk,validateLocaleAndSetLanguage:()=>s0e,valuesHelper:()=>xF,version:()=>Qm,versionMajorMinor:()=>rk,visitArray:()=>zw,visitCommaListElements:()=>Ww,visitEachChild:()=>sr,visitFunctionBody:()=>gf,visitIterationBody:()=>Hu,visitLexicalEnvironment:()=>FO,visitNode:()=>He,visitNodes:()=>kr,visitParameterList:()=>Sc,walkUpBindingElementsAndPatterns:()=>dk,walkUpLexicalEnvironments:()=>Hie,walkUpOuterExpressions:()=>Ene,walkUpParenthesizedExpressions:()=>Rh,walkUpParenthesizedTypes:()=>c8,walkUpParenthesizedTypesAndGetParentAndChild:()=>lte,whitespaceOrMapCommentRegExp:()=>LO,writeCommentRange:()=>$k,writeFile:()=>rE,writeFileEnsuringDirectories:()=>vz,zipWith:()=>oj});var XDe=Nt({"src/typescript/_namespaces/ts.ts"(){"use strict";Ns(),sA(),zn(),w1(),_Ke()}}),fKe=mIe({"src/typescript/typescript.ts"(e,t){XDe(),XDe(),typeof console<"u"&&(E.loggingHost={log(r,i){switch(r){case 1:return console.error(i);case 2:return console.warn(i);case 3:return console.log(i);case 4:return console.log(i)}}}),t.exports=$De}});return fKe()})();typeof module<"u"&&module.exports&&(module.exports=ts); \ No newline at end of file diff --git a/pkg/typescript/typescript_test.go b/pkg/typescript/typescript_test.go new file mode 100644 index 0000000..7769477 --- /dev/null +++ b/pkg/typescript/typescript_test.go @@ -0,0 +1,73 @@ +package typescript_test + +import ( + "strings" + "testing" + + "github.com/dgate-io/dgate/pkg/typescript" + "github.com/dop251/goja" +) + +// TOOD: add more test cases for errors to ensure the line numbers are correct +// and the error messages are correct; also wrap code in a function and test. + +func TestTranspile(t *testing.T) { + baseDefault := `function validateDataID(data: Data): any | null { + return (data.id == null) ? null : data; + } + interface Data { + id: string | null; + name: string; + description: string; + }` + + tsSrcList := []string{ + "export " + strings.TrimSpace(baseDefault), + "export default " + strings.TrimSpace(baseDefault), + baseDefault + ` + export default validateDataID + `, + baseDefault + ` + export { validateDataID } + `, + baseDefault + ` + export { validateDataID: validateDataID } + `, + } + + for _, tsSrc := range tsSrcList { + vm := goja.New() + jsSrc, err := typescript.Transpile(tsSrc) + if err != nil { + t.Fatal(err) + return + } + vm.Set("exports", map[string]any{}) + if jsSrc == "" { + t.Fatal("jsSrc is empty") + return + } + _, err = vm.RunString(jsSrc) + if err != nil { + t.Fatal(err) + return + } + + val := vm.Get("exports") + exportMap := val.Export().(map[string]any) + + if _, ok := exportMap["validateDataID"]; !ok { + if _, ok := exportMap["default"]; !ok { + t.Log(jsSrc) + t.Fatal("exports.default or exports.validateDataID not found") + } + } + if esMod, ok := exportMap["__esModule"]; !ok { + t.Fatal("exports.__esModule not found") + } else { + if !esMod.(bool) { + t.Fatal("exports.__esModule != true") + } + } + } +} diff --git a/pkg/util/bytes.go b/pkg/util/bytes.go new file mode 100644 index 0000000..28350ff --- /dev/null +++ b/pkg/util/bytes.go @@ -0,0 +1,20 @@ +package util + +import ( + "fmt" + + "github.com/dop251/goja" +) + +func ToBytes(a any) ([]byte, error) { + switch dt := a.(type) { + case string: + return []byte(dt), nil + case []byte: + return dt, nil + case goja.ArrayBuffer: + return dt.Bytes(), nil + default: + return nil, fmt.Errorf("invalid type %T, expected (string, []byte or ArrayBuffer)", a) + } +} diff --git a/pkg/util/default.go b/pkg/util/default.go new file mode 100644 index 0000000..fe66775 --- /dev/null +++ b/pkg/util/default.go @@ -0,0 +1,15 @@ +package util + +func Default[T any](value *T, defaultValue *T) *T { + if value == nil { + return defaultValue + } + return value +} + +func DefaultString(value string, defaultValue string) string { + if value == "" { + return defaultValue + } + return value +} diff --git a/pkg/util/default_test.go b/pkg/util/default_test.go new file mode 100644 index 0000000..dbc227d --- /dev/null +++ b/pkg/util/default_test.go @@ -0,0 +1,24 @@ +package util_test + +import ( + "testing" + + "github.com/dgate-io/dgate/pkg/util" +) + +func TestDefault(t *testing.T) { + var i *int + var d int = 10 + if util.Default(&d, nil) == nil { + t.Error("Default failed") + } + if util.Default(i, &d) != &d { + t.Error("Default failed") + } + if util.DefaultString("", "default") != "default" { + t.Error("DefaultString failed") + } + if util.DefaultString("value", "default") != "value" { + t.Error("DefaultString failed") + } +} diff --git a/pkg/util/env.go b/pkg/util/env.go new file mode 100644 index 0000000..e679d84 --- /dev/null +++ b/pkg/util/env.go @@ -0,0 +1,14 @@ +package util + +import ( + "os" + "strings" +) + +func EnvVarCheckBool(name string) bool { + val := strings.ToLower(os.Getenv(name)) + if val == "true" || val == "1" || val == "yes" || val == "y" { + return true + } + return false +} diff --git a/pkg/util/hash.go b/pkg/util/hash.go new file mode 100644 index 0000000..8237179 --- /dev/null +++ b/pkg/util/hash.go @@ -0,0 +1,87 @@ +package util + +import ( + "bytes" + "encoding/gob" + "encoding/json" + "errors" + "hash" + "hash/crc32" +) +func jsonHash(objs ...any) (hash.Hash32, error) { + hash, err := crc32Hash(func(a any) []byte { + b, err := json.Marshal(a) + if err != nil { + return nil + } + return b + }, objs...) + if err != nil { + return nil, err + } + return hash, nil +} +func JsonHash(objs ...any) (uint32, error) { + hash, err := jsonHash(objs...) + if err != nil { + return 0, err + } + return hash.Sum32(), nil +} + + +func JsonHashBytes(objs ...any) ([]byte, error) { + hash, err := jsonHash(objs...) + if err != nil { + return nil, err + } + return hash.Sum(nil), nil +} + +func GobHashBytes(objs ...any) (uint32, error) { + hash, err := crc32Hash(func(a any) []byte { + b := bytes.Buffer{} + enc := gob.NewEncoder(&b) + err := enc.Encode(a) + if err != nil { + return nil + } + return b.Bytes() + }, objs...) + if err != nil { + return 0, err + } + return hash.Sum32(), nil +} + +func GobHash(objs ...any) (uint32, error) { + hash, err := crc32Hash(func(a any) []byte { + b := bytes.Buffer{} + enc := gob.NewEncoder(&b) + err := enc.Encode(a) + if err != nil { + return nil + } + return b.Bytes() + }, objs...) + if err != nil { + return 0, err + } + return hash.Sum32(), nil +} + +func crc32Hash(encoder func(any) []byte, objs ...any) (hash.Hash32, error) { + hash := crc32.NewIEEE() + if len(objs) == 0 { + return nil, errors.New("no values provided") + } + for _, r := range objs { + b := bytes.Buffer{} + _, err := b.Write(encoder(r)) + if err != nil { + return nil, err + } + hash.Write(b.Bytes()) + } + return hash, nil +} diff --git a/pkg/util/heap/heap.go b/pkg/util/heap/heap.go new file mode 100644 index 0000000..9822cfb --- /dev/null +++ b/pkg/util/heap/heap.go @@ -0,0 +1,120 @@ +package heap + +import ( + "cmp" + "errors" +) + +type HeapType int + +const ( + MinHeapType HeapType = iota + MaxHeapType +) + +type Heap[K cmp.Ordered, V any] struct { + heapType HeapType + data []pair[K, V] +} + +type pair[K cmp.Ordered, V any] struct { + key K + val V +} + +var ErrHeapEmpty = errors.New("heap is empty") + +func NewHeap[K cmp.Ordered, V any](ht HeapType) *Heap[K, V] { + if ht != MinHeapType && ht != MaxHeapType { + panic("invalid heap type") + } + return &Heap[K, V]{ht, []pair[K, V]{}} +} + +func (h *Heap[K, V]) Push(key K, val V) { + h.data = append(h.data, pair[K, V]{ + key: key, + val: val, + }) + h.heapifyUp(len(h.data)-1, h.heapType) +} + +func (h *Heap[K, V]) Pop() (K, V, bool) { + if len(h.data) == 0 { + var ( + v V + k K + ) + return k, v, false + } + min := h.data[0] + lastIdx := len(h.data) - 1 + h.data[0] = h.data[lastIdx] + h.data = h.data[:lastIdx] + h.heapifyDown(0, h.heapType) + return min.key, min.val, true +} + +func (h *Heap[K, V]) Peak() (K, V, bool) { + if len(h.data) == 0 { + var ( + v V + k K + ) + return k, v, false + } + min := h.data[0] + return min.key, min.val, true +} + +func (h *Heap[K, V]) Len() int { + return len(h.data) +} + +func (h *Heap[K, V]) heapifyDown(idx int, ht HeapType) { + for { + left := 2*idx + 1 + right := 2*idx + 2 + target := idx + if ht == MinHeapType { + if left < len(h.data) && h.data[left].key < h.data[target].key { + target = left + } + if right < len(h.data) && h.data[right].key < h.data[target].key { + target = right + } + if target == idx { + break + } + } else { + if left < len(h.data) && h.data[left].key > h.data[target].key { + target = left + } + if right < len(h.data) && h.data[right].key > h.data[target].key { + target = right + } + if target == idx { + break + } + } + h.data[idx], h.data[target] = h.data[target], h.data[idx] + idx = target + } +} + +func (h *Heap[K, V]) heapifyUp(idx int, ht HeapType) { + for idx > 0 { + parent := (idx - 1) / 2 + if ht == MinHeapType { + if h.data[parent].key <= h.data[idx].key { + break + } + } else { + if h.data[parent].key >= h.data[idx].key { + break + } + } + h.data[parent], h.data[idx] = h.data[idx], h.data[parent] + idx = parent + } +} diff --git a/pkg/util/heap/heap_test.go b/pkg/util/heap/heap_test.go new file mode 100644 index 0000000..8442547 --- /dev/null +++ b/pkg/util/heap/heap_test.go @@ -0,0 +1,200 @@ +package heap_test + +import ( + "testing" + + "github.com/dgate-io/dgate/pkg/util/heap" + "github.com/stretchr/testify/assert" +) + +func TestHeap_MinHeap(t *testing.T) { + h := heap.NewHeap[int, any](heap.MinHeapType) + numElements := 1_000_000 + for i := numElements; i > 0; i-- { + h.Push(i, i) + } + for i := 1; i <= numElements; i++ { + j, _, ok := h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if i != j { + t.Fatalf("expected key to be %d, got %d", i, j) + } + } +} + +func TestHeap_MinHeap_PushPop(t *testing.T) { + h := heap.NewHeap[int, any](heap.MinHeapType) + + assert.Equal(t, 0, h.Len()) + h.Push(3, 33) + h.Push(2, 22) + h.Push(1, 11) + + assert.Equal(t, 3, h.Len()) + min, val, ok := h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if min != 1 { + t.Fatalf("expected min to be 1, got %d", min) + } + if val != 11 { + t.Fatalf("expected value to be 11, got %v", val) + } + + assert.Equal(t, 2, h.Len()) + min, val, ok = h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if min != 2 { + t.Fatalf("expected min to be 2, got %d", min) + } + if val != 22 { + t.Fatalf("expected value to be 22, got %v", val) + } + + assert.Equal(t, 1, h.Len()) + min, val, ok = h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if min != 3 { + t.Fatalf("expected min to be 3, got %d", min) + } + if val != 33 { + t.Fatalf("expected value to be 33, got %v", val) + } + + assert.Equal(t, 0, h.Len()) + _, _, ok = h.Pop() + if ok { + t.Fatalf("expected key to be empty") + } +} + +func TestHeap_MaxHeap(t *testing.T) { + h := heap.NewHeap[int, any](heap.MaxHeapType) + numElements := 1_000_000 + for i := 1; i <= numElements; i++ { + h.Push(i, i) + } + for i := numElements; i > 0; i-- { + j, _, ok := h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if i != j { + t.Fatalf("expected key to be %d, got %d", i, j) + } + } +} + +func TestHeap_MaxHeap_PushPop(t *testing.T) { + h := heap.NewHeap[int, any](heap.MaxHeapType) + + assert.Equal(t, 0, h.Len()) + h.Push(1, 11) + h.Push(2, 22) + h.Push(3, 33) + + assert.Equal(t, 3, h.Len()) + max, val, ok := h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if max != 3 { + t.Fatalf("expected max to be 3, got %d", max) + } + if val != 33 { + t.Fatalf("expected value to be 11, got %v", val) + } + + assert.Equal(t, 2, h.Len()) + max, val, ok = h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if max != 2 { + t.Fatalf("expected max to be 2, got %d", max) + } + if val != 22 { + t.Fatalf("expected value to be 22, got %v", val) + } + + assert.Equal(t, 1, h.Len()) + max, val, ok = h.Pop() + if !ok { + t.Fatalf("expected key to be found") + } + if max != 1 { + t.Fatalf("expected max to be 1, got %d", max) + } + if val != 11 { + t.Fatalf("expected value to be 11, got %v", val) + } + + assert.Equal(t, 0, h.Len()) + _, _, ok = h.Pop() + if ok { + t.Fatalf("expected key to be empty") + } +} + +func BenchmarkHeap_MinHeap(b *testing.B) { + b.Run("PushAsc", func(b *testing.B) { + h := heap.NewHeap[int, any](heap.MinHeapType) + for i := 0; i < b.N; i++ { + h.Push(i, nil) + } + }) + b.Run("PushDesc", func(b *testing.B) { + h := heap.NewHeap[int, any](heap.MinHeapType) + for i := 0; i < b.N; i++ { + h.Push(b.N-i, nil) + } + }) + b.Run("Pop", func(b *testing.B) { + h := heap.NewHeap[int, any](heap.MinHeapType) + b.ResetTimer() + for i := 0; i < b.N; i++ { + if _, _, ok := h.Pop(); !ok { + b.StopTimer() + for i := 0; i < 10_000_000; i++ { + h.Push(i, nil) + } + b.StartTimer() + } + } + }) +} + +func BenchmarkHeap_MaxHeap(b *testing.B) { + b.Run("PushAsc", func(b *testing.B) { + h := heap.NewHeap[int, any](heap.MaxHeapType) + for i := 0; i < b.N; i++ { + h.Push(i, nil) + } + }) + b.Run("PushDesc", func(b *testing.B) { + h := heap.NewHeap[int, any](heap.MaxHeapType) + for i := 0; i < b.N; i++ { + h.Push(b.N-i, nil) + } + }) + b.Run("Pop", func(b *testing.B) { + h := heap.NewHeap[int, any](heap.MaxHeapType) + b.ResetTimer() + for i := 0; i < b.N; i++ { + if _, _, ok := h.Pop(); !ok { + b.StopTimer() + for i := 10_000_000; i > 0; i-- { + h.Push(i, nil) + } + b.StartTimer() + } + } + }) +} diff --git a/pkg/util/http.go b/pkg/util/http.go new file mode 100644 index 0000000..2f8e007 --- /dev/null +++ b/pkg/util/http.go @@ -0,0 +1,15 @@ +package util + +import ( + "fmt" + "net/http" +) + +func WriteStatusCodeError(w http.ResponseWriter, code int) { + w.Header().Set("Content-Type", "text/plain; charset=utf-8") + w.Header().Set("X-Content-Type-Options", "nosniff") + w.WriteHeader(code) + w.Write([]byte( + fmt.Sprintf("DGate: %d %s", code, http.StatusText(code)), + )) +} diff --git a/pkg/util/http_response.go b/pkg/util/http_response.go new file mode 100644 index 0000000..a96532b --- /dev/null +++ b/pkg/util/http_response.go @@ -0,0 +1,55 @@ +package util + +import ( + "encoding/json" + "net/http" + "reflect" +) + +func isSlice(v interface{}) bool { + return reflect.TypeOf(v).Kind() == reflect.Slice +} + +func sliceLen(v interface{}) int { + return reflect.ValueOf(v).Len() +} + +func JsonResponse(w http.ResponseWriter, statusCode int, data any) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(statusCode) + if data == nil { + w.Write([]byte("{}")) + return + } + responseData := map[string]any{ + "status_code": statusCode, + "data": data, + } + if isSlice(data) { + responseData["count"] = sliceLen(data) + } + value, err := json.Marshal(responseData) + if err != nil { + JsonError(w, http.StatusInternalServerError, "Error marshalling response data") + } else { + w.Write(value) + } +} + +func JsonError[T any](w http.ResponseWriter, statusCode int, message T) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(statusCode) + json.NewEncoder(w).Encode(map[string]any{ + "error": message, + "status": statusCode, + }) +} + +func JsonErrors[T any](w http.ResponseWriter, statusCode int, message []T) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(statusCode) + json.NewEncoder(w).Encode(map[string]any{ + "errors": message, + "status": statusCode, + }) +} diff --git a/pkg/util/iplist/iplist.go b/pkg/util/iplist/iplist.go new file mode 100644 index 0000000..d0bf119 --- /dev/null +++ b/pkg/util/iplist/iplist.go @@ -0,0 +1,145 @@ +package iplist + +import ( + "bytes" + "fmt" + "net" + + "github.com/dgate-io/dgate/pkg/util/linkedlist" +) + +type IPList struct { + v4s *linkedlist.LinkedList[*net.IPNet] + v6s *linkedlist.LinkedList[*net.IPNet] +} + +func NewIPList() *IPList { + return &IPList{ + v4s: linkedlist.New[*net.IPNet](), + v6s: linkedlist.New[*net.IPNet](), + } +} + +func (l *IPList) AddCIDRString(cidr string) error { + _, ipn, err := net.ParseCIDR(cidr) + if err != nil { + return err + } + if ipn.IP.To4() != nil { + l.insertIPv4(ipn) + return nil + } else if ipn.IP.To16() != nil { + l.insertIPv6(ipn) + return nil + } + return fmt.Errorf("invalid ip address: %s", cidr) +} + +func (l *IPList) AddIPString(ipstr string) error { + ip := net.ParseIP(ipstr) + if ip == nil { + return fmt.Errorf("invalid ip address: %s", ipstr) + } + maskBits := 32 + if ip.To4() != nil { + mask := net.CIDRMask(maskBits, maskBits) + ipn := &net.IPNet{IP: ip, Mask: mask} + l.insertIPv4(ipn) + return nil + } else if ip.To16() != nil { + maskBits := 128 + mask := net.CIDRMask(maskBits, maskBits) + ipn := &net.IPNet{IP: ip, Mask: mask} + l.insertIPv6(ipn) + return nil + } + return fmt.Errorf("invalid ip address: %s", ipstr) +} + +func (l *IPList) Len() int { + return l.v4s.Len() + l.v6s.Len() +} +func (l *IPList) Contains(ipstr string) (bool, error) { + if l.Len() == 0 { + return false, nil + } + // parse ip + ip := net.ParseIP(ipstr) + if ip == nil { + return false, fmt.Errorf("invalid ip address: %s", ipstr) + } + if ip.To4() != nil { + return l.containsIPv4(ip), nil + } else if ip.To16() != nil { + return l.containsIPv6(ip), nil + } + return false, nil +} + +func (l *IPList) containsIPv4(ip net.IP) bool { + for n := l.v4s.Head; n != nil; n = n.Next { + ipn := n.Value + if ipn.Contains(ip) { + return true + } + } + return false +} + +func (l *IPList) containsIPv6(ip net.IP) bool { + for n := l.v6s.Head; n != nil; n = n.Next { + ipn := n.Value + if ipn.Contains(ip) { + return true + } + } + return false +} + +func (l *IPList) insertIPv6(ipmask *net.IPNet) { + if l.v6s.Len() == 0 { + l.v6s.Insert(ipmask) + return + } + for n := l.v6s.Head; n.Next != nil; n = n.Next { + ipn := n.Value + if compareIPs(ipmask.IP, ipn.IP) < 0 { + l.v6s.InsertBefore(n, ipmask) + return + } + } + l.v6s.Insert(ipmask) +} + +func (l *IPList) insertIPv4(ipmask *net.IPNet) { + if l.v4s.Len() == 0 { + l.v4s.Insert(ipmask) + return + } + for n := l.v4s.Head; n.Next != nil; n = n.Next { + ipn := n.Value + if compareIPs(ipmask.IP, ipn.IP) < 0 { + l.v4s.InsertBefore(n, ipmask) + return + } + } + l.v4s.Insert(ipmask) +} + +func (l *IPList) String() string { + var buf bytes.Buffer + buf.WriteString("IPv4: ") + buf.WriteString(l.v4s.String()) + buf.WriteString("\n") + buf.WriteString("IPv6: ") + buf.WriteString(l.v6s.String()) + buf.WriteString("\n") + return buf.String() +} + +func compareIPs(a, b net.IP) int { + if len(a) != len(b) { + return len(a) - len(b) + } + return bytes.Compare(a, b) +} diff --git a/pkg/util/iplist/iplist_test.go b/pkg/util/iplist/iplist_test.go new file mode 100644 index 0000000..e7b1acb --- /dev/null +++ b/pkg/util/iplist/iplist_test.go @@ -0,0 +1,107 @@ +package iplist_test + +import ( + "encoding/binary" + "net" + "testing" + + "github.com/dgate-io/dgate/pkg/util/iplist" + "github.com/stretchr/testify/assert" +) + +func TestIPList_IPv4_IPv6_CIDR(t *testing.T) { + ipl := iplist.NewIPList() + assert.Nil(t, ipl.AddCIDRString("192.168.0.0/16")) + assert.Nil(t, ipl.AddCIDRString("192.168.0.0/24")) + assert.Nil(t, ipl.AddCIDRString("10.0.0.0/8")) + + assert.Nil(t, ipl.AddCIDRString("e0d4::/64")) + assert.Nil(t, ipl.AddCIDRString("e0d3::/128")) + + assert.Equal(t, 5, ipl.Len()) + + assert.Nil(t, ipl.AddIPString("255.255.255.255")) + assert.Nil(t, ipl.AddIPString("0.0.0.0")) + assert.Nil(t, ipl.AddIPString("e0d5::d1ee:0c22")) + assert.Nil(t, ipl.AddIPString("e0d5::0c22")) + assert.Nil(t, ipl.AddIPString("::0c22")) + assert.Nil(t, ipl.AddIPString("::1")) + assert.Nil(t, ipl.AddIPString("::")) + + assert.Equal(t, 12, ipl.Len()) + + t.Log(ipl.String()) + + ipTests := map[string]bool{ + "192.168.0.0": true, + "192.168.255.255": true, + "10.0.0.0": true, + "10.255.255.255": true, + "255.255.255.255": true, + "0.0.0.0": true, + "e0d4::": true, + "e0d4::ffff:ffff:ffff:ffff": true, + "e0d3::": true, + "e0d5::d1ee:0c22": true, + "e0d5::0c22": true, + "::0c22": true, + "::1": true, + "::": true, + + "11.0.0.0": false, + "9.255.255.255": false, + "255.255.255.254": false, + "0.0.0.1": false, + "::2": false, + "e0d3::1": false, + "::612f:efe5:ed85": false, + "::c341:0997": false, + "::0997": false, + } + for ip, exp := range ipTests { + contains, err := ipl.Contains(ip) + if err != nil { + t.Fatal(err) + } + t.Run(ip, func(t *testing.T) { + assert.True( + t, contains == exp, + "expected validation for %s to be %v", ip, exp, + ) + }) + } +} + +func BenchmarkIPList(b *testing.B) { + ipl := iplist.NewIPList() + err := ipl.AddCIDRString("::/64") + if err != nil { + b.Fatal(err) + } + err = ipl.AddCIDRString("0.0.0.0/16") + if err != nil { + b.Fatal(err) + } + err = ipl.AddIPString("127.0.0.1") + if err != nil { + b.Fatal(err) + } + err = ipl.AddIPString("f60b::1") + if err != nil { + b.Fatal(err) + } + b.Run("Contains", func(b *testing.B) { + for i := 0; i < b.N; i++ { + ipl.Contains("255.255.255.255") + } + }) + b.Run("AddIPString", func(b *testing.B) { + for i := 0; i < b.N; i++ { + // interger to ip + ip := make(net.IP, 4) + binary.BigEndian.PutUint32(ip, uint32(i)) + + assert.Nil(b, ipl.AddIPString(ip.String())) + } + }) +} diff --git a/pkg/util/linkedlist/linkedlist.go b/pkg/util/linkedlist/linkedlist.go new file mode 100644 index 0000000..590d4d3 --- /dev/null +++ b/pkg/util/linkedlist/linkedlist.go @@ -0,0 +1,163 @@ +package linkedlist + +import ( + "bytes" + "errors" + "fmt" + "reflect" +) + +var ( + ErrNodeNotFound = errors.New("node not found") + ErrValueNotFound = errors.New("value not found") +) + +type LinkedList[T any] struct { + Head *Node[T] + Tail *Node[T] + len int +} + +// New returns a new linked list. +func New[T any](items ...T) *LinkedList[T] { + ll := &LinkedList[T]{} + for _, item := range items { + ll.Insert(item) + } + return ll +} + +// Insert inserts a new node at the end of the linked list. +func (l *LinkedList[T]) Insert(value T) { + node := &Node[T]{Value: value} + l.len++ + if l.Head == nil { + l.Head = node + l.Tail = node + return + } + l.Tail.Next = node + l.Tail = node +} + +// String returns a string representation of the linked list. +func (l *LinkedList[T]) String() string { + var buf bytes.Buffer + node := l.Head + for node != nil { + buf.WriteString(fmt.Sprintf("%v", node.Value)) + if node.Next != nil { + buf.WriteString(" -> ") + } + node = node.Next + } + return buf.String() +} + +// InsertBefore inserts a new node with the specififed value, before the given node. +func (l *LinkedList[T]) InsertBefore(node *Node[T], value T) error { + newNode := &Node[T]{Value: value} + if node == l.Head { + newNode.Next = l.Head + l.Head = newNode + l.len++ + return nil + } + prev := l.Head + for prev.Next != nil { + if prev.Next == node { + newNode.Next = prev.Next + prev.Next = newNode + l.len++ + return nil + } + prev = prev.Next + } + return ErrNodeNotFound +} + +// Remove removes the given node from the linked list. +func (l *LinkedList[T]) Remove(value T) error { + if l.Head == nil { + return ErrValueNotFound + } + if reflect.DeepEqual(l.Head.Value, value) { + if l.len == 1 { + l.Head = nil + l.Tail = nil + l.len = 0 + return nil + } + l.Head = l.Head.Next + l.len-- + return nil + } + prev := l.Head + for prev.Next != nil { + if reflect.DeepEqual(prev.Next.Value, value) { + if prev.Next == l.Tail { + l.Tail = prev + } + prev.Next = prev.Next.Next + l.len-- + return nil + } + prev = prev.Next + } + return ErrValueNotFound +} + +// RemoveTail removes the last node from the linked list. +func (l *LinkedList[T]) RemoveTail() error { + if l.Head == nil { + return ErrValueNotFound + } + if l.len == 1 { + l.Head = nil + l.Tail = nil + l.len = 0 + return nil + } + prev := l.Head + for prev.Next != nil { + if prev.Next == l.Tail { + prev.Next = nil + l.Tail = prev + l.len-- + return nil + } + prev = prev.Next + } + return ErrValueNotFound +} + +// Contains returns true if the linked list contains the given value. +func (l *LinkedList[T]) Contains(value T) bool { + if l.Head == nil { + return false + } + node := l.Head + for node != nil { + if reflect.DeepEqual(node.Value, value) { + return true + } + node = node.Next + } + return false +} + +// Empty returns true if the linked list is empty. +func (l *LinkedList[T]) Empty() bool { + return l.Head == nil +} + +// Len returns the length of the linked list. +func (l *LinkedList[T]) Len() int { + return l.len +} + +// Node represents a node in the linked list. +type Node[T any] struct { + Value T + Next *Node[T] +} diff --git a/pkg/util/linkedlist/linkedlist_sort.go b/pkg/util/linkedlist/linkedlist_sort.go new file mode 100644 index 0000000..c98cd25 --- /dev/null +++ b/pkg/util/linkedlist/linkedlist_sort.go @@ -0,0 +1,152 @@ +package linkedlist + +import ( + "fmt" +) + +type Compariable interface { + Compare(interface{}) int +} + +func SortLinkedList[T any](ll *LinkedList[T], less func(i, j T) bool) { + ll.Head = mergeSortListNode(ll.Head, less) + ll.Tail = ll.Head + for ll.Tail != nil && ll.Tail.Next != nil { + ll.Tail = ll.Tail.Next + } +} + +// MergeSortList sorts a linked list using merge sort +func mergeSortListNode[T any](head *Node[T], less func(T, T) bool) *Node[T] { + if head == nil || head.Next == nil { + return head + } + + // Find the middle of the list + middle := findMiddle(head) + + // Split the list into two halves + secondHalf := middle.Next + middle.Next = nil + + // Recursively sort each half + left := mergeSortListNode(head, less) + right := mergeSortListNode(secondHalf, less) + + // Merge the sorted halves + return merge(less, left, right) +} + +// findMiddle finds the middle of the linked list +func findMiddle[T any](head *Node[T]) *Node[T] { + slow, fast := head, head + + for fast != nil && fast.Next != nil && fast.Next.Next != nil { + slow = slow.Next + fast = fast.Next.Next + } + + return slow +} + +// merge merges two sorted linked lists +func merge[T any](less func(T, T) bool, left, right *Node[T]) *Node[T] { + dummy := &Node[T]{} + current := dummy + + for left != nil && right != nil { + if less(left.Value, right.Value) { + current.Next = left + left = left.Next + } else { + current.Next = right + right = right.Next + } + current = current.Next + } + + // If there are remaining nodes in either list, append them + if left != nil { + current.Next = left + } + if right != nil { + current.Next = right + } + + return dummy.Next +} + +// DisplayList prints the elements of the linked list +func DisplayList[T any](head *Node[T]) { + current := head + for current != nil { + fmt.Printf("%v -> ", current.Value) + current = current.Next + } + fmt.Println("nil") +} + +func SortLinkedListIterative[T any](ll *LinkedList[T], less func(i, j T) bool) { + ll.Head, ll.Tail = sortLinkedListNodeIterative(ll.Head, ll.Tail, less) +} + +// MergeSortListIterative sorts a linked list using iterative merge sort +func sortLinkedListNodeIterative[T any](head, tail *Node[T], less func(i, j T) bool) (*Node[T], *Node[T]) { + if head == nil || head.Next == nil { + return head, tail + } + + // Get the length of the linked list + length := 0 + current := head + for current != nil { + length++ + current = current.Next + } + + dummy := &Node[T]{} + dummy.Next = head + + tailMaybe := tail + + for step := 1; step < length; step *= 2 { + prevTail := dummy + current = dummy.Next + + for current != nil { + left := current + right := split(left, step) + current = split(right, step) + + merged := merge(less, left, right) + prevTail.Next = merged + + // Move to the end of the merged list + for merged.Next != nil { + merged = merged.Next + } + + prevTail = merged + tailMaybe = merged + } + } + for tailMaybe != nil && tailMaybe.Next != nil { + tailMaybe = tailMaybe.Next + } + return dummy.Next, tailMaybe +} + +// split splits the linked list into two parts, returns the head of the second part +func split[T any](head *Node[T], steps int) *Node[T] { + for i := 1; head != nil && i < steps; i++ { + head = head.Next + } + + if head == nil { + return nil + } + + nextPart := head.Next + head.Next = nil + return nextPart +} diff --git a/pkg/util/linkedlist/linkedlist_sort_test.go b/pkg/util/linkedlist/linkedlist_sort_test.go new file mode 100644 index 0000000..d7f16b7 --- /dev/null +++ b/pkg/util/linkedlist/linkedlist_sort_test.go @@ -0,0 +1,70 @@ +package linkedlist_test + +import ( + "fmt" + "testing" + + "github.com/dgate-io/dgate/pkg/util/linkedlist" +) + +func TestMergeSortLinkedListRecursive(t *testing.T) { + // Example usage + // Create a linked list: 3 -> 1 -> 4 -> 2 -> 5 + ll := Generate[int](3, 1, 4, 2, 5) + + fmt.Println("Original linked list:") + linkedlist.DisplayList(ll.Head) + + // Sort the linked list using merge sort + linkedlist.SortLinkedList(ll, func(i, j int) bool { return i < j }) + + fmt.Println("Linked list after sorting:") + linkedlist.DisplayList(ll.Head) +} + +func TestMergeSortLinkedListIterative(t *testing.T) { + // Example usage + // Create a linked list: 3 -> 1 -> 4 -> 2 -> 5 + ll := Generate[int](3, 1, 4, 2, 5) + + fmt.Println("Original linked list:") + linkedlist.DisplayList(ll.Head) + + // Sort the linked list using merge sort + linkedlist.SortLinkedListIterative(ll, func(i, j int) bool { return i < j }) + + fmt.Println("Linked list after sorting:") + linkedlist.DisplayList(ll.Head) +} + +func BenchmarkMergeSortIter(b *testing.B) { + funcs := map[string]func(*linkedlist.LinkedList[int], func(i, j int) bool){ + "SortLinkedListRecursive": linkedlist.SortLinkedList[int], + "SortLinkedListIterative": linkedlist.SortLinkedListIterative[int], + } + + for name, llSortFunc := range funcs { + b.Run(name, func(b *testing.B) { + b.StopTimer() + for i := 0; i < b.N; i++ { + ll := Generate[int]() + for j := 10000; j >= 1; j-- { + ll.Insert((i * j) - (i + j)) + } + + b.StartTimer() + llSortFunc(ll, func(i, j int) bool { return i < j }) + b.StopTimer() + } + }) + } +} + +// Generate generates a linked list from the given values. +func Generate[T any](values ...T) *linkedlist.LinkedList[T] { + l := linkedlist.New[T]() + for _, v := range values { + l.Insert(v) + } + return l +} diff --git a/pkg/util/linkedlist/linkedlist_test.go b/pkg/util/linkedlist/linkedlist_test.go new file mode 100644 index 0000000..490a054 --- /dev/null +++ b/pkg/util/linkedlist/linkedlist_test.go @@ -0,0 +1,194 @@ +package linkedlist_test + +import ( + "testing" + + "github.com/dgate-io/dgate/pkg/util/linkedlist" + "github.com/stretchr/testify/assert" +) + +func TestLinkedListInsert(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Equal(t, 3, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "c", l.Tail.Value) +} + +func TestLinkedListInsertBefore(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("c") + l.Insert("d") + assert.Nil(t, l.InsertBefore(l.Head.Next, "b")) + assert.Equal(t, 4, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Head.Next.Value) + assert.Equal(t, "c", l.Head.Next.Next.Value) + assert.Equal(t, "d", l.Head.Next.Next.Next.Value) + assert.Equal(t, "d", l.Tail.Value) +} + +func TestLinkedListInsertBeforeHead(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("b") + l.Insert("c") + l.Insert("d") + assert.Nil(t, l.InsertBefore(l.Head, "a")) + assert.Equal(t, 4, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Head.Next.Value) + assert.Equal(t, "c", l.Head.Next.Next.Value) + assert.Equal(t, "d", l.Head.Next.Next.Next.Value) + assert.Equal(t, "d", l.Tail.Value) +} + +func TestLinkedListInsertBeforeTail(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("d") + assert.Nil(t, l.InsertBefore(l.Tail, "c")) + assert.Equal(t, 4, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Head.Next.Value) + assert.Equal(t, "c", l.Head.Next.Next.Value) + assert.Equal(t, "d", l.Head.Next.Next.Next.Value) + assert.Equal(t, "d", l.Tail.Value) +} + +func TestLinkedListInsertBeforeNonExisting(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + n := &linkedlist.Node[string]{} + assert.ErrorIs(t, l.InsertBefore(n, "d"), + linkedlist.ErrNodeNotFound) + assert.Equal(t, 3, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Head.Next.Value) + assert.Equal(t, "c", l.Head.Next.Next.Value) + assert.Nil(t, l.Head.Next.Next.Next) + assert.Equal(t, "c", l.Tail.Value) +} + +func TestLinkedListEmpty(t *testing.T) { + l := linkedlist.New[string]() + assert.Equal(t, 0, l.Len()) + assert.True(t, l.Empty()) + assert.Nil(t, l.Head) + assert.Nil(t, l.Tail) + + l.Insert("a") + assert.Equal(t, 1, l.Len()) + assert.False(t, l.Empty()) + assert.Nil(t, l.Remove("a")) + + assert.Equal(t, 0, l.Len()) + assert.True(t, l.Empty()) + assert.Nil(t, l.Head) + assert.Nil(t, l.Tail) +} + +func TestLinkedListRemove(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Nil(t, l.Remove("b")) + assert.Equal(t, 2, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "c", l.Tail.Value) +} + +func TestLinkedListRemoveHead(t *testing.T) { + l := linkedlist.New[string]() + assert.ErrorIs(t, l.Remove("d"), + linkedlist.ErrValueNotFound) + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Nil(t, l.Remove("a")) + assert.Equal(t, 2, l.Len()) + assert.Equal(t, "b", l.Head.Value) + assert.Equal(t, "c", l.Tail.Value) +} + +func TestLinkedListRemoveTail(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Nil(t, l.Remove("c")) + assert.Equal(t, 2, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Tail.Value) +} + +func TestLinkedListRemoveNonExisting(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.ErrorIs(t, l.Remove("d"), + linkedlist.ErrValueNotFound) + assert.Equal(t, 3, l.Len()) + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Head.Next.Value) + assert.Equal(t, "c", l.Head.Next.Next.Value) + assert.Nil(t, l.Head.Next.Next.Next) + assert.Equal(t, "c", l.Tail.Value) +} + +func TestLinkedListContains(t *testing.T) { + l := linkedlist.New[string]() + assert.False(t, l.Contains("a")) + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.True(t, l.Contains("a")) + assert.True(t, l.Contains("b")) + assert.True(t, l.Contains("c")) + assert.False(t, l.Contains("d")) +} + +func TestLinkedListHeadTail(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "c", l.Tail.Value) +} + +func TestLinkedListLen(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Equal(t, 3, l.Len()) +} + +func TestLinkedListNodeNext(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Head.Next.Value) + assert.Equal(t, "c", l.Head.Next.Next.Value) + assert.Nil(t, l.Head.Next.Next.Next) +} + +func TestLinkedListNodeValue(t *testing.T) { + l := linkedlist.New[string]() + l.Insert("a") + l.Insert("b") + l.Insert("c") + assert.Equal(t, "a", l.Head.Value) + assert.Equal(t, "b", l.Head.Next.Value) + assert.Equal(t, "c", l.Head.Next.Next.Value) +} diff --git a/pkg/util/linker/linker.go b/pkg/util/linker/linker.go new file mode 100644 index 0000000..6596889 --- /dev/null +++ b/pkg/util/linker/linker.go @@ -0,0 +1,244 @@ +package linker + +import ( + "cmp" + "encoding/json" + "fmt" + + "github.com/dgate-io/dgate/pkg/util/safe" + "github.com/dgate-io/dgate/pkg/util/tree/avl" +) + +type kv[T, U any] struct { + Key T `json:"key"` + Val U `json:"val"` +} + +type Linker[K cmp.Ordered] interface { + Vertex() Linker[K] + Get(K) Linker[K] + Len(K) int + Find(K, K) (Linker[K], bool) + Each(K, func(K, Linker[K])) + LinkOneMany(K, K, Linker[K]) + UnlinkOneMany(K, K) (Linker[K], bool) + UnlinkAllOneMany(K) []Linker[K] + LinkOneOne(K, K, Linker[K]) + UnlinkOneOne(K) (Linker[K], bool) + UnlinkOneOneByKey(K, K) (Linker[K], bool) + Clone() Linker[K] +} + +var _ Linker[string] = &Link[string, any]{} + +// Link is a vertex in a graph that can be linked to other vertices. +// It is a named vertex that can have multiple edges to other vertices. +// There are two types of edges: one-to-one and one-to-many. +type Link[K cmp.Ordered, V any] struct { + item *safe.Ref[V] + edges []*kv[K, avl.Tree[K, Linker[K]]] +} + +func NamedVertexWithVertex[K cmp.Ordered, V any](vertex Linker[K]) *Link[K, V] { + return vertex.(*Link[K, V]) +} + +func NewNamedVertex[K cmp.Ordered, V any](names ...K) *Link[K, V] { + return NewNamedVertexWithValue[K, V](nil, names...) +} + +func NewNamedVertexWithValue[K cmp.Ordered, V any](item *V, names ...K) *Link[K, V] { + edges := make([]*kv[K, avl.Tree[K, Linker[K]]], len(names)) + for i, name := range names { + edges[i] = &kv[K, avl.Tree[K, Linker[K]]]{ + Key: name, Val: avl.NewTree[K, Linker[K]](), + } + } + + return &Link[K, V]{ + item: safe.NewRef(item), + edges: edges, + } +} + +func (nl *Link[K, V]) Vertex() Linker[K] { + return nl +} + +func (nl *Link[K, V]) Item() *V { + return nl.item.Load() +} + +func (nl *Link[K, V]) SetItem(item *V) { + nl.item.Replace(item) +} + +func (nl *Link[K, V]) Get(name K) Linker[K] { + for _, edge := range nl.edges { + if edge.Key == name { + if !edge.Val.Empty() { + count := 0 + edge.Val.Each(func(key K, val Linker[K]) bool { + count++ + return count <= 2 + }) + if _, lk, ok := edge.Val.RootKeyValue(); ok && count == 1 { + return lk + } + panic("this function should not be called on a vertex with more than one edge per name") + } + return nil + } + } + return nil +} + +func (nl *Link[K, V]) Len(name K) int { + for _, edge := range nl.edges { + if edge.Key == name { + return edge.Val.Length() + } + } + return 0 +} + +func (nl *Link[K, V]) Find(name K, key K) (Linker[K], bool) { + for _, edge := range nl.edges { + if edge.Key == name { + return edge.Val.Find(key) + } + } + return nil, false +} + +// LinkOneMany adds an edge from this vertex to specified vertex +func (nl *Link[K, V]) LinkOneMany(name K, key K, vtx Linker[K]) { + for _, edge := range nl.edges { + if edge.Key == name { + edge.Val.Insert(key, vtx) + return + } + } + panic("name not found for this vertex: " + fmt.Sprint(name)) +} + +// UnlinkOneMany removes links to a vertex and returns the vertex +func (nl *Link[K, V]) UnlinkOneMany(name K, key K) (Linker[K], bool) { + for _, edge := range nl.edges { + if edge.Key == name { + return edge.Val.Pop(key) + } + } + panic("name not found for this vertex: " + fmt.Sprint(name)) +} + +// UnlinkAllOneMany removes all edges from the vertex and returns them +func (nl *Link[K, V]) UnlinkAllOneMany(name K) []Linker[K] { + for _, edge := range nl.edges { + if edge.Key == name { + var removed []Linker[K] + edge.Val.Each(func(key K, val Linker[K]) bool { + removed = append(removed, val) + return true + }) + edge.Val.Clear() + return removed + } + } + panic("name not found for this vertex: " + fmt.Sprint(name)) +} + +// LinkOneOne links a vertex to the vertex +func (nl *Link[K, V]) LinkOneOne(name K, key K, vertex Linker[K]) { + for _, edge := range nl.edges { + if edge.Key == name { + edge.Val.Insert(key, vertex) + if edge.Val.Length() > 1 { + panic("this function should not be called on a vertex with more than one edge per name") + } + return + } + } + panic("name not found for this vertex: " + fmt.Sprint(name)) +} + +// UnlinkOneOne unlinks a vertex from the vertex and returns the vertex +func (nl *Link[K, V]) UnlinkOneOneByKey(name K, key K) (Linker[K], bool) { + for _, edge := range nl.edges { + if edge.Key == name { + return edge.Val.Pop(key) + } + } + panic("name not found for this vertex: " + fmt.Sprint(name)) +} + +// UnlinkOneOne unlinks a vertex from the vertex and returns the vertex +func (nl *Link[K, V]) UnlinkOneOne(name K) (Linker[K], bool) { + for _, edge := range nl.edges { + if edge.Key == name { + _, link, ok := edge.Val.RootKeyValue() + if ok { + edge.Val.Clear() + } + return link, ok + } + } + panic("name not found for this vertex: " + fmt.Sprint(name)) +} + +// Clone returns a copy of the vertex +func (nl *Link[K, V]) Clone() Linker[K] { + edges := make([]*kv[K, avl.Tree[K, Linker[K]]], len(nl.edges)) + for i, edge := range nl.edges { + edges[i] = &kv[K, avl.Tree[K, Linker[K]]]{ + Key: edge.Key, Val: edge.Val.Clone(), + } + } + copiedItem := *nl.item + return &Link[K, V]{ + item: &copiedItem, + edges: edges, + } +} + +// Each iterates over all edges +func (nl *Link[K, V]) Each(name K, fn func(K, Linker[K])) { + for _, edge := range nl.edges { + if edge.Key == name { + edge.Val.Each(func(key K, vertex Linker[K]) bool { + fn(key, vertex) + return true + }) + return + } + } + panic("name not found for this vertex: " + fmt.Sprint(name)) +} + +// MarshalJSON implements the json.Marshaler interface +func (nl *Link[K, V]) MarshalJSON() ([]byte, error) { + type Alias Link[K, V] + return json.Marshal(&struct { + *Alias + Item *V `json:"item"` + }{ + Alias: (*Alias)(nl), + Item: nl.item.Read(), + }) +} + +// UnmarshalJSON implements the json.Unmarshaler interface +func (nl *Link[K, V]) UnmarshalJSON(data []byte) error { + type Alias Link[K, V] + aux := &struct { + *Alias + Item *V `json:"item"` + }{ + Alias: (*Alias)(nl), + } + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + nl.item = safe.NewRef(aux.Item) + return nil +} diff --git a/pkg/util/linker/linker_test.go b/pkg/util/linker/linker_test.go new file mode 100644 index 0000000..8df45ad --- /dev/null +++ b/pkg/util/linker/linker_test.go @@ -0,0 +1,40 @@ +package linker_test + +import ( + "testing" + + "github.com/dgate-io/dgate/pkg/util/linker" + "github.com/stretchr/testify/assert" +) + +func TestLinkerTests(t *testing.T) { + linker1 := linker.NewNamedVertex[string, int]( + "top", "bottom", + ) + linker2 := linker.NewNamedVertex[string, int]( + "top", "bottom", + ) + linker3 := linker.NewNamedVertex[string, int]( + "top", "bottom", + ) + linker4 := linker.NewNamedVertex[string, int]( + "top", "bottom", + ) + linker1.LinkOneOne("top", "l1top", linker2) + linker2.LinkOneOne("top", "l2top", linker3) + linker3.LinkOneOne("top", "l3top", linker4) + linker4.LinkOneOne("bottom", "l4bottom", linker3) + linker3.LinkOneMany("bottom", "l3bottom", linker2) + linker2.LinkOneMany("bottom", "l2bottom", linker1) + + + assert.True(t, linker1.Len("top") == 1) + assert.True(t, linker2.Len("top") == 1) + assert.True(t, linker3.Len("top") == 1) + assert.True(t, linker4.Len("top") == 0) + + assert.True(t, linker1.Len("bottom") == 0) + assert.True(t, linker2.Len("bottom") == 1) + assert.True(t, linker3.Len("bottom") == 1) + assert.True(t, linker4.Len("bottom") == 1) +} diff --git a/pkg/util/logger/logging.go b/pkg/util/logger/logging.go new file mode 100644 index 0000000..4c75b11 --- /dev/null +++ b/pkg/util/logger/logging.go @@ -0,0 +1,143 @@ +package logger + +import ( + "io" + "log" + + "github.com/hashicorp/go-hclog" + "github.com/rs/zerolog" +) + +type ZeroHCLogger struct { + zerolog.Logger +} + +var _ hclog.Logger = (*ZeroHCLogger)(nil) + +func NewZeroHCLogger(logger zerolog.Logger) *ZeroHCLogger { + return &ZeroHCLogger{logger} +} + +func NewNopHCLogger() *ZeroHCLogger { + return &ZeroHCLogger{zerolog.Nop()} +} + +func (l *ZeroHCLogger) IsTrace() bool { + return l.Logger.GetLevel() == zerolog.TraceLevel +} + +func (l *ZeroHCLogger) IsDebug() bool { + return l.Logger.GetLevel() == zerolog.DebugLevel +} + +func (l *ZeroHCLogger) IsInfo() bool { + return l.Logger.GetLevel() == zerolog.InfoLevel +} + +func (l *ZeroHCLogger) IsWarn() bool { + return l.Logger.GetLevel() == zerolog.WarnLevel +} + +func (l *ZeroHCLogger) IsError() bool { + return l.Logger.GetLevel() == zerolog.ErrorLevel +} + +func (l *ZeroHCLogger) Trace(format string, args ...interface{}) { + l.Logger.Trace().Fields(args).Msg(format) +} + +func (l *ZeroHCLogger) Debug(format string, args ...interface{}) { + l.Logger.Debug().Fields(args).Msg(format) +} + +func (l *ZeroHCLogger) Info(format string, args ...interface{}) { + l.Logger.Info().Fields(args).Msg(format) +} + +func (l *ZeroHCLogger) Warn(format string, args ...interface{}) { + l.Logger.Warn().Fields(args).Msg(format) +} + +func (l *ZeroHCLogger) Error(format string, args ...interface{}) { + l.Logger.Error().Fields(args).Msg(format) +} + +func (l *ZeroHCLogger) Log(level hclog.Level, format string, args ...interface{}) { + switch level { + case hclog.Trace: + l.Logger.Trace().Fields(args).Msg(format) + case hclog.Debug: + l.Logger.Debug().Fields(args).Msg(format) + case hclog.Info: + l.Logger.Info().Fields(args).Msg(format) + case hclog.Warn: + l.Logger.Warn().Fields(args).Msg(format) + case hclog.Error: + l.Logger.Error().Fields(args).Msg(format) + default: + log.Fatalf("unknown level %d", level) + } +} + +func (l *ZeroHCLogger) GetLevel() hclog.Level { + switch l.Logger.GetLevel() { + case zerolog.TraceLevel: + return hclog.Trace + case zerolog.DebugLevel: + return hclog.Debug + case zerolog.InfoLevel: + return hclog.Info + case zerolog.WarnLevel: + return hclog.Warn + case zerolog.ErrorLevel: + return hclog.Error + default: + log.Printf("unknown level %d", l.Logger.GetLevel()) + return hclog.NoLevel + } +} + +func (l *ZeroHCLogger) SetLevel(level hclog.Level) { + switch level { + case hclog.Trace: + l.Logger = l.Logger.Level(zerolog.TraceLevel) + case hclog.Debug: + l.Logger = l.Logger.Level(zerolog.DebugLevel) + case hclog.Info: + l.Logger = l.Logger.Level(zerolog.InfoLevel) + case hclog.Warn: + l.Logger = l.Logger.Level(zerolog.WarnLevel) + case hclog.Error: + l.Logger = l.Logger.Level(zerolog.ErrorLevel) + default: + log.Fatalf("unknown level %d", level) + } +} + +func (l *ZeroHCLogger) Name() string { + return "" +} + +func (l *ZeroHCLogger) Named(name string) hclog.Logger { + return &ZeroHCLogger{l.Logger.With().Str("name", name).Logger()} +} + +func (l *ZeroHCLogger) ResetNamed(name string) hclog.Logger { + return &ZeroHCLogger{l.Logger.With().Str("name", name).Logger()} +} + +func (l *ZeroHCLogger) With(args ...interface{}) hclog.Logger { + return &ZeroHCLogger{l.Logger.With().Fields(args).Logger()} +} + +func (l *ZeroHCLogger) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger { + return log.New(l.Logger, "", 0) +} + +func (l *ZeroHCLogger) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer { + return l.Logger +} + +func (l *ZeroHCLogger) ImpliedArgs() []interface{} { + return nil +} diff --git a/pkg/util/parse.go b/pkg/util/parse.go new file mode 100644 index 0000000..7787725 --- /dev/null +++ b/pkg/util/parse.go @@ -0,0 +1,14 @@ +package util + +import "strconv" + +func ParseInt(s string, def int) (int, error) { + if s == "" { + return def, nil + } + if i, err := strconv.Atoi(s); err == nil { + return i, nil + } else { + return def, err + } +} diff --git a/pkg/util/queue/queue.go b/pkg/util/queue/queue.go new file mode 100644 index 0000000..348c74d --- /dev/null +++ b/pkg/util/queue/queue.go @@ -0,0 +1,59 @@ +package queue + +type Queue[V any] interface { + // Push adds an element to the queue. + Push(V) + // Pop removes and returns the element at the front of the queue. + Pop() (V, bool) + // Peek returns the element at the front of the queue without removing it. + // It returns nil if the queue is empty. + Peek() (V, bool) + // Len returns the number of elements in the queue. + Len() int +} + +type queueImpl[V any] struct { + items []V +} + +// New returns a new queue. +func New[V any]() Queue[V] { + return newQueue[V](128) +} + +// NewWithSize returns a new queue with the specified size. +func NewWithSize[V any](size int) Queue[V] { + return newQueue[V](size) +} + +func newQueue[V any](size int) *queueImpl[V] { + return &queueImpl[V]{ + items: make([]V, 0, size), + } +} + +func (q *queueImpl[V]) Push(item V) { + q.items = append(q.items, item) +} + +func (q *queueImpl[V]) Pop() (V, bool) { + var item V + if len(q.items) == 0 { + return item, false + } + item = q.items[0] + q.items = q.items[1:] + return item, true +} + +func (q *queueImpl[V]) Peek() (V, bool) { + if len(q.items) == 0 { + var v V + return v, false + } + return q.items[0], true +} + +func (q *queueImpl[V]) Len() int { + return len(q.items) +} diff --git a/pkg/util/queue/queue_test.go b/pkg/util/queue/queue_test.go new file mode 100644 index 0000000..f38bfd9 --- /dev/null +++ b/pkg/util/queue/queue_test.go @@ -0,0 +1,72 @@ +package queue_test + +import ( + "testing" + + "github.com/dgate-io/dgate/pkg/util/queue" + "github.com/stretchr/testify/assert" +) + +func TestQueue_PushPop(t *testing.T) { + q := queue.New[int]() + q.Push(1) + q.Push(2) + q.Push(3) + + if q.Len() != 3 { + t.Fatalf("expected length to be 3, got %d", q.Len()) + } + + v, ok := q.Pop() + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 1, v, "expected value to be 1, got %d", v) + + v, ok = q.Pop() + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 2, v, "expected value to be 2, got %d", v) + + v, ok = q.Pop() + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 3, v, "expected value to be 3, got %d", v) + + if q.Len() != 0 { + t.Fatalf("expected length to be 0, got %d", q.Len()) + } + + v, ok = q.Pop() + assert.False(t, ok, "expected key to be not found") + assert.Equal(t, 0, v, "expected value to be 0, got %d", v) +} + +func TestQueue_Peek(t *testing.T) { + q := queue.New[int]() + q.Push(1) + q.Push(2) + q.Push(3) + + v, ok := q.Peek() + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 1, v, "expected value to be 1, got %d", v) + + v, ok = q.Peek() + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 1, v, "expected value to be 1, got %d", v) + + q.Pop() + + v, ok = q.Peek() + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 2, v, "expected value to be 2, got %d", v) + + q.Pop() + + v, ok = q.Peek() + assert.True(t, ok, "expected key to be found") + assert.Equal(t, 3, v, "expected value to be 3, got %d", v) + + q.Pop() + + v, ok = q.Peek() + assert.False(t, ok, "expected key to be not found") + assert.Equal(t, 0, v, "expected value to be 0, got %d", v) +} diff --git a/pkg/util/safe/ref.go b/pkg/util/safe/ref.go new file mode 100644 index 0000000..a51152a --- /dev/null +++ b/pkg/util/safe/ref.go @@ -0,0 +1,59 @@ +package safe + +import ( + "encoding/json" + "sync/atomic" +) + +// Ref is a generic struct that holds concurrent read and write objects +// to allow for safe concurrent read access with minimal locking, and +// atomic updates to the write object. +type Ref[T any] struct { + v *atomic.Pointer[T] +} + +// NewRef creates a new Ref instance with an initial value that is a pointer. +func NewRef[T any](t *T) *Ref[T] { + ap := new(atomic.Pointer[T]) + if t != nil { + ap.Store(shallowCopy(t)) + } + return &Ref[T]{ + v: ap, + } +} + +// Read returns a copy of the object. +func (rw *Ref[T]) Read() *T { + return shallowCopy(rw.v.Load()) +} + +// Load returns the current object. +func (rw *Ref[T]) Load() *T { + return rw.v.Load() +} + +// Replace replaces the ref and returns the old ref +func (rw *Ref[T]) Replace(new *T) (old *T) { + old = rw.v.Load() + newCopy := shallowCopy(new) + rw.v.Store(newCopy) + return old +} + +// shallowCopy copies the contents of src to dst. +func shallowCopy[T any](src *T) *T { + dst := new(T) + *dst = *src + return dst +} + +// MarshalJSON returns the JSON encoding of the read object. +func (rw *Ref[T]) MarshalJSON() ([]byte, error) { + return json.Marshal(rw.Read()) +} + +// UnmarshalJSON decodes the JSON data and updates the write object. +func (rw *Ref[T]) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, rw.Read()) +} diff --git a/pkg/util/safe/ref_test.go b/pkg/util/safe/ref_test.go new file mode 100644 index 0000000..97ee49b --- /dev/null +++ b/pkg/util/safe/ref_test.go @@ -0,0 +1,32 @@ +package safe_test + +import ( + "testing" + + "github.com/dgate-io/dgate/pkg/util/safe" +) + +type test struct { + i int + t *test +} + +func TestRef(t *testing.T) { + src := &test{1, nil} + src.t = src + ref := safe.NewRef(src) + readSrc := ref.Read() + oldReadSrc := ref.Replace(readSrc) + newReadSrc := ref.Read() + checkEqual(t, src, readSrc, oldReadSrc, newReadSrc) +} + +func checkEqual(t *testing.T, items ...interface{}) { + for i, item := range items { + for j, other := range items { + if i != j && item == other { + t.Errorf("item %v should not be equal to item %v", i, j) + } + } + } +} diff --git a/pkg/util/sliceutil/slice.go b/pkg/util/sliceutil/slice.go new file mode 100644 index 0000000..f9c5569 --- /dev/null +++ b/pkg/util/sliceutil/slice.go @@ -0,0 +1,69 @@ +package sliceutil + +func SliceMapper[T any, V any](items []T, mpr func(T) V) []V { + if items == nil { + return nil + } + slice, _ := SliceMapperError(items, func(i T) (V, error) { + return mpr(i), nil + }) + return slice +} + +func SliceMapperError[T any, V any](items []T, mpr func(T) (V, error)) (slice []V, err error) { + if items == nil { + return nil, nil + } + slice = make([]V, len(items)) + for i, v := range items { + slice[i], err = mpr(v) + if err != nil { + return nil, err + } + } + return slice, nil +} + +func SliceMapperFilter[T any, V any](items []T, mpr func(T) (bool, V)) []V { + if items == nil { + return nil + } + slice := make([]V, 0) + for _, i := range items { + keep, val := mpr(i) + if !keep { + continue + } + slice = append(slice, val) + } + return slice +} + +func SliceUnique[T any, C comparable](arr []T, eq func(T) C) []T { + unique := make([]T, 0) + seen := map[C]struct{}{} + for _, v := range arr { + k := eq(v) + if _, ok := seen[k]; !ok { + seen[k] = struct{}{} + unique = append(unique, v) + } + } + return unique +} + +func SliceContains[T comparable](arr []T, val T) bool { + for _, v := range arr { + if v == val { + return true + } + } + return false +} + +func SliceCopy[T any](arr []T) []T { + if arr == nil { + return nil + } + return append([]T(nil), arr...) +} diff --git a/pkg/util/tree/avl/avl.go b/pkg/util/tree/avl/avl.go new file mode 100644 index 0000000..c75291b --- /dev/null +++ b/pkg/util/tree/avl/avl.go @@ -0,0 +1,421 @@ +package avl + +import ( + "cmp" + "sync" +) + +// node represents a node in the AVL tree. +type node[K cmp.Ordered, V any] struct { + key K + val V + left *node[K, V] + right *node[K, V] + height int +} + +// Length returns the length of the node. +func (n *node[K, V]) _length() int { + if n == nil { + return 0 + } + return 1 + n.left._length() + n.right._length() +} + +// Tree represents an AVL tree. +type Tree[K cmp.Ordered, V any] interface { + // Each traverses the tree in order and calls the given function for each node. + Each(func(K, V) bool) + // Insert inserts a key-value pair and returns the previous value if it exists. + Insert(K, V) V + // Delete removes a node with the given key from the AVL tree. + Delete(K) bool + // Pop removes a node with the given key from the AVL tree and returns the value. + Pop(K) (V, bool) + // Find returns the value associated with the given key. + Find(K) (V, bool) + // RootKeyValue returns the key and value of the root node. + RootKeyValue() (K, V, bool) + // Length returns the length of the tree. + Length() int + // Height returns the height of the tree. + Height() int + // Clear removes all nodes from the tree. + Clear() + // Empty returns true if the tree is empty. + Empty() bool + // Clone returns a copy of the tree. + Clone() Tree[K, V] +} + +type tree[K cmp.Ordered, V any] struct { + root *node[K, V] + mtx *sync.RWMutex +} + +func NewTree[K cmp.Ordered, V any]() Tree[K, V] { + return &tree[K, V]{mtx: &sync.RWMutex{}} +} + +func NewTreeFromRight[K cmp.Ordered, V any](t Tree[K, V]) Tree[K, V] { + root := t.(*tree[K, V]).root + if root != nil { + root = root.right + } + return &tree[K, V]{root: root, mtx: &sync.RWMutex{}} +} + +func NewTreeFromLeft[K cmp.Ordered, V any](t Tree[K, V]) Tree[K, V] { + root := t.(*tree[K, V]).root + if root != nil { + root = root.left + } + return &tree[K, V]{root: root, mtx: &sync.RWMutex{}} +} + +// Each traverses the tree in order and calls the given function for each node. +func (t *tree[K, V]) Each(f func(K, V) bool) { + t.mtx.RLock() + defer t.mtx.RUnlock() + each(t.root, func(n *node[K, V]) bool { + return f(n.key, n.val) + }) +} + +func each[K cmp.Ordered, V any](node *node[K, V], f func(*node[K, V]) bool) bool { + if node == nil { + return true + } + if each(node.left, f) && f(node) { + return each(node.right, f) + } + return false +} + +// rotateRight performs a right rotation on the given node. +func rotateRight[K cmp.Ordered, V any](y *node[K, V]) *node[K, V] { + x := y.left + t := x.right + + // Perform rotation + x.right = y + y.left = t + + // Update heights + updateHeight(y) + updateHeight(x) + + return x +} + +// rotateLeft performs a left rotation on the given node. +func rotateLeft[K cmp.Ordered, V any](x *node[K, V]) *node[K, V] { + y := x.right + t := y.left + + // Perform rotation + y.left = x + x.right = t + + // Update heights + updateHeight(x) + updateHeight(y) + + return y +} + +func getHeight[K cmp.Ordered, V any](node *node[K, V]) int { + if node == nil { + return 0 + } + return node.height +} + +func updateHeight[K cmp.Ordered, V any](node *node[K, V]) { + node.height = 1 + max(getHeight(node.left), getHeight(node.right)) +} + +// getBalanceFactor returns the balance factor of a node. +func getBalanceFactor[K cmp.Ordered, V any](node *node[K, V]) int { + if node == nil { + return 0 + } + if node.left == nil && node.right == nil { + return 1 + } + if node.left == nil { + return -node.right.height + } + if node.right == nil { + return node.left.height + } + return node.left.height - node.right.height +} + +// Insert inserts a key-value pair into the AVL tree. thread-safe +func (t *tree[K, V]) Insert(key K, value V) (v V) { + t.mtx.Lock() + defer t.mtx.Unlock() + t.root, v = replace(t.root, key, value) + return v +} + +func replace[K cmp.Ordered, V any](root *node[K, V], key K, value V) (*node[K, V], V) { + // Perform standard BST insertion + var oldValue V + if root == nil { + return &node[K, V]{ + key: key, + val: value, + height: 1, + }, oldValue + } + if key < root.key { + root.left, oldValue = replace(root.left, key, value) + } else if key > root.key { + root.right, oldValue = replace(root.right, key, value) + } else { + // Update the value for an existing key + oldValue, root.val = root.val, value + return root, oldValue + } + + updateHeight(root) + + // Get the balance factor of this node + balance := getBalanceFactor(root) + + // Perform rotations if needed + // Left Left Case + if balance > 1 && key < root.left.key { + return rotateRight(root), oldValue + } + // Right Right Case + if balance < -1 && key > root.right.key { + return rotateLeft(root), oldValue + } + // Left Right Case + if balance > 1 && key > root.left.key { + root.left = rotateLeft(root.left) + return rotateRight(root), oldValue + } + // Right Left Case + if balance < -1 && key < root.right.key { + root.right = rotateRight(root.right) + return rotateLeft(root), oldValue + } + + return root, oldValue +} +func deleteNode[K cmp.Ordered, V any](root *node[K, V], key K) (*node[K, V], V, bool) { + var v V + if root == nil { + return nil, v, false + } + + deleted := false + // Standard BST delete + if key < root.key { + root.left, v, deleted = deleteNode(root.left, key) + } else if key > root.key { + root.right, v, deleted = deleteNode(root.right, key) + } else { + deleted = true + v = root.val + // Node with only one child or no child + if root.left == nil || root.right == nil { + var temp *node[K, V] + if root.left != nil { + temp = root.left + } else { + temp = root.right + } + + // No child case + if temp == nil { + // temp = root + root = nil + } else { // One child case + *root = *temp // Copy the contents of the non-empty child + } + + // Free the old node + temp = nil + } else { + // Node with two children, get the inorder successor (smallest + // in the right subtree) + temp := findMin(root.right) + + // Copy the inorder successor's data to this node + root.key = temp.key + root.val = temp.val + + // Delete the inorder successor + root.right, v, deleted = deleteNode(root.right, temp.key) + } + } + + // If the tree had only one node, then return + if root == nil { + return nil, v, deleted + } + + if deleted { + // Update height of the current node + updateHeight(root) + + // Get the balance factor of this node + balance := getBalanceFactor(root) + + // Perform rotations if needed + // Left Left Case + if balance > 1 && getBalanceFactor(root.left) >= 0 { + return rotateRight(root), v, deleted + } + // Left Right Case + if balance > 1 && getBalanceFactor(root.left) < 0 { + root.left = rotateLeft(root.left) + return rotateRight(root), v, deleted + } + // Right Right Case + if balance < -1 && getBalanceFactor(root.right) <= 0 { + return rotateLeft(root), v, deleted + } + // Right Left Case + if balance < -1 && getBalanceFactor(root.right) > 0 { + root.right = rotateRight(root.right) + return rotateLeft(root), v, deleted + } + } + + return root, v, deleted +} + +func findMin[K cmp.Ordered, V any](node *node[K, V]) *node[K, V] { + for node.left != nil { + node = node.left + } + return node +} + +// Delete removes a node with the given key from the AVL tree. +func (t *tree[K, V]) Delete(key K) bool { + t.mtx.Lock() + defer t.mtx.Unlock() + var found bool + t.root, _, found = deleteNode(t.root, key) + return found +} + +// Pop removes a node with the given key from the AVL tree and returns the value. +func (t *tree[K, V]) Pop(key K) (V, bool) { + t.mtx.Lock() + defer t.mtx.Unlock() + var found bool + var v V + t.root, v, found = deleteNode(t.root, key) + return v, found +} + +// Find returns the value associated with the given key. +func (t *tree[K, V]) Find(key K) (V, bool) { + t.mtx.RLock() + defer t.mtx.RUnlock() + return find(t.root, key) +} + +func find[K cmp.Ordered, V any](root *node[K, V], key K) (V, bool) { + if root == nil { + var v V + return v, false + } + if key < root.key { + return find(root.left, key) + } else if key > root.key { + return find(root.right, key) + } else { + return root.val, true + } +} + +// RootKey returns the key and value of the root node. +func (t *tree[K, V]) RootKeyValue() (K, V, bool) { + t.mtx.RLock() + defer t.mtx.RUnlock() + if t.root == nil { + var k K + var v V + return k, v, false + } + return t.root.key, t.root.val, true +} + +// Length returns the length of the tree. +func (t *tree[K, V]) Length() int { + t.mtx.RLock() + defer t.mtx.RUnlock() + if t.root == nil { + return 0 + } + return t.root._length() +} + +// Height returns the height of the tree. +func (t *tree[K, V]) Height() int { + t.mtx.RLock() + defer t.mtx.RUnlock() + if t.root == nil { + return 0 + } + return t.root.height +} + +// Clear removes all nodes from the tree. +func (t *tree[K, V]) Clear() { + t.mtx.Lock() + defer t.mtx.Unlock() + t.root = nil +} + +// Clone returns a copy of the tree. +func (t *tree[K, V]) Clone() Tree[K, V] { + t.mtx.RLock() + defer t.mtx.RUnlock() + return &tree[K, V]{root: clone(t.root, func(_ K, v V) V { + v2 := &v + return *v2 + }), mtx: &sync.RWMutex{}} +} + +// Empty returns true if the tree is empty. +func (t *tree[K, V]) Empty() bool { + t.mtx.RLock() + defer t.mtx.RUnlock() + return t.root == nil +} + +func clone[K cmp.Ordered, V any](root *node[K, V], fn func(K, V) V) *node[K, V] { + if root == nil { + return nil + } + return &node[K, V]{ + key: root.key, + val: fn(root.key, root.val), + left: clone(root.left, fn), + right: clone(root.right, fn), + } +} + +// MarshalJSON returns the JSON encoding of the AVL tree. +// func (t *tree[K, V]) MarshalJSON() ([]byte, error) { +// t.mtx.RLock() +// defer t.mtx.RUnlock() +// return json.Marshal(t.root) +// } + +// UnmarshalJSON decodes the JSON encoding of the AVL tree. +// func (t *tree[K, V]) UnmarshalJSON(data []byte) error { +// t.mtx.Lock() +// defer t.mtx.Unlock() +// return json.Unmarshal(data, &t.root) +// } diff --git a/pkg/util/tree/avl/avl_test.go b/pkg/util/tree/avl/avl_test.go new file mode 100644 index 0000000..d887f19 --- /dev/null +++ b/pkg/util/tree/avl/avl_test.go @@ -0,0 +1,292 @@ +package avl_test + +import ( + "math/rand" + "testing" + + "github.com/dgate-io/dgate/pkg/util/tree/avl" +) + +// Test AVL Tree Insertion +func TestAVLTreeInsertDelete(t *testing.T) { + tree := avl.NewTree[string, int]() // Example with string keys and int values + + testCases := map[string]int{ + "lemon": 110, + "lime": 120, + "lychee": 130, + "papaya": 140, + "cherry": 150, + "berry": 160, + "fig": 170, + "strawberry": 180, + "apricot": 190, + "avocado": 200, + "apple": 10, + "orange": 20, + "banana": 30, + "grapes": 40, + "mango": 50, + "kiwi": 60, + "pear": 70, + "peach": 80, + "plum": 90, + "guava": 100, + } + + // Insertion tests + for key, value := range testCases { + tree.Insert(key, value) + } + + // Inorder traversal to check correctness + expectedOrder := []string{ + "apple", + "apricot", + "avocado", + "banana", + "berry", + "cherry", + "fig", + "grapes", + "guava", + "kiwi", + "lemon", + "lime", + "lychee", + "mango", + "orange", + "papaya", + "peach", + "pear", + "plum", + "strawberry", + } + + var actualOrder []string + + tree.Each(func(key string, value int) bool { + actualOrder = append(actualOrder, key) + return true + }) + + // Check if the traversal order matches the expected order + for i, key := range actualOrder { + if key != expectedOrder[i] { + t.Errorf("Expected order %v, got %v", expectedOrder, actualOrder) + break + } + } + + // Deletion tests + switcher := false + for len(expectedOrder) > 0 { + if switcher { + // delete something that exists + randomIndex := rand.Intn(len(expectedOrder)) + if !tree.Delete(expectedOrder[randomIndex]) { + t.Errorf("Expected deletion of %s to succeed", expectedOrder[randomIndex]) + } + // remove the deleted key from the expected order + expectedOrder = append(expectedOrder[:randomIndex], expectedOrder[randomIndex+1:]...) + } else { + // search for something that doesn't exist + randomIndex := rand.Intn(len(expectedOrder)) + nonExistentKey := expectedOrder[randomIndex] + "-nonexistent" + if tree.Delete(nonExistentKey) { + t.Errorf("Expected deletion of %s to fail", nonExistentKey) + } + } + + // Perform inorder traversal + actualOrder = nil + tree.Each(func(key string, value int) bool { + actualOrder = append(actualOrder, key) + return true + }) + + // Check if the traversal order matches the expected order + for i, key := range actualOrder { + if key != expectedOrder[i] { + t.Errorf("Expected order %v, got %v", expectedOrder, actualOrder) + break + } + } + + switcher = !switcher + + } +} + +func TestAVLTreeEach(t *testing.T) { + tree := avl.NewTree[int, int]() // Example with string keys and int values + + // Insertion tests + for i := 0; i < 1000; i++ { + tree.Insert(i, i) + } + + // Inorder traversal to check correctness + i := 0 + tree.Each(func(k int, v int) bool { + if k != i { + t.Errorf("Expected %d, got %d", i, k) + } + i++ + return true + }) + + // Inorder traversal stopping early + i = 0 + tree.Each(func(k int, v int) bool { + if k != i { + t.Errorf("Expected %d, got %d", i, k) + } + i++ + return i < 500 + }) + if i != 500 { + t.Errorf("Expected 500, got %d", i) + } +} + +func TestAVLTreeHeight(t *testing.T) { + tree := avl.NewTree[int, int]() // Example with string keys and int values + if tree.Height() != 0 { + t.Errorf("Expected height 1, got %d", tree.Height()) + } + tree.Insert(-1, -1) + if tree.Height() != 1 { + t.Errorf("Expected height 1, got %d", tree.Height()) + } + tree.Insert(-2, -2) + if tree.Height() != 2 { + t.Errorf("Expected height 2, got %d", tree.Height()) + } + + // Insertion tests + for i := 0; i < 1000; i++ { + tree.Insert(i, i) + treeHeight(t, tree) + } +} + +func TestAVLTreeInsertion(t *testing.T) { + tree := avl.NewTree[int, int]() // Example with string keys and int values + + t.Run("0-999", func(t *testing.T) { + // Insertion tests + for i := 0; i < 1000; i++ { + tree.Insert(i, i) + } + + treeHeight(t, tree) + treeLength(t, tree) + + // Inorder traversal to check correctness + for i := 0; i < 999; i++ { + x, ok := tree.Find(i) + if !ok { + t.Errorf("Expected %d, got not found", i) + } + if x != i { + t.Errorf("Expected %d, got %d", i, x) + } + } + }) + t.Run("999-0", func(t *testing.T) { + // Insertion overwrite tests + for i := 999; i >= 0; i-- { + tree.Insert(i, i) + } + + treeHeight(t, tree) + treeLength(t, tree) + + // Inorder traversal to check correctness + for i := 0; i < 999; i++ { + x, ok := tree.Find(i) + if !ok { + t.Errorf("Expected %d, got not found", i) + } + if x != i { + t.Errorf("Expected %d, got %d", i, x) + } + } + }) +} + +func treeHeight(t *testing.T, tree avl.Tree[int, int]) int { + if tree.Empty() { + return 0 + } + l := avl.NewTreeFromLeft(tree) + r := avl.NewTreeFromRight(tree) + totalTreeHeight := 1 + max(treeHeight(t, l), treeHeight(t, r)) + if totalTreeHeight != tree.Height() { + t.Errorf("Expected height %d, got %d", totalTreeHeight, tree.Height()) + } + return totalTreeHeight +} + +func treeLength(t *testing.T, tree avl.Tree[int, int]) int { + if tree.Empty() { + return 0 + } + l := avl.NewTreeFromLeft(tree) + r := avl.NewTreeFromRight(tree) + totalTreeLength := 1 + treeLength(t, l) + treeLength(t, r) + if totalTreeLength != tree.Length() { + t.Errorf("Expected length %d, got %d", totalTreeLength, tree.Length()) + } + return totalTreeLength +} + +// Benchmark AVL Tree Insertion +func BenchmarkAVLTreeInsert(b *testing.B) { + tree := avl.NewTree[int, int]() // Example with string keys and int values + + // Run the insertion operation b.N times + for i := 0; i < b.N; i++ { + tree.Insert(i, i) + } +} + +// Benchmark AVL Tree Insertion +func BenchmarkAVLTreeFind(b *testing.B) { + tree := avl.NewTree[int, int]() + + // Insert k nodes into the tree + k := 1_000_000 + { + b.StopTimer() + for i := 0; i < k; i++ { + tree.Insert(i, i) + } + b.StartTimer() + } + + // Run the find operation b.N times + for i := 0; i < b.N; i++ { + tree.Find(i % k) + } +} + +func BenchmarkAVLTreeInsertAndFindParallel(b *testing.B) { + tree := avl.NewTree[int, int]() + b.RunParallel(func(pb *testing.PB) { + i := 0 + for pb.Next() { + tree.Insert(i, i) + i++ + } + }) + + b.RunParallel(func(pb *testing.PB) { + i := 0 + for pb.Next() { + tree.Find(0) + i++ + } + }) +}