@apollo/client 3.8.7 → 3.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +14 -0
- package/CHANGELOG.md +3369 -0
- package/apollo-client.cjs +356 -354
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +133 -152
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +133 -152
- package/cache/core/cache.d.ts +10 -0
- package/cache/core/cache.js +17 -5
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +92 -0
- package/cache/core/types/common.js +4 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +1 -1
- package/cache/inmemory/entityStore.js +190 -29
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fixPolyfills.js +9 -0
- package/cache/inmemory/fixPolyfills.js.map +1 -1
- package/cache/inmemory/fixPolyfills.native.js +12 -0
- package/cache/inmemory/fixPolyfills.native.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.js +23 -12
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/helpers.js +20 -11
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.js +161 -8
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +72 -4
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/object-canon.js +91 -3
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.js +193 -43
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.js +20 -2
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +4 -0
- package/cache/inmemory/readFromStore.js +54 -9
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +28 -0
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.js +152 -25
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/config/jest/setup.js +2 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +264 -3
- package/core/ApolloClient.js +235 -7
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts +4 -6
- package/core/LocalState.js +56 -18
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +25 -0
- package/core/ObservableQuery.js +239 -30
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +3 -3
- package/core/QueryInfo.js +116 -13
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +4 -0
- package/core/QueryManager.js +229 -33
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +112 -103
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +112 -103
- package/core/equalByQuery.js +20 -1
- package/core/equalByQuery.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +19 -0
- package/core/index.js.map +1 -1
- package/core/networkStatus.d.ts +39 -0
- package/core/networkStatus.js +39 -0
- package/core/networkStatus.js.map +1 -1
- package/core/types.d.ts +9 -0
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +225 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +5 -111
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +5 -111
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/errors/errors.cjs +1 -1
- package/errors/errors.cjs.map +1 -1
- package/errors/errors.cjs.native.js +1 -1
- package/errors/index.js +14 -1
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +1 -0
- package/link/batch/batch.cjs +2 -2
- package/link/batch/batch.cjs.map +1 -1
- package/link/batch/batch.cjs.native.js +2 -2
- package/link/batch/batchLink.d.ts +21 -0
- package/link/batch/batchLink.js +2 -1
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.js +24 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch-http/batch-http.cjs +3 -2
- package/link/batch-http/batch-http.cjs.map +1 -1
- package/link/batch-http/batch-http.cjs.native.js +3 -2
- package/link/batch-http/batchHttpLink.d.ts +4 -0
- package/link/batch-http/batchHttpLink.js +53 -2
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/context/context.cjs.map +1 -1
- package/link/context/index.js +1 -0
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.js +12 -5
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs +5 -5
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +5 -5
- package/link/error/error.cjs +1 -1
- package/link/error/error.cjs.map +1 -1
- package/link/error/error.cjs.native.js +1 -1
- package/link/error/index.d.ts +3 -0
- package/link/error/index.js +4 -1
- package/link/error/index.js.map +1 -1
- package/link/http/HttpLink.d.ts +0 -2
- package/link/http/HttpLink.js +1 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.d.ts +1 -1
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.js +23 -1
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/createSignalIfSupported.d.ts +5 -0
- package/link/http/createSignalIfSupported.js +5 -0
- package/link/http/createSignalIfSupported.js.map +1 -1
- package/link/http/http.cjs +14 -15
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +14 -15
- package/link/http/index.js +2 -1
- package/link/http/index.js.map +1 -1
- package/link/http/iterators/async.d.ts +4 -0
- package/link/http/iterators/async.js +4 -0
- package/link/http/iterators/async.js.map +1 -1
- package/link/http/iterators/nodeStream.d.ts +4 -0
- package/link/http/iterators/nodeStream.js +4 -0
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/iterators/promise.d.ts +4 -0
- package/link/http/iterators/promise.js +4 -0
- package/link/http/iterators/promise.js.map +1 -1
- package/link/http/iterators/reader.d.ts +4 -0
- package/link/http/iterators/reader.js +4 -0
- package/link/http/iterators/reader.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js +50 -13
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/responseIterator.d.ts +4 -0
- package/link/http/responseIterator.js +6 -0
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/rewriteURIForGET.d.ts +1 -1
- package/link/http/rewriteURIForGET.js +10 -0
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +46 -1
- package/link/http/selectHttpOptionsAndBody.js +23 -0
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.js.map +1 -1
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.js +34 -4
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs +4 -4
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +4 -4
- package/link/remove-typename/remove-typename.cjs +12 -9
- package/link/remove-typename/remove-typename.cjs.map +1 -1
- package/link/remove-typename/remove-typename.cjs.native.js +12 -9
- package/link/remove-typename/removeTypenameFromVariables.js +12 -9
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/link/retry/delayFunction.d.ts +29 -0
- package/link/retry/delayFunction.js +6 -0
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/retry.cjs +5 -5
- package/link/retry/retry.cjs.map +1 -1
- package/link/retry/retry.cjs.native.js +5 -5
- package/link/retry/retryFunction.d.ts +20 -0
- package/link/retry/retryLink.d.ts +6 -0
- package/link/retry/retryLink.js +31 -6
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +13 -0
- package/link/schema/index.js +3 -3
- package/link/schema/index.js.map +1 -1
- package/link/schema/schema.cjs +3 -3
- package/link/schema/schema.cjs.map +1 -1
- package/link/schema/schema.cjs.native.js +3 -3
- package/link/subscriptions/index.js +35 -2
- package/link/subscriptions/index.js.map +1 -1
- package/link/subscriptions/subscriptions.cjs +3 -2
- package/link/subscriptions/subscriptions.cjs.map +1 -1
- package/link/subscriptions/subscriptions.cjs.native.js +3 -2
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/filterOperationVariables.js +4 -0
- package/link/utils/filterOperationVariables.js.map +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/transformOperation.js +3 -2
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.d.ts +12 -0
- package/link/ws/index.js +1 -1
- package/link/ws/index.js.map +1 -1
- package/link/ws/ws.cjs +1 -1
- package/link/ws/ws.cjs.map +1 -1
- package/link/ws/ws.cjs.native.js +1 -1
- package/package.json +56 -45
- package/react/cache/QueryReference.d.ts +6 -1
- package/react/cache/QueryReference.js +26 -1
- package/react/cache/QueryReference.js.map +1 -1
- package/react/cache/SuspenseCache.d.ts +10 -0
- package/react/cache/SuspenseCache.js +1 -1
- package/react/cache/SuspenseCache.js.map +1 -1
- package/react/cache/getSuspenseCache.js.map +1 -1
- package/react/context/ApolloContext.d.ts +5 -0
- package/react/context/ApolloContext.js +10 -3
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/context.cjs +1 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +1 -3
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.js +3 -1
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/hoc.cjs +9 -17
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +9 -17
- package/react/hoc/mutation-hoc.js +9 -4
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.js +10 -4
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.js +10 -4
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/withApollo.js +3 -4
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs +72 -57
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +72 -57
- package/react/hooks/internal/__use.js +5 -0
- package/react/hooks/internal/__use.js.map +1 -1
- package/react/hooks/internal/index.d.ts +1 -0
- package/react/hooks/internal/index.js +2 -0
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -3
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/internal/useLazyRef.d.ts +3 -0
- package/react/hooks/internal/useLazyRef.js +10 -0
- package/react/hooks/internal/useLazyRef.js.map +1 -0
- package/react/hooks/useBackgroundQuery.js +6 -0
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.js +21 -17
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.js +13 -4
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.js +8 -3
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +11 -0
- package/react/hooks/useQuery.js +137 -5
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReactiveVar.js +5 -0
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +19 -0
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +5 -0
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +11 -5
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +53 -1
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/parser/index.js +4 -5
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +2 -4
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +2 -4
- package/react/ssr/RenderPromises.js +21 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/getDataFromTree.js +18 -3
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/ssr.cjs +6 -4
- package/react/ssr/ssr.cjs.map +1 -1
- package/react/ssr/ssr.cjs.native.js +6 -4
- package/react/types/types.d.ts +66 -0
- package/testing/core/core.cjs +18 -13
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +18 -13
- package/testing/core/itAsync.d.ts +1 -1
- package/testing/core/itAsync.js.map +1 -1
- package/testing/core/mocking/mockFetch.d.ts +2 -2
- package/testing/core/mocking/mockFetch.js +8 -4
- package/testing/core/mocking/mockFetch.js.map +1 -1
- package/testing/core/mocking/mockLink.js +25 -9
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.js +2 -0
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.js +1 -1
- package/testing/core/mocking/mockWatchQuery.js.map +1 -1
- package/testing/core/observableToPromise.d.ts +17 -3
- package/testing/core/observableToPromise.js +5 -0
- package/testing/core/observableToPromise.js.map +1 -1
- package/testing/core/subscribeAndCount.js +3 -0
- package/testing/core/subscribeAndCount.js.map +1 -1
- package/testing/core/wait.js +2 -2
- package/testing/core/wait.js.map +1 -1
- package/testing/core/withConsoleSpy.d.ts +3 -0
- package/testing/core/withConsoleSpy.js +7 -1
- package/testing/core/withConsoleSpy.js.map +1 -1
- package/testing/core/wrap.js +2 -0
- package/testing/core/wrap.js.map +1 -1
- package/testing/internal/ObservableStream.js +14 -14
- package/testing/internal/ObservableStream.js.map +1 -1
- package/testing/internal/disposables/spyOnConsole.d.ts +1 -0
- package/testing/internal/disposables/spyOnConsole.js +2 -0
- package/testing/internal/disposables/spyOnConsole.js.map +1 -1
- package/testing/internal/disposables/withCleanup.d.ts +1 -0
- package/testing/internal/disposables/withCleanup.js +3 -0
- package/testing/internal/disposables/withCleanup.js.map +1 -1
- package/testing/internal/profile/Render.d.ts +28 -0
- package/testing/internal/profile/Render.js +12 -1
- package/testing/internal/profile/Render.js.map +1 -1
- package/testing/internal/profile/profile.d.ts +44 -7
- package/testing/internal/profile/profile.js +63 -51
- package/testing/internal/profile/profile.js.map +1 -1
- package/testing/internal/profile/traces.d.ts +4 -0
- package/testing/internal/profile/traces.js +9 -5
- package/testing/internal/profile/traces.js.map +1 -1
- package/testing/matchers/ProfiledComponent.js +27 -22
- package/testing/matchers/ProfiledComponent.js.map +1 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
- package/testing/matchers/toMatchDocument.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +4 -0
- package/testing/react/MockedProvider.js +6 -2
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +4 -2
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +4 -2
- package/utilities/common/arrays.js +1 -0
- package/utilities/common/arrays.js.map +1 -1
- package/utilities/common/canUse.js +16 -1
- package/utilities/common/canUse.js.map +1 -1
- package/utilities/common/cloneDeep.d.ts +3 -0
- package/utilities/common/cloneDeep.js +5 -0
- package/utilities/common/cloneDeep.js.map +1 -1
- package/utilities/common/compact.d.ts +4 -0
- package/utilities/common/compact.js +4 -0
- package/utilities/common/compact.js.map +1 -1
- package/utilities/common/errorHandling.js +1 -3
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/incrementalResult.js +3 -0
- package/utilities/common/incrementalResult.js.map +1 -1
- package/utilities/common/makeUniqueId.js +2 -0
- package/utilities/common/makeUniqueId.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.js +3 -0
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeDeep.js +12 -1
- package/utilities/common/mergeDeep.js.map +1 -1
- package/utilities/common/mergeOptions.d.ts +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/common/omitDeep.js.map +1 -1
- package/utilities/globals/global.js +7 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/globals.cjs +4 -5
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +4 -5
- package/utilities/globals/index.d.ts +4 -0
- package/utilities/globals/index.js +7 -0
- package/utilities/globals/index.js.map +1 -1
- package/utilities/globals/invariantWrappers.d.ts +40 -0
- package/utilities/globals/invariantWrappers.js +11 -3
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/utilities/globals/maybe.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +19 -6
- package/utilities/graphql/DocumentTransform.js.map +1 -1
- package/utilities/graphql/directives.js +3 -0
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts +25 -0
- package/utilities/graphql/fragments.js +36 -0
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts +5 -0
- package/utilities/graphql/getFromAST.js +9 -0
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/print.js.map +1 -1
- package/utilities/graphql/storeUtils.d.ts +14 -0
- package/utilities/graphql/storeUtils.js +7 -2
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js +106 -7
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/observables/Concast.d.ts +1 -1
- package/utilities/observables/Concast.js +84 -1
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/Observable.js +6 -0
- package/utilities/observables/Observable.js.map +1 -1
- package/utilities/observables/asyncMap.js +12 -3
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.js +3 -0
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/observables/subclassing.js +14 -0
- package/utilities/observables/subclassing.js.map +1 -1
- package/utilities/policies/pagination.js +47 -3
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/promises/decoration.js +1 -0
- package/utilities/promises/decoration.js.map +1 -1
- package/utilities/types/DeepOmit.js.map +1 -1
- package/utilities/types/DeepPartial.d.ts +1 -1
- package/utilities/types/DeepPartial.js +4 -0
- package/utilities/types/DeepPartial.js.map +1 -1
- package/utilities/types/IsStrictlyAny.js.map +1 -1
- package/utilities/types/TODO.d.ts +3 -0
- package/utilities/types/TODO.js +2 -0
- package/utilities/types/TODO.js.map +1 -0
- package/utilities/utilities.cjs +31 -27
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +31 -27
- package/version.js +1 -1
- package/cache/core/cache.d.ts.map +0 -1
- package/cache/core/types/Cache.d.ts.map +0 -1
- package/cache/core/types/DataProxy.d.ts.map +0 -1
- package/cache/core/types/common.d.ts.map +0 -1
- package/cache/index.d.ts.map +0 -1
- package/cache/inmemory/entityStore.d.ts.map +0 -1
- package/cache/inmemory/fixPolyfills.d.ts.map +0 -1
- package/cache/inmemory/fixPolyfills.native.d.ts.map +0 -1
- package/cache/inmemory/fragmentRegistry.d.ts.map +0 -1
- package/cache/inmemory/helpers.d.ts.map +0 -1
- package/cache/inmemory/inMemoryCache.d.ts.map +0 -1
- package/cache/inmemory/key-extractor.d.ts.map +0 -1
- package/cache/inmemory/object-canon.d.ts.map +0 -1
- package/cache/inmemory/policies.d.ts.map +0 -1
- package/cache/inmemory/reactiveVars.d.ts.map +0 -1
- package/cache/inmemory/readFromStore.d.ts.map +0 -1
- package/cache/inmemory/types.d.ts.map +0 -1
- package/cache/inmemory/writeToStore.d.ts.map +0 -1
- package/config/jest/setup.d.ts.map +0 -1
- package/core/ApolloClient.d.ts.map +0 -1
- package/core/LocalState.d.ts.map +0 -1
- package/core/ObservableQuery.d.ts.map +0 -1
- package/core/QueryInfo.d.ts.map +0 -1
- package/core/QueryManager.d.ts.map +0 -1
- package/core/equalByQuery.d.ts.map +0 -1
- package/core/index.d.ts.map +0 -1
- package/core/networkStatus.d.ts.map +0 -1
- package/core/types.d.ts.map +0 -1
- package/core/watchQueryOptions.d.ts.map +0 -1
- package/dev/index.d.ts.map +0 -1
- package/dev/loadDevMessages.d.ts.map +0 -1
- package/dev/loadErrorMessageHandler.d.ts.map +0 -1
- package/dev/loadErrorMessages.d.ts.map +0 -1
- package/errors/index.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/invariantErrorCodes.d.ts.map +0 -1
- package/link/batch/batchLink.d.ts.map +0 -1
- package/link/batch/batching.d.ts.map +0 -1
- package/link/batch/index.d.ts.map +0 -1
- package/link/batch-http/batchHttpLink.d.ts.map +0 -1
- package/link/batch-http/index.d.ts.map +0 -1
- package/link/context/index.d.ts.map +0 -1
- package/link/core/ApolloLink.d.ts.map +0 -1
- package/link/core/concat.d.ts.map +0 -1
- package/link/core/empty.d.ts.map +0 -1
- package/link/core/execute.d.ts.map +0 -1
- package/link/core/from.d.ts.map +0 -1
- package/link/core/index.d.ts.map +0 -1
- package/link/core/split.d.ts.map +0 -1
- package/link/core/types.d.ts.map +0 -1
- package/link/error/index.d.ts.map +0 -1
- package/link/http/HttpLink.d.ts.map +0 -1
- package/link/http/checkFetcher.d.ts.map +0 -1
- package/link/http/createHttpLink.d.ts.map +0 -1
- package/link/http/createSignalIfSupported.d.ts.map +0 -1
- package/link/http/index.d.ts.map +0 -1
- package/link/http/iterators/async.d.ts.map +0 -1
- package/link/http/iterators/nodeStream.d.ts.map +0 -1
- package/link/http/iterators/promise.d.ts.map +0 -1
- package/link/http/iterators/reader.d.ts.map +0 -1
- package/link/http/parseAndCheckHttpResponse.d.ts.map +0 -1
- package/link/http/responseIterator.d.ts.map +0 -1
- package/link/http/rewriteURIForGET.d.ts.map +0 -1
- package/link/http/selectHttpOptionsAndBody.d.ts.map +0 -1
- package/link/http/selectURI.d.ts.map +0 -1
- package/link/http/serializeFetchParameter.d.ts.map +0 -1
- package/link/persisted-queries/index.d.ts.map +0 -1
- package/link/remove-typename/index.d.ts.map +0 -1
- package/link/remove-typename/removeTypenameFromVariables.d.ts.map +0 -1
- package/link/retry/delayFunction.d.ts.map +0 -1
- package/link/retry/index.d.ts.map +0 -1
- package/link/retry/retryFunction.d.ts.map +0 -1
- package/link/retry/retryLink.d.ts.map +0 -1
- package/link/schema/index.d.ts.map +0 -1
- package/link/subscriptions/index.d.ts.map +0 -1
- package/link/utils/createOperation.d.ts.map +0 -1
- package/link/utils/filterOperationVariables.d.ts.map +0 -1
- package/link/utils/fromError.d.ts.map +0 -1
- package/link/utils/fromPromise.d.ts.map +0 -1
- package/link/utils/index.d.ts.map +0 -1
- package/link/utils/throwServerError.d.ts.map +0 -1
- package/link/utils/toPromise.d.ts.map +0 -1
- package/link/utils/transformOperation.d.ts.map +0 -1
- package/link/utils/validateOperation.d.ts.map +0 -1
- package/link/ws/index.d.ts.map +0 -1
- package/react/cache/QueryReference.d.ts.map +0 -1
- package/react/cache/SuspenseCache.d.ts.map +0 -1
- package/react/cache/getSuspenseCache.d.ts.map +0 -1
- package/react/cache/index.d.ts.map +0 -1
- package/react/cache/types.d.ts.map +0 -1
- package/react/components/Mutation.d.ts.map +0 -1
- package/react/components/Query.d.ts.map +0 -1
- package/react/components/Subscription.d.ts.map +0 -1
- package/react/components/index.d.ts.map +0 -1
- package/react/components/types.d.ts.map +0 -1
- package/react/context/ApolloConsumer.d.ts.map +0 -1
- package/react/context/ApolloContext.d.ts.map +0 -1
- package/react/context/ApolloProvider.d.ts.map +0 -1
- package/react/context/index.d.ts.map +0 -1
- package/react/hoc/graphql.d.ts.map +0 -1
- package/react/hoc/hoc-utils.d.ts.map +0 -1
- package/react/hoc/index.d.ts.map +0 -1
- package/react/hoc/mutation-hoc.d.ts.map +0 -1
- package/react/hoc/query-hoc.d.ts.map +0 -1
- package/react/hoc/subscription-hoc.d.ts.map +0 -1
- package/react/hoc/types.d.ts.map +0 -1
- package/react/hoc/withApollo.d.ts.map +0 -1
- package/react/hooks/constants.d.ts.map +0 -1
- package/react/hooks/index.d.ts.map +0 -1
- package/react/hooks/internal/__use.d.ts.map +0 -1
- package/react/hooks/internal/index.d.ts.map +0 -1
- package/react/hooks/internal/useDeepMemo.d.ts.map +0 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/react/hooks/useApolloClient.d.ts.map +0 -1
- package/react/hooks/useBackgroundQuery.d.ts.map +0 -1
- package/react/hooks/useFragment.d.ts.map +0 -1
- package/react/hooks/useLazyQuery.d.ts.map +0 -1
- package/react/hooks/useMutation.d.ts.map +0 -1
- package/react/hooks/useQuery.d.ts.map +0 -1
- package/react/hooks/useReactiveVar.d.ts.map +0 -1
- package/react/hooks/useReadQuery.d.ts.map +0 -1
- package/react/hooks/useSubscription.d.ts.map +0 -1
- package/react/hooks/useSuspenseQuery.d.ts.map +0 -1
- package/react/hooks/useSyncExternalStore.d.ts.map +0 -1
- package/react/index.d.ts.map +0 -1
- package/react/parser/index.d.ts.map +0 -1
- package/react/ssr/RenderPromises.d.ts.map +0 -1
- package/react/ssr/getDataFromTree.d.ts.map +0 -1
- package/react/ssr/index.d.ts.map +0 -1
- package/react/ssr/renderToStringWithData.d.ts.map +0 -1
- package/react/types/types.d.ts.map +0 -1
- package/testing/core/index.d.ts.map +0 -1
- package/testing/core/itAsync.d.ts.map +0 -1
- package/testing/core/mocking/mockClient.d.ts.map +0 -1
- package/testing/core/mocking/mockFetch.d.ts.map +0 -1
- package/testing/core/mocking/mockLink.d.ts.map +0 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +0 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +0 -1
- package/testing/core/mocking/mockWatchQuery.d.ts.map +0 -1
- package/testing/core/observableToPromise.d.ts.map +0 -1
- package/testing/core/subscribeAndCount.d.ts.map +0 -1
- package/testing/core/wait.d.ts.map +0 -1
- package/testing/core/withConsoleSpy.d.ts.map +0 -1
- package/testing/core/wrap.d.ts.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing/internal/ObservableStream.d.ts.map +0 -1
- package/testing/internal/disposables/index.d.ts.map +0 -1
- package/testing/internal/disposables/spyOnConsole.d.ts.map +0 -1
- package/testing/internal/disposables/withCleanup.d.ts.map +0 -1
- package/testing/internal/index.d.ts.map +0 -1
- package/testing/internal/profile/Render.d.ts.map +0 -1
- package/testing/internal/profile/index.d.ts.map +0 -1
- package/testing/internal/profile/profile.d.ts.map +0 -1
- package/testing/internal/profile/traces.d.ts.map +0 -1
- package/testing/matchers/ProfiledComponent.d.ts.map +0 -1
- package/testing/matchers/index.d.ts.map +0 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +0 -1
- package/testing/matchers/toMatchDocument.d.ts.map +0 -1
- package/testing/react/MockedProvider.d.ts.map +0 -1
- package/utilities/common/arrays.d.ts.map +0 -1
- package/utilities/common/canUse.d.ts.map +0 -1
- package/utilities/common/cloneDeep.d.ts.map +0 -1
- package/utilities/common/compact.d.ts.map +0 -1
- package/utilities/common/errorHandling.d.ts.map +0 -1
- package/utilities/common/filterInPlace.d.ts +0 -2
- package/utilities/common/filterInPlace.d.ts.map +0 -1
- package/utilities/common/filterInPlace.js +0 -11
- package/utilities/common/filterInPlace.js.map +0 -1
- package/utilities/common/incrementalResult.d.ts.map +0 -1
- package/utilities/common/makeUniqueId.d.ts.map +0 -1
- package/utilities/common/maybeDeepFreeze.d.ts.map +0 -1
- package/utilities/common/mergeDeep.d.ts.map +0 -1
- package/utilities/common/mergeOptions.d.ts.map +0 -1
- package/utilities/common/objects.d.ts.map +0 -1
- package/utilities/common/omitDeep.d.ts.map +0 -1
- package/utilities/common/stringifyForDisplay.d.ts.map +0 -1
- package/utilities/common/stripTypename.d.ts.map +0 -1
- package/utilities/globals/global.d.ts.map +0 -1
- package/utilities/globals/index.d.ts.map +0 -1
- package/utilities/globals/invariantWrappers.d.ts.map +0 -1
- package/utilities/globals/maybe.d.ts.map +0 -1
- package/utilities/graphql/DocumentTransform.d.ts.map +0 -1
- package/utilities/graphql/directives.d.ts.map +0 -1
- package/utilities/graphql/fragments.d.ts.map +0 -1
- package/utilities/graphql/getFromAST.d.ts.map +0 -1
- package/utilities/graphql/operations.d.ts.map +0 -1
- package/utilities/graphql/print.d.ts.map +0 -1
- package/utilities/graphql/storeUtils.d.ts.map +0 -1
- package/utilities/graphql/transform.d.ts.map +0 -1
- package/utilities/index.d.ts.map +0 -1
- package/utilities/observables/Concast.d.ts.map +0 -1
- package/utilities/observables/Observable.d.ts.map +0 -1
- package/utilities/observables/asyncMap.d.ts.map +0 -1
- package/utilities/observables/iteration.d.ts.map +0 -1
- package/utilities/observables/subclassing.d.ts.map +0 -1
- package/utilities/policies/pagination.d.ts.map +0 -1
- package/utilities/promises/decoration.d.ts.map +0 -1
- package/utilities/types/DeepOmit.d.ts.map +0 -1
- package/utilities/types/DeepPartial.d.ts.map +0 -1
- package/utilities/types/IsStrictlyAny.d.ts.map +0 -1
- package/utilities/types/Primitive.d.ts.map +0 -1
- package/version.d.ts.map +0 -1
package/apollo-client.min.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("ts-invariant"),r=require("@wry/equality"),n=require("graphql"),i=require("zen-observable-ts");require("symbol-observable");var o=require("optimism"),s=require("@wry/context"),a=require("@wry/trie"),u=require("graphql-tag"),c=require("react");function l(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e)for(var r in e)t[r]=e[r];return t.default=e,Object.freeze(t)}var h=l(r),p=f(c),d="3.8.7";function v(e){try{return e()}catch(e){}}var y=v((function(){return globalThis}))||v((function(){return window}))||v((function(){return self}))||v((function(){return global}))||v((function(){return v.constructor("return this")()})),m=new Map;function g(e){var t=m.get(e)||1;return m.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function b(e,t){void 0===t&&(t=0);var r=g("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?r:t}),t).split(JSON.stringify(r)).join("<undefined>")}function _(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if("number"==typeof t){var i=t;(t=x(i))||(t=q(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var w=Object.assign((function(e,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];e||t.invariant(e,x(r,n)||q(r,n))}),{debug:_(t.invariant.debug),log:_(t.invariant.log),warn:_(t.invariant.warn),error:_(t.invariant.error)});function O(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return new t.InvariantError(x(e,r)||q(e,r))}var k=Symbol.for("ApolloErrorMessageHandler_"+d);function S(e){return"string"==typeof e?e:b(e,2).slice(0,1e3)}function x(e,t){if(void 0===t&&(t=[]),e)return y[k]&&y[k](e,t.map(S))}function q(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:d,message:e,args:t.map(S)})))}function E(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments,n=e.name.value;w(r&&1===r.length,67,n);var i=r[0];w(i.name&&"if"===i.name.value,68,n);var o=i.value;w(o&&("Variable"===o.kind||"BooleanValue"===o.kind),69,n),t.push({directive:e,ifArgument:i})}}));return t}(r).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?(i=t&&t[n.value.name.value],w(void 0!==i,66,r.name.value)):i=n.value.value,"skip"===r.name.value?!i:i}))}function R(e,t,r){var i=new Set(e),o=i.size;return n.visit(t,{Directive:function(e){if(i.delete(e.name.value)&&(!r||!i.size))return n.BREAK}}),r?!i.size:i.size<o}function P(e){return e&&R(["client","export"],e,!0)}var Q="function"==typeof WeakMap&&"ReactNative"!==v((function(){return navigator.product})),D="function"==typeof WeakSet,T="function"==typeof Symbol&&"function"==typeof Symbol.for,C=T&&Symbol.asyncIterator,F="function"==typeof v((function(){return window.document.createElement})),M=v((function(){return navigator.userAgent.indexOf("jsdom")>=0}))||!1,I=F&&!M;function N(e){return null!==e&&"object"==typeof e}function j(t,r){var n=r,i=[];return t.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw O(70,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&i.push(e)})),void 0===n&&(w(1===i.length,71,i.length),n=i[0].name.value),e.__assign(e.__assign({},t),{definitions:e.__spreadArray([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)})}function A(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function L(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=e.name.value;if("function"==typeof t)return t(r);var n=t&&t[r];return w(n,72,r),n||null;default:return null}}function V(e){return{__ref:String(e)}}function z(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function W(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return W(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return W(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw O(81,t.value,r.kind);e[t.value]=null}}var B=["connection","include","skip","client","rest","export","nonreactive"],U=Object.assign((function(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(K(i),")")}return r.connection.key}var o=e;if(t){var s=K(t);o+="(".concat(s,")")}return r&&Object.keys(r).forEach((function(e){-1===B.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(K(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=K;return K=e,t}}),K=function(e){return JSON.stringify(e,H)};function H(e,t){return N(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function J(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return W(r,n,i,t)})),r}return null}function G(e){return e.alias?e.alias.value:e.name.value}function Y(e,t,r){for(var n,i=0,o=t.selections;i<o.length;i++){if(X(u=o[i])){if("__typename"===u.name.value)return e[G(u)]}else n?n.push(u):n=[u]}if("string"==typeof e.__typename)return e.__typename;if(n)for(var s=0,a=n;s<a.length;s++){var u,c=Y(e,L(u=a[s],r).selectionSet,r);if("string"==typeof c)return c}}function X(e){return"Field"===e.kind}function $(e){w(e&&"Document"===e.kind,73);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw O(74,e.kind);return e}));return w(t.length<=1,75,t.length),e}function Z(e){return $(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function ee(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function te(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function re(e){var t=Z(e);return w(t&&"query"===t.operation,76),t}function ne(e){var t;$(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw O(80)}function ie(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&W(t,e.variable.name,e.defaultValue)})),t}function oe(e){return e}var se=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=D?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),!1!==t.cache&&(this.stableCacheKeys=new a.Trie(Q,(function(e){return{key:e}})))}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(oe,{cache:!1})},e.split=function(t,r,n){return void 0===n&&(n=e.identity()),new e((function(e){return(t(e)?r:n).transformDocument(e)}),{cache:!1})},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.getStableCacheEntry(e);if(t&&t.value)return t.value;$(e);var r=this.transform(e);return this.resultCache.add(r),t&&(t.value=r),r},e.prototype.concat=function(t){var r=this;return new e((function(e){return t.transformDocument(r.transformDocument(e))}),{cache:!1})},e.prototype.getStableCacheEntry=function(e){if(this.stableCacheKeys){var t=this.getCacheKey(e);return t?(w(Array.isArray(t),65),this.stableCacheKeys.lookupArray(t)):void 0}},e}(),ae=Q?new WeakMap:void 0,ue=function(e){var t;return(t=null==ae?void 0:ae.get(e))||(t=n.print(e),null==ae||ae.set(e,t)),t},ce=Array.isArray;function le(e){return Array.isArray(e)&&e.length>0}var fe={kind:n.Kind.FIELD,name:{kind:n.Kind.NAME,value:"__typename"}};function he(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===n.Kind.FRAGMENT_SPREAD&&he(t[e.name.value],t)}))}function pe(e){return he(Z(e)||function(e){w("Document"===e.kind,77),w(e.definitions.length<=1,78);var t=e.definitions[0];return w("FragmentDefinition"===t.kind,79),t}(e),A(te(e)))?null:e}function de(e){var t=new Map;return function(r){void 0===r&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function ve(t,r){$(r);for(var i=de(""),o=de(""),s=function(e){for(var t=0,r=void 0;t<e.length&&(r=e[t]);++t)if(!ce(r)){if(r.kind===n.Kind.OPERATION_DEFINITION)return i(r.name&&r.name.value);if(r.kind===n.Kind.FRAGMENT_DEFINITION)return o(r.name.value)}return null},a=0,u=r.definitions.length-1;u>=0;--u)r.definitions[u].kind===n.Kind.OPERATION_DEFINITION&&++a;var c,l,f,h=(c=t,l=new Map,f=new Map,c.forEach((function(e){e&&(e.name?l.set(e.name,e):e.test&&f.set(e.test,e))})),function(e){var t=l.get(e.name.value);return!t&&f.size&&f.forEach((function(r,n){n(e)&&(t=r)})),t}),p=function(e){return le(e)&&e.map(h).some((function(e){return e&&e.remove}))},d=new Map,v=!1,y={enter:function(e){if(p(e.directives))return v=!0,null}},m=n.visit(r,{Field:y,InlineFragment:y,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,r,n,i){var o=s(i);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,r,n,i){if(p(e.directives))return v=!0,null;var o=s(i);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,r,n){d.set(JSON.stringify(n),e)},leave:function(e,t,r,i){return e===d.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every((function(e){return e.kind===n.Kind.FIELD&&"__typename"===e.name.value}))?(o(e.name.value).removed=!0,v=!0,null):void 0}},Directive:{leave:function(e){if(h(e))return v=!0,null}}});if(!v)return r;var g=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){g(o(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},b=new Set;m.definitions.forEach((function(e){e.kind===n.Kind.OPERATION_DEFINITION?g(i(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){b.add(e)})):e.kind!==n.Kind.FRAGMENT_DEFINITION||0!==a||o(e.name.value).removed||b.add(e.name.value)})),b.forEach((function(e){g(o(e)).fragmentSpreads.forEach((function(e){b.add(e)}))}));var _={enter:function(e){if(t=e.name.value,!b.has(t)||o(t).removed)return null;var t}};return pe(n.visit(m,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(t){if(t.variableDefinitions){var r=g(i(t.name&&t.name.value)).transitiveVars;if(r.size<t.variableDefinitions.length)return e.__assign(e.__assign({},t),{variableDefinitions:t.variableDefinitions.filter((function(e){return r.has(e.variable.name.value)}))})}}}}))}var ye=Object.assign((function(t){return n.visit(t,{SelectionSet:{enter:function(t,r,i){if(!i||i.kind!==n.Kind.OPERATION_DEFINITION){var o=t.selections;if(o)if(!o.some((function(e){return X(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var s=i;if(!(X(s)&&s.directives&&s.directives.some((function(e){return"export"===e.name.value}))))return e.__assign(e.__assign({},t),{selections:e.__spreadArray(e.__spreadArray([],o,!0),[fe],!1)})}}}}})}),{added:function(e){return e===fe}});function me(t){return"query"===ne(t).operation?t:n.visit(t,{OperationDefinition:{enter:function(t){return e.__assign(e.__assign({},t),{operation:"query"})}}})}function ge(e){return $(e),ve([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var be=Object.prototype.hasOwnProperty;function _e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return we(e)}function we(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new ke,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var Oe=function(e,t,r){return this.merge(e[r],t[r])},ke=function(){function t(e){void 0===e&&(e=Oe),this.reconciler=e,this.isObject=N,this.pastCopies=new Set}return t.prototype.merge=function(t,r){for(var n=this,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return N(r)&&N(t)?(Object.keys(r).forEach((function(o){if(be.call(t,o)){var s=t[o];if(r[o]!==s){var a=n.reconciler.apply(n,e.__spreadArray([t,r,o],i,!1));a!==s&&((t=n.shallowCopyForMerge(t))[o]=a)}}else(t=n.shallowCopyForMerge(t))[o]=r[o]})),t):r},t.prototype.shallowCopyForMerge=function(t){return N(t)&&(this.pastCopies.has(t)||(t=Array.isArray(t)?t.slice(0):e.__assign({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},t}();function Se(e){var t=Promise.resolve(e);return t.status="fulfilled",t.value=e,t}var xe=Object.prototype.toString;function qe(e){return Ee(e)}function Ee(e,t){switch(xe.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=Ee(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=Ee(e[r],t)})),n;default:return e}}function Re(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function Pe(e,t,r){return new i.Observable((function(n){var i={then:function(e){return new Promise((function(t){return t(e())}))}};function o(e,t){return function(r){if(e){var o=function(){return n.closed?0:e(r)};i=i.then(o,o).then((function(e){return n.next(e)}),(function(e){return n.error(e)}))}else n[t](r)}}var s={next:o(t,"next"),error:o(r,"error"),complete:function(){i.then((function(){return n.complete()}))}},a=e.subscribe(s);return function(){return a.unsubscribe()}}))}function Qe(e){function t(t){Object.defineProperty(e,t,{value:i.Observable})}return T&&Symbol.species&&t(Symbol.species),t("@@species"),e}function De(e){return e&&"function"==typeof e.then}var Te=function(t){function r(e){var r=t.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),Re(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),Re(r.observers,"error",e))},complete:function(){var e=r,t=e.sub,n=e.sources;if(null!==t){var i=(void 0===n?[]:n).shift();i?De(i)?i.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=i.subscribe(r.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),Re(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof e&&(e=[new i.Observable(e)]),De(e)?e.then((function(e){return r.start(e)}),r.handlers.error):r.start(e),r}return e.__extends(r,t),r.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},r.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},r.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},r.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},r.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},r.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},r}(i.Observable);function Ce(e){return"incremental"in e}function Fe(e){return N(e)&&"payload"in e}function Me(e,t){var r=e,n=new ke;return Ce(t)&&le(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var s=i[o],a=!isNaN(+s)?[]:{};a[s]=t,t=a}r=n.merge(r,t)})),r}function Ie(e){return le(Ne(e))}function Ne(e){var t=le(e.errors)?e.errors.slice(0):[];return Ce(e)&&le(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function je(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}function Ae(t,r){return je(t,r,r.variables&&{variables:je(e.__assign(e.__assign({},t&&t.variables),r.variables))})}function Le(e){return new i.Observable((function(t){t.error(e)}))}Qe(Te);var Ve=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function ze(e,t){return t?t(e):i.Observable.of()}function We(e){return"function"==typeof e?new Ue(e):e}function Be(e){return e.request.length<=1}var Ue=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t((function(){return i.Observable.of()}))},t.from=function(e){return 0===e.length?t.empty():e.map(We).reduce((function(e,t){return e.concat(t)}))},t.split=function(e,r,n){var o=We(r),s=We(n||new t(ze));return Be(o)&&Be(s)?new t((function(t){return e(t)?o.request(t)||i.Observable.of():s.request(t)||i.Observable.of()})):new t((function(t,r){return e(t)?o.request(t,r)||i.Observable.of():s.request(t,r)||i.Observable.of()}))},t.execute=function(t,r){return t.request(function(t,r){var n=e.__assign({},t);return Object.defineProperty(r,"setContext",{enumerable:!1,value:function(t){n="function"==typeof t?e.__assign(e.__assign({},n),t(n)):e.__assign(e.__assign({},n),t)}}),Object.defineProperty(r,"getContext",{enumerable:!1,value:function(){return e.__assign({},n)}}),r}(r.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?ee(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw O(43,i)}return e}(r))))||i.Observable.of()},t.concat=function(e,r){var n=We(e);if(Be(n))return n;var o=We(r);return Be(o)?new t((function(e){return n.request(e,(function(e){return o.request(e)||i.Observable.of()}))||i.Observable.of()})):new t((function(e,t){return n.request(e,(function(e){return o.request(e,t)||i.Observable.of()}))||i.Observable.of()}))},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(ze)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,t){throw O(36)},t.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}(),Ke=Ue.empty,He=Ue.from,Je=Ue.split,Ge=Ue.concat,Ye=Ue.execute;function Xe(e){var t=null,r=null,n=!1,i=[],o=[];function s(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function a(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function u(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",s),e.removeListener("error",a),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",s),e.on("error",a),e.on("end",u),e.on("finish",u),e.on("close",u);var c={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return C&&(c[Symbol.asyncIterator]=function(){return this}),c}function $e(e){var t={next:function(){return e.read()}};return C&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ze(e){var t,r,n=e;if(e.body&&(n=e.body),function(e){return!(!C||!e[Symbol.asyncIterator])}(n))return r=n[Symbol.asyncIterator](),(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t;if(function(e){return!!e.getReader}(n))return $e(n.getReader());if(function(e){return!!e.stream}(n))return $e(n.stream().getReader());if(function(e){return!!e.arrayBuffer}(n))return function(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise((function(t,r){e.then((function(e){t({value:e,done:!1})})).catch(r)})))}};return C&&(r[Symbol.asyncIterator]=function(){return this}),r}(n.arrayBuffer());if(function(e){return!!e.pipe}(n))return Xe(n);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var et=Symbol();function tt(e){return e.hasOwnProperty("graphQLErrors")}var rt=function(t){function r(n){var i,o,s=n.graphQLErrors,a=n.protocolErrors,u=n.clientErrors,c=n.networkError,l=n.errorMessage,f=n.extraInfo,h=t.call(this,l)||this;return h.name="ApolloError",h.graphQLErrors=s||[],h.protocolErrors=a||[],h.clientErrors=u||[],h.networkError=c||null,h.message=l||(i=h,o=e.__spreadArray(e.__spreadArray(e.__spreadArray([],i.graphQLErrors,!0),i.clientErrors,!0),i.protocolErrors,!0),i.networkError&&o.push(i.networkError),o.map((function(e){return N(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=f,h.__proto__=r.prototype,h}return e.__extends(r,t),r}(Error),nt=Object.prototype.hasOwnProperty;function it(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function ot(e,t){if(e.status>=300){Ve(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function st(e){return function(t){return t.text().then((function(e){return ot(t,e)})).then((function(r){return t.status>=300&&Ve(t,r,"Response not successful: Received status code ".concat(t.status)),Array.isArray(r)||nt.call(r,"data")||nt.call(r,"errors")||Ve(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),r}))}}var at=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=O(39,t,e.message);throw n.parseError=e,n}return r},ut={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},ct=function(e,t){return t(e)};function lt(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o={},s={};n.forEach((function(t){o=e.__assign(e.__assign(e.__assign({},o),t.options),{headers:e.__assign(e.__assign({},o.headers),t.headers)}),t.credentials&&(o.credentials=t.credentials),s=e.__assign(e.__assign({},s),t.http)})),o.headers&&(o.headers=function(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]=e[t]})),r}var n=Object.create(null);Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]={originalName:t,value:e[t]}}));var i=Object.create(null);return Object.keys(n).forEach((function(e){i[n[e].originalName]=n[e].value})),i}(o.headers,s.preserveHeaderCase));var a=t.operationName,u=t.extensions,c=t.variables,l=t.query,f={operationName:a,variables:c};return s.includeExtensions&&(f.extensions=u),s.includeQuery&&(f.query=r(l,ue)),{options:o,body:f}}var ft=function(e){if(!e&&"undefined"==typeof fetch)throw O(37)},ht=function(e,t){var r=e.getContext().uri;return r||("function"==typeof t?t(e):t||"/graphql")};function pt(e,t){var r=[],n=function(e,t){r.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=at(t.variables,"Variables map")}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=at(t.extensions,"Extensions map")}catch(e){return{parseError:e}}n("extensions",o)}var s="",a=e,u=e.indexOf("#");-1!==u&&(s=e.substr(u),a=e.substr(0,u));var c=-1===a.indexOf("?")?"?":"&";return{newURI:a+c+r.join("&")+s}}var dt=v((function(){return fetch})),vt=function(t){void 0===t&&(t={});var r=t.uri,o=void 0===r?"/graphql":r,s=t.fetch,a=t.print,u=void 0===a?ct:a,c=t.includeExtensions,l=t.preserveHeaderCase,f=t.useGETForQueries,h=t.includeUnusedVariables,p=void 0!==h&&h,d=e.__rest(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);var y={http:{includeExtensions:c,preserveHeaderCase:l},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new Ue((function(t){var r=ht(t,o),a=t.getContext(),c={};if(a.clientAwareness){var l=a.clientAwareness,h=l.name,d=l.version;h&&(c["apollographql-client-name"]=h),d&&(c["apollographql-client-version"]=d)}var m=e.__assign(e.__assign({},c),a.headers),g={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m};if(R(["client"],t.query)){var b=ge(t.query);if(!b)return Le(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));t.query=b}var _,w,O,k,S,x=lt(t,u,ut,y,g),q=x.options,E=x.body;E.variables&&!p&&(E.variables=(_=E.variables,w=t.query,O=e.__assign({},_),k=new Set(Object.keys(_)),n.visit(w,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&k.delete(e.name.value)}}),k.forEach((function(e){delete O[e]})),O)),q.signal||"undefined"==typeof AbortController||(S=new AbortController,q.signal=S.signal);var P,Q="OperationDefinition"===(P=ne(t.query)).kind&&"subscription"===P.operation,D=R(["defer"],t.query);if(f&&!t.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(q.method="GET"),D||Q){q.headers=q.headers||{};var T="multipart/mixed;";Q?T+="boundary=graphql;subscriptionSpec=1.0,application/json":D&&(T+="deferSpec=20220824,application/json"),q.headers.accept=T}if("GET"===q.method){var C=pt(r,E),F=C.newURI,M=C.parseError;if(M)return Le(M);r=F}else try{q.body=at(E,"Payload")}catch(M){return Le(M)}return new i.Observable((function(n){var i=s||v((function(){return fetch}))||dt,o=n.next.bind(n);return i(r,q).then((function(r){var n;t.setContext({response:r});var i=null===(n=r.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(t,r){var n;return e.__awaiter(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,f,h,p,d,v,y,m,g,b,_,w,O,k,S,x,q;return e.__generator(this,(function(E){switch(E.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");i=new TextDecoder("utf-8"),o=null===(n=t.headers)||void 0===n?void 0:n.get("content-type"),s="boundary=",a=(null==o?void 0:o.includes(s))?null==o?void 0:o.substring((null==o?void 0:o.indexOf(s))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="\r\n--".concat(a),c="",l=Ze(t),f=!0,E.label=1;case 1:return f?[4,l.next()]:[3,3];case 2:for(h=E.sent(),p=h.value,d=h.done,v="string"==typeof p?p:i.decode(p),y=c.length-u.length+1,f=!d,m=(c+=v).indexOf(u,y);m>-1;){if(g=void 0,x=[c.slice(0,m),c.slice(m+u.length)],c=x[1],b=(g=x[0]).indexOf("\r\n\r\n"),_=it(g.slice(0,b)),(w=_["content-type"])&&-1===w.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(O=g.slice(b))if(k=ot(t,O),Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k||"payload"in k)Fe(k)?(S={},"payload"in k&&(S=e.__assign({},k.payload)),"errors"in k&&(S=e.__assign(e.__assign({},S),{extensions:e.__assign(e.__assign({},"extensions"in S?S.extensions:null),(q={},q[et]=k.errors,q))})),r(S)):r(k);else if(1===Object.keys(k).length&&"hasNext"in k&&!k.hasNext)return[2];m=c.indexOf(u)}return[3,1];case 3:return[2]}}))}))}(r,o):st(t)(r).then(o)})).then((function(){S=void 0,n.complete()})).catch((function(e){S=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){S&&S.abort()}}))}))},yt=function(t){function r(e){void 0===e&&(e={});var r=t.call(this,vt(e).request)||this;return r.options=e,r}return e.__extends(r,t),r}(Ue),mt=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=o.wrap(j)}return t.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},t.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(t,r){return void 0===r&&(r=!!t.optimistic),this.read(e.__assign(e.__assign({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(t,r){return void 0===r&&(r=!!t.optimistic),this.read(e.__assign(e.__assign({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},t.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=e.__rest(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,o=t.fragmentName,s=e.__rest(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(s,{query:this.getFragmentDoc(i,o),dataId:r,result:n}))},t.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),o=r(i);return null==o?i:(n.writeQuery(e.__assign(e.__assign({},t),{data:o})),o)}})},t.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),o=r(i);return null==o?i:(n.writeFragment(e.__assign(e.__assign({},t),{data:o})),o)}})},t}();exports.Cache=void 0,exports.Cache||(exports.Cache={});var gt=function(t){function r(e,n,i,o){var s,a=t.call(this,e)||this;if(a.message=e,a.path=n,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var u=a.path.length-1;u>=0;--u)a.missing=((s={})[a.path[u]]=a.missing,s)}else a.missing=a.path;return a.__proto__=r.prototype,a}return e.__extends(r,t),r}(Error),bt=Object.prototype.hasOwnProperty;function _t(e){return null==e}function wt(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=_t(n)?_t(i)?void 0:{_id:i}:{id:n}),_t(n)&&!_t(i)&&(n=i),!_t(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var Ot={dataIdFromObject:wt,addTypename:!0,resultCaching:!0,canonizeResults:!1};function kt(e){var t=e.canonizeResults;return void 0===t?Ot.canonizeResults:t}var St=/^[_a-z][_0-9a-z]*/i;function xt(e){var t=e.match(St);return t?t[0]:e}function qt(e,t,r){return!!N(t)&&(ce(t)?t.every((function(t){return qt(e,t,r)})):e.selections.every((function(e){if(X(e)&&E(e,r)){var n=G(e);return bt.call(t,n)&&(!e.selectionSet||qt(e.selectionSet,t[n],r))}return!0})))}function Et(e){return N(e)&&!z(e)&&!ce(e)}function Rt(e,t){var r=A(te(e));return{fragmentMap:r,lookupFragment:function(e){var n=r[e];return!n&&t&&(n=t.lookup(e)),n||null}}}var Pt=Object.create(null),Qt=function(){return Pt},Dt=Object.create(null),Tt=function(){function t(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return z(e)?r.get(e.__ref,t):e&&e[t]},this.canRead=function(e){return z(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return V(e);if(z(e))return e;var n=r.policies.identify(e)[0];if(n){var i=V(n);return t&&r.merge(n,e),i}}}return t.prototype.toObject=function(){return e.__assign({},this.data)},t.prototype.has=function(e){return void 0!==this.lookup(e,!0)},t.prototype.get=function(e,t){if(this.group.depend(e,t),bt.call(this.data,e)){var r=this.data[e];if(r&&bt.call(r,t))return r[t]}return"__typename"===t&&bt.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof It?this.parent.get(e,t):void 0},t.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),bt.call(this.data,e)?this.data[e]:this instanceof It?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},t.prototype.merge=function(e,t){var r,n=this;z(e)&&(e=e.__ref),z(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){w("string"==typeof r,1);var s=new ke(jt).merge(i,o);if(this.data[r]=s,s!==i&&(delete this.refs[r],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==s[e]){a[e]=1;var t=xt(e);t===e||n.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||n instanceof It||delete s[e]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(e){return n.group.dirty(r,e)}))}}},t.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var o=Object.create(null),s=!1,a=!0,u={DELETE:Pt,INVALIDATE:Dt,isReference:z,toReference:this.toReference,canRead:this.canRead,readField:function(e,r){return n.policies.readField("string"==typeof e?{fieldName:e,from:r||V(t)}:e,{store:n})}};if(Object.keys(i).forEach((function(c){var l=xt(c),f=i[c];if(void 0!==f){var h="function"==typeof r?r:r[c]||r[l];if(h){var p=h===Qt?Pt:h(f,e.__assign(e.__assign({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(t,c)}));if(p===Dt)n.group.dirty(t,c);else if(p===Pt&&(p=void 0),p!==f)o[c]=p,s=!0,f=p}void 0!==f&&(a=!1)}})),s)return this.merge(t,o),a&&(this instanceof It?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},t.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),s=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,s?((n={})[s]=Qt,n):Qt)}return!1},t.prototype.evict=function(e,t){var r=!1;return e.id&&(bt.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof It&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){bt.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},t.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach((function(e){t&&bt.call(t,e)||r.delete(e)})),t){var n=t.__META,i=e.__rest(t,["__META"]);Object.keys(i).forEach((function(e){r.merge(e,i[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},t.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof It?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){bt.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof It;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},t.prototype.findChildRefIds=function(e){if(!bt.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){z(e)&&(t[e.__ref]=!0),N(e)&&Object.keys(e).forEach((function(t){var r=e[t];N(r)&&n.add(r)}))}))}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),Ct=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?o.dep():null,this.keyMaker=new a.Trie(Q)},e.prototype.depend=function(e,t){if(this.d){this.d(Ft(e,t));var r=xt(t);r!==t&&this.d(Ft(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Ft(e,t),"__exists"===t?"forget":"setDirty")},e}();function Ft(e,t){return t+"#"+e}function Mt(e,t){At(e)&&e.group.depend(t,"__exists")}!function(t){var r=function(t){function r(e){var r=e.policies,n=e.resultCaching,i=void 0===n||n,o=e.seed,s=t.call(this,r,new Ct(i))||this;return s.stump=new Nt(s),s.storageTrie=new a.Trie(Q),o&&s.replace(o),s}return e.__extends(r,t),r.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=r}(Tt||(Tt={}));var It=function(t){function n(e,r,n,i){var o=t.call(this,r.policies,i)||this;return o.id=e,o.parent=r,o.replay=n,o.group=i,n(o),o}return e.__extends(n,t),n.prototype.addLayer=function(e,t){return new n(e,this,t,this.group)},n.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var i=t.data[e],o=n.lookup(e);o?i?i!==o&&Object.keys(i).forEach((function(n){r.equal(i[n],o[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(o).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},n.prototype.toObject=function(){return e.__assign(e.__assign({},this.parent.toObject()),this.data)},n.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return bt.call(this.data,r)?e.__assign(e.__assign({},n),t.prototype.findChildRefIds.call(this,r)):n},n.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},n}(Tt),Nt=function(t){function r(e){return t.call(this,"EntityStore.Stump",e,(function(){}),new Ct(e.group.caching,e.group))||this}return e.__extends(r,t),r.prototype.removeLayer=function(){return this},r.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},r}(It);function jt(e,t,n){var i=e[n],o=t[n];return r.equal(i,o)?i:o}function At(e){return!!(e instanceof Tt&&e.group.caching)}var Lt,Vt,zt=function(){function t(){this.known=new(D?WeakSet:Set),this.pool=new a.Trie(Q),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return N(e)&&this.known.has(e)},t.prototype.pass=function(t){if(N(t)){var r=function(t){return N(t)?ce(t)?t.slice(0):e.__assign({__proto__:Object.getPrototypeOf(t)},t):t}(t);return this.passes.set(r,t),r}return t},t.prototype.admit=function(e){var t=this;if(N(e)){var r=this.passes.get(e);if(r)return r;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(a=this.pool.lookupArray(n)).array||this.known.add(a.array=n),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],s=this.sortedKeys(e);o.push(s.json);var a,u=o.length;if(s.sorted.forEach((function(r){o.push(t.admit(e[r]))})),!(a=this.pool.lookupArray(o)).object){var c=a.object=Object.create(i);this.known.add(c),s.sorted.forEach((function(e,t){c[e]=o[u+t]}))}return a.object}}return e},t.prototype.sortedKeys=function(e){var t=Object.keys(e),r=this.pool.lookupArray(t);if(!r.keys){t.sort();var n=JSON.stringify(t);(r.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,r.keys={sorted:t,json:n})}return r.keys},t}(),Wt=Object.assign((function(e){if(N(e)){void 0===Lt&&Bt();var t=Lt.admit(e),r=Vt.get(t);return void 0===r&&Vt.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)}),{reset:Bt});function Bt(){Lt=new zt,Vt=new(Q?WeakMap:Map)}function Ut(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Kt=function(){function t(t){var r=this;this.knownResults=new(Q?WeakMap:Map),this.config=je(t,{addTypename:!1!==t.addTypename,canonizeResults:kt(t)}),this.canon=t.canon||new zt,this.executeSelectionSet=o.wrap((function(t){var n,i=t.context.canonizeResults,o=Ut(t);o[3]=!i;var s=(n=r.executeSelectionSet).peek.apply(n,o);return s?i?e.__assign(e.__assign({},s),{result:r.canon.admit(s.result)}):s:(Mt(t.context.store,t.enclosingRef.__ref),r.execSelectionSetImpl(t))}),{max:this.config.resultCacheMaxSize,keyArgs:Ut,makeCacheKey:function(e,t,r,n){if(At(r.store))return r.store.makeCacheKey(e,z(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=o.wrap((function(e){return Mt(e.context.store,e.enclosingRef.__ref),r.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(At(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return t.prototype.resetCanon=function(){this.canon=new zt},t.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,o=void 0===i?"ROOT_QUERY":i,s=t.variables,a=t.returnPartialData,u=void 0===a||a,c=t.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;s=e.__assign(e.__assign({},ie(re(n))),s);var h,p=V(o),d=this.executeSelectionSet({selectionSet:ne(n).selectionSet,objectOrReference:p,enclosingRef:p,context:e.__assign({store:r,query:n,policies:f,variables:s,varString:Wt(s),canonizeResults:l},Rt(n,this.config.fragments))});if(d.missing&&(h=[new gt(Ht(d.missing),d.missing,n,s)],!u))throw h[0];return{result:d.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,t,r,n){if(At(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,i=e.objectOrReference,o=e.enclosingRef,s=e.context;if(z(i)&&!s.policies.rootTypenamesById[i.__ref]&&!s.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var a,u=s.variables,c=s.policies,l=s.store.getFieldValue(i,"__typename"),f=[],h=new ke;function p(e,t){var r;return e.missing&&(a=h.merge(a,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&f.push({__typename:l});var d=new Set(r.selections);d.forEach((function(e){var r,v;if(E(e,u))if(X(e)){var y=c.readField({fieldName:e.name.value,field:e,variables:s.variables,from:i},s),m=G(e);void 0===y?ye.added(e)||(a=h.merge(a,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(z(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),r))):ce(y)?y=p(t.executeSubSelectedArray({field:e,array:y,enclosingRef:o,context:s}),m):e.selectionSet?null!=y&&(y=p(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:y,enclosingRef:z(y)?y:o,context:s}),m)):s.canonizeResults&&(y=t.canon.pass(y)),void 0!==y&&f.push(((v={})[m]=y,v))}else{var g=L(e,s.lookupFragment);if(!g&&e.kind===n.Kind.FRAGMENT_SPREAD)throw O(9,e.name.value);g&&c.fragmentMatches(g,l)&&g.selectionSet.selections.forEach(d.add,d)}}));var v={result:we(f),missing:a},y=s.canonizeResults?this.canon.admit(v):v;return y.result&&this.knownResults.set(y.result,r),y},t.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,s=e.context,a=new ke;function u(e,r){var n;return e.missing&&(t=a.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(e,t){return null===e?null:ce(e)?u(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:s}),t):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:z(e)?e:o,context:s}),t):e})),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},t}();function Ht(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var Jt=new s.Slot,Gt=new WeakMap;function Yt(e){var t=Gt.get(e);return t||Gt.set(e,t={vars:new Set,dep:o.dep()}),t}function Xt(e){Yt(e).vars.forEach((function(t){return t.forgetCache(e)}))}function $t(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){Yt(e).dep.dirty(n),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var s=Array.from(r);r.clear(),s.forEach((function(t){return t(e)}))}}else{var a=Jt.getValue();a&&(i(a),Yt(a).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),Yt(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}var Zt=Object.create(null);function er(e){var t=JSON.stringify(e);return Zt[t]||(Zt[t]=Object.create(null))}function tr(e){var t=er(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=nr(e,(function(e){var i=sr(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&bt.call(t,e[0])&&(i=sr(t,e,or)),w(void 0!==i,4,e.join("."),t),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function rr(e){var t=er(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,s=nr(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return sr(t,e)}else{var s=r.slice(1);if(i&&bt.call(i,s)){var a=e.slice(0);return a[0]=s,sr(i,a)}}else if(n&&le(n.directives)){var u=r.slice(1),c=n.directives.find((function(e){return e.name.value===u})),l=c&&J(c,i);return l&&sr(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function nr(e,t){var r=new ke;return ir(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var s=n.length-1;s>=0;--s)(i={})[n[s]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function ir(e){var t=er(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){ce(t)?(ir(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),ce(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function or(e,t){return e[t]}function sr(e,t,r){return r=r||or,ar(t.reduce((function e(t,n){return ce(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function ar(e){return N(e)?ce(e)?e.map(ar):nr(Object.keys(e).sort(),(function(t){return sr(e,t)})):e}function ur(e){return void 0!==e.args?e.args:e.field?J(e.field,e.variables):null}U.setStringify(Wt);var cr=function(){},lr=function(e,t){return t.fieldName},fr=function(e,t,r){return(0,r.mergeObjects)(e,t)},hr=function(e,t){return t},pr=function(){function t(t){this.config=t,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=e.__assign({dataIdFromObject:wt},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return t.prototype.identify=function(t,r){var n,i=this,o=r&&(r.typename||(null===(n=r.storeObject)||void 0===n?void 0:n.__typename))||t.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var s,a=r&&r.storeObject||t,u=e.__assign(e.__assign({},r),{typename:o,storeObject:a,readField:r&&r.readField||function(){var e=vr(arguments,a);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),c=o&&this.getTypePolicy(o),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(e.__assign(e.__assign({},t),a),u);if(!ce(f)){s=f;break}l=tr(f)}return s=s?String(s):void 0,u.keyObject?[s,u.keyObject]:[s]},t.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach((function(n){var i=t[n],o=i.queryType,s=i.mutationType,a=i.subscriptionType,u=e.__rest(i,["queryType","mutationType","subscriptionType"]);o&&r.setRootTypename("Query",n),s&&r.setRootTypename("Mutation",n),a&&r.setRootTypename("Subscription",n),bt.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]}))},t.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function s(e,t){e.merge="function"==typeof t?t:!0===t?fr:!1===t?hr:e.merge}s(n,t.merge),n.keyFn=!1===i?cr:ce(i)?tr(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var a=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===a?lr:ce(a)?rr(a):"function"==typeof a?a:n.keyFn,"function"==typeof u&&(n.read=u),s(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||lr)}))},t.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(w(!n||n===e,5,e),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},t.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(St);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},t.prototype.getTypePolicy=function(t){var r=this;if(!bt.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach((function(e,n){if(e.test(t)){var o=r.supertypeMap.get(n);o&&o.forEach((function(e){return i.add(e)}))}}))),i&&i.size&&i.forEach((function(t){var i=r.getTypePolicy(t),o=i.fields,s=e.__rest(i,["fields"]);Object.assign(n,s),Object.assign(n.fields,o)}))}var o=this.toBeAdded[t];return o&&o.length&&o.splice(0).forEach((function(e){r.updateTypePolicy(t,e)})),this.typePolicies[t]},t.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),a=[s],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&a.indexOf(t)<0&&a.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l<a.length;++l){var f=a[l];if(f.has(o))return s.has(o)||s.add(o),!0;f.forEach(u),c&&l===a.length-1&&qt(e.selectionSet,r,n)&&(c=!1,!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&u(r)})))}return!1},t.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},t.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},a=ur(e);o;){var u=o(a,s);if(!ce(u)){t=u||n;break}o=rr(u)}return void 0===t&&(t=e.field?function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return W(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return W(n,r,i,t)}))),U(e.name.value,n,r)}(e.field,e.variables):U(n,ur(e))),!1===t?n:n===xt(t)?t:n+":"+t},t.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),o=xt(i),s=t.store.getFieldValue(r,i),a=this.getFieldPolicy(e.typename,o,!1),u=a&&a.read;if(u){var c=dr(this,r,e,t,t.store.getStorage(z(r)?r.__ref:r,i));return Jt.withValue(this.cache,u,[s,c])}return s}},t.prototype.getReadFunction=function(e,t){var r=this.getFieldPolicy(e,t,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},t.prototype.runMergeFunction=function(e,t,r,n,i){var o=r.field,s=r.typename,a=r.merge;return a===fr?yr(n.store)(e,t):a===hr?t:(n.overwrite&&(e=void 0),a(e,t,dr(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,i||Object.create(null))))},t}();function dr(e,t,r,n,i){var o=e.getStoreFieldName(r),s=xt(o),a=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:ur(r),field:r.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:z,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(vr(arguments,t,a),n)},mergeObjects:yr(n.store)}}function vr(t,r,n){var i,o=t[0],s=t[1],a=t.length;return"string"==typeof o?i={fieldName:o,from:a>1?s:r}:(i=e.__assign({},o),bt.call(i,"from")||(i.from=r)),void 0===i.variables&&(i.variables=n),i}function yr(t){return function(r,n){if(ce(r)||ce(n))throw O(8);if(N(r)&&N(n)){var i=t.getFieldValue(r,"__typename"),o=t.getFieldValue(n,"__typename");if(i&&o&&i!==o)return n;if(z(r)&&Et(n))return t.merge(r.__ref,n),r;if(Et(r)&&z(n))return t.merge(r,n.__ref),n;if(Et(r)&&Et(n))return e.__assign(e.__assign({},r),n)}return n}}function mr(t,r,n){var i="".concat(r).concat(n),o=t.flavors.get(i);return o||t.flavors.set(i,o=t.clientOnly===r&&t.deferred===n?t:e.__assign(e.__assign({},t),{clientOnly:r,deferred:n})),o}var gr=function(){function t(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return t.prototype.writeToStore=function(t,r){var n=this,i=r.query,o=r.result,s=r.dataId,a=r.variables,u=r.overwrite,c=Z(i),l=new ke;a=e.__assign(e.__assign({},ie(c)),a);var f=e.__assign(e.__assign({store:t,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:Wt(a)},Rt(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:o||Object.create(null),dataId:s,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:f});if(!z(h))throw O(11,o);return f.incomingById.forEach((function(e,r){var i=e.storeObject,o=e.mergeTree,s=(e.fieldNodeSet,V(r));if(o&&o.map.size){var a=n.applyMerges(o,s,i,f);if(z(a))return;i=a}t.merge(r,i)})),t.retain(h.__ref),h},t.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,o=t.selectionSet,s=t.context,a=t.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||Y(i,o,s.fragmentMap)||n&&s.store.get(n,"__typename");"string"==typeof l&&(c.__typename=l);var f=function(){var t=vr(arguments,c,s.variables);if(z(t.from)){var r=s.incomingById.get(t.from.__ref);if(r){var n=u.readField(e.__assign(e.__assign({},t),{from:r.storeObject}),s);if(void 0!==n)return n}}return u.readField(t,s)},h=new Set;this.flattenFields(o,i,s,l).forEach((function(e,t){var n,o=G(t),s=i[o];if(h.add(t),void 0!==s){var p=u.getStoreFieldName({typename:l,fieldName:t.name.value,field:t,variables:e.variables}),d=_r(a,p),v=r.processFieldValue(s,t,t.selectionSet?mr(e,!1,!1):e,d),y=void 0;t.selectionSet&&(z(v)||Et(v))&&(y=f("__typename",v));var m=u.getMergeFunction(l,t.name.value,y);m?d.info={field:t,typename:l,merge:m}:kr(a,p),c=e.merge(c,((n={})[p]=v,n))}else 0}));try{var p=u.identify(i,{typename:l,selectionSet:o,fragmentMap:s.fragmentMap,storeObject:c,readField:f}),d=p[0],v=p[1];n=n||d,v&&(c=s.merge(c,v))}catch(e){if(!n)throw e}if("string"==typeof n){var y=V(n),m=s.written[n]||(s.written[n]=[]);if(m.indexOf(o)>=0)return y;if(m.push(o),this.reader&&this.reader.isFresh(i,y,o,s))return y;var g=s.incomingById.get(n);return g?(g.storeObject=s.merge(g.storeObject,c),g.mergeTree=wr(g.mergeTree,a),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):s.incomingById.set(n,{storeObject:c,mergeTree:Or(a)?void 0:a,fieldNodeSet:h}),y}return c},t.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?ce(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,r,_r(n,o));return kr(n,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},t.prototype.flattenFields=function(e,t,r,i){void 0===i&&(i=Y(t,e,r.fragmentMap));var o=new Map,s=this.cache.policies,u=new a.Trie(!1);return function e(a,c){var l=u.lookup(a,c.clientOnly,c.deferred);l.visited||(l.visited=!0,a.selections.forEach((function(a){if(E(a,r.variables)){var u=c.clientOnly,l=c.deferred;if(u&&l||!le(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(u=!0),"defer"===t){var n=J(e,r.variables);n&&!1===n.if||(l=!0)}})),X(a)){var f=o.get(a);f&&(u=u&&f.clientOnly,l=l&&f.deferred),o.set(a,mr(r,u,l))}else{var h=L(a,r.lookupFragment);if(!h&&a.kind===n.Kind.FRAGMENT_SPREAD)throw O(13,a.name.value);h&&s.fragmentMatches(h,i,t,r.variables)&&e(h.selectionSet,mr(r,u,l))}}})))}(e,r),o},t.prototype.applyMerges=function(t,r,n,i,o){var s,a=this;if(t.map.size&&!z(n)){var u,c=ce(n)||!z(r)&&!Et(r)?void 0:r,l=n;c&&!o&&(o=[z(c)?c.__ref:c]);var f=function(e,t){return ce(e)?"number"==typeof t?e[t]:void 0:i.store.getFieldValue(e,String(t))};t.map.forEach((function(e,t){var r=f(c,t),n=f(l,t);if(void 0!==n){o&&o.push(t);var s=a.applyMerges(e,r,n,i,o);s!==n&&(u=u||new Map).set(t,s),o&&w(o.pop()===t)}})),u&&(n=ce(l)?l.slice(0):e.__assign({},l),u.forEach((function(e,t){n[t]=e})))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,o&&(s=i.store).getStorage.apply(s,o)):n},t}(),br=[];function _r(e,t){var r=e.map;return r.has(t)||r.set(t,br.pop()||{map:new Map}),r.get(t)}function wr(t,r){if(t===r||!r||Or(r))return t;if(!t||Or(t))return r;var n=t.info&&r.info?e.__assign(e.__assign({},t.info),r.info):t.info||r.info,i=t.map.size&&r.map.size,o={info:n,map:i?new Map:t.map.size?t.map:r.map};if(i){var s=new Set(r.map.keys());t.map.forEach((function(e,t){o.map.set(t,wr(e,r.map.get(t))),s.delete(t)})),s.forEach((function(e){o.map.set(e,wr(r.map.get(e),t.map.get(e)))}))}return o}function Or(e){return!e||!(e.info||e.map.size)}function kr(e,t){var r=e.map,n=r.get(t);n&&Or(n)&&(br.push(n),r.delete(t))}new Set;var Sr,xr=function(t){function n(e){void 0===e&&(e={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new se(ye),r.assumeImmutableResults=!0,r.makeVar=$t,r.txCount=0,r.config=function(e){return je(Ot,e)}(e),r.addTypename=!!r.config.addTypename,r.policies=new pr({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.__extends(n,t),n.prototype.init=function(){var e=this.data=new Tt.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},n.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new gr(this,this.storeReader=new Kt({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:kt(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=o.wrap((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(At(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,Wt({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},n.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},n.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},n.prototype.read=function(t){var r=t.returnPartialData,n=void 0!==r&&r;try{return this.storeReader.diffQueryAgainstStore(e.__assign(e.__assign({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof gt)return null;throw e}},n.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},n.prototype.modify=function(e){if(bt.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},n.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(e.__assign(e.__assign({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},n.prototype.watch=function(e){var t=this;return this.watches.size||function(e){Yt(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&Xt(t),t.maybeBroadcastWatch.forget(e)}},n.prototype.gc=function(e){Wt.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},n.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},n.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},n.prototype.identify=function(e){if(z(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){}},n.prototype.evict=function(t){if(!t.id){if(bt.call(t,"id"))return!1;t=e.__assign(e.__assign({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},n.prototype.reset=function(e){var t=this;return this.init(),Wt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Xt(this)):this.broadcastWatches(),Promise.resolve()},n.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},n.prototype.batch=function(t){var r,n=this,i=t.update,o=t.optimistic,s=void 0===o||o,a=t.removeOptimistic,u=t.onWatchUpdated,c=function(e){var t=n,o=t.data,s=t.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return r=i(n)}finally{--n.txCount,n.data=o,n.optimisticData=s}},l=new Set;return u&&!this.txCount&&this.broadcastWatches(e.__assign(e.__assign({},t),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof s?this.optimisticData=this.optimisticData.addLayer(s,c):!1===s?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),u&&l.size?(this.broadcastWatches(e.__assign(e.__assign({},t),{onWatchUpdated:function(e,t){var r=u.call(this,e,t);return!1!==r&&l.delete(e),r}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(t),r},n.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},n.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},n.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},n.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},n.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},n.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,i=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(i.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,i,n))||n&&r.equal(n.result,i.result)||e.callback(e.lastDiff=i,n)},n}(mt);function qr(e){return!!e&&e<7}function Er(e){return 7===e||8===e}function Rr(t,r,n,i){var o=r.data,s=e.__rest(r,["data"]),a=n.data,u=e.__rest(n,["data"]);return h(s,u)&&Pr(ne(t).selectionSet,o,a,{fragmentMap:A(te(t)),variables:i})}function Pr(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every((function(e){if(i.has(e))return!0;if(i.add(e),!E(e,n.variables))return!0;if(Qr(e))return!0;if(X(e)){var o=G(e),s=t&&t[o],a=r&&r[o],u=e.selectionSet;if(!u)return h(s,a);var c=Array.isArray(s),l=Array.isArray(a);if(c!==l)return!1;if(c&&l){var f=s.length;if(a.length!==f)return!1;for(var p=0;p<f;++p)if(!Pr(u,s[p],a[p],n))return!1;return!0}return Pr(u,s,a,n)}var d=L(e,n.fragmentMap);return d?!!Qr(d)||Pr(d.selectionSet,t,r,n):void 0}))}function Qr(e){return!!e.directives&&e.directives.some(Dr)}function Dr(e){return"nonreactive"===e.name.value}exports.NetworkStatus=void 0,(Sr=exports.NetworkStatus||(exports.NetworkStatus={}))[Sr.loading=1]="loading",Sr[Sr.setVariables=2]="setVariables",Sr[Sr.fetchMore=3]="fetchMore",Sr[Sr.refetch=4]="refetch",Sr[Sr.poll=6]="poll",Sr[Sr.ready=7]="ready",Sr[Sr.error=8]="error";var Tr=Object.assign,Cr=(Object.hasOwnProperty,function(t){function n(r){var n=r.queryManager,i=r.queryInfo,o=r.options,s=t.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Mr)}catch(e){}var r=!s.observers.size;s.observers.add(e);var n=s.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&s.reobserve().catch((function(){})),function(){s.observers.delete(e)&&!s.observers.size&&s.tearDownQuery()}}))||this;s.observers=new Set,s.subscriptions=new Set,s.queryInfo=i,s.queryManager=n,s.waitForOwnResult=Ir(o.fetchPolicy),s.isTornDown=!1;var a=n.defaultOptions.watchQuery,u=(void 0===a?{}:a).fetchPolicy,c=void 0===u?"cache-first":u,l=o.fetchPolicy,f=void 0===l?c:l,h=o.initialFetchPolicy,p=void 0===h?"standby"===f?c:f:h;s.options=e.__assign(e.__assign({},o),{initialFetchPolicy:p,fetchPolicy:f}),s.queryId=i.queryId||n.generateQueryId();var d=Z(s.query);return s.queryName=d&&d.name&&d.name.value,s}return e.__extends(n,t),Object.defineProperty(n.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),n.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},n.prototype.getCurrentResult=function(t){void 0===t&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||exports.NetworkStatus.ready,o=e.__assign(e.__assign({},n),{loading:qr(i),networkStatus:i}),s=this.options.fetchPolicy,a=void 0===s?"cache-first":s;if(Ir(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(o.data=u.result),r.equal(o.data,{})&&(o.data=void 0),u.complete?(delete o.partial,!u.complete||o.networkStatus!==exports.NetworkStatus.loading||"cache-first"!==a&&"cache-only"!==a||(o.networkStatus=exports.NetworkStatus.ready,o.loading=!1)):o.partial=!0}return t&&this.updateLastResult(o),o},n.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Rr(this.query,this.last.result,e,this.variables):!r.equal(this.last.result,e))||t&&!r.equal(this.last.variables,t))},n.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||r.equal(n.variables,this.variables)))return n[e]},n.prototype.getLastResult=function(e){return this.getLast("result",e)},n.prototype.getLastError=function(e){return this.getLast("error",e)},n.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},n.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},n.prototype.refetch=function(t){var n={pollInterval:0},i=this.options.fetchPolicy;return n.fetchPolicy="cache-and-network"===i?i:"no-cache"===i?"no-cache":"network-only",t&&!r.equal(this.options.variables,t)&&(n.variables=this.options.variables=e.__assign(e.__assign({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(n,exports.NetworkStatus.refetch)},n.prototype.fetchMore=function(t){var r=this,n=e.__assign(e.__assign({},t.query?t:e.__assign(e.__assign(e.__assign(e.__assign({},this.options),{query:this.options.query}),t),{variables:e.__assign(e.__assign({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"});n.query=this.transformDocument(n.query);var i=this.queryManager.generateQueryId();this.lastQuery=t.query?this.transformDocument(this.options.query):n.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=exports.NetworkStatus.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set;return this.queryManager.fetchQuery(i,n,exports.NetworkStatus.fetchMore).then((function(e){return r.queryManager.removeQuery(i),o.networkStatus===exports.NetworkStatus.fetchMore&&(o.networkStatus=s),r.queryManager.cache.batch({update:function(i){var o=t.updateQuery;o?i.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},(function(t){return o(t,{fetchMoreResult:e.data,variables:n.variables})})):i.writeQuery({query:n.query,variables:n.variables,data:e.data})},onWatchUpdated:function(e){a.add(e.query)}}),e})).finally((function(){a.has(r.query)||Fr(r)}))},n.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},n.prototype.setOptions=function(e){return this.reobserve(e)},n.prototype.silentSetOptions=function(e){var t=je(this.options,e||{});Tr(this.options,t)},n.prototype.setVariables=function(e){return r.equal(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},exports.NetworkStatus.setVariables):Promise.resolve())},n.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},n.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},n.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},n.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},n.prototype.fetch=function(e,t,r){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,r)},n.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){w(r,22),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(qr(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},exports.NetworkStatus.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},n.prototype.updateLastResult=function(t,n){void 0===n&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!r.equal(n,this.last.variables)&&(i=void 0),this.last=e.__assign({result:this.queryManager.assumeImmutableResults?t:qe(t),variables:n},i?{error:i}:null)},n.prototype.reobserveAsConcast=function(t,n){var i=this;this.isTornDown=!1;var o=n===exports.NetworkStatus.refetch||n===exports.NetworkStatus.fetchMore||n===exports.NetworkStatus.poll,s=this.options.variables,a=this.options.fetchPolicy,u=je(this.options,t||{}),c=o?u:Tr(this.options,u),l=this.transformDocument(c.query);this.lastQuery=l,o||(this.updatePolling(),t&&t.variables&&!r.equal(t.variables,s)&&"standby"!==c.fetchPolicy&&c.fetchPolicy===a&&(this.applyNextFetchPolicy("variables-changed",c),void 0===n&&(n=exports.NetworkStatus.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Ir(c.fetchPolicy));var f=function(){i.concast===d&&(i.waitForOwnResult=!1)},h=c.variables&&e.__assign({},c.variables),p=this.fetch(c,n,l),d=p.concast,v=p.fromLink,y={next:function(e){f(),i.reportResult(e,h)},error:function(e){f(),i.reportError(e,h)}};return o||!v&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=y),d.addObserver(y),d},n.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},n.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.last;this.resetLastResults();var n=this.subscribe.apply(this,e);return this.last=r,n},n.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},n.prototype.reportResult=function(e,t){var r=this.getLastError(),n=this.isDifferentFromLastResult(e,t);(r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(r||n)&&Re(this.observers,"next",e)},n.prototype.reportError=function(t,r){var n=e.__assign(e.__assign({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:exports.NetworkStatus.error,loading:!1});this.updateLastResult(n,r),Re(this.observers,"error",this.last.error=t)},n.prototype.hasObservers=function(){return this.observers.size>0},n.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},n.prototype.transformDocument=function(e){return this.queryManager.transform(e)},n}(i.Observable));function Fr(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):e.reobserve()}function Mr(e){}function Ir(e){return"network-only"===e||"no-cache"===e||"standby"===e}Qe(Cr);var Nr=function(){function t(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return t.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=_e(t.resolvers,e)})):this.resolvers=_e(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(t){var r=t.document,n=t.remoteResult,i=t.context,o=t.variables,s=t.onlyRunForcedResolvers,a=void 0!==s&&s;return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){return r?[2,this.resolveDocument(r,n.data,i,o,this.fragmentMatcher,a).then((function(t){return e.__assign(e.__assign({},n),{data:t.result})}))]:[2,n]}))}))},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return R(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return ge(e)},t.prototype.prepareContext=function(t){var r=this.cache;return e.__assign(e.__assign({},t),{cache:r,getCacheKey:function(e){return r.identify(e)}})},t.prototype.addExportedVariables=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(i){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,r)||{},this.prepareContext(n),r).then((function(t){return e.__assign(e.__assign({},r),t.exportedVariables)}))]:[2,e.__assign({},r)]}))}))},t.prototype.shouldForceResolvers=function(e){var t=!1;return n.visit(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return n.BREAK}}}),t},t.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:me(e),variables:t,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(t,r,n,i,o,s){return void 0===n&&(n={}),void 0===i&&(i={}),void 0===o&&(o=function(){return!0}),void 0===s&&(s=!1),e.__awaiter(this,void 0,void 0,(function(){var a,u,c,l,f,h,p,d,v,y;return e.__generator(this,(function(m){return a=ne(t),u=te(t),c=A(u),l=this.collectSelectionsToResolve(a,c),f=a.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(p=this).cache,v=p.client,y={fragmentMap:c,context:e.__assign(e.__assign({},n),{cache:d,client:v}),variables:i,fragmentMatcher:o,defaultOperationType:h,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:s},!1,[2,this.resolveSelectionSet(a.selectionSet,false,r,y).then((function(e){return{result:e,exportedVariables:y.exportedVariables}}))]}))}))},t.prototype.resolveSelectionSet=function(t,r,n,i){return e.__awaiter(this,void 0,void 0,(function(){var o,s,a,u,c,l=this;return e.__generator(this,(function(f){return o=i.fragmentMap,s=i.context,a=i.variables,u=[n],c=function(t){return e.__awaiter(l,void 0,void 0,(function(){var c,l;return e.__generator(this,(function(e){return(r||i.selectionsToResolve.has(t))&&E(t,a)?X(t)?[2,this.resolveField(t,r,n,i).then((function(e){var r;void 0!==e&&u.push(((r={})[G(t)]=e,r))}))]:(!function(e){return"InlineFragment"===e.kind}(t)?(c=o[t.name.value],w(c,18,t.name.value)):c=t,c&&c.typeCondition&&(l=c.typeCondition.name.value,i.fragmentMatcher(n,l,s))?[2,this.resolveSelectionSet(c.selectionSet,r,n,i).then((function(e){u.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(t.selections.map(c)).then((function(){return we(u)}))]}))}))},t.prototype.resolveField=function(t,r,n,i){return e.__awaiter(this,void 0,void 0,(function(){var o,s,a,u,c,l,f,h,p,d=this;return e.__generator(this,(function(e){return n?(o=i.variables,s=t.name.value,a=G(t),u=s!==a,c=n[a]||n[s],l=Promise.resolve(c),i.onlyRunForcedResolvers&&!this.shouldForceResolvers(t)||(f=n.__typename||i.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(p=h[u?s:a])&&(l=Promise.resolve(Jt.withValue(this.cache,p,[n,J(t,o),i.context,{field:t,fragmentMap:i.fragmentMap}])))),[2,l.then((function(e){var n,o;if(void 0===e&&(e=c),t.directives&&t.directives.forEach((function(t){"export"===t.name.value&&t.arguments&&t.arguments.forEach((function(t){"as"===t.name.value&&"StringValue"===t.value.kind&&(i.exportedVariables[t.value.value]=e)}))})),!t.selectionSet)return e;if(null==e)return e;var s=null!==(o=null===(n=t.directives)||void 0===n?void 0:n.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(e)?d.resolveSubSelectedArray(t,r||s,e,i):t.selectionSet?d.resolveSelectionSet(t.selectionSet,r||s,e,i):void 0}))]):[2,null]}))}))},t.prototype.resolveSubSelectedArray=function(e,t,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(e,t,r,n):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,r,n):void 0})))},t.prototype.collectSelectionsToResolve=function(e,t){var r=function(e){return!Array.isArray(e)},i=this.selectionsToResolveCache;return function e(o){if(!i.has(o)){var s=new Set;i.set(o,s),n.visit(o,{Directive:function(e,t,i,o,a){"client"===e.name.value&&a.forEach((function(e){r(e)&&n.isSelectionNode(e)&&s.add(e)}))},FragmentSpread:function(i,o,a,u,c){var l=t[i.name.value];w(l,19,i.name.value);var f=e(l);f.size>0&&(c.forEach((function(e){r(e)&&n.isSelectionNode(e)&&s.add(e)})),s.add(i),f.forEach((function(e){s.add(e)})))}})}return i.get(o)}(e)},t}(),jr=new(Q?WeakMap:Map);function Ar(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return jr.set(e,(jr.get(e)+1)%1e15),r.apply(this,arguments)})}function Lr(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Vr=function(){function t(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;jr.has(r)||(jr.set(r,0),Ar(r,"evict"),Ar(r,"modify"),Ar(r,"reset"))}return t.prototype.init=function(e){var t=e.networkStatus||exports.NetworkStatus.loading;return this.variables&&this.networkStatus!==exports.NetworkStatus.loading&&!r.equal(this.variables,e.variables)&&(t=exports.NetworkStatus.setVariables),r.equal(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Lr(this),this.dirty=!1},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&r.equal(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},t.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},t.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||r.equal(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},t.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Fr(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Lr(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(qr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(t){var n=this;void 0===t&&(t=this.variables);var i=this.observableQuery;if(!i||"no-cache"!==i.options.fetchPolicy){var o=e.__assign(e.__assign({},this.getDiffOptions(t)),{watcher:this,callback:function(e){return n.setDiff(e)}});this.lastWatch&&r.equal(o,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=o))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===jr.get(this.cache)&&r.equal(t,n.variables)&&r.equal(e.data,n.result.data))},t.prototype.markResult=function(e,t,n,i){var o=this,s=new ke,a=le(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&le(e.incremental)){var u=Me(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=s.merge(c.result,e.data)}this.graphQLErrors=a,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==i&&(zr(e,n.errorPolicy)?this.cache.performTransaction((function(s){if(o.shouldWrite(e,n.variables))s.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===i}),o.lastWrite={result:e,variables:n.variables,dmCount:jr.get(o.cache)};else if(o.lastDiff&&o.lastDiff.diff.complete)return void(e.data=o.lastDiff.diff.result);var a=o.getDiffOptions(n.variables),u=s.diff(a);!o.stopped&&r.equal(o.variables,n.variables)&&o.updateWatch(n.variables),o.updateLastDiff(u,a),u.complete&&(e.data=u.result)})):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=exports.NetworkStatus.ready},t.prototype.markError=function(e){return this.networkStatus=exports.NetworkStatus.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function zr(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!Ie(e);return!n&&r&&e.data&&(n=!0),n}var Wr=Object.prototype.hasOwnProperty,Br=function(){function t(e){var t=this,r=e.cache,n=e.link,i=e.defaultOptions,o=e.documentTransform,s=e.queryDeduplication,a=void 0!==s&&s,u=e.onBroadcast,c=e.ssrMode,l=void 0!==c&&c,f=e.clientAwareness,h=void 0===f?{}:f,p=e.localState,d=e.assumeImmutableResults,v=void 0===d?!!r.assumeImmutableResults:d;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Q?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map;var y=new se((function(e){return t.cache.transformDocument(e)}),{cache:!1});this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=a,this.clientAwareness=h,this.localState=p||new Nr({cache:r}),this.ssrMode=l,this.assumeImmutableResults=v,this.documentTransform=o?y.concat(o).concat(y):y,(this.onBroadcast=u)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(O(25))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},t.prototype.mutate=function(t){var r,n,i=t.mutation,o=t.variables,s=t.optimisticResponse,a=t.updateQueries,u=t.refetchQueries,c=void 0===u?[]:u,l=t.awaitRefetchQueries,f=void 0!==l&&l,h=t.update,p=t.onQueryUpdated,d=t.fetchPolicy,v=void 0===d?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.fetchPolicy)||"network-only":d,y=t.errorPolicy,m=void 0===y?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":y,g=t.keepRootFields,b=t.context;return e.__awaiter(this,void 0,void 0,(function(){var t,r,n,u;return e.__generator(this,(function(l){switch(l.label){case 0:return w(i,26),w("network-only"===v||"no-cache"===v,27),t=this.generateMutationId(),i=this.cache.transformForLink(this.transform(i)),r=this.getDocumentInfo(i).hasClientExports,o=this.getVariables(i,o),r?[4,this.localState.addExportedVariables(i,o,b)]:[3,2];case 1:o=l.sent(),l.label=2;case 2:return n=this.mutationStore&&(this.mutationStore[t]={mutation:i,variables:o,loading:!0,error:null}),s&&this.markMutationOptimistic(s,{mutationId:t,document:i,variables:o,fetchPolicy:v,errorPolicy:m,context:b,updateQueries:a,update:h,keepRootFields:g}),this.broadcastQueries(),u=this,[2,new Promise((function(r,l){return Pe(u.getObservableFromLink(i,e.__assign(e.__assign({},b),{optimisticResponse:s}),o,!1),(function(r){if(Ie(r)&&"none"===m)throw new rt({graphQLErrors:Ne(r)});n&&(n.loading=!1,n.error=null);var l=e.__assign({},r);return"function"==typeof c&&(c=c(l)),"ignore"===m&&Ie(l)&&delete l.errors,u.markMutationResult({mutationId:t,result:l,document:i,variables:o,fetchPolicy:v,errorPolicy:m,context:b,update:h,updateQueries:a,awaitRefetchQueries:f,refetchQueries:c,removeOptimistic:s?t:void 0,onQueryUpdated:p,keepRootFields:g})})).subscribe({next:function(e){u.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||r(e)},error:function(e){n&&(n.loading=!1,n.error=e),s&&u.cache.removeOptimistic(t),u.broadcastQueries(),l(e instanceof rt?e:new rt({networkError:e}))}})}))]}}))}))},t.prototype.markMutationResult=function(t,r){var n=this;void 0===r&&(r=this.cache);var i=t.result,o=[],s="no-cache"===t.fetchPolicy;if(!s&&zr(i,t.errorPolicy)){if(Ce(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Ce(i)&&le(i.incremental)){var a=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),u=void 0;a.result&&(u=Me(a.result,i)),void 0!==u&&(i.data=u,o.push({result:u,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var c=t.updateQueries;c&&this.queries.forEach((function(e,t){var s=e.observableQuery,a=s&&s.queryName;if(a&&Wr.call(c,a)){var u=c[a],l=n.queries.get(t),f=l.document,h=l.variables,p=r.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),d=p.result;if(p.complete&&d){var v=u(d,{mutationResult:i,queryName:f&&ee(f)||void 0,queryVariables:h});v&&o.push({result:v,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(o.length>0||t.refetchQueries||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(r){s||o.forEach((function(e){return r.write(e)}));var a,u=t.update,c=!(Ce(a=i)||function(e){return"hasNext"in e&&"data"in e}(a))||Ce(i)&&!i.hasNext;if(u){if(!s){var l=r.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(i=e.__assign(e.__assign({},i),{data:l.result}))&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}c&&u(r,i,{context:t.context,variables:t.variables})}s||t.keepRootFields||!c||r.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then((function(){return i}))}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(t,r){var n=this,i="function"==typeof t?t(r.variables):t;return this.cache.recordOptimisticTransaction((function(t){try{n.markMutationResult(e.__assign(e.__assign({},r),{result:{data:i}}),t)}catch(e){}}),r.mutationId)},t.prototype.fetchQuery=function(e,t,r){return this.fetchConcastWithInfo(e,t,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},t.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:P(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:R(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:ve([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:ie(Z(t)),asQuery:e.__assign(e.__assign({},t),{definitions:t.definitions.map((function(t){return"OperationDefinition"===t.kind&&"query"!==t.operation?e.__assign(e.__assign({},t),{operation:"query"}):t}))})};r.set(t,n)}return r.get(t)},t.prototype.getVariables=function(t,r){return e.__assign(e.__assign({},this.getDocumentInfo(t).defaultVars),r)},t.prototype.watchQuery=function(t){var r=this.transform(t.query);void 0===(t=e.__assign(e.__assign({},t),{variables:this.getVariables(r,t.variables)})).notifyOnNetworkStatusChange&&(t.notifyOnNetworkStatusChange=!1);var n=new Vr(this),i=new Cr({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(t,r){var n=this;return void 0===r&&(r=this.generateQueryId()),w(t.query,28),w("Document"===t.query.kind,29),w(!t.returnPartialData,30),w(!t.pollInterval,31),this.fetchQuery(r,e.__assign(e.__assign({},t),{query:this.transform(t.query)})).finally((function(){return n.stopQuery(r)}))},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},t.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(O(32)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=exports.NetworkStatus.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(t){var r=this;void 0===t&&(t="active");var n=new Map,i=new Map,o=new Set;return Array.isArray(t)&&t.forEach((function(e){var t;"string"==typeof e?i.set(e,!1):N(t=e)&&"Document"===t.kind&&Array.isArray(t.definitions)?i.set(r.transform(e),!1):N(e)&&e.query&&o.add(e)})),this.queries.forEach((function(e,r){var o=e.observableQuery,s=e.document;if(o){if("all"===t)return void n.set(r,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===t&&!o.hasObservers())return;("active"===t||a&&i.has(a)||s&&i.has(s))&&(n.set(r,o),a&&i.set(a,!0),s&&i.set(s,!0))}})),o.size&&o.forEach((function(t){var i=g("legacyOneTimeQuery"),o=r.getQuery(i).init({document:t.query,variables:t.variables}),s=new Cr({queryManager:r,queryInfo:o,options:e.__assign(e.__assign({},t),{fetchPolicy:"network-only"})});w(s.queryId===i),o.setObservableQuery(s),n.set(i,s)})),n},t.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,o=e.errorPolicy,s=void 0===o?"none":o,a=e.variables,u=e.context,c=void 0===u?{}:u;r=this.transform(r),a=this.getVariables(r,a);var l=function(e){return t.getObservableFromLink(r,c,e).map((function(i){"no-cache"!==n&&(zr(i,s)&&t.cache.write({query:r,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var o=Ie(i),a=function(e){return!!e.extensions&&Array.isArray(e.extensions[et])}(i);if(o||a){var u={};if(o&&(u.graphQLErrors=i.errors),a&&(u.protocolErrors=i.extensions[et]),"none"===s||a)throw new rt(u)}return"ignore"===s&&delete i.errors,i}))};if(this.getDocumentInfo(r).hasClientExports){var f=this.localState.addExportedVariables(r,a,c).then(l);return new i.Observable((function(e){var t=null;return f.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return l(a)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(t,r,n,o){var s,a,u=this;void 0===o&&(o=null!==(s=null==r?void 0:r.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var c=this.getDocumentInfo(t),l=c.serverQuery,f=c.clientQuery;if(l){var h=this.inFlightLinkObservables,p=this.link,d={query:l,variables:n,operationName:ee(l)||void 0,context:this.prepareContext(e.__assign(e.__assign({},r),{forceFetch:!o}))};if(r=d.context,o){var v=ue(l),y=h.get(v)||new Map;h.set(v,y);var m=Wt(n);if(!(a=y.get(m))){var g=new Te([Ye(p,d)]);y.set(m,a=g),g.beforeNext((function(){y.delete(m)&&y.size<1&&h.delete(v)}))}}else a=new Te([Ye(p,d)])}else a=new Te([i.Observable.of({data:{}})]),r=this.prepareContext(r);return f&&(a=Pe(a,(function(e){return u.localState.runResolvers({document:f,remoteResult:e,context:r,variables:n})}))),a},t.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(r.query);return Pe(this.getObservableFromLink(i,r.context,r.variables),(function(o){var s=Ne(o),a=s.length>0;if(n>=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new rt({graphQLErrors:s}));e.markResult(o,i,r,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:exports.NetworkStatus.ready};return a&&"ignore"!==r.errorPolicy&&(u.errors=s,u.networkStatus=exports.NetworkStatus.error),u}),(function(t){var r=tt(t)?t:new rt({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},t.prototype.fetchConcastWithInfo=function(e,t,r,n){var i=this;void 0===r&&(r=exports.NetworkStatus.loading),void 0===n&&(n=t.query);var o,s,a=this.getVariables(n,t.variables),u=this.getQuery(e),c=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?c&&c.fetchPolicy||"cache-first":l,h=t.errorPolicy,p=void 0===h?c&&c.errorPolicy||"none":h,d=t.returnPartialData,v=void 0!==d&&d,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,g=t.context,b=void 0===g?{}:g,_=Object.assign({},t,{query:n,variables:a,fetchPolicy:f,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:m,context:b}),w=function(e){_.variables=e;var n=i.fetchQueryByPolicy(u,_,r);return"standby"!==_.fetchPolicy&&n.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",t),n},O=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){O(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(_.query).hasClientExports)o=new Te(this.localState.addExportedVariables(_.query,_.variables,_.context).then(w).then((function(e){return e.sources}))),s=!0;else{var k=w(_.variables);s=k.fromLink,o=new Te(k.sources)}return o.promise.then(O,O),{concast:o,fromLink:s}},t.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,s=e.removeOptimistic,a=void 0===s?o?g("refetchQueries"):void 0:s,u=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){c.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof Vr&&e.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),c.size&&c.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,s=e.diff;if(u){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}n=u(i,s,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),a&&this.cache.removeOptimistic(a),l},t.prototype.fetchQueryByPolicy=function(t,r,n){var o=this,s=r.query,a=r.variables,u=r.fetchPolicy,c=r.refetchWritePolicy,l=r.errorPolicy,f=r.returnPartialData,h=r.context,p=r.notifyOnNetworkStatusChange,d=t.networkStatus;t.init({document:s,variables:a,networkStatus:n});var v=function(){return t.getDiff()},y=function(r,n){void 0===n&&(n=t.networkStatus||exports.NetworkStatus.loading);var u=r.result;var c=function(t){return i.Observable.of(e.__assign({data:t,loading:qr(n),networkStatus:n},r.complete?null:{partial:!0}))};return u&&o.getDocumentInfo(s).hasForcedResolvers?o.localState.runResolvers({document:s,remoteResult:{data:u},context:h,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data||void 0)})):"none"===l&&n===exports.NetworkStatus.refetch&&Array.isArray(r.missing)?c(void 0):c(u)},m="no-cache"===u?0:n===exports.NetworkStatus.refetch&&"merge"!==c?1:2,g=function(){return o.getResultsFromLink(t,m,{query:s,variables:a,context:h,fetchPolicy:u,errorPolicy:l})},b=p&&"number"==typeof d&&d!==n&&qr(n);switch(u){default:case"cache-first":return(_=v()).complete?{fromLink:!1,sources:[y(_,t.markReady())]}:f||b?{fromLink:!0,sources:[y(_),g()]}:{fromLink:!0,sources:[g()]};case"cache-and-network":var _;return(_=v()).complete||f||b?{fromLink:!0,sources:[y(_),g()]}:{fromLink:!0,sources:[g()]};case"cache-only":return{fromLink:!1,sources:[y(v(),t.markReady())]};case"network-only":return b?{fromLink:!0,sources:[y(v()),g()]}:{fromLink:!0,sources:[g()]};case"no-cache":return b?{fromLink:!0,sources:[y(t.getDiff()),g()]}:{fromLink:!0,sources:[g()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Vr(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(t){void 0===t&&(t={});var r=this.localState.prepareContext(t);return e.__assign(e.__assign({},r),{clientAwareness:this.clientAwareness})},t}(),Ur=function(){function t(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw O(15);var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,s=e.documentTransform,a=e.ssrMode,u=void 0!==a&&a,c=e.ssrForceFetchDelay,l=void 0===c?0:c,f=e.connectToDevTools,h=void 0===f?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:f,p=e.queryDeduplication,v=void 0===p||p,y=e.defaultOptions,m=e.assumeImmutableResults,g=void 0===m?o.assumeImmutableResults:m,b=e.resolvers,_=e.typeDefs,w=e.fragmentMatcher,k=e.name,S=e.version,x=e.link;x||(x=r?new yt({uri:r,credentials:n,headers:i}):Ue.empty()),this.link=x,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=v,this.defaultOptions=y||Object.create(null),this.typeDefs=_,l&&setTimeout((function(){return t.disableNetworkFetches=!1}),l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=d,this.localState=new Nr({cache:o,client:this,resolvers:b,fragmentMatcher:w}),this.queryManager=new Br({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,documentTransform:s,queryDeduplication:v,ssrMode:u,clientAwareness:{name:k,version:S},localState:this.localState,assumeImmutableResults:g,onBroadcast:h?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),h&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if("object"==typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=Ae(this.defaultOptions.watchQuery,t)),!this.disableNetworkFetches||"network-only"!==t.fetchPolicy&&"cache-and-network"!==t.fetchPolicy||(t=e.__assign(e.__assign({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},t.prototype.query=function(t){return this.defaultOptions.query&&(t=Ae(this.defaultOptions.query,t)),w("cache-and-network"!==t.fetchPolicy,16),this.disableNetworkFetches&&"network-only"===t.fetchPolicy&&(t=e.__assign(e.__assign({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Ae(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},t.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},t.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},t.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Ye(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},t.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},t.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){})),i},t.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}(),Kr=T?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Hr(){w("createContext"in p,45);var e=p.createContext[Kr];return e||(Object.defineProperty(p.createContext,Kr,{value:e=p.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var Jr=Hr;function Gr(e){var t=p.useContext(Hr()),r=e||t.client;return w(!!r,49),r}var Yr,Xr=p.useSyncExternalStore||function(e,t,r){var n=t();var i=p.useState({inst:{value:n,getSnapshot:t}}),o=i[0].inst,s=i[1];return I?p.useLayoutEffect((function(){Object.assign(o,{value:n,getSnapshot:t}),$r(o)&&s({inst:o})}),[e,n,t]):Object.assign(o,{value:n,getSnapshot:t}),p.useEffect((function(){return $r(o)&&s({inst:o}),e((function(){$r(o)&&s({inst:o})}))}),[e]),n};function $r(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch(e){return!0}}exports.DocumentType=void 0,(Yr=exports.DocumentType||(exports.DocumentType={}))[Yr.Query=0]="Query",Yr[Yr.Mutation=1]="Mutation",Yr[Yr.Subscription=2]="Subscription";var Zr=new Map;function en(e){var t;switch(e){case exports.DocumentType.Query:t="Query";break;case exports.DocumentType.Mutation:t="Mutation";break;case exports.DocumentType.Subscription:t="Subscription"}return t}function tn(e){var t,r,n=Zr.get(e);if(n)return n;w(!!e&&!!e.kind,59,e);for(var i=[],o=[],s=[],a=[],u=0,c=e.definitions;u<c.length;u++){var l=c[u];if("FragmentDefinition"!==l.kind){if("OperationDefinition"===l.kind)switch(l.operation){case"query":o.push(l);break;case"mutation":s.push(l);break;case"subscription":a.push(l)}}else i.push(l)}w(!i.length||o.length||s.length||a.length,60),w(o.length+s.length+a.length<=1,61,e,o.length,a.length,s.length),r=o.length?exports.DocumentType.Query:exports.DocumentType.Mutation,o.length||s.length||(r=exports.DocumentType.Subscription);var f=o.length?o:s.length?s:a;w(1===f.length,62,e,f.length);var h=f[0];t=h.variableDefinitions||[];var p={name:h.name&&"Name"===h.name.kind?h.name.value:"data",type:r,variables:t};return Zr.set(e,p),p}function rn(e,t){var r=tn(e),n=en(t),i=en(r.type);w(r.type===t,63,n,n,i)}var nn=Object.prototype.hasOwnProperty;function on(e,t){var r=p.useRef();r.current&&e===r.current.client&&t===r.current.query||(r.current=new sn(e,t,r.current));var n=r.current;return n.forceUpdateState=p.useReducer((function(e){return e+1}),0)[1],n}var sn=function(){function t(e,t,r){var n=this;this.client=e,this.query=t,this.forceUpdate=function(){return n.forceUpdateState()},this.ssrDisabledResult={loading:!0,data:void 0,error:void 0,networkStatus:exports.NetworkStatus.loading},this.skipStandbyResult={loading:!1,data:void 0,error:void 0,networkStatus:exports.NetworkStatus.ready},this.toQueryResultCache=new(Q?WeakMap:Map),rn(t,exports.DocumentType.Query);var i=r&&r.result,o=i&&i.data;o&&(this.previousData=o)}return t.prototype.forceUpdateState=function(){},t.prototype.executeQuery=function(e){var t,r=this;e.query&&Object.assign(this,{query:e.query}),this.watchQueryOptions=this.createWatchQueryOptions(this.queryHookOptions=e);var n=this.observable.reobserveAsConcast(this.getObsQueryOptions());return this.previousData=(null===(t=this.result)||void 0===t?void 0:t.data)||this.previousData,this.result=void 0,this.forceUpdate(),new Promise((function(e){var t;n.subscribe({next:function(e){t=e},error:function(){e(r.toQueryResult(r.observable.getCurrentResult()))},complete:function(){e(r.toQueryResult(t))}})}))},t.prototype.useQuery=function(e){var t=this;this.renderPromises=p.useContext(Hr()).renderPromises,this.useOptions(e);var n=this.useObservableQuery(),i=Xr(p.useCallback((function(e){if(t.renderPromises)return function(){};t.forceUpdate=e;var i=function(){var e=t.result,i=n.getCurrentResult();e&&e.loading===i.loading&&e.networkStatus===i.networkStatus&&r.equal(e.data,i.data)||t.setResult(i)},o=function(e){if(s.unsubscribe(),s=n.resubscribeAfterError(i,o),!nn.call(e,"graphQLErrors"))throw e;var a=t.result;(!a||a&&a.loading||!r.equal(e,a.error))&&t.setResult({data:a&&a.data,error:e,loading:!1,networkStatus:exports.NetworkStatus.error})},s=n.subscribe(i,o);return function(){setTimeout((function(){return s.unsubscribe()})),t.forceUpdate=function(){return t.forceUpdateState()}}}),[n,this.renderPromises,this.client.disableNetworkFetches]),(function(){return t.getCurrentResult()}),(function(){return t.getCurrentResult()}));return this.unsafeHandlePartialRefetch(i),this.toQueryResult(i)},t.prototype.useOptions=function(e){var n,i=this.createWatchQueryOptions(this.queryHookOptions=e),o=this.watchQueryOptions;r.equal(i,o)||(this.watchQueryOptions=i,o&&this.observable&&(this.observable.reobserve(this.getObsQueryOptions()),this.previousData=(null===(n=this.result)||void 0===n?void 0:n.data)||this.previousData,this.result=void 0)),this.onCompleted=e.onCompleted||t.prototype.onCompleted,this.onError=e.onError||t.prototype.onError,!this.renderPromises&&!this.client.disableNetworkFetches||!1!==this.queryHookOptions.ssr||this.queryHookOptions.skip?this.queryHookOptions.skip||"standby"===this.watchQueryOptions.fetchPolicy?this.result=this.skipStandbyResult:this.result!==this.ssrDisabledResult&&this.result!==this.skipStandbyResult||(this.result=void 0):this.result=this.ssrDisabledResult},t.prototype.getObsQueryOptions=function(){var e=[],t=this.client.defaultOptions.watchQuery;return t&&e.push(t),this.queryHookOptions.defaultOptions&&e.push(this.queryHookOptions.defaultOptions),e.push(je(this.observable&&this.observable.options,this.watchQueryOptions)),e.reduce(Ae)},t.prototype.createWatchQueryOptions=function(t){var r;void 0===t&&(t={});var n=t.skip;t.ssr,t.onCompleted,t.onError,t.defaultOptions;var i=e.__rest(t,["skip","ssr","onCompleted","onError","defaultOptions"]),o=Object.assign(i,{query:this.query});if(!this.renderPromises||"network-only"!==o.fetchPolicy&&"cache-and-network"!==o.fetchPolicy||(o.fetchPolicy="cache-first"),o.variables||(o.variables={}),n){var s=o.fetchPolicy,a=void 0===s?this.getDefaultFetchPolicy():s,u=o.initialFetchPolicy,c=void 0===u?a:u;Object.assign(o,{initialFetchPolicy:c,fetchPolicy:"standby"})}else o.fetchPolicy||(o.fetchPolicy=(null===(r=this.observable)||void 0===r?void 0:r.options.initialFetchPolicy)||this.getDefaultFetchPolicy());return o},t.prototype.getDefaultFetchPolicy=function(){var e,t;return(null===(e=this.queryHookOptions.defaultOptions)||void 0===e?void 0:e.fetchPolicy)||(null===(t=this.client.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first"},t.prototype.onCompleted=function(e){},t.prototype.onError=function(e){},t.prototype.useObservableQuery=function(){var e=this.observable=this.renderPromises&&this.renderPromises.getSSRObservable(this.watchQueryOptions)||this.observable||this.client.watchQuery(this.getObsQueryOptions());this.obsQueryFields=p.useMemo((function(){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}),[e]);var t=!(!1===this.queryHookOptions.ssr||this.queryHookOptions.skip);return this.renderPromises&&t&&(this.renderPromises.registerSSRObservable(e),e.getCurrentResult().loading&&this.renderPromises.addObservableQueryPromise(e)),e},t.prototype.setResult=function(e){var t=this.result;t&&t.data&&(this.previousData=t.data),this.result=e,this.forceUpdate(),this.handleErrorOrCompleted(e,t)},t.prototype.handleErrorOrCompleted=function(e,t){var r=this;if(!e.loading){var n=this.toApolloError(e);Promise.resolve().then((function(){n?r.onError(n):e.data&&(null==t?void 0:t.networkStatus)!==e.networkStatus&&e.networkStatus===exports.NetworkStatus.ready&&r.onCompleted(e.data)})).catch((function(e){}))}},t.prototype.toApolloError=function(e){return le(e.errors)?new rt({graphQLErrors:e.errors}):e.error},t.prototype.getCurrentResult=function(){return this.result||this.handleErrorOrCompleted(this.result=this.observable.getCurrentResult()),this.result},t.prototype.toQueryResult=function(t){var r=this.toQueryResultCache.get(t);if(r)return r;var n=t.data;t.partial;var i=e.__rest(t,["data","partial"]);return this.toQueryResultCache.set(t,r=e.__assign(e.__assign(e.__assign({data:n},i),this.obsQueryFields),{client:this.client,observable:this.observable,variables:this.observable.variables,called:!this.queryHookOptions.skip,previousData:this.previousData})),!r.error&&le(t.errors)&&(r.error=new rt({graphQLErrors:t.errors})),r},t.prototype.unsafeHandlePartialRefetch=function(e){!e.partial||!this.queryHookOptions.partialRefetch||e.loading||e.data&&0!==Object.keys(e.data).length||"cache-only"===this.observable.options.fetchPolicy||(Object.assign(e,{loading:!0,networkStatus:exports.NetworkStatus.refetch}),this.observable.refetch())},t}(),an=["refetch","reobserve","fetchMore","updateQuery","startPolling","subscribeToMore"];function un(e){var t={data:e.result,complete:!!e.complete};return e.missing&&(t.missing=we(e.missing.map((function(e){return e.missing})))),t}var cn=p.use||function(e){var t=function(e){if(function(e){return"status"in e}(e))return e;var t=e;return t.status="pending",t.then((function(e){if("pending"===t.status){var r=t;r.status="fulfilled",r.value=e}}),(function(e){if("pending"===t.status){var r=t;r.status="rejected",r.reason=e}})),e}(e);switch(t.status){case"pending":throw t;case"rejected":throw t.reason;case"fulfilled":return t.value}},ln=Symbol();var fn=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],hn=function(){function t(e,t){var n=this;this.listeners=new Set,this.status="loading",this.references=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,this.result=e.getCurrentResult(!1),this.key=t.key,t.onDispose&&(this.onDispose=t.onDispose),Er(this.result.networkStatus)||this.result.data&&(!this.result.partial||this.watchQueryOptions.returnPartialData)?(this.promise=Se(this.result),this.status="idle"):this.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),this.subscription=e.filter((function(e){var t=e.data;return!r.equal(t,{})})).subscribe({next:this.handleNext,error:this.handleError});var i=function(){var e;n.references||(n.autoDisposeTimeoutId=setTimeout(n.dispose,null!==(e=t.autoDisposeTimeoutMs)&&void 0!==e?e:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var t=!1;return function(){t||(t=!0,e.references--,setTimeout((function(){e.references||e.dispose()})))}},t.prototype.didChangeOptions=function(e){var t=this;return fn.some((function(n){return!r.equal(t.watchQueryOptions[n],e[n])}))},t.prototype.applyOptions=function(t){var r=this.watchQueryOptions,n=r.fetchPolicy,i=r.canonizeResults;return"standby"===n&&n!==t.fetchPolicy?this.initiateFetch(this.observable.reobserve(t)):(this.observable.silentSetOptions(t),i!==t.canonizeResults&&(this.result=e.__assign(e.__assign({},this.result),this.observable.getCurrentResult()),this.promise=Se(this.result))),this.promise},t.prototype.listen=function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var t;switch(this.status){case"loading":void 0===e.data&&(e.data=this.result.data),this.status="idle",this.result=e,null===(t=this.resolve)||void 0===t||t.call(this,e);break;case"idle":if(e.data===this.result.data)return;void 0===e.data&&(e.data=this.result.data),this.result=e,this.promise=Se(e),this.deliver(this.promise)}},t.prototype.handleError=function(e){var t,r,n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.status){case"loading":this.status="idle",null===(t=this.reject)||void 0===t||t.call(this,e);break;case"idle":this.promise=(r=e,(n=Promise.reject(r)).catch((function(){})),n.status="rejected",n.reason=r,n),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach((function(t){return t(e)}))},t.prototype.initiateFetch=function(e){var t=this;return this.status="loading",this.promise=new Promise((function(e,r){t.resolve=e,t.reject=r})),this.promise.catch((function(){})),e.then((function(e){var r;"loading"===t.status&&(t.status="idle",t.result=e,null===(r=t.resolve)||void 0===r||r.call(t,e))})).catch((function(){})),e},t}(),pn=function(){function e(e){void 0===e&&(e=Object.create(null)),this.queryRefs=new a.Trie(Q),this.options=e}return e.prototype.getQueryRef=function(e,t){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new hn(t(),{key:e,autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},e}(),dn=Symbol.for("apollo.suspenseCache");function vn(e){var t;return e[dn]||(e[dn]=new pn(null===(t=e.defaultOptions.react)||void 0===t?void 0:t.suspense)),e[dn]}var yn=Symbol.for("apollo.skipToken");function mn(e){return le(e.errors)?new rt({graphQLErrors:e.errors}):e.error}function gn(t){var n,i,o,s=t.client,a=t.query,u=t.options;return n=function(){var t;if(u===yn)return{query:a,fetchPolicy:"standby"};var r=u.fetchPolicy||(null===(t=s.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first",n=e.__assign(e.__assign({},u),{fetchPolicy:r,query:a,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return u.skip&&(n.fetchPolicy="standby"),n},i=[s,u,a],(o=p.useRef()).current&&r.equal(o.current.deps,i)||(o.current={value:n(),deps:i}),o.current.value}exports.setLogVerbosity=t.setVerbosity,exports.Observable=i.Observable,exports.disableExperimentalFragmentVariables=u.disableExperimentalFragmentVariables,exports.disableFragmentWarnings=u.disableFragmentWarnings,exports.enableExperimentalFragmentVariables=u.enableExperimentalFragmentVariables,exports.gql=u.gql,exports.resetCaches=u.resetCaches,exports.ApolloCache=mt,exports.ApolloClient=Ur,exports.ApolloConsumer=function(e){var t=Hr();return p.createElement(t.Consumer,null,(function(t){return w(t&&t.client,44),e.children(t.client)}))},exports.ApolloError=rt,exports.ApolloLink=Ue,exports.ApolloProvider=function(t){var r=t.client,n=t.children,i=Hr(),o=p.useContext(i),s=p.useMemo((function(){return e.__assign(e.__assign({},o),{client:r||o.client})}),[o,r]);return w(s.client,46),p.createElement(i.Provider,{value:s},n)},exports.DocumentTransform=se,exports.HttpLink=yt,exports.InMemoryCache=xr,exports.MissingFieldError=gt,exports.ObservableQuery=Cr,exports.checkFetcher=ft,exports.concat=Ge,exports.createHttpLink=vt,exports.createSignalIfSupported=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}},exports.defaultDataIdFromObject=wt,exports.defaultPrinter=ct,exports.empty=Ke,exports.execute=Ye,exports.fallbackHttpConfig=ut,exports.from=He,exports.fromError=Le,exports.fromPromise=function(e){return new i.Observable((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))},exports.getApolloContext=Hr,exports.isApolloError=tt,exports.isNetworkRequestSettled=Er,exports.isReference=z,exports.makeReference=V,exports.makeVar=$t,exports.mergeOptions=Ae,exports.operationName=en,exports.parseAndCheckHttpResponse=st,exports.parser=tn,exports.resetApolloContext=Jr,exports.rewriteURIForGET=pt,exports.selectHttpOptionsAndBody=function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return n.unshift(r),lt.apply(void 0,e.__spreadArray([t,ct],n,!1))},exports.selectHttpOptionsAndBodyInternal=lt,exports.selectURI=ht,exports.serializeFetchParameter=at,exports.skipToken=yn,exports.split=Je,exports.throwServerError=Ve,exports.toPromise=function(e){var t=!1;return new Promise((function(r,n){e.subscribe({next:function(e){t||(t=!0,r(e))},error:n})}))},exports.useApolloClient=Gr,exports.useBackgroundQuery=function(t,r){void 0===r&&(r=Object.create(null));var n=Gr(r.client),i=vn(n),o=gn({client:n,query:t,options:r}),s=o.fetchPolicy,a=o.variables,u=r.queryKey,c=void 0===u?[]:u,l=p.useRef("standby"!==s);l.current||(l.current="standby"!==s);var f=e.__spreadArray([t,Wt(a)],[].concat(c),!0),h=i.getQueryRef(f,(function(){return n.watchQuery(o)})),d=p.useState((function(){return new Map([[h.key,h.promise]])})),v=d[0],y=d[1];if(h.didChangeOptions(o)){var m=h.applyOptions(o);v.set(h.key,m)}p.useEffect((function(){return h.retain()}),[h]);var g=p.useCallback((function(e){var t=h.fetchMore(e);return y((function(e){return new Map(e).set(h.key,h.promise)})),t}),[h]),b=p.useCallback((function(e){var t=h.refetch(e);return y((function(e){return new Map(e).set(h.key,h.promise)})),t}),[h]);h.promiseCache=v;var _=p.useMemo((function(){return function(e){var t;return(t={})[ln]=e,t}(h)}),[h]);return[l.current?_:void 0,{fetchMore:g,refetch:b}]},exports.useFragment=function(t){var n=Gr().cache,i=t.fragment,o=t.fragmentName,s=t.from,a=t.optimistic,u=void 0===a||a,c=e.__rest(t,["fragment","fragmentName","from","optimistic"]),l=e.__assign(e.__assign({},c),{returnPartialData:!0,id:"string"==typeof s?s:n.identify(s),query:n.getFragmentDoc(i,o),optimistic:u}),f=p.useRef(),h=n.diff(l),d=function(){var e=un(h);return f.current&&r.equal(f.current.data,e.data)?f.current:f.current=e};return Xr((function(t){var i=0,o=n.watch(e.__assign(e.__assign({},l),{immediate:!0,callback:function(e){r.equal(e,h)||(f.current=un(h=e),i=setTimeout(t))}}));return function(){o(),clearTimeout(i)}}),d,d)},exports.useLazyQuery=function(t,r){var n,i=p.useRef(),o=p.useRef(),s=p.useRef(),a=Ae(r,i.current||{}),u=null!==(n=null==a?void 0:a.query)&&void 0!==n?n:t;o.current=a,s.current=u;var c=on(Gr(r&&r.client),u),l=c.useQuery(e.__assign(e.__assign({},a),{skip:!i.current})),f=l.observable.options.initialFetchPolicy||c.getDefaultFetchPolicy(),h=Object.assign(l,{called:!!i.current}),d=p.useMemo((function(){for(var e={},t=function(t){var r=h[t];e[t]=function(){return i.current||(i.current=Object.create(null),c.forceUpdateState()),r.apply(this,arguments)}},r=0,n=an;r<n.length;r++){t(n[r])}return e}),[]);Object.assign(h,d);var v=p.useCallback((function(t){i.current=t?e.__assign(e.__assign({},t),{fetchPolicy:t.fetchPolicy||f}):{fetchPolicy:f};var r=Ae(o.current,e.__assign({query:s.current},i.current)),n=c.executeQuery(e.__assign(e.__assign({},r),{skip:!1})).then((function(e){return Object.assign(e,d)}));return n.catch((function(){})),n}),[]);return[v,h]},exports.useMutation=function(t,n){var i=Gr(null==n?void 0:n.client);rn(t,exports.DocumentType.Mutation);var o=p.useState({called:!1,loading:!1,client:i}),s=o[0],a=o[1],u=p.useRef({result:s,mutationId:0,isMounted:!0,client:i,mutation:t,options:n});Object.assign(u.current,{client:i,options:n,mutation:t});var c=p.useCallback((function(t){void 0===t&&(t={});var n=u.current,i=n.options,o=n.mutation,s=e.__assign(e.__assign({},i),{mutation:o}),c=t.client||u.current.client;u.current.result.loading||s.ignoreResults||!u.current.isMounted||a(u.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:c});var l=++u.current.mutationId,f=Ae(s,t);return c.mutate(f).then((function(e){var n,i,o=e.data,s=e.errors,h=s&&s.length>0?new rt({graphQLErrors:s}):void 0,p=t.onError||(null===(n=u.current.options)||void 0===n?void 0:n.onError);if(h&&p&&p(h,f),l===u.current.mutationId&&!f.ignoreResults){var d={called:!0,loading:!1,data:o,error:h,client:c};u.current.isMounted&&!r.equal(u.current.result,d)&&a(u.current.result=d)}var v=t.onCompleted||(null===(i=u.current.options)||void 0===i?void 0:i.onCompleted);return h||null==v||v(e.data,f),e})).catch((function(e){var n;if(l===u.current.mutationId&&u.current.isMounted){var i={loading:!1,error:e,data:void 0,called:!0,client:c};r.equal(u.current.result,i)||a(u.current.result=i)}var o=t.onError||(null===(n=u.current.options)||void 0===n?void 0:n.onError);if(o)return o(e,f),{data:void 0,errors:e};throw e}))}),[]),l=p.useCallback((function(){u.current.isMounted&&a({called:!1,loading:!1,client:i})}),[]);return p.useEffect((function(){return u.current.isMounted=!0,function(){u.current.isMounted=!1}}),[]),[c,e.__assign({reset:l},s)]},exports.useQuery=function(e,t){return void 0===t&&(t=Object.create(null)),on(Gr(t.client),e).useQuery(t)},exports.useReactiveVar=function(e){return Xr(p.useCallback((function(t){return e.onNextChange((function r(){t(),e.onNextChange(r)}))}),[e]),e,e)},exports.useReadQuery=function(e){var t=function(e){return e[ln]}(e);w(t.promiseCache,51);var r=t.promiseCache,n=t.key;r.has(n)||r.set(n,t.promise);var i=Xr(p.useCallback((function(e){return t.listen((function(r){t.promiseCache.set(t.key,r),e()}))}),[t]),(function(){return r.get(n)}),(function(){return r.get(n)})),o=cn(i);return p.useMemo((function(){return{data:o.data,networkStatus:o.networkStatus,error:mn(o)}}),[o])},exports.useSubscription=function(e,t){var n=p.useRef(!1),i=Gr(null==t?void 0:t.client);rn(e,exports.DocumentType.Subscription);var o=p.useState({loading:!(null==t?void 0:t.skip),error:void 0,data:void 0,variables:null==t?void 0:t.variables}),s=o[0],a=o[1];n.current||(n.current=!0,null==t||t.onSubscriptionData,null==t||t.onSubscriptionComplete);var u=p.useState((function(){return(null==t?void 0:t.skip)?null:i.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})})),c=u[0],l=u[1],f=p.useRef(!1);p.useEffect((function(){return function(){f.current=!0}}),[]);var h=p.useRef({client:i,subscription:e,options:t});return p.useEffect((function(){var n,o,s,u,c=null==t?void 0:t.shouldResubscribe;"function"==typeof c&&(c=!!c(t)),(null==t?void 0:t.skip)?(!(null==t?void 0:t.skip)!=!(null===(n=h.current.options)||void 0===n?void 0:n.skip)||f.current)&&(a({loading:!1,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),l(null),f.current=!1):(!1===c||i===h.current.client&&e===h.current.subscription&&(null==t?void 0:t.fetchPolicy)===(null===(o=h.current.options)||void 0===o?void 0:o.fetchPolicy)&&!(null==t?void 0:t.skip)==!(null===(s=h.current.options)||void 0===s?void 0:s.skip)&&r.equal(null==t?void 0:t.variables,null===(u=h.current.options)||void 0===u?void 0:u.variables))&&!f.current||(a({loading:!0,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),l(i.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})),f.current=!1),Object.assign(h.current,{client:i,subscription:e,options:t})}),[i,e,t,f.current]),p.useEffect((function(){if(c){var e=!1,r=c.subscribe({next:function(r){var n,o;if(!e){var s={loading:!1,data:r.data,error:void 0,variables:null==t?void 0:t.variables};a(s),(null===(n=h.current.options)||void 0===n?void 0:n.onData)?h.current.options.onData({client:i,data:s}):(null===(o=h.current.options)||void 0===o?void 0:o.onSubscriptionData)&&h.current.options.onSubscriptionData({client:i,subscriptionData:s})}},error:function(r){var n,i;e||(a({loading:!1,data:void 0,error:r,variables:null==t?void 0:t.variables}),null===(i=null===(n=h.current.options)||void 0===n?void 0:n.onError)||void 0===i||i.call(n,r))},complete:function(){var t,r;e||((null===(t=h.current.options)||void 0===t?void 0:t.onComplete)?h.current.options.onComplete():(null===(r=h.current.options)||void 0===r?void 0:r.onSubscriptionComplete)&&h.current.options.onSubscriptionComplete())}});return function(){e=!0,setTimeout((function(){r.unsubscribe()}))}}}),[c]),s},exports.useSuspenseQuery=function(t,r){void 0===r&&(r=Object.create(null));var n=Gr(r.client),i=vn(n),o=gn({client:n,query:t,options:r}),s=o.fetchPolicy,a=o.variables,u=r.queryKey,c=void 0===u?[]:u,l=e.__spreadArray([t,Wt(a)],[].concat(c),!0),f=i.getQueryRef(l,(function(){return n.watchQuery(o)})),h=p.useState((function(){return new Map([[f.key,f.promise]])})),d=h[0],v=h[1],y=d.get(f.key);f.didChangeOptions(o)&&(y=f.applyOptions(o),d.set(f.key,y)),y||(y=f.promise,d.set(f.key,y)),p.useEffect((function(){var e=f.retain(),t=f.listen((function(e){v((function(t){return new Map(t).set(f.key,e)}))}));return function(){t(),e()}}),[f]);var m=p.useMemo((function(){var e=mn(f.result);return{loading:!1,data:f.result.data,networkStatus:e?exports.NetworkStatus.error:exports.NetworkStatus.ready,error:e}}),[f.result]),g="standby"===s?m:cn(y),b=p.useCallback((function(e){var t=f.fetchMore(e);return v((function(e){return new Map(e).set(f.key,f.promise)})),t}),[f]),_=p.useCallback((function(e){var t=f.refetch(e);return v((function(e){return new Map(e).set(f.key,f.promise)})),t}),[f]),w=p.useCallback((function(e){return f.observable.subscribeToMore(e)}),[f]);return p.useMemo((function(){return{client:n,data:g.data,error:mn(g),networkStatus:g.networkStatus,fetchMore:b,refetch:_,subscribeToMore:w}}),[n,b,_,g,w])};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("ts-invariant"),r=require("@wry/equality"),n=require("graphql"),i=require("zen-observable-ts");require("symbol-observable");var o=require("optimism"),s=require("@wry/trie"),a=require("graphql-tag"),u=require("react");function c(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e)for(var r in e)t[r]=e[r];return t.default=e,Object.freeze(t)}var f=c(r),h=l(u),p="3.8.9";function d(e){try{return e()}catch(e){}}var v=d((function(){return globalThis}))||d((function(){return window}))||d((function(){return self}))||d((function(){return global}))||d((function(){return d.constructor("return this")()})),y=new Map;function m(e){var t=y.get(e)||1;return y.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function g(e,t){void 0===t&&(t=0);var r=m("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?r:t}),t).split(JSON.stringify(r)).join("<undefined>")}function b(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if("number"==typeof t){var i=t;(t=S(i))||(t=x(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var _=Object.assign((function(e,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];e||t.invariant(e,S(r,n)||x(r,n))}),{debug:b(t.invariant.debug),log:b(t.invariant.log),warn:b(t.invariant.warn),error:b(t.invariant.error)});function w(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return new t.InvariantError(S(e,r)||x(e,r))}var O=Symbol.for("ApolloErrorMessageHandler_"+p);function k(e){return"string"==typeof e?e:g(e,2).slice(0,1e3)}function S(e,t){if(void 0===t&&(t=[]),e)return v[O]&&v[O](e,t.map(k))}function x(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:p,message:e,args:t.map(k)})))}function q(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments,n=e.name.value;_(r&&1===r.length,67,n);var i=r[0];_(i.name&&"if"===i.name.value,68,n);var o=i.value;_(o&&("Variable"===o.kind||"BooleanValue"===o.kind),69,n),t.push({directive:e,ifArgument:i})}}));return t}(r).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?(i=t&&t[n.value.name.value],_(void 0!==i,66,r.name.value)):i=n.value.value,"skip"===r.name.value?!i:i}))}function E(e,t,r){var i=new Set(e),o=i.size;return n.visit(t,{Directive:function(e){if(i.delete(e.name.value)&&(!r||!i.size))return n.BREAK}}),r?!i.size:i.size<o}function R(e){return e&&E(["client","export"],e,!0)}var P="function"==typeof WeakMap&&"ReactNative"!==d((function(){return navigator.product})),Q="function"==typeof WeakSet,D="function"==typeof Symbol&&"function"==typeof Symbol.for,T=D&&Symbol.asyncIterator,C="function"==typeof d((function(){return window.document.createElement})),F=d((function(){return navigator.userAgent.indexOf("jsdom")>=0}))||!1,M=C&&!F;function I(e){return null!==e&&"object"==typeof e}function N(t,r){var n=r,i=[];return t.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw w(70,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&i.push(e)})),void 0===n&&(_(1===i.length,71,i.length),n=i[0].name.value),e.__assign(e.__assign({},t),{definitions:e.__spreadArray([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)})}function j(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function A(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=e.name.value;if("function"==typeof t)return t(r);var n=t&&t[r];return _(n,72,r),n||null;default:return null}}function L(e){return{__ref:String(e)}}function V(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function z(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return z(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return z(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw w(81,t.value,r.kind);e[t.value]=null}}var W=["connection","include","skip","client","rest","export","nonreactive"],B=Object.assign((function(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(U(i),")")}return r.connection.key}var o=e;if(t){var s=U(t);o+="(".concat(s,")")}return r&&Object.keys(r).forEach((function(e){-1===W.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(U(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=U;return U=e,t}}),U=function(e){return JSON.stringify(e,K)};function K(e,t){return I(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function H(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return z(r,n,i,t)})),r}return null}function J(e){return e.alias?e.alias.value:e.name.value}function G(e,t,r){for(var n,i=0,o=t.selections;i<o.length;i++){if(Y(u=o[i])){if("__typename"===u.name.value)return e[J(u)]}else n?n.push(u):n=[u]}if("string"==typeof e.__typename)return e.__typename;if(n)for(var s=0,a=n;s<a.length;s++){var u,c=G(e,A(u=a[s],r).selectionSet,r);if("string"==typeof c)return c}}function Y(e){return"Field"===e.kind}function X(e){_(e&&"Document"===e.kind,73);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw w(74,e.kind);return e}));return _(t.length<=1,75,t.length),e}function $(e){return X(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Z(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function ee(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function te(e){var t=$(e);return _(t&&"query"===t.operation,76),t}function re(e){var t;X(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw w(80)}function ne(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&z(t,e.variable.name,e.defaultValue)})),t}function ie(e){return e}var oe=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=Q?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),!1!==t.cache&&(this.stableCacheKeys=new s.Trie(P,(function(e){return{key:e}})))}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(ie,{cache:!1})},e.split=function(t,r,n){return void 0===n&&(n=e.identity()),new e((function(e){return(t(e)?r:n).transformDocument(e)}),{cache:!1})},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.getStableCacheEntry(e);if(t&&t.value)return t.value;X(e);var r=this.transform(e);return this.resultCache.add(r),t&&(t.value=r),r},e.prototype.concat=function(t){var r=this;return new e((function(e){return t.transformDocument(r.transformDocument(e))}),{cache:!1})},e.prototype.getStableCacheEntry=function(e){if(this.stableCacheKeys){var t=this.getCacheKey(e);return t?(_(Array.isArray(t),65),this.stableCacheKeys.lookupArray(t)):void 0}},e}(),se=P?new WeakMap:void 0,ae=function(e){var t;return(t=null==se?void 0:se.get(e))||(t=n.print(e),null==se||se.set(e,t)),t},ue=Array.isArray;function ce(e){return Array.isArray(e)&&e.length>0}var le={kind:n.Kind.FIELD,name:{kind:n.Kind.NAME,value:"__typename"}};function fe(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===n.Kind.FRAGMENT_SPREAD&&fe(t[e.name.value],t)}))}function he(e){return fe($(e)||function(e){_("Document"===e.kind,77),_(e.definitions.length<=1,78);var t=e.definitions[0];return _("FragmentDefinition"===t.kind,79),t}(e),j(ee(e)))?null:e}function pe(e){var t=new Map;return function(r){void 0===r&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function de(t,r){X(r);for(var i=pe(""),o=pe(""),s=function(e){for(var t=0,r=void 0;t<e.length&&(r=e[t]);++t)if(!ue(r)){if(r.kind===n.Kind.OPERATION_DEFINITION)return i(r.name&&r.name.value);if(r.kind===n.Kind.FRAGMENT_DEFINITION)return o(r.name.value)}return null},a=0,u=r.definitions.length-1;u>=0;--u)r.definitions[u].kind===n.Kind.OPERATION_DEFINITION&&++a;var c,l,f,h=(c=t,l=new Map,f=new Map,c.forEach((function(e){e&&(e.name?l.set(e.name,e):e.test&&f.set(e.test,e))})),function(e){var t=l.get(e.name.value);return!t&&f.size&&f.forEach((function(r,n){n(e)&&(t=r)})),t}),p=function(e){return ce(e)&&e.map(h).some((function(e){return e&&e.remove}))},d=new Map,v=!1,y={enter:function(e){if(p(e.directives))return v=!0,null}},m=n.visit(r,{Field:y,InlineFragment:y,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,r,n,i){var o=s(i);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,r,n,i){if(p(e.directives))return v=!0,null;var o=s(i);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,r,n){d.set(JSON.stringify(n),e)},leave:function(e,t,r,i){return e===d.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every((function(e){return e.kind===n.Kind.FIELD&&"__typename"===e.name.value}))?(o(e.name.value).removed=!0,v=!0,null):void 0}},Directive:{leave:function(e){if(h(e))return v=!0,null}}});if(!v)return r;var g=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){g(o(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},b=new Set;m.definitions.forEach((function(e){e.kind===n.Kind.OPERATION_DEFINITION?g(i(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){b.add(e)})):e.kind!==n.Kind.FRAGMENT_DEFINITION||0!==a||o(e.name.value).removed||b.add(e.name.value)})),b.forEach((function(e){g(o(e)).fragmentSpreads.forEach((function(e){b.add(e)}))}));var _={enter:function(e){if(t=e.name.value,!b.has(t)||o(t).removed)return null;var t}};return he(n.visit(m,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(t){if(t.variableDefinitions){var r=g(i(t.name&&t.name.value)).transitiveVars;if(r.size<t.variableDefinitions.length)return e.__assign(e.__assign({},t),{variableDefinitions:t.variableDefinitions.filter((function(e){return r.has(e.variable.name.value)}))})}}}}))}var ve=Object.assign((function(t){return n.visit(t,{SelectionSet:{enter:function(t,r,i){if(!i||i.kind!==n.Kind.OPERATION_DEFINITION){var o=t.selections;if(o)if(!o.some((function(e){return Y(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var s=i;if(!(Y(s)&&s.directives&&s.directives.some((function(e){return"export"===e.name.value}))))return e.__assign(e.__assign({},t),{selections:e.__spreadArray(e.__spreadArray([],o,!0),[le],!1)})}}}}})}),{added:function(e){return e===le}});function ye(t){return"query"===re(t).operation?t:n.visit(t,{OperationDefinition:{enter:function(t){return e.__assign(e.__assign({},t),{operation:"query"})}}})}function me(e){return X(e),de([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var ge=Object.prototype.hasOwnProperty;function be(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _e(e)}function _e(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Oe,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var we=function(e,t,r){return this.merge(e[r],t[r])},Oe=function(){function t(e){void 0===e&&(e=we),this.reconciler=e,this.isObject=I,this.pastCopies=new Set}return t.prototype.merge=function(t,r){for(var n=this,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return I(r)&&I(t)?(Object.keys(r).forEach((function(o){if(ge.call(t,o)){var s=t[o];if(r[o]!==s){var a=n.reconciler.apply(n,e.__spreadArray([t,r,o],i,!1));a!==s&&((t=n.shallowCopyForMerge(t))[o]=a)}}else(t=n.shallowCopyForMerge(t))[o]=r[o]})),t):r},t.prototype.shallowCopyForMerge=function(t){return I(t)&&(this.pastCopies.has(t)||(t=Array.isArray(t)?t.slice(0):e.__assign({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},t}();function ke(e){var t=Promise.resolve(e);return t.status="fulfilled",t.value=e,t}var Se=Object.prototype.toString;function xe(e){return qe(e)}function qe(e,t){switch(Se.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=qe(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=qe(e[r],t)})),n;default:return e}}function Ee(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function Re(e,t,r){return new i.Observable((function(n){var i={then:function(e){return new Promise((function(t){return t(e())}))}};function o(e,t){return function(r){if(e){var o=function(){return n.closed?0:e(r)};i=i.then(o,o).then((function(e){return n.next(e)}),(function(e){return n.error(e)}))}else n[t](r)}}var s={next:o(t,"next"),error:o(r,"error"),complete:function(){i.then((function(){return n.complete()}))}},a=e.subscribe(s);return function(){return a.unsubscribe()}}))}function Pe(e){function t(t){Object.defineProperty(e,t,{value:i.Observable})}return D&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Qe(e){return e&&"function"==typeof e.then}var De=function(t){function r(e){var r=t.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),Ee(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),Ee(r.observers,"error",e))},complete:function(){var e=r,t=e.sub,n=e.sources;if(null!==t){var i=(void 0===n?[]:n).shift();i?Qe(i)?i.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=i.subscribe(r.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),Ee(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof e&&(e=[new i.Observable(e)]),Qe(e)?e.then((function(e){return r.start(e)}),r.handlers.error):r.start(e),r}return e.__extends(r,t),r.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},r.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},r.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},r.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},r.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},r.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},r}(i.Observable);function Te(e){return"incremental"in e}function Ce(e){return I(e)&&"payload"in e}function Fe(e,t){var r=e,n=new Oe;return Te(t)&&ce(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var s=i[o],a=!isNaN(+s)?[]:{};a[s]=t,t=a}r=n.merge(r,t)})),r}function Me(e){return ce(Ie(e))}function Ie(e){var t=ce(e.errors)?e.errors.slice(0):[];return Te(e)&&ce(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function Ne(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}function je(t,r){return Ne(t,r,r.variables&&{variables:Ne(e.__assign(e.__assign({},t&&t.variables),r.variables))})}function Ae(e){return new i.Observable((function(t){t.error(e)}))}Pe(De);var Le=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function Ve(e,t){return t?t(e):i.Observable.of()}function ze(e){return"function"==typeof e?new Be(e):e}function We(e){return e.request.length<=1}var Be=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t((function(){return i.Observable.of()}))},t.from=function(e){return 0===e.length?t.empty():e.map(ze).reduce((function(e,t){return e.concat(t)}))},t.split=function(e,r,n){var o=ze(r),s=ze(n||new t(Ve));return We(o)&&We(s)?new t((function(t){return e(t)?o.request(t)||i.Observable.of():s.request(t)||i.Observable.of()})):new t((function(t,r){return e(t)?o.request(t,r)||i.Observable.of():s.request(t,r)||i.Observable.of()}))},t.execute=function(t,r){return t.request(function(t,r){var n=e.__assign({},t);return Object.defineProperty(r,"setContext",{enumerable:!1,value:function(t){n="function"==typeof t?e.__assign(e.__assign({},n),t(n)):e.__assign(e.__assign({},n),t)}}),Object.defineProperty(r,"getContext",{enumerable:!1,value:function(){return e.__assign({},n)}}),r}(r.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Z(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw w(43,i)}return e}(r))))||i.Observable.of()},t.concat=function(e,r){var n=ze(e);if(We(n))return n;var o=ze(r);return We(o)?new t((function(e){return n.request(e,(function(e){return o.request(e)||i.Observable.of()}))||i.Observable.of()})):new t((function(e,t){return n.request(e,(function(e){return o.request(e,t)||i.Observable.of()}))||i.Observable.of()}))},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Ve)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,t){throw w(36)},t.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}(),Ue=Be.empty,Ke=Be.from,He=Be.split,Je=Be.concat,Ge=Be.execute;function Ye(e){var t=null,r=null,n=!1,i=[],o=[];function s(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function a(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function u(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",s),e.removeListener("error",a),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",s),e.on("error",a),e.on("end",u),e.on("finish",u),e.on("close",u);var c={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return T&&(c[Symbol.asyncIterator]=function(){return this}),c}function Xe(e){var t={next:function(){return e.read()}};return T&&(t[Symbol.asyncIterator]=function(){return this}),t}function $e(e){var t,r,n=e;if(e.body&&(n=e.body),function(e){return!(!T||!e[Symbol.asyncIterator])}(n))return r=n[Symbol.asyncIterator](),(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t;if(function(e){return!!e.getReader}(n))return Xe(n.getReader());if(function(e){return!!e.stream}(n))return Xe(n.stream().getReader());if(function(e){return!!e.arrayBuffer}(n))return function(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise((function(t,r){e.then((function(e){t({value:e,done:!1})})).catch(r)})))}};return T&&(r[Symbol.asyncIterator]=function(){return this}),r}(n.arrayBuffer());if(function(e){return!!e.pipe}(n))return Ye(n);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Ze=Symbol();function et(e){return e.hasOwnProperty("graphQLErrors")}var tt=function(t){function r(n){var i,o,s=n.graphQLErrors,a=n.protocolErrors,u=n.clientErrors,c=n.networkError,l=n.errorMessage,f=n.extraInfo,h=t.call(this,l)||this;return h.name="ApolloError",h.graphQLErrors=s||[],h.protocolErrors=a||[],h.clientErrors=u||[],h.networkError=c||null,h.message=l||(i=h,o=e.__spreadArray(e.__spreadArray(e.__spreadArray([],i.graphQLErrors,!0),i.clientErrors,!0),i.protocolErrors,!0),i.networkError&&o.push(i.networkError),o.map((function(e){return I(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=f,h.__proto__=r.prototype,h}return e.__extends(r,t),r}(Error),rt=Object.prototype.hasOwnProperty;function nt(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function it(e,t){if(e.status>=300){Le(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function ot(e){return function(t){return t.text().then((function(e){return it(t,e)})).then((function(r){return Array.isArray(r)||rt.call(r,"data")||rt.call(r,"errors")||Le(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),r}))}}var st=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=w(39,t,e.message);throw n.parseError=e,n}return r},at={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},ut=function(e,t){return t(e)};function ct(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o={},s={};n.forEach((function(t){o=e.__assign(e.__assign(e.__assign({},o),t.options),{headers:e.__assign(e.__assign({},o.headers),t.headers)}),t.credentials&&(o.credentials=t.credentials),s=e.__assign(e.__assign({},s),t.http)})),o.headers&&(o.headers=function(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]=e[t]})),r}var n=Object.create(null);Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]={originalName:t,value:e[t]}}));var i=Object.create(null);return Object.keys(n).forEach((function(e){i[n[e].originalName]=n[e].value})),i}(o.headers,s.preserveHeaderCase));var a=t.operationName,u=t.extensions,c=t.variables,l=t.query,f={operationName:a,variables:c};return s.includeExtensions&&(f.extensions=u),s.includeQuery&&(f.query=r(l,ae)),{options:o,body:f}}var lt=function(e){if(!e&&"undefined"==typeof fetch)throw w(37)},ft=function(e,t){var r=e.getContext().uri;return r||("function"==typeof t?t(e):t||"/graphql")};function ht(e,t){var r=[],n=function(e,t){r.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=st(t.variables,"Variables map")}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=st(t.extensions,"Extensions map")}catch(e){return{parseError:e}}n("extensions",o)}var s="",a=e,u=e.indexOf("#");-1!==u&&(s=e.substr(u),a=e.substr(0,u));var c=-1===a.indexOf("?")?"?":"&";return{newURI:a+c+r.join("&")+s}}var pt=d((function(){return fetch})),dt=function(t){void 0===t&&(t={});var r=t.uri,o=void 0===r?"/graphql":r,s=t.fetch,a=t.print,u=void 0===a?ut:a,c=t.includeExtensions,l=t.preserveHeaderCase,f=t.useGETForQueries,h=t.includeUnusedVariables,p=void 0!==h&&h,v=e.__rest(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);var y={http:{includeExtensions:c,preserveHeaderCase:l},options:v.fetchOptions,credentials:v.credentials,headers:v.headers};return new Be((function(t){var r=ft(t,o),a=t.getContext(),c={};if(a.clientAwareness){var l=a.clientAwareness,h=l.name,v=l.version;h&&(c["apollographql-client-name"]=h),v&&(c["apollographql-client-version"]=v)}var m=e.__assign(e.__assign({},c),a.headers),g={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m};if(E(["client"],t.query)){var b=me(t.query);if(!b)return Ae(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));t.query=b}var _,w,O,k,S,x=ct(t,u,at,y,g),q=x.options,R=x.body;R.variables&&!p&&(R.variables=(_=R.variables,w=t.query,O=e.__assign({},_),k=new Set(Object.keys(_)),n.visit(w,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&k.delete(e.name.value)}}),k.forEach((function(e){delete O[e]})),O)),q.signal||"undefined"==typeof AbortController||(S=new AbortController,q.signal=S.signal);var P,Q="OperationDefinition"===(P=re(t.query)).kind&&"subscription"===P.operation,D=E(["defer"],t.query);if(f&&!t.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(q.method="GET"),D||Q){q.headers=q.headers||{};var T="multipart/mixed;";Q?T+="boundary=graphql;subscriptionSpec=1.0,application/json":D&&(T+="deferSpec=20220824,application/json"),q.headers.accept=T}if("GET"===q.method){var C=ht(r,R),F=C.newURI,M=C.parseError;if(M)return Ae(M);r=F}else try{q.body=st(R,"Payload")}catch(M){return Ae(M)}return new i.Observable((function(n){var i=s||d((function(){return fetch}))||pt,o=n.next.bind(n);return i(r,q).then((function(r){var n;t.setContext({response:r});var i=null===(n=r.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(t,r){var n;return e.__awaiter(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,f,h,p,d,v,y,m,g,b,_,w,O,k,S,x,q;return e.__generator(this,(function(E){switch(E.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");i=new TextDecoder("utf-8"),o=null===(n=t.headers)||void 0===n?void 0:n.get("content-type"),s="boundary=",a=(null==o?void 0:o.includes(s))?null==o?void 0:o.substring((null==o?void 0:o.indexOf(s))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="\r\n--".concat(a),c="",l=$e(t),f=!0,E.label=1;case 1:return f?[4,l.next()]:[3,3];case 2:for(h=E.sent(),p=h.value,d=h.done,v="string"==typeof p?p:i.decode(p),y=c.length-u.length+1,f=!d,m=(c+=v).indexOf(u,y);m>-1;){if(g=void 0,x=[c.slice(0,m),c.slice(m+u.length)],c=x[1],b=(g=x[0]).indexOf("\r\n\r\n"),_=nt(g.slice(0,b)),(w=_["content-type"])&&-1===w.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(O=g.slice(b))if(k=it(t,O),Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k||"payload"in k)Ce(k)?(S={},"payload"in k&&(S=e.__assign({},k.payload)),"errors"in k&&(S=e.__assign(e.__assign({},S),{extensions:e.__assign(e.__assign({},"extensions"in S?S.extensions:null),(q={},q[Ze]=k.errors,q))})),r(S)):r(k);else if(1===Object.keys(k).length&&"hasNext"in k&&!k.hasNext)return[2];m=c.indexOf(u)}return[3,1];case 3:return[2]}}))}))}(r,o):ot(t)(r).then(o)})).then((function(){S=void 0,n.complete()})).catch((function(e){S=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){S&&S.abort()}}))}))},vt=function(t){function r(e){void 0===e&&(e={});var r=t.call(this,dt(e).request)||this;return r.options=e,r}return e.__extends(r,t),r}(Be),yt=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=o.wrap(N)}return t.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},t.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(t,r){return void 0===r&&(r=!!t.optimistic),this.read(e.__assign(e.__assign({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(t,r){return void 0===r&&(r=!!t.optimistic),this.read(e.__assign(e.__assign({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},t.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=e.__rest(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,o=t.fragmentName,s=e.__rest(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(s,{query:this.getFragmentDoc(i,o),dataId:r,result:n}))},t.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),o=r(i);return null==o?i:(n.writeQuery(e.__assign(e.__assign({},t),{data:o})),o)}})},t.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),o=r(i);return null==o?i:(n.writeFragment(e.__assign(e.__assign({},t),{data:o})),o)}})},t}();exports.Cache=void 0,exports.Cache||(exports.Cache={});var mt=function(t){function r(e,n,i,o){var s,a=t.call(this,e)||this;if(a.message=e,a.path=n,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var u=a.path.length-1;u>=0;--u)a.missing=((s={})[a.path[u]]=a.missing,s)}else a.missing=a.path;return a.__proto__=r.prototype,a}return e.__extends(r,t),r}(Error),gt=Object.prototype.hasOwnProperty;function bt(e){return null==e}function _t(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=bt(n)?bt(i)?void 0:{_id:i}:{id:n}),bt(n)&&!bt(i)&&(n=i),!bt(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var wt={dataIdFromObject:_t,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Ot(e){var t=e.canonizeResults;return void 0===t?wt.canonizeResults:t}var kt=/^[_a-z][_0-9a-z]*/i;function St(e){var t=e.match(kt);return t?t[0]:e}function xt(e,t,r){return!!I(t)&&(ue(t)?t.every((function(t){return xt(e,t,r)})):e.selections.every((function(e){if(Y(e)&&q(e,r)){var n=J(e);return gt.call(t,n)&&(!e.selectionSet||xt(e.selectionSet,t[n],r))}return!0})))}function qt(e){return I(e)&&!V(e)&&!ue(e)}function Et(e,t){var r=j(ee(e));return{fragmentMap:r,lookupFragment:function(e){var n=r[e];return!n&&t&&(n=t.lookup(e)),n||null}}}var Rt=Object.create(null),Pt=function(){return Rt},Qt=Object.create(null),Dt=function(){function t(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return V(e)?r.get(e.__ref,t):e&&e[t]},this.canRead=function(e){return V(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return L(e);if(V(e))return e;var n=r.policies.identify(e)[0];if(n){var i=L(n);return t&&r.merge(n,e),i}}}return t.prototype.toObject=function(){return e.__assign({},this.data)},t.prototype.has=function(e){return void 0!==this.lookup(e,!0)},t.prototype.get=function(e,t){if(this.group.depend(e,t),gt.call(this.data,e)){var r=this.data[e];if(r&>.call(r,t))return r[t]}return"__typename"===t&>.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Mt?this.parent.get(e,t):void 0},t.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),gt.call(this.data,e)?this.data[e]:this instanceof Mt?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},t.prototype.merge=function(e,t){var r,n=this;V(e)&&(e=e.__ref),V(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){_("string"==typeof r,1);var s=new Oe(Nt).merge(i,o);if(this.data[r]=s,s!==i&&(delete this.refs[r],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==s[e]){a[e]=1;var t=St(e);t===e||n.policies.hasKeyArgs(s.__typename,t)||(a[t]=1),void 0!==s[e]||n instanceof Mt||delete s[e]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(e){return n.group.dirty(r,e)}))}}},t.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var o=Object.create(null),s=!1,a=!0,u={DELETE:Rt,INVALIDATE:Qt,isReference:V,toReference:this.toReference,canRead:this.canRead,readField:function(e,r){return n.policies.readField("string"==typeof e?{fieldName:e,from:r||L(t)}:e,{store:n})}};if(Object.keys(i).forEach((function(c){var l=St(c),f=i[c];if(void 0!==f){var h="function"==typeof r?r:r[c]||r[l];if(h){var p=h===Pt?Rt:h(f,e.__assign(e.__assign({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(t,c)}));if(p===Qt)n.group.dirty(t,c);else if(p===Rt&&(p=void 0),p!==f)o[c]=p,s=!0,f=p}void 0!==f&&(a=!1)}})),s)return this.merge(t,o),a&&(this instanceof Mt?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},t.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),s=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,s?((n={})[s]=Pt,n):Pt)}return!1},t.prototype.evict=function(e,t){var r=!1;return e.id&&(gt.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof Mt&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){gt.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},t.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach((function(e){t&>.call(t,e)||r.delete(e)})),t){var n=t.__META,i=e.__rest(t,["__META"]);Object.keys(i).forEach((function(e){r.merge(e,i[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},t.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Mt?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){gt.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof Mt;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},t.prototype.findChildRefIds=function(e){if(!gt.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){V(e)&&(t[e.__ref]=!0),I(e)&&Object.keys(e).forEach((function(t){var r=e[t];I(r)&&n.add(r)}))}))}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),Tt=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?o.dep():null,this.keyMaker=new s.Trie(P)},e.prototype.depend=function(e,t){if(this.d){this.d(Ct(e,t));var r=St(t);r!==t&&this.d(Ct(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Ct(e,t),"__exists"===t?"forget":"setDirty")},e}();function Ct(e,t){return t+"#"+e}function Ft(e,t){jt(e)&&e.group.depend(t,"__exists")}!function(t){var r=function(t){function r(e){var r=e.policies,n=e.resultCaching,i=void 0===n||n,o=e.seed,a=t.call(this,r,new Tt(i))||this;return a.stump=new It(a),a.storageTrie=new s.Trie(P),o&&a.replace(o),a}return e.__extends(r,t),r.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=r}(Dt||(Dt={}));var Mt=function(t){function n(e,r,n,i){var o=t.call(this,r.policies,i)||this;return o.id=e,o.parent=r,o.replay=n,o.group=i,n(o),o}return e.__extends(n,t),n.prototype.addLayer=function(e,t){return new n(e,this,t,this.group)},n.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var i=t.data[e],o=n.lookup(e);o?i?i!==o&&Object.keys(i).forEach((function(n){r.equal(i[n],o[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(o).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},n.prototype.toObject=function(){return e.__assign(e.__assign({},this.parent.toObject()),this.data)},n.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return gt.call(this.data,r)?e.__assign(e.__assign({},n),t.prototype.findChildRefIds.call(this,r)):n},n.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},n}(Dt),It=function(t){function r(e){return t.call(this,"EntityStore.Stump",e,(function(){}),new Tt(e.group.caching,e.group))||this}return e.__extends(r,t),r.prototype.removeLayer=function(){return this},r.prototype.merge=function(e,t){return this.parent.merge(e,t)},r}(Mt);function Nt(e,t,n){var i=e[n],o=t[n];return r.equal(i,o)?i:o}function jt(e){return!!(e instanceof Dt&&e.group.caching)}var At,Lt,Vt=function(){function t(){this.known=new(Q?WeakSet:Set),this.pool=new s.Trie(P),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return I(e)&&this.known.has(e)},t.prototype.pass=function(t){if(I(t)){var r=function(t){return I(t)?ue(t)?t.slice(0):e.__assign({__proto__:Object.getPrototypeOf(t)},t):t}(t);return this.passes.set(r,t),r}return t},t.prototype.admit=function(e){var t=this;if(I(e)){var r=this.passes.get(e);if(r)return r;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(a=this.pool.lookupArray(n)).array||this.known.add(a.array=n),a.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],s=this.sortedKeys(e);o.push(s.json);var a,u=o.length;if(s.sorted.forEach((function(r){o.push(t.admit(e[r]))})),!(a=this.pool.lookupArray(o)).object){var c=a.object=Object.create(i);this.known.add(c),s.sorted.forEach((function(e,t){c[e]=o[u+t]}))}return a.object}}return e},t.prototype.sortedKeys=function(e){var t=Object.keys(e),r=this.pool.lookupArray(t);if(!r.keys){t.sort();var n=JSON.stringify(t);(r.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,r.keys={sorted:t,json:n})}return r.keys},t}(),zt=Object.assign((function(e){if(I(e)){void 0===At&&Wt();var t=At.admit(e),r=Lt.get(t);return void 0===r&&Lt.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)}),{reset:Wt});function Wt(){At=new Vt,Lt=new(P?WeakMap:Map)}function Bt(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Ut=function(){function t(t){var r=this;this.knownResults=new(P?WeakMap:Map),this.config=Ne(t,{addTypename:!1!==t.addTypename,canonizeResults:Ot(t)}),this.canon=t.canon||new Vt,this.executeSelectionSet=o.wrap((function(t){var n,i=t.context.canonizeResults,o=Bt(t);o[3]=!i;var s=(n=r.executeSelectionSet).peek.apply(n,o);return s?i?e.__assign(e.__assign({},s),{result:r.canon.admit(s.result)}):s:(Ft(t.context.store,t.enclosingRef.__ref),r.execSelectionSetImpl(t))}),{max:this.config.resultCacheMaxSize,keyArgs:Bt,makeCacheKey:function(e,t,r,n){if(jt(r.store))return r.store.makeCacheKey(e,V(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=o.wrap((function(e){return Ft(e.context.store,e.enclosingRef.__ref),r.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(jt(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Vt},t.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,o=void 0===i?"ROOT_QUERY":i,s=t.variables,a=t.returnPartialData,u=void 0===a||a,c=t.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;s=e.__assign(e.__assign({},ne(te(n))),s);var h,p=L(o),d=this.executeSelectionSet({selectionSet:re(n).selectionSet,objectOrReference:p,enclosingRef:p,context:e.__assign({store:r,query:n,policies:f,variables:s,varString:zt(s),canonizeResults:l},Et(n,this.config.fragments))});if(d.missing&&(h=[new mt(Kt(d.missing),d.missing,n,s)],!u))throw h[0];return{result:d.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,t,r,n){if(jt(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,i=e.objectOrReference,o=e.enclosingRef,s=e.context;if(V(i)&&!s.policies.rootTypenamesById[i.__ref]&&!s.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var a,u=s.variables,c=s.policies,l=s.store.getFieldValue(i,"__typename"),f=[],h=new Oe;function p(e,t){var r;return e.missing&&(a=h.merge(a,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&f.push({__typename:l});var d=new Set(r.selections);d.forEach((function(e){var r,v;if(q(e,u))if(Y(e)){var y=c.readField({fieldName:e.name.value,field:e,variables:s.variables,from:i},s),m=J(e);void 0===y?ve.added(e)||(a=h.merge(a,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(V(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),r))):ue(y)?y=p(t.executeSubSelectedArray({field:e,array:y,enclosingRef:o,context:s}),m):e.selectionSet?null!=y&&(y=p(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:y,enclosingRef:V(y)?y:o,context:s}),m)):s.canonizeResults&&(y=t.canon.pass(y)),void 0!==y&&f.push(((v={})[m]=y,v))}else{var g=A(e,s.lookupFragment);if(!g&&e.kind===n.Kind.FRAGMENT_SPREAD)throw w(9,e.name.value);g&&c.fragmentMatches(g,l)&&g.selectionSet.selections.forEach(d.add,d)}}));var v={result:_e(f),missing:a},y=s.canonizeResults?this.canon.admit(v):v;return y.result&&this.knownResults.set(y.result,r),y},t.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,s=e.context,a=new Oe;function u(e,r){var n;return e.missing&&(t=a.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(e,t){return null===e?null:ue(e)?u(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:s}),t):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:V(e)?e:o,context:s}),t):e})),{result:s.canonizeResults?this.canon.admit(i):i,missing:t}},t}();function Kt(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var Ht=new o.Slot,Jt=new WeakMap;function Gt(e){var t=Jt.get(e);return t||Jt.set(e,t={vars:new Set,dep:o.dep()}),t}function Yt(e){Gt(e).vars.forEach((function(t){return t.forgetCache(e)}))}function Xt(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){Gt(e).dep.dirty(n),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var s=Array.from(r);r.clear(),s.forEach((function(t){return t(e)}))}}else{var a=Ht.getValue();a&&(i(a),Gt(a).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),Gt(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}var $t=Object.create(null);function Zt(e){var t=JSON.stringify(e);return $t[t]||($t[t]=Object.create(null))}function er(e){var t=Zt(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=rr(e,(function(e){var i=or(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&>.call(t,e[0])&&(i=or(t,e,ir)),_(void 0!==i,4,e.join("."),t),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function tr(e){var t=Zt(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,s=rr(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return or(t,e)}else{var s=r.slice(1);if(i&>.call(i,s)){var a=e.slice(0);return a[0]=s,or(i,a)}}else if(n&&ce(n.directives)){var u=r.slice(1),c=n.directives.find((function(e){return e.name.value===u})),l=c&&H(c,i);return l&&or(l,e.slice(1))}})),a=JSON.stringify(s);return(t||"{}"!==a)&&(o+=":"+a),o})}function rr(e,t){var r=new Oe;return nr(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var s=n.length-1;s>=0;--s)(i={})[n[s]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function nr(e){var t=Zt(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){ue(t)?(nr(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),ue(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function ir(e,t){return e[t]}function or(e,t,r){return r=r||ir,sr(t.reduce((function e(t,n){return ue(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function sr(e){return I(e)?ue(e)?e.map(sr):rr(Object.keys(e).sort(),(function(t){return or(e,t)})):e}function ar(e){return void 0!==e.args?e.args:e.field?H(e.field,e.variables):null}B.setStringify(zt);var ur=function(){},cr=function(e,t){return t.fieldName},lr=function(e,t,r){return(0,r.mergeObjects)(e,t)},fr=function(e,t){return t},hr=function(){function t(t){this.config=t,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=e.__assign({dataIdFromObject:_t},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return t.prototype.identify=function(t,r){var n,i=this,o=r&&(r.typename||(null===(n=r.storeObject)||void 0===n?void 0:n.__typename))||t.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var s,a=r&&r.storeObject||t,u=e.__assign(e.__assign({},r),{typename:o,storeObject:a,readField:r&&r.readField||function(){var e=dr(arguments,a);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),c=o&&this.getTypePolicy(o),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(e.__assign(e.__assign({},t),a),u);if(!ue(f)){s=f;break}l=er(f)}return s=s?String(s):void 0,u.keyObject?[s,u.keyObject]:[s]},t.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach((function(n){var i=t[n],o=i.queryType,s=i.mutationType,a=i.subscriptionType,u=e.__rest(i,["queryType","mutationType","subscriptionType"]);o&&r.setRootTypename("Query",n),s&&r.setRootTypename("Mutation",n),a&&r.setRootTypename("Subscription",n),gt.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]}))},t.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function s(e,t){e.merge="function"==typeof t?t:!0===t?lr:!1===t?fr:e.merge}s(n,t.merge),n.keyFn=!1===i?ur:ue(i)?er(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var a=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===a?cr:ue(a)?tr(a):"function"==typeof a?a:n.keyFn,"function"==typeof u&&(n.read=u),s(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||cr)}))},t.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(_(!n||n===e,5,e),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},t.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(kt);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},t.prototype.getTypePolicy=function(t){var r=this;if(!gt.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach((function(e,n){if(e.test(t)){var o=r.supertypeMap.get(n);o&&o.forEach((function(e){return i.add(e)}))}}))),i&&i.size&&i.forEach((function(t){var i=r.getTypePolicy(t),o=i.fields,s=e.__rest(i,["fields"]);Object.assign(n,s),Object.assign(n.fields,o)}))}var o=this.toBeAdded[t];return o&&o.length&&o.splice(0).forEach((function(e){r.updateTypePolicy(t,e)})),this.typePolicies[t]},t.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),a=[s],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&a.indexOf(t)<0&&a.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l<a.length;++l){var f=a[l];if(f.has(o))return s.has(o)||s.add(o),!0;f.forEach(u),c&&l===a.length-1&&xt(e.selectionSet,r,n)&&(c=!1,!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&u(r)})))}return!1},t.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},t.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},a=ar(e);o;){var u=o(a,s);if(!ue(u)){t=u||n;break}o=tr(u)}return void 0===t&&(t=e.field?function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return z(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return z(n,r,i,t)}))),B(e.name.value,n,r)}(e.field,e.variables):B(n,ar(e))),!1===t?n:n===St(t)?t:n+":"+t},t.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),o=St(i),s=t.store.getFieldValue(r,i),a=this.getFieldPolicy(e.typename,o,!1),u=a&&a.read;if(u){var c=pr(this,r,e,t,t.store.getStorage(V(r)?r.__ref:r,i));return Ht.withValue(this.cache,u,[s,c])}return s}},t.prototype.getReadFunction=function(e,t){var r=this.getFieldPolicy(e,t,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},t.prototype.runMergeFunction=function(e,t,r,n,i){var o=r.field,s=r.typename,a=r.merge;return a===lr?vr(n.store)(e,t):a===fr?t:(n.overwrite&&(e=void 0),a(e,t,pr(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,i||Object.create(null))))},t}();function pr(e,t,r,n,i){var o=e.getStoreFieldName(r),s=St(o),a=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:ar(r),field:r.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:V,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(dr(arguments,t,a),n)},mergeObjects:vr(n.store)}}function dr(t,r,n){var i,o=t[0],s=t[1],a=t.length;return"string"==typeof o?i={fieldName:o,from:a>1?s:r}:(i=e.__assign({},o),gt.call(i,"from")||(i.from=r)),void 0===i.variables&&(i.variables=n),i}function vr(t){return function(r,n){if(ue(r)||ue(n))throw w(8);if(I(r)&&I(n)){var i=t.getFieldValue(r,"__typename"),o=t.getFieldValue(n,"__typename");if(i&&o&&i!==o)return n;if(V(r)&&qt(n))return t.merge(r.__ref,n),r;if(qt(r)&&V(n))return t.merge(r,n.__ref),n;if(qt(r)&&qt(n))return e.__assign(e.__assign({},r),n)}return n}}function yr(t,r,n){var i="".concat(r).concat(n),o=t.flavors.get(i);return o||t.flavors.set(i,o=t.clientOnly===r&&t.deferred===n?t:e.__assign(e.__assign({},t),{clientOnly:r,deferred:n})),o}var mr=function(){function t(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return t.prototype.writeToStore=function(t,r){var n=this,i=r.query,o=r.result,s=r.dataId,a=r.variables,u=r.overwrite,c=$(i),l=new Oe;a=e.__assign(e.__assign({},ne(c)),a);var f=e.__assign(e.__assign({store:t,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:zt(a)},Et(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:o||Object.create(null),dataId:s,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:f});if(!V(h))throw w(11,o);return f.incomingById.forEach((function(e,r){var i=e.storeObject,o=e.mergeTree,s=(e.fieldNodeSet,L(r));if(o&&o.map.size){var a=n.applyMerges(o,s,i,f);if(V(a))return;i=a}t.merge(r,i)})),t.retain(h.__ref),h},t.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,o=t.selectionSet,s=t.context,a=t.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||G(i,o,s.fragmentMap)||n&&s.store.get(n,"__typename");"string"==typeof l&&(c.__typename=l);var f=function(){var t=dr(arguments,c,s.variables);if(V(t.from)){var r=s.incomingById.get(t.from.__ref);if(r){var n=u.readField(e.__assign(e.__assign({},t),{from:r.storeObject}),s);if(void 0!==n)return n}}return u.readField(t,s)},h=new Set;this.flattenFields(o,i,s,l).forEach((function(e,t){var n,o=J(t),s=i[o];if(h.add(t),void 0!==s){var p=u.getStoreFieldName({typename:l,fieldName:t.name.value,field:t,variables:e.variables}),d=br(a,p),v=r.processFieldValue(s,t,t.selectionSet?yr(e,!1,!1):e,d),y=void 0;t.selectionSet&&(V(v)||qt(v))&&(y=f("__typename",v));var m=u.getMergeFunction(l,t.name.value,y);m?d.info={field:t,typename:l,merge:m}:Or(a,p),c=e.merge(c,((n={})[p]=v,n))}else 0}));try{var p=u.identify(i,{typename:l,selectionSet:o,fragmentMap:s.fragmentMap,storeObject:c,readField:f}),d=p[0],v=p[1];n=n||d,v&&(c=s.merge(c,v))}catch(e){if(!n)throw e}if("string"==typeof n){var y=L(n),m=s.written[n]||(s.written[n]=[]);if(m.indexOf(o)>=0)return y;if(m.push(o),this.reader&&this.reader.isFresh(i,y,o,s))return y;var g=s.incomingById.get(n);return g?(g.storeObject=s.merge(g.storeObject,c),g.mergeTree=_r(g.mergeTree,a),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):s.incomingById.set(n,{storeObject:c,mergeTree:wr(a)?void 0:a,fieldNodeSet:h}),y}return c},t.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?ue(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,r,br(n,o));return Or(n,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},t.prototype.flattenFields=function(e,t,r,i){void 0===i&&(i=G(t,e,r.fragmentMap));var o=new Map,a=this.cache.policies,u=new s.Trie(!1);return function e(s,c){var l=u.lookup(s,c.clientOnly,c.deferred);l.visited||(l.visited=!0,s.selections.forEach((function(s){if(q(s,r.variables)){var u=c.clientOnly,l=c.deferred;if(u&&l||!ce(s.directives)||s.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(u=!0),"defer"===t){var n=H(e,r.variables);n&&!1===n.if||(l=!0)}})),Y(s)){var f=o.get(s);f&&(u=u&&f.clientOnly,l=l&&f.deferred),o.set(s,yr(r,u,l))}else{var h=A(s,r.lookupFragment);if(!h&&s.kind===n.Kind.FRAGMENT_SPREAD)throw w(13,s.name.value);h&&a.fragmentMatches(h,i,t,r.variables)&&e(h.selectionSet,yr(r,u,l))}}})))}(e,r),o},t.prototype.applyMerges=function(t,r,n,i,o){var s,a=this;if(t.map.size&&!V(n)){var u,c=ue(n)||!V(r)&&!qt(r)?void 0:r,l=n;c&&!o&&(o=[V(c)?c.__ref:c]);var f=function(e,t){return ue(e)?"number"==typeof t?e[t]:void 0:i.store.getFieldValue(e,String(t))};t.map.forEach((function(e,t){var r=f(c,t),n=f(l,t);if(void 0!==n){o&&o.push(t);var s=a.applyMerges(e,r,n,i,o);s!==n&&(u=u||new Map).set(t,s),o&&_(o.pop()===t)}})),u&&(n=ue(l)?l.slice(0):e.__assign({},l),u.forEach((function(e,t){n[t]=e})))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,o&&(s=i.store).getStorage.apply(s,o)):n},t}(),gr=[];function br(e,t){var r=e.map;return r.has(t)||r.set(t,gr.pop()||{map:new Map}),r.get(t)}function _r(t,r){if(t===r||!r||wr(r))return t;if(!t||wr(t))return r;var n=t.info&&r.info?e.__assign(e.__assign({},t.info),r.info):t.info||r.info,i=t.map.size&&r.map.size,o={info:n,map:i?new Map:t.map.size?t.map:r.map};if(i){var s=new Set(r.map.keys());t.map.forEach((function(e,t){o.map.set(t,_r(e,r.map.get(t))),s.delete(t)})),s.forEach((function(e){o.map.set(e,_r(r.map.get(e),t.map.get(e)))}))}return o}function wr(e){return!e||!(e.info||e.map.size)}function Or(e,t){var r=e.map,n=r.get(t);n&&wr(n)&&(gr.push(n),r.delete(t))}new Set;var kr,Sr=function(t){function n(e){void 0===e&&(e={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new oe(ve),r.assumeImmutableResults=!0,r.makeVar=Xt,r.txCount=0,r.config=function(e){return Ne(wt,e)}(e),r.addTypename=!!r.config.addTypename,r.policies=new hr({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.__extends(n,t),n.prototype.init=function(){var e=this.data=new Dt.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},n.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new mr(this,this.storeReader=new Ut({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Ot(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=o.wrap((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(jt(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,zt({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},n.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},n.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},n.prototype.read=function(t){var r=t.returnPartialData,n=void 0!==r&&r;try{return this.storeReader.diffQueryAgainstStore(e.__assign(e.__assign({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof mt)return null;throw e}},n.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},n.prototype.modify=function(e){if(gt.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},n.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(e.__assign(e.__assign({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},n.prototype.watch=function(e){var t=this;return this.watches.size||function(e){Gt(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&Yt(t),t.maybeBroadcastWatch.forget(e)}},n.prototype.gc=function(e){zt.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},n.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},n.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},n.prototype.identify=function(e){if(V(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){}},n.prototype.evict=function(t){if(!t.id){if(gt.call(t,"id"))return!1;t=e.__assign(e.__assign({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},n.prototype.reset=function(e){var t=this;return this.init(),zt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Yt(this)):this.broadcastWatches(),Promise.resolve()},n.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},n.prototype.batch=function(t){var r,n=this,i=t.update,o=t.optimistic,s=void 0===o||o,a=t.removeOptimistic,u=t.onWatchUpdated,c=function(e){var t=n,o=t.data,s=t.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return r=i(n)}finally{--n.txCount,n.data=o,n.optimisticData=s}},l=new Set;return u&&!this.txCount&&this.broadcastWatches(e.__assign(e.__assign({},t),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof s?this.optimisticData=this.optimisticData.addLayer(s,c):!1===s?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),u&&l.size?(this.broadcastWatches(e.__assign(e.__assign({},t),{onWatchUpdated:function(e,t){var r=u.call(this,e,t);return!1!==r&&l.delete(e),r}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(t),r},n.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},n.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},n.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},n.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},n.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},n.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,i=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(i.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,i,n))||n&&r.equal(n.result,i.result)||e.callback(e.lastDiff=i,n)},n}(yt);function xr(e){return!!e&&e<7}function qr(e){return 7===e||8===e}function Er(t,r,n,i){var o=r.data,s=e.__rest(r,["data"]),a=n.data,u=e.__rest(n,["data"]);return f(s,u)&&Rr(re(t).selectionSet,o,a,{fragmentMap:j(ee(t)),variables:i})}function Rr(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every((function(e){if(i.has(e))return!0;if(i.add(e),!q(e,n.variables))return!0;if(Pr(e))return!0;if(Y(e)){var o=J(e),s=t&&t[o],a=r&&r[o],u=e.selectionSet;if(!u)return f(s,a);var c=Array.isArray(s),l=Array.isArray(a);if(c!==l)return!1;if(c&&l){var h=s.length;if(a.length!==h)return!1;for(var p=0;p<h;++p)if(!Rr(u,s[p],a[p],n))return!1;return!0}return Rr(u,s,a,n)}var d=A(e,n.fragmentMap);return d?!!Pr(d)||Rr(d.selectionSet,t,r,n):void 0}))}function Pr(e){return!!e.directives&&e.directives.some(Qr)}function Qr(e){return"nonreactive"===e.name.value}exports.NetworkStatus=void 0,(kr=exports.NetworkStatus||(exports.NetworkStatus={}))[kr.loading=1]="loading",kr[kr.setVariables=2]="setVariables",kr[kr.fetchMore=3]="fetchMore",kr[kr.refetch=4]="refetch",kr[kr.poll=6]="poll",kr[kr.ready=7]="ready",kr[kr.error=8]="error";var Dr=Object.assign,Tr=(Object.hasOwnProperty,function(t){function n(r){var n=r.queryManager,i=r.queryInfo,o=r.options,s=t.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Fr)}catch(e){}var r=!s.observers.size;s.observers.add(e);var n=s.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&s.reobserve().catch((function(){})),function(){s.observers.delete(e)&&!s.observers.size&&s.tearDownQuery()}}))||this;s.observers=new Set,s.subscriptions=new Set,s.queryInfo=i,s.queryManager=n,s.waitForOwnResult=Mr(o.fetchPolicy),s.isTornDown=!1;var a=n.defaultOptions.watchQuery,u=(void 0===a?{}:a).fetchPolicy,c=void 0===u?"cache-first":u,l=o.fetchPolicy,f=void 0===l?c:l,h=o.initialFetchPolicy,p=void 0===h?"standby"===f?c:f:h;s.options=e.__assign(e.__assign({},o),{initialFetchPolicy:p,fetchPolicy:f}),s.queryId=i.queryId||n.generateQueryId();var d=$(s.query);return s.queryName=d&&d.name&&d.name.value,s}return e.__extends(n,t),Object.defineProperty(n.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),n.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},n.prototype.getCurrentResult=function(t){void 0===t&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||exports.NetworkStatus.ready,o=e.__assign(e.__assign({},n),{loading:xr(i),networkStatus:i}),s=this.options.fetchPolicy,a=void 0===s?"cache-first":s;if(Mr(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(o.data=u.result),r.equal(o.data,{})&&(o.data=void 0),u.complete?(delete o.partial,!u.complete||o.networkStatus!==exports.NetworkStatus.loading||"cache-first"!==a&&"cache-only"!==a||(o.networkStatus=exports.NetworkStatus.ready,o.loading=!1)):o.partial=!0}return t&&this.updateLastResult(o),o},n.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Er(this.query,this.last.result,e,this.variables):!r.equal(this.last.result,e))||t&&!r.equal(this.last.variables,t))},n.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||r.equal(n.variables,this.variables)))return n[e]},n.prototype.getLastResult=function(e){return this.getLast("result",e)},n.prototype.getLastError=function(e){return this.getLast("error",e)},n.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},n.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},n.prototype.refetch=function(t){var n={pollInterval:0},i=this.options.fetchPolicy;return n.fetchPolicy="cache-and-network"===i?i:"no-cache"===i?"no-cache":"network-only",t&&!r.equal(this.options.variables,t)&&(n.variables=this.options.variables=e.__assign(e.__assign({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(n,exports.NetworkStatus.refetch)},n.prototype.fetchMore=function(t){var r=this,n=e.__assign(e.__assign({},t.query?t:e.__assign(e.__assign(e.__assign(e.__assign({},this.options),{query:this.options.query}),t),{variables:e.__assign(e.__assign({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"});n.query=this.transformDocument(n.query);var i=this.queryManager.generateQueryId();this.lastQuery=t.query?this.transformDocument(this.options.query):n.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=exports.NetworkStatus.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set;return this.queryManager.fetchQuery(i,n,exports.NetworkStatus.fetchMore).then((function(e){return r.queryManager.removeQuery(i),o.networkStatus===exports.NetworkStatus.fetchMore&&(o.networkStatus=s),r.queryManager.cache.batch({update:function(i){var o=t.updateQuery;o?i.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},(function(t){return o(t,{fetchMoreResult:e.data,variables:n.variables})})):i.writeQuery({query:n.query,variables:n.variables,data:e.data})},onWatchUpdated:function(e){a.add(e.query)}}),e})).finally((function(){a.has(r.query)||Cr(r)}))},n.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},n.prototype.setOptions=function(e){return this.reobserve(e)},n.prototype.silentSetOptions=function(e){var t=Ne(this.options,e||{});Dr(this.options,t)},n.prototype.setVariables=function(e){return r.equal(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},exports.NetworkStatus.setVariables):Promise.resolve())},n.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},n.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},n.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},n.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},n.prototype.fetch=function(e,t,r){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,r)},n.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){_(r,22),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(xr(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},exports.NetworkStatus.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},n.prototype.updateLastResult=function(t,n){void 0===n&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!r.equal(n,this.last.variables)&&(i=void 0),this.last=e.__assign({result:this.queryManager.assumeImmutableResults?t:xe(t),variables:n},i?{error:i}:null)},n.prototype.reobserveAsConcast=function(t,n){var i=this;this.isTornDown=!1;var o=n===exports.NetworkStatus.refetch||n===exports.NetworkStatus.fetchMore||n===exports.NetworkStatus.poll,s=this.options.variables,a=this.options.fetchPolicy,u=Ne(this.options,t||{}),c=o?u:Dr(this.options,u),l=this.transformDocument(c.query);this.lastQuery=l,o||(this.updatePolling(),t&&t.variables&&!r.equal(t.variables,s)&&"standby"!==c.fetchPolicy&&c.fetchPolicy===a&&(this.applyNextFetchPolicy("variables-changed",c),void 0===n&&(n=exports.NetworkStatus.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Mr(c.fetchPolicy));var f=function(){i.concast===d&&(i.waitForOwnResult=!1)},h=c.variables&&e.__assign({},c.variables),p=this.fetch(c,n,l),d=p.concast,v=p.fromLink,y={next:function(e){f(),i.reportResult(e,h)},error:function(e){f(),i.reportError(e,h)}};return o||!v&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=y),d.addObserver(y),d},n.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},n.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.last;this.resetLastResults();var n=this.subscribe.apply(this,e);return this.last=r,n},n.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},n.prototype.reportResult=function(e,t){var r=this.getLastError(),n=this.isDifferentFromLastResult(e,t);(r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(r||n)&&Ee(this.observers,"next",e)},n.prototype.reportError=function(t,r){var n=e.__assign(e.__assign({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:exports.NetworkStatus.error,loading:!1});this.updateLastResult(n,r),Ee(this.observers,"error",this.last.error=t)},n.prototype.hasObservers=function(){return this.observers.size>0},n.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},n.prototype.transformDocument=function(e){return this.queryManager.transform(e)},n}(i.Observable));function Cr(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,t){return this.nextFetchPolicy=n,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,t):r}}):e.reobserve()}function Fr(e){}function Mr(e){return"network-only"===e||"no-cache"===e||"standby"===e}Pe(Tr);var Ir=function(){function t(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return t.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=be(t.resolvers,e)})):this.resolvers=be(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(t){var r=t.document,n=t.remoteResult,i=t.context,o=t.variables,s=t.onlyRunForcedResolvers,a=void 0!==s&&s;return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){return r?[2,this.resolveDocument(r,n.data,i,o,this.fragmentMatcher,a).then((function(t){return e.__assign(e.__assign({},n),{data:t.result})}))]:[2,n]}))}))},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return E(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return me(e)},t.prototype.prepareContext=function(t){var r=this.cache;return e.__assign(e.__assign({},t),{cache:r,getCacheKey:function(e){return r.identify(e)}})},t.prototype.addExportedVariables=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(i){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,r)||{},this.prepareContext(n),r).then((function(t){return e.__assign(e.__assign({},r),t.exportedVariables)}))]:[2,e.__assign({},r)]}))}))},t.prototype.shouldForceResolvers=function(e){var t=!1;return n.visit(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return n.BREAK}}}),t},t.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:ye(e),variables:t,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(t,r,n,i,o,s){return void 0===n&&(n={}),void 0===i&&(i={}),void 0===o&&(o=function(){return!0}),void 0===s&&(s=!1),e.__awaiter(this,void 0,void 0,(function(){var a,u,c,l,f,h,p,d,v,y;return e.__generator(this,(function(m){return a=re(t),u=ee(t),c=j(u),l=this.collectSelectionsToResolve(a,c),f=a.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(p=this).cache,v=p.client,y={fragmentMap:c,context:e.__assign(e.__assign({},n),{cache:d,client:v}),variables:i,fragmentMatcher:o,defaultOperationType:h,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:s},!1,[2,this.resolveSelectionSet(a.selectionSet,false,r,y).then((function(e){return{result:e,exportedVariables:y.exportedVariables}}))]}))}))},t.prototype.resolveSelectionSet=function(t,r,n,i){return e.__awaiter(this,void 0,void 0,(function(){var o,s,a,u,c,l=this;return e.__generator(this,(function(f){return o=i.fragmentMap,s=i.context,a=i.variables,u=[n],c=function(t){return e.__awaiter(l,void 0,void 0,(function(){var c,l;return e.__generator(this,(function(e){return(r||i.selectionsToResolve.has(t))&&q(t,a)?Y(t)?[2,this.resolveField(t,r,n,i).then((function(e){var r;void 0!==e&&u.push(((r={})[J(t)]=e,r))}))]:(!function(e){return"InlineFragment"===e.kind}(t)?(c=o[t.name.value],_(c,18,t.name.value)):c=t,c&&c.typeCondition&&(l=c.typeCondition.name.value,i.fragmentMatcher(n,l,s))?[2,this.resolveSelectionSet(c.selectionSet,r,n,i).then((function(e){u.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(t.selections.map(c)).then((function(){return _e(u)}))]}))}))},t.prototype.resolveField=function(t,r,n,i){return e.__awaiter(this,void 0,void 0,(function(){var o,s,a,u,c,l,f,h,p,d=this;return e.__generator(this,(function(e){return n?(o=i.variables,s=t.name.value,a=J(t),u=s!==a,c=n[a]||n[s],l=Promise.resolve(c),i.onlyRunForcedResolvers&&!this.shouldForceResolvers(t)||(f=n.__typename||i.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(p=h[u?s:a])&&(l=Promise.resolve(Ht.withValue(this.cache,p,[n,H(t,o),i.context,{field:t,fragmentMap:i.fragmentMap}])))),[2,l.then((function(e){var n,o;if(void 0===e&&(e=c),t.directives&&t.directives.forEach((function(t){"export"===t.name.value&&t.arguments&&t.arguments.forEach((function(t){"as"===t.name.value&&"StringValue"===t.value.kind&&(i.exportedVariables[t.value.value]=e)}))})),!t.selectionSet)return e;if(null==e)return e;var s=null!==(o=null===(n=t.directives)||void 0===n?void 0:n.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(e)?d.resolveSubSelectedArray(t,r||s,e,i):t.selectionSet?d.resolveSelectionSet(t.selectionSet,r||s,e,i):void 0}))]):[2,null]}))}))},t.prototype.resolveSubSelectedArray=function(e,t,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(e,t,r,n):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,r,n):void 0})))},t.prototype.collectSelectionsToResolve=function(e,t){var r=function(e){return!Array.isArray(e)},i=this.selectionsToResolveCache;return function e(o){if(!i.has(o)){var s=new Set;i.set(o,s),n.visit(o,{Directive:function(e,t,i,o,a){"client"===e.name.value&&a.forEach((function(e){r(e)&&n.isSelectionNode(e)&&s.add(e)}))},FragmentSpread:function(i,o,a,u,c){var l=t[i.name.value];_(l,19,i.name.value);var f=e(l);f.size>0&&(c.forEach((function(e){r(e)&&n.isSelectionNode(e)&&s.add(e)})),s.add(i),f.forEach((function(e){s.add(e)})))}})}return i.get(o)}(e)},t}(),Nr=new(P?WeakMap:Map);function jr(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return Nr.set(e,(Nr.get(e)+1)%1e15),r.apply(this,arguments)})}function Ar(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Lr=function(){function t(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;Nr.has(r)||(Nr.set(r,0),jr(r,"evict"),jr(r,"modify"),jr(r,"reset"))}return t.prototype.init=function(e){var t=e.networkStatus||exports.NetworkStatus.loading;return this.variables&&this.networkStatus!==exports.NetworkStatus.loading&&!r.equal(this.variables,e.variables)&&(t=exports.NetworkStatus.setVariables),r.equal(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Ar(this),this.dirty=!1},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&r.equal(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},t.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},t.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||r.equal(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},t.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Cr(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Ar(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(xr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(t){var n=this;void 0===t&&(t=this.variables);var i=this.observableQuery;if(!i||"no-cache"!==i.options.fetchPolicy){var o=e.__assign(e.__assign({},this.getDiffOptions(t)),{watcher:this,callback:function(e){return n.setDiff(e)}});this.lastWatch&&r.equal(o,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=o))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Nr.get(this.cache)&&r.equal(t,n.variables)&&r.equal(e.data,n.result.data))},t.prototype.markResult=function(e,t,n,i){var o=this,s=new Oe,a=ce(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&ce(e.incremental)){var u=Fe(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=s.merge(c.result,e.data)}this.graphQLErrors=a,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==i&&(Vr(e,n.errorPolicy)?this.cache.performTransaction((function(s){if(o.shouldWrite(e,n.variables))s.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===i}),o.lastWrite={result:e,variables:n.variables,dmCount:Nr.get(o.cache)};else if(o.lastDiff&&o.lastDiff.diff.complete)return void(e.data=o.lastDiff.diff.result);var a=o.getDiffOptions(n.variables),u=s.diff(a);!o.stopped&&r.equal(o.variables,n.variables)&&o.updateWatch(n.variables),o.updateLastDiff(u,a),u.complete&&(e.data=u.result)})):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=exports.NetworkStatus.ready},t.prototype.markError=function(e){return this.networkStatus=exports.NetworkStatus.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Vr(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!Me(e);return!n&&r&&e.data&&(n=!0),n}var zr=Object.prototype.hasOwnProperty,Wr=function(){function t(e){var t=e.cache,r=e.link,n=e.defaultOptions,i=e.documentTransform,o=e.queryDeduplication,s=void 0!==o&&o,a=e.onBroadcast,u=e.ssrMode,c=void 0!==u&&u,l=e.clientAwareness,f=void 0===l?{}:l,h=e.localState,p=e.assumeImmutableResults,d=void 0===p?!!t.assumeImmutableResults:p,v=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(P?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map;var y=new oe((function(e){return v.cache.transformDocument(e)}),{cache:!1});this.cache=t,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=s,this.clientAwareness=f,this.localState=h||new Ir({cache:t}),this.ssrMode=c,this.assumeImmutableResults=d,this.documentTransform=i?y.concat(i).concat(y):y,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(w(25))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},t.prototype.mutate=function(t){var r,n,i=t.mutation,o=t.variables,s=t.optimisticResponse,a=t.updateQueries,u=t.refetchQueries,c=void 0===u?[]:u,l=t.awaitRefetchQueries,f=void 0!==l&&l,h=t.update,p=t.onQueryUpdated,d=t.fetchPolicy,v=void 0===d?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.fetchPolicy)||"network-only":d,y=t.errorPolicy,m=void 0===y?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":y,g=t.keepRootFields,b=t.context;return e.__awaiter(this,void 0,void 0,(function(){var t,r,n,u;return e.__generator(this,(function(l){switch(l.label){case 0:return _(i,26),_("network-only"===v||"no-cache"===v,27),t=this.generateMutationId(),i=this.cache.transformForLink(this.transform(i)),r=this.getDocumentInfo(i).hasClientExports,o=this.getVariables(i,o),r?[4,this.localState.addExportedVariables(i,o,b)]:[3,2];case 1:o=l.sent(),l.label=2;case 2:return n=this.mutationStore&&(this.mutationStore[t]={mutation:i,variables:o,loading:!0,error:null}),s&&this.markMutationOptimistic(s,{mutationId:t,document:i,variables:o,fetchPolicy:v,errorPolicy:m,context:b,updateQueries:a,update:h,keepRootFields:g}),this.broadcastQueries(),u=this,[2,new Promise((function(r,l){return Re(u.getObservableFromLink(i,e.__assign(e.__assign({},b),{optimisticResponse:s}),o,!1),(function(r){if(Me(r)&&"none"===m)throw new tt({graphQLErrors:Ie(r)});n&&(n.loading=!1,n.error=null);var l=e.__assign({},r);return"function"==typeof c&&(c=c(l)),"ignore"===m&&Me(l)&&delete l.errors,u.markMutationResult({mutationId:t,result:l,document:i,variables:o,fetchPolicy:v,errorPolicy:m,context:b,update:h,updateQueries:a,awaitRefetchQueries:f,refetchQueries:c,removeOptimistic:s?t:void 0,onQueryUpdated:p,keepRootFields:g})})).subscribe({next:function(e){u.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||r(e)},error:function(e){n&&(n.loading=!1,n.error=e),s&&u.cache.removeOptimistic(t),u.broadcastQueries(),l(e instanceof tt?e:new tt({networkError:e}))}})}))]}}))}))},t.prototype.markMutationResult=function(t,r){var n=this;void 0===r&&(r=this.cache);var i=t.result,o=[],s="no-cache"===t.fetchPolicy;if(!s&&Vr(i,t.errorPolicy)){if(Te(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Te(i)&&ce(i.incremental)){var a=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),u=void 0;a.result&&(u=Fe(a.result,i)),void 0!==u&&(i.data=u,o.push({result:u,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var c=t.updateQueries;c&&this.queries.forEach((function(e,t){var s=e.observableQuery,a=s&&s.queryName;if(a&&zr.call(c,a)){var u=c[a],l=n.queries.get(t),f=l.document,h=l.variables,p=r.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),d=p.result;if(p.complete&&d){var v=u(d,{mutationResult:i,queryName:f&&Z(f)||void 0,queryVariables:h});v&&o.push({result:v,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(o.length>0||t.refetchQueries||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(r){s||o.forEach((function(e){return r.write(e)}));var a,u=t.update,c=!(Te(a=i)||function(e){return"hasNext"in e&&"data"in e}(a))||Te(i)&&!i.hasNext;if(u){if(!s){var l=r.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(i=e.__assign(e.__assign({},i),{data:l.result}))&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}c&&u(r,i,{context:t.context,variables:t.variables})}s||t.keepRootFields||!c||r.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then((function(){return i}))}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(t,r){var n=this,i="function"==typeof t?t(r.variables):t;return this.cache.recordOptimisticTransaction((function(t){try{n.markMutationResult(e.__assign(e.__assign({},r),{result:{data:i}}),t)}catch(e){}}),r.mutationId)},t.prototype.fetchQuery=function(e,t,r){return this.fetchConcastWithInfo(e,t,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},t.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:R(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:E(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:de([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:ne($(t)),asQuery:e.__assign(e.__assign({},t),{definitions:t.definitions.map((function(t){return"OperationDefinition"===t.kind&&"query"!==t.operation?e.__assign(e.__assign({},t),{operation:"query"}):t}))})};r.set(t,n)}return r.get(t)},t.prototype.getVariables=function(t,r){return e.__assign(e.__assign({},this.getDocumentInfo(t).defaultVars),r)},t.prototype.watchQuery=function(t){var r=this.transform(t.query);void 0===(t=e.__assign(e.__assign({},t),{variables:this.getVariables(r,t.variables)})).notifyOnNetworkStatusChange&&(t.notifyOnNetworkStatusChange=!1);var n=new Lr(this),i=new Tr({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(t,r){var n=this;return void 0===r&&(r=this.generateQueryId()),_(t.query,28),_("Document"===t.query.kind,29),_(!t.returnPartialData,30),_(!t.pollInterval,31),this.fetchQuery(r,e.__assign(e.__assign({},t),{query:this.transform(t.query)})).finally((function(){return n.stopQuery(r)}))},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},t.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(w(32)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=exports.NetworkStatus.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(t){var r=this;void 0===t&&(t="active");var n=new Map,i=new Map,o=new Set;return Array.isArray(t)&&t.forEach((function(e){var t;"string"==typeof e?i.set(e,!1):I(t=e)&&"Document"===t.kind&&Array.isArray(t.definitions)?i.set(r.transform(e),!1):I(e)&&e.query&&o.add(e)})),this.queries.forEach((function(e,r){var o=e.observableQuery,s=e.document;if(o){if("all"===t)return void n.set(r,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===t&&!o.hasObservers())return;("active"===t||a&&i.has(a)||s&&i.has(s))&&(n.set(r,o),a&&i.set(a,!0),s&&i.set(s,!0))}})),o.size&&o.forEach((function(t){var i=m("legacyOneTimeQuery"),o=r.getQuery(i).init({document:t.query,variables:t.variables}),s=new Tr({queryManager:r,queryInfo:o,options:e.__assign(e.__assign({},t),{fetchPolicy:"network-only"})});_(s.queryId===i),o.setObservableQuery(s),n.set(i,s)})),n},t.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,o=e.errorPolicy,s=void 0===o?"none":o,a=e.variables,u=e.context,c=void 0===u?{}:u;r=this.transform(r),a=this.getVariables(r,a);var l=function(e){return t.getObservableFromLink(r,c,e).map((function(i){"no-cache"!==n&&(Vr(i,s)&&t.cache.write({query:r,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var o=Me(i),a=function(e){return!!e.extensions&&Array.isArray(e.extensions[Ze])}(i);if(o||a){var u={};if(o&&(u.graphQLErrors=i.errors),a&&(u.protocolErrors=i.extensions[Ze]),"none"===s||a)throw new tt(u)}return"ignore"===s&&delete i.errors,i}))};if(this.getDocumentInfo(r).hasClientExports){var f=this.localState.addExportedVariables(r,a,c).then(l);return new i.Observable((function(e){var t=null;return f.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return l(a)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(t,r,n,o){var s,a,u=this;void 0===o&&(o=null!==(s=null==r?void 0:r.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var c=this.getDocumentInfo(t),l=c.serverQuery,f=c.clientQuery;if(l){var h=this.inFlightLinkObservables,p=this.link,d={query:l,variables:n,operationName:Z(l)||void 0,context:this.prepareContext(e.__assign(e.__assign({},r),{forceFetch:!o}))};if(r=d.context,o){var v=ae(l),y=h.get(v)||new Map;h.set(v,y);var m=zt(n);if(!(a=y.get(m))){var g=new De([Ge(p,d)]);y.set(m,a=g),g.beforeNext((function(){y.delete(m)&&y.size<1&&h.delete(v)}))}}else a=new De([Ge(p,d)])}else a=new De([i.Observable.of({data:{}})]),r=this.prepareContext(r);return f&&(a=Re(a,(function(e){return u.localState.runResolvers({document:f,remoteResult:e,context:r,variables:n})}))),a},t.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(r.query);return Re(this.getObservableFromLink(i,r.context,r.variables),(function(o){var s=Ie(o),a=s.length>0;if(n>=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new tt({graphQLErrors:s}));e.markResult(o,i,r,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:exports.NetworkStatus.ready};return a&&"ignore"!==r.errorPolicy&&(u.errors=s,u.networkStatus=exports.NetworkStatus.error),u}),(function(t){var r=et(t)?t:new tt({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},t.prototype.fetchConcastWithInfo=function(e,t,r,n){var i=this;void 0===r&&(r=exports.NetworkStatus.loading),void 0===n&&(n=t.query);var o,s,a=this.getVariables(n,t.variables),u=this.getQuery(e),c=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?c&&c.fetchPolicy||"cache-first":l,h=t.errorPolicy,p=void 0===h?c&&c.errorPolicy||"none":h,d=t.returnPartialData,v=void 0!==d&&d,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,g=t.context,b=void 0===g?{}:g,_=Object.assign({},t,{query:n,variables:a,fetchPolicy:f,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:m,context:b}),w=function(e){_.variables=e;var n=i.fetchQueryByPolicy(u,_,r);return"standby"!==_.fetchPolicy&&n.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",t),n},O=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){O(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(_.query).hasClientExports)o=new De(this.localState.addExportedVariables(_.query,_.variables,_.context).then(w).then((function(e){return e.sources}))),s=!0;else{var k=w(_.variables);s=k.fromLink,o=new De(k.sources)}return o.promise.then(O,O),{concast:o,fromLink:s}},t.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,s=e.removeOptimistic,a=void 0===s?o?m("refetchQueries"):void 0:s,u=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){c.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof Lr&&e.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),c.size&&c.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,s=e.diff;if(u){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}n=u(i,s,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),a&&this.cache.removeOptimistic(a),l},t.prototype.fetchQueryByPolicy=function(t,r,n){var o=this,s=r.query,a=r.variables,u=r.fetchPolicy,c=r.refetchWritePolicy,l=r.errorPolicy,f=r.returnPartialData,h=r.context,p=r.notifyOnNetworkStatusChange,d=t.networkStatus;t.init({document:s,variables:a,networkStatus:n});var v=function(){return t.getDiff()},y=function(r,n){void 0===n&&(n=t.networkStatus||exports.NetworkStatus.loading);var u=r.result;var c=function(t){return i.Observable.of(e.__assign({data:t,loading:xr(n),networkStatus:n},r.complete?null:{partial:!0}))};return u&&o.getDocumentInfo(s).hasForcedResolvers?o.localState.runResolvers({document:s,remoteResult:{data:u},context:h,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data||void 0)})):"none"===l&&n===exports.NetworkStatus.refetch&&Array.isArray(r.missing)?c(void 0):c(u)},m="no-cache"===u?0:n===exports.NetworkStatus.refetch&&"merge"!==c?1:2,g=function(){return o.getResultsFromLink(t,m,{query:s,variables:a,context:h,fetchPolicy:u,errorPolicy:l})},b=p&&"number"==typeof d&&d!==n&&xr(n);switch(u){default:case"cache-first":return(_=v()).complete?{fromLink:!1,sources:[y(_,t.markReady())]}:f||b?{fromLink:!0,sources:[y(_),g()]}:{fromLink:!0,sources:[g()]};case"cache-and-network":var _;return(_=v()).complete||f||b?{fromLink:!0,sources:[y(_),g()]}:{fromLink:!0,sources:[g()]};case"cache-only":return{fromLink:!1,sources:[y(v(),t.markReady())]};case"network-only":return b?{fromLink:!0,sources:[y(v()),g()]}:{fromLink:!0,sources:[g()]};case"no-cache":return b?{fromLink:!0,sources:[y(t.getDiff()),g()]}:{fromLink:!0,sources:[g()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Lr(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(t){void 0===t&&(t={});var r=this.localState.prepareContext(t);return e.__assign(e.__assign({},r),{clientAwareness:this.clientAwareness})},t}(),Br=function(){function t(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw w(15);var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,s=e.documentTransform,a=e.ssrMode,u=void 0!==a&&a,c=e.ssrForceFetchDelay,l=void 0===c?0:c,f=e.connectToDevTools,h=void 0===f?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:f,d=e.queryDeduplication,v=void 0===d||d,y=e.defaultOptions,m=e.assumeImmutableResults,g=void 0===m?o.assumeImmutableResults:m,b=e.resolvers,_=e.typeDefs,O=e.fragmentMatcher,k=e.name,S=e.version,x=e.link;x||(x=r?new vt({uri:r,credentials:n,headers:i}):Be.empty()),this.link=x,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=v,this.defaultOptions=y||Object.create(null),this.typeDefs=_,l&&setTimeout((function(){return t.disableNetworkFetches=!1}),l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=p,this.localState=new Ir({cache:o,client:this,resolvers:b,fragmentMatcher:O}),this.queryManager=new Wr({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,documentTransform:s,queryDeduplication:v,ssrMode:u,clientAwareness:{name:k,version:S},localState:this.localState,assumeImmutableResults:g,onBroadcast:h?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),h&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if("object"==typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=je(this.defaultOptions.watchQuery,t)),!this.disableNetworkFetches||"network-only"!==t.fetchPolicy&&"cache-and-network"!==t.fetchPolicy||(t=e.__assign(e.__assign({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},t.prototype.query=function(t){return this.defaultOptions.query&&(t=je(this.defaultOptions.query,t)),_("cache-and-network"!==t.fetchPolicy,16),this.disableNetworkFetches&&"network-only"===t.fetchPolicy&&(t=e.__assign(e.__assign({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=je(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},t.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},t.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},t.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Ge(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},t.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},t.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){})),i},t.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}(),Ur=D?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Kr(){_("createContext"in h,45);var e=h.createContext[Ur];return e||(Object.defineProperty(h.createContext,Ur,{value:e=h.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var Hr=Kr;function Jr(e){var t=h.useContext(Kr()),r=e||t.client;return _(!!r,49),r}var Gr,Yr=h.useSyncExternalStore||function(e,t,r){var n=t();var i=h.useState({inst:{value:n,getSnapshot:t}}),o=i[0].inst,s=i[1];return M?h.useLayoutEffect((function(){Object.assign(o,{value:n,getSnapshot:t}),Xr(o)&&s({inst:o})}),[e,n,t]):Object.assign(o,{value:n,getSnapshot:t}),h.useEffect((function(){return Xr(o)&&s({inst:o}),e((function(){Xr(o)&&s({inst:o})}))}),[e]),n};function Xr(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch(e){return!0}}exports.DocumentType=void 0,(Gr=exports.DocumentType||(exports.DocumentType={}))[Gr.Query=0]="Query",Gr[Gr.Mutation=1]="Mutation",Gr[Gr.Subscription=2]="Subscription";var $r=new Map;function Zr(e){var t;switch(e){case exports.DocumentType.Query:t="Query";break;case exports.DocumentType.Mutation:t="Mutation";break;case exports.DocumentType.Subscription:t="Subscription"}return t}function en(e){var t,r,n=$r.get(e);if(n)return n;_(!!e&&!!e.kind,59,e);for(var i=[],o=[],s=[],a=[],u=0,c=e.definitions;u<c.length;u++){var l=c[u];if("FragmentDefinition"!==l.kind){if("OperationDefinition"===l.kind)switch(l.operation){case"query":o.push(l);break;case"mutation":s.push(l);break;case"subscription":a.push(l)}}else i.push(l)}_(!i.length||o.length||s.length||a.length,60),_(o.length+s.length+a.length<=1,61,e,o.length,a.length,s.length),r=o.length?exports.DocumentType.Query:exports.DocumentType.Mutation,o.length||s.length||(r=exports.DocumentType.Subscription);var f=o.length?o:s.length?s:a;_(1===f.length,62,e,f.length);var h=f[0];t=h.variableDefinitions||[];var p={name:h.name&&"Name"===h.name.kind?h.name.value:"data",type:r,variables:t};return $r.set(e,p),p}function tn(e,t){var r=en(e),n=Zr(t),i=Zr(r.type);_(r.type===t,63,n,n,i)}var rn=Object.prototype.hasOwnProperty;function nn(e,t){var r=h.useRef();r.current&&e===r.current.client&&t===r.current.query||(r.current=new on(e,t,r.current));var n=r.current;return n.forceUpdateState=h.useReducer((function(e){return e+1}),0)[1],n}var on=function(){function t(e,t,r){var n=this;this.client=e,this.query=t,this.forceUpdate=function(){return n.forceUpdateState()},this.ssrDisabledResult={loading:!0,data:void 0,error:void 0,networkStatus:exports.NetworkStatus.loading},this.skipStandbyResult={loading:!1,data:void 0,error:void 0,networkStatus:exports.NetworkStatus.ready},this.toQueryResultCache=new(P?WeakMap:Map),tn(t,exports.DocumentType.Query);var i=r&&r.result,o=i&&i.data;o&&(this.previousData=o)}return t.prototype.forceUpdateState=function(){},t.prototype.executeQuery=function(e){var t,r=this;e.query&&Object.assign(this,{query:e.query}),this.watchQueryOptions=this.createWatchQueryOptions(this.queryHookOptions=e);var n=this.observable.reobserveAsConcast(this.getObsQueryOptions());return this.previousData=(null===(t=this.result)||void 0===t?void 0:t.data)||this.previousData,this.result=void 0,this.forceUpdate(),new Promise((function(e){var t;n.subscribe({next:function(e){t=e},error:function(){e(r.toQueryResult(r.observable.getCurrentResult()))},complete:function(){e(r.toQueryResult(t))}})}))},t.prototype.useQuery=function(e){var t=this;this.renderPromises=h.useContext(Kr()).renderPromises,this.useOptions(e);var n=this.useObservableQuery(),i=Yr(h.useCallback((function(e){if(t.renderPromises)return function(){};t.forceUpdate=e;var i=function(){var e=t.result,i=n.getCurrentResult();e&&e.loading===i.loading&&e.networkStatus===i.networkStatus&&r.equal(e.data,i.data)||t.setResult(i)},o=function(e){if(s.unsubscribe(),s=n.resubscribeAfterError(i,o),!rn.call(e,"graphQLErrors"))throw e;var a=t.result;(!a||a&&a.loading||!r.equal(e,a.error))&&t.setResult({data:a&&a.data,error:e,loading:!1,networkStatus:exports.NetworkStatus.error})},s=n.subscribe(i,o);return function(){setTimeout((function(){return s.unsubscribe()})),t.forceUpdate=function(){return t.forceUpdateState()}}}),[n,this.renderPromises,this.client.disableNetworkFetches]),(function(){return t.getCurrentResult()}),(function(){return t.getCurrentResult()}));return this.unsafeHandlePartialRefetch(i),this.toQueryResult(i)},t.prototype.useOptions=function(e){var n,i=this.createWatchQueryOptions(this.queryHookOptions=e),o=this.watchQueryOptions;r.equal(i,o)||(this.watchQueryOptions=i,o&&this.observable&&(this.observable.reobserve(this.getObsQueryOptions()),this.previousData=(null===(n=this.result)||void 0===n?void 0:n.data)||this.previousData,this.result=void 0)),this.onCompleted=e.onCompleted||t.prototype.onCompleted,this.onError=e.onError||t.prototype.onError,!this.renderPromises&&!this.client.disableNetworkFetches||!1!==this.queryHookOptions.ssr||this.queryHookOptions.skip?this.queryHookOptions.skip||"standby"===this.watchQueryOptions.fetchPolicy?this.result=this.skipStandbyResult:this.result!==this.ssrDisabledResult&&this.result!==this.skipStandbyResult||(this.result=void 0):this.result=this.ssrDisabledResult},t.prototype.getObsQueryOptions=function(){var e=[],t=this.client.defaultOptions.watchQuery;return t&&e.push(t),this.queryHookOptions.defaultOptions&&e.push(this.queryHookOptions.defaultOptions),e.push(Ne(this.observable&&this.observable.options,this.watchQueryOptions)),e.reduce(je)},t.prototype.createWatchQueryOptions=function(t){var r;void 0===t&&(t={});var n=t.skip;t.ssr,t.onCompleted,t.onError,t.defaultOptions;var i=e.__rest(t,["skip","ssr","onCompleted","onError","defaultOptions"]),o=Object.assign(i,{query:this.query});if(!this.renderPromises||"network-only"!==o.fetchPolicy&&"cache-and-network"!==o.fetchPolicy||(o.fetchPolicy="cache-first"),o.variables||(o.variables={}),n){var s=o.fetchPolicy,a=void 0===s?this.getDefaultFetchPolicy():s,u=o.initialFetchPolicy,c=void 0===u?a:u;Object.assign(o,{initialFetchPolicy:c,fetchPolicy:"standby"})}else o.fetchPolicy||(o.fetchPolicy=(null===(r=this.observable)||void 0===r?void 0:r.options.initialFetchPolicy)||this.getDefaultFetchPolicy());return o},t.prototype.getDefaultFetchPolicy=function(){var e,t;return(null===(e=this.queryHookOptions.defaultOptions)||void 0===e?void 0:e.fetchPolicy)||(null===(t=this.client.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first"},t.prototype.onCompleted=function(e){},t.prototype.onError=function(e){},t.prototype.useObservableQuery=function(){var e=this.observable=this.renderPromises&&this.renderPromises.getSSRObservable(this.watchQueryOptions)||this.observable||this.client.watchQuery(this.getObsQueryOptions());this.obsQueryFields=h.useMemo((function(){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}),[e]);var t=!(!1===this.queryHookOptions.ssr||this.queryHookOptions.skip);return this.renderPromises&&t&&(this.renderPromises.registerSSRObservable(e),e.getCurrentResult().loading&&this.renderPromises.addObservableQueryPromise(e)),e},t.prototype.setResult=function(e){var t=this.result;t&&t.data&&(this.previousData=t.data),this.result=e,this.forceUpdate(),this.handleErrorOrCompleted(e,t)},t.prototype.handleErrorOrCompleted=function(e,t){var r=this;if(!e.loading){var n=this.toApolloError(e);Promise.resolve().then((function(){n?r.onError(n):e.data&&(null==t?void 0:t.networkStatus)!==e.networkStatus&&e.networkStatus===exports.NetworkStatus.ready&&r.onCompleted(e.data)})).catch((function(e){}))}},t.prototype.toApolloError=function(e){return ce(e.errors)?new tt({graphQLErrors:e.errors}):e.error},t.prototype.getCurrentResult=function(){return this.result||this.handleErrorOrCompleted(this.result=this.observable.getCurrentResult()),this.result},t.prototype.toQueryResult=function(t){var r=this.toQueryResultCache.get(t);if(r)return r;var n=t.data;t.partial;var i=e.__rest(t,["data","partial"]);return this.toQueryResultCache.set(t,r=e.__assign(e.__assign(e.__assign({data:n},i),this.obsQueryFields),{client:this.client,observable:this.observable,variables:this.observable.variables,called:!this.queryHookOptions.skip,previousData:this.previousData})),!r.error&&ce(t.errors)&&(r.error=new tt({graphQLErrors:t.errors})),r},t.prototype.unsafeHandlePartialRefetch=function(e){!e.partial||!this.queryHookOptions.partialRefetch||e.loading||e.data&&0!==Object.keys(e.data).length||"cache-only"===this.observable.options.fetchPolicy||(Object.assign(e,{loading:!0,networkStatus:exports.NetworkStatus.refetch}),this.observable.refetch())},t}(),sn=["refetch","reobserve","fetchMore","updateQuery","startPolling","subscribeToMore"];function an(e,t){var n=h.useRef();return n.current&&r.equal(n.current.deps,t)||(n.current={value:e(),deps:t}),n.current.value}var un={};var cn=h.use||function(e){var t=function(e){if(function(e){return"status"in e}(e))return e;var t=e;return t.status="pending",t.then((function(e){if("pending"===t.status){var r=t;r.status="fulfilled",r.value=e}}),(function(e){if("pending"===t.status){var r=t;r.status="rejected",r.reason=e}})),e}(e);switch(t.status){case"pending":throw t;case"rejected":throw t.reason;case"fulfilled":return t.value}};function ln(e){var t={data:e.result,complete:!!e.complete};return e.missing&&(t.missing=_e(e.missing.map((function(e){return e.missing})))),t}var fn=Symbol();var hn=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],pn=function(){function t(e,t){var n=this;this.listeners=new Set,this.status="loading",this.references=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,this.result=e.getCurrentResult(!1),this.key=t.key,t.onDispose&&(this.onDispose=t.onDispose),qr(this.result.networkStatus)||this.result.data&&(!this.result.partial||this.watchQueryOptions.returnPartialData)?(this.promise=ke(this.result),this.status="idle"):this.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),this.subscription=e.filter((function(e){var t=e.data;return!r.equal(t,{})})).subscribe({next:this.handleNext,error:this.handleError});var i=function(){var e;n.references||(n.autoDisposeTimeoutId=setTimeout(n.dispose,null!==(e=t.autoDisposeTimeoutMs)&&void 0!==e?e:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var t=!1;return function(){t||(t=!0,e.references--,setTimeout((function(){e.references||e.dispose()})))}},t.prototype.didChangeOptions=function(e){var t=this;return hn.some((function(n){return!r.equal(t.watchQueryOptions[n],e[n])}))},t.prototype.applyOptions=function(t){var r=this.watchQueryOptions,n=r.fetchPolicy,i=r.canonizeResults;return"standby"===n&&n!==t.fetchPolicy?this.initiateFetch(this.observable.reobserve(t)):(this.observable.silentSetOptions(t),i!==t.canonizeResults&&(this.result=e.__assign(e.__assign({},this.result),this.observable.getCurrentResult()),this.promise=ke(this.result))),this.promise},t.prototype.listen=function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var t;switch(this.status){case"loading":void 0===e.data&&(e.data=this.result.data),this.status="idle",this.result=e,null===(t=this.resolve)||void 0===t||t.call(this,e);break;case"idle":if(e.data===this.result.data)return;void 0===e.data&&(e.data=this.result.data),this.result=e,this.promise=ke(e),this.deliver(this.promise)}},t.prototype.handleError=function(e){var t,r,n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.status){case"loading":this.status="idle",null===(t=this.reject)||void 0===t||t.call(this,e);break;case"idle":this.promise=(r=e,(n=Promise.reject(r)).catch((function(){})),n.status="rejected",n.reason=r,n),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach((function(t){return t(e)}))},t.prototype.initiateFetch=function(e){var t=this;return this.status="loading",this.promise=new Promise((function(e,r){t.resolve=e,t.reject=r})),this.promise.catch((function(){})),e.then((function(e){var r;"loading"===t.status&&(t.status="idle",t.result=e,null===(r=t.resolve)||void 0===r||r.call(t,e))})).catch((function(){})),e},t}(),dn=function(){function e(e){void 0===e&&(e=Object.create(null)),this.queryRefs=new s.Trie(P),this.options=e}return e.prototype.getQueryRef=function(e,t){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new pn(t(),{key:e,autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},e}(),vn=Symbol.for("apollo.suspenseCache");function yn(e){var t;return e[vn]||(e[vn]=new dn(null===(t=e.defaultOptions.react)||void 0===t?void 0:t.suspense)),e[vn]}var mn=Symbol.for("apollo.skipToken");function gn(e){return ce(e.errors)?new tt({graphQLErrors:e.errors}):e.error}function bn(t){var r=t.client,n=t.query,i=t.options;return an((function(){var t;if(i===mn)return{query:n,fetchPolicy:"standby"};var o=i.fetchPolicy||(null===(t=r.defaultOptions.watchQuery)||void 0===t?void 0:t.fetchPolicy)||"cache-first",s=e.__assign(e.__assign({},i),{fetchPolicy:o,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return i.skip&&(s.fetchPolicy="standby"),s}),[r,i,n])}exports.setLogVerbosity=t.setVerbosity,exports.Observable=i.Observable,exports.disableExperimentalFragmentVariables=a.disableExperimentalFragmentVariables,exports.disableFragmentWarnings=a.disableFragmentWarnings,exports.enableExperimentalFragmentVariables=a.enableExperimentalFragmentVariables,exports.gql=a.gql,exports.resetCaches=a.resetCaches,exports.ApolloCache=yt,exports.ApolloClient=Br,exports.ApolloConsumer=function(e){var t=Kr();return h.createElement(t.Consumer,null,(function(t){return _(t&&t.client,44),e.children(t.client)}))},exports.ApolloError=tt,exports.ApolloLink=Be,exports.ApolloProvider=function(t){var r=t.client,n=t.children,i=Kr(),o=h.useContext(i),s=h.useMemo((function(){return e.__assign(e.__assign({},o),{client:r||o.client})}),[o,r]);return _(s.client,46),h.createElement(i.Provider,{value:s},n)},exports.DocumentTransform=oe,exports.HttpLink=vt,exports.InMemoryCache=Sr,exports.MissingFieldError=mt,exports.ObservableQuery=Tr,exports.checkFetcher=lt,exports.concat=Je,exports.createHttpLink=dt,exports.createSignalIfSupported=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}},exports.defaultDataIdFromObject=_t,exports.defaultPrinter=ut,exports.empty=Ue,exports.execute=Ge,exports.fallbackHttpConfig=at,exports.from=Ke,exports.fromError=Ae,exports.fromPromise=function(e){return new i.Observable((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))},exports.getApolloContext=Kr,exports.isApolloError=et,exports.isNetworkRequestSettled=qr,exports.isReference=V,exports.makeReference=L,exports.makeVar=Xt,exports.mergeOptions=je,exports.operationName=Zr,exports.parseAndCheckHttpResponse=ot,exports.parser=en,exports.resetApolloContext=Hr,exports.rewriteURIForGET=ht,exports.selectHttpOptionsAndBody=function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return n.unshift(r),ct.apply(void 0,e.__spreadArray([t,ut],n,!1))},exports.selectHttpOptionsAndBodyInternal=ct,exports.selectURI=ft,exports.serializeFetchParameter=st,exports.skipToken=mn,exports.split=He,exports.throwServerError=Le,exports.toPromise=function(e){var t=!1;return new Promise((function(r,n){e.subscribe({next:function(e){t||(t=!0,r(e))},error:n})}))},exports.useApolloClient=Jr,exports.useBackgroundQuery=function(t,r){void 0===r&&(r=Object.create(null));var n=Jr(r.client),i=yn(n),o=bn({client:n,query:t,options:r}),s=o.fetchPolicy,a=o.variables,u=r.queryKey,c=void 0===u?[]:u,l=h.useRef("standby"!==s);l.current||(l.current="standby"!==s);var f=e.__spreadArray([t,zt(a)],[].concat(c),!0),p=i.getQueryRef(f,(function(){return n.watchQuery(o)})),d=h.useState((function(){return new Map([[p.key,p.promise]])})),v=d[0],y=d[1];if(p.didChangeOptions(o)){var m=p.applyOptions(o);v.set(p.key,m)}h.useEffect((function(){return p.retain()}),[p]);var g=h.useCallback((function(e){var t=p.fetchMore(e);return y((function(e){return new Map(e).set(p.key,p.promise)})),t}),[p]),b=h.useCallback((function(e){var t=p.refetch(e);return y((function(e){return new Map(e).set(p.key,p.promise)})),t}),[p]);p.promiseCache=v;var _=h.useMemo((function(){return function(e){var t;return(t={})[fn]=e,t}(p)}),[p]);return[l.current?_:void 0,{fetchMore:g,refetch:b}]},exports.useFragment=function(t){var n,i,o=Jr().cache,s=an((function(){var r=t.fragment,n=t.fragmentName,i=t.from,s=t.optimistic,a=void 0===s||s,u=e.__rest(t,["fragment","fragmentName","from","optimistic"]);return e.__assign(e.__assign({},u),{returnPartialData:!0,id:"string"==typeof i?i:o.identify(i),query:o.getFragmentDoc(r,n),optimistic:a})}),[t]),a=(n=function(){return ln(o.diff(s))},(i=h.useRef(un)).current===un&&(i.current=n()),i),u=h.useCallback((function(){return a.current}),[]);return Yr(h.useCallback((function(t){var n=0,i=o.watch(e.__assign(e.__assign({},s),{immediate:!0,callback:function(e){r.equal(e.result,a.current.data)||(a.current=ln(e),clearTimeout(n),n=setTimeout(t))}}));return function(){i(),clearTimeout(n)}}),[o,s]),u,u)},exports.useLazyQuery=function(t,r){var n,i=h.useRef(),o=h.useRef(),s=h.useRef(),a=je(r,i.current||{}),u=null!==(n=null==a?void 0:a.query)&&void 0!==n?n:t;o.current=a,s.current=u;var c=nn(Jr(r&&r.client),u),l=c.useQuery(e.__assign(e.__assign({},a),{skip:!i.current})),f=l.observable.options.initialFetchPolicy||c.getDefaultFetchPolicy(),p=Object.assign(l,{called:!!i.current}),d=h.useMemo((function(){for(var e={},t=function(t){var r=p[t];e[t]=function(){return i.current||(i.current=Object.create(null),c.forceUpdateState()),r.apply(this,arguments)}},r=0,n=sn;r<n.length;r++){t(n[r])}return e}),[]);Object.assign(p,d);var v=h.useCallback((function(t){i.current=t?e.__assign(e.__assign({},t),{fetchPolicy:t.fetchPolicy||f}):{fetchPolicy:f};var r=je(o.current,e.__assign({query:s.current},i.current)),n=c.executeQuery(e.__assign(e.__assign({},r),{skip:!1})).then((function(e){return Object.assign(e,d)}));return n.catch((function(){})),n}),[]);return[v,p]},exports.useMutation=function(t,n){var i=Jr(null==n?void 0:n.client);tn(t,exports.DocumentType.Mutation);var o=h.useState({called:!1,loading:!1,client:i}),s=o[0],a=o[1],u=h.useRef({result:s,mutationId:0,isMounted:!0,client:i,mutation:t,options:n});Object.assign(u.current,{client:i,options:n,mutation:t});var c=h.useCallback((function(t){void 0===t&&(t={});var n=u.current,i=n.options,o=n.mutation,s=e.__assign(e.__assign({},i),{mutation:o}),c=t.client||u.current.client;u.current.result.loading||s.ignoreResults||!u.current.isMounted||a(u.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:c});var l=++u.current.mutationId,f=je(s,t);return c.mutate(f).then((function(e){var n,i,o=e.data,s=e.errors,h=s&&s.length>0?new tt({graphQLErrors:s}):void 0,p=t.onError||(null===(n=u.current.options)||void 0===n?void 0:n.onError);if(h&&p&&p(h,f),l===u.current.mutationId&&!f.ignoreResults){var d={called:!0,loading:!1,data:o,error:h,client:c};u.current.isMounted&&!r.equal(u.current.result,d)&&a(u.current.result=d)}var v=t.onCompleted||(null===(i=u.current.options)||void 0===i?void 0:i.onCompleted);return h||null==v||v(e.data,f),e})).catch((function(e){var n;if(l===u.current.mutationId&&u.current.isMounted){var i={loading:!1,error:e,data:void 0,called:!0,client:c};r.equal(u.current.result,i)||a(u.current.result=i)}var o=t.onError||(null===(n=u.current.options)||void 0===n?void 0:n.onError);if(o)return o(e,f),{data:void 0,errors:e};throw e}))}),[]),l=h.useCallback((function(){if(u.current.isMounted){var e={called:!1,loading:!1,client:i};Object.assign(u.current,{mutationId:0,result:e}),a(e)}}),[]);return h.useEffect((function(){return u.current.isMounted=!0,function(){u.current.isMounted=!1}}),[]),[c,e.__assign({reset:l},s)]},exports.useQuery=function(e,t){return void 0===t&&(t=Object.create(null)),nn(Jr(t.client),e).useQuery(t)},exports.useReactiveVar=function(e){return Yr(h.useCallback((function(t){return e.onNextChange((function r(){t(),e.onNextChange(r)}))}),[e]),e,e)},exports.useReadQuery=function(e){var t=function(e){return e[fn]}(e);_(t.promiseCache,51);var r=t.promiseCache,n=t.key;r.has(n)||r.set(n,t.promise);var i=Yr(h.useCallback((function(e){return t.listen((function(r){t.promiseCache.set(t.key,r),e()}))}),[t]),(function(){return r.get(n)}),(function(){return r.get(n)})),o=cn(i);return h.useMemo((function(){return{data:o.data,networkStatus:o.networkStatus,error:gn(o)}}),[o])},exports.useSubscription=function(e,t){var n=h.useRef(!1),i=Jr(null==t?void 0:t.client);tn(e,exports.DocumentType.Subscription);var o=h.useState({loading:!(null==t?void 0:t.skip),error:void 0,data:void 0,variables:null==t?void 0:t.variables}),s=o[0],a=o[1];n.current||(n.current=!0,null==t||t.onSubscriptionData,null==t||t.onSubscriptionComplete);var u=h.useState((function(){return(null==t?void 0:t.skip)?null:i.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})})),c=u[0],l=u[1],f=h.useRef(!1);h.useEffect((function(){return function(){f.current=!0}}),[]);var p=h.useRef({client:i,subscription:e,options:t});return h.useEffect((function(){var n,o,s,u,c=null==t?void 0:t.shouldResubscribe;"function"==typeof c&&(c=!!c(t)),(null==t?void 0:t.skip)?(!(null==t?void 0:t.skip)!=!(null===(n=p.current.options)||void 0===n?void 0:n.skip)||f.current)&&(a({loading:!1,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),l(null),f.current=!1):(!1===c||i===p.current.client&&e===p.current.subscription&&(null==t?void 0:t.fetchPolicy)===(null===(o=p.current.options)||void 0===o?void 0:o.fetchPolicy)&&!(null==t?void 0:t.skip)==!(null===(s=p.current.options)||void 0===s?void 0:s.skip)&&r.equal(null==t?void 0:t.variables,null===(u=p.current.options)||void 0===u?void 0:u.variables))&&!f.current||(a({loading:!0,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),l(i.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})),f.current=!1),Object.assign(p.current,{client:i,subscription:e,options:t})}),[i,e,t,f.current]),h.useEffect((function(){if(c){var e=!1,r=c.subscribe({next:function(r){var n,o;if(!e){var s={loading:!1,data:r.data,error:void 0,variables:null==t?void 0:t.variables};a(s),(null===(n=p.current.options)||void 0===n?void 0:n.onData)?p.current.options.onData({client:i,data:s}):(null===(o=p.current.options)||void 0===o?void 0:o.onSubscriptionData)&&p.current.options.onSubscriptionData({client:i,subscriptionData:s})}},error:function(r){var n,i;e||(a({loading:!1,data:void 0,error:r,variables:null==t?void 0:t.variables}),null===(i=null===(n=p.current.options)||void 0===n?void 0:n.onError)||void 0===i||i.call(n,r))},complete:function(){var t,r;e||((null===(t=p.current.options)||void 0===t?void 0:t.onComplete)?p.current.options.onComplete():(null===(r=p.current.options)||void 0===r?void 0:r.onSubscriptionComplete)&&p.current.options.onSubscriptionComplete())}});return function(){e=!0,setTimeout((function(){r.unsubscribe()}))}}}),[c]),s},exports.useSuspenseQuery=function(t,r){void 0===r&&(r=Object.create(null));var n=Jr(r.client),i=yn(n),o=bn({client:n,query:t,options:r}),s=o.fetchPolicy,a=o.variables,u=r.queryKey,c=void 0===u?[]:u,l=e.__spreadArray([t,zt(a)],[].concat(c),!0),f=i.getQueryRef(l,(function(){return n.watchQuery(o)})),p=h.useState((function(){return new Map([[f.key,f.promise]])})),d=p[0],v=p[1],y=d.get(f.key);f.didChangeOptions(o)&&(y=f.applyOptions(o),d.set(f.key,y)),y||(y=f.promise,d.set(f.key,y)),h.useEffect((function(){var e=f.retain(),t=f.listen((function(e){v((function(t){return new Map(t).set(f.key,e)}))}));return function(){t(),e()}}),[f]);var m=h.useMemo((function(){var e=gn(f.result);return{loading:!1,data:f.result.data,networkStatus:e?exports.NetworkStatus.error:exports.NetworkStatus.ready,error:e}}),[f.result]),g="standby"===s?m:cn(y),b=h.useCallback((function(e){var t=f.fetchMore(e);return v((function(e){return new Map(e).set(f.key,f.promise)})),t}),[f]),_=h.useCallback((function(e){var t=f.refetch(e);return v((function(e){return new Map(e).set(f.key,f.promise)})),t}),[f]),w=h.useCallback((function(e){return f.observable.subscribeToMore(e)}),[f]);return h.useMemo((function(){return{client:n,data:g.data,error:gn(g),networkStatus:g.networkStatus,fetchMore:b,refetch:_,subscribeToMore:w}}),[n,b,_,g,w])};
|