From 0ff85b20a3ad4b298590e7ac7e9d63aba7e5c894 Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Mon, 11 Dec 2023 19:37:29 -0800 Subject: [PATCH 01/11] chore(deps): Update CircleCI secops orb version (apollographql/apollo-ios-dev#197) --- .circleci/config.yml | 2 +- apollo-ios-codegen/.circleci/config.yml | 2 +- apollo-ios-pagination/.circleci/config.yml | 2 +- apollo-ios/.circleci/config.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3c908829..edd70bb1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 workflows: security-scans: diff --git a/apollo-ios-codegen/.circleci/config.yml b/apollo-ios-codegen/.circleci/config.yml index f3c908829..edd70bb1e 100644 --- a/apollo-ios-codegen/.circleci/config.yml +++ b/apollo-ios-codegen/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 workflows: security-scans: diff --git a/apollo-ios-pagination/.circleci/config.yml b/apollo-ios-pagination/.circleci/config.yml index f3c908829..edd70bb1e 100644 --- a/apollo-ios-pagination/.circleci/config.yml +++ b/apollo-ios-pagination/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 workflows: security-scans: diff --git a/apollo-ios/.circleci/config.yml b/apollo-ios/.circleci/config.yml index f3c908829..edd70bb1e 100644 --- a/apollo-ios/.circleci/config.yml +++ b/apollo-ios/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 workflows: security-scans: From 48c2c6b16ad2ecaa057d2644b81ab50aa6c21c0a Mon Sep 17 00:00:00 2001 From: gh-action-runner Date: Tue, 12 Dec 2023 03:38:15 +0000 Subject: [PATCH 02/11] Squashed 'apollo-ios/' changes from 39013627..0c0a9903 0c0a9903 chore(deps): Update CircleCI secops orb version (apollographql/apollo-ios-dev#197) git-subtree-dir: apollo-ios git-subtree-split: 0c0a9903a55710fa1708068ef91a017236467ff8 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3c908829..edd70bb1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 workflows: security-scans: From 37e3a67b3fd8109709b25e83746ee89b5d7bbe36 Mon Sep 17 00:00:00 2001 From: gh-action-runner Date: Tue, 12 Dec 2023 03:38:26 +0000 Subject: [PATCH 03/11] Squashed 'apollo-ios-codegen/' changes from 4cc288c4..44b718a9 44b718a9 chore(deps): Update CircleCI secops orb version (apollographql/apollo-ios-dev#197) git-subtree-dir: apollo-ios-codegen git-subtree-split: 44b718a9a30d97681b9d550eb1ceedc2cc5d7c30 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3c908829..edd70bb1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 workflows: security-scans: From efbe0679c7a6187cc4459e25f4782bc26ab09689 Mon Sep 17 00:00:00 2001 From: gh-action-runner Date: Tue, 12 Dec 2023 03:38:37 +0000 Subject: [PATCH 04/11] Squashed 'apollo-ios-pagination/' changes from 71f74166..70a6b37a 70a6b37a chore(deps): Update CircleCI secops orb version (apollographql/apollo-ios-dev#197) git-subtree-dir: apollo-ios-pagination git-subtree-split: 70a6b37a86f420a863d345163dfaf2c4db257ff1 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3c908829..edd70bb1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 workflows: security-scans: From 143d14917bd69539da41e18121e3d709cc3cf030 Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Wed, 13 Dec 2023 12:16:43 -0800 Subject: [PATCH 05/11] tests: TestCodegenConfigurations projects should fail on warnings (apollographql/apollo-ios-dev#198) --- .../EmbeddedInTarget-InSchemaModule/Package.swift | 3 --- .../EmbeddedInTarget-InSchemaModule/test-project.sh | 2 +- .../PackageOne/Package.swift | 3 --- .../PackageTwo/Package.swift | 3 --- .../EmbeddedInTarget-RelativeAbsolute/test-project.sh | 5 +++-- .../SwiftPackageManager/Package.swift | 3 --- .../SwiftPackageManager/test-project.sh | 2 +- apollo-ios/Sources/ApolloAPI/DataDict.swift | 1 - 8 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift index 0227cf207..b43316073 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift @@ -23,9 +23,6 @@ let package = Package( name: "TestApp", dependencies: [ .product(name: "ApolloAPI", package: "apollo-ios") - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ]), .testTarget( name: "TestAppTests", diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh index e3b25cd69..9093d6a49 100755 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh @@ -1,3 +1,3 @@ #!/bin/bash -swift test +swift test -Xswiftc -warnings-as-errors diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift index e605c9f40..04f08a310 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift @@ -45,9 +45,6 @@ let package = Package( "graphql/PetDetails.graphql", "graphql/AllAnimalsIncludeSkipQuery.graphql", "graphql/PetAdoptionMutation.graphql" - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ]), .testTarget( name: "PackageOneTests", diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift index c4a017cbe..3ad6d14f2 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift @@ -22,9 +22,6 @@ let package = Package( name: "PackageTwo", dependencies: [ .product(name: "ApolloAPI", package: "apollo-ios"), - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ]), .target( name: "TestMocks", diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh index 29ccda806..bb8a4657a 100755 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh @@ -1,9 +1,10 @@ #!/bin/bash +set -e echo "Testing PackageOne.." cd PackageOne -swift test +swift test -Xswiftc -warnings-as-errors echo "Testing PackageTwo.." cd ../PackageTwo -swift test +swift test -Xswiftc -warnings-as-errors diff --git a/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift b/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift index 3b2fb5eca..9a71cca28 100644 --- a/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift +++ b/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift @@ -23,9 +23,6 @@ let package = Package( dependencies: [ .product(name: "Apollo", package: "apollo-ios"), .product(name: "AnimalKingdomAPI", package: "AnimalKingdomAPI") - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ] ), .testTarget( diff --git a/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh b/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh index e3b25cd69..9093d6a49 100755 --- a/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh +++ b/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh @@ -1,3 +1,3 @@ #!/bin/bash -swift test +swift test -Xswiftc -warnings-as-errors diff --git a/apollo-ios/Sources/ApolloAPI/DataDict.swift b/apollo-ios/Sources/ApolloAPI/DataDict.swift index 1f2ba6719..539ca45f5 100644 --- a/apollo-ios/Sources/ApolloAPI/DataDict.swift +++ b/apollo-ios/Sources/ApolloAPI/DataDict.swift @@ -48,7 +48,6 @@ public struct DataDict: Hashable { _storage.deferredFragments } - #warning("TODO, remove deferredFragments default value when we set these up in executor") public init( data: [String: AnyHashable], fulfilledFragments: Set, From f6ebf7380e15ab5bc3cc4cfcb321cfe93a6d140d Mon Sep 17 00:00:00 2001 From: gh-action-runner Date: Wed, 13 Dec 2023 20:17:39 +0000 Subject: [PATCH 06/11] Squashed 'apollo-ios/' changes from 0c0a9903..5cebbacc 5cebbacc tests: TestCodegenConfigurations projects should fail on warnings (apollographql/apollo-ios-dev#198) git-subtree-dir: apollo-ios git-subtree-split: 5cebbacc5e43bd0e20e06dffba64f5775238ec19 --- Sources/ApolloAPI/DataDict.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/ApolloAPI/DataDict.swift b/Sources/ApolloAPI/DataDict.swift index 1f2ba6719..539ca45f5 100644 --- a/Sources/ApolloAPI/DataDict.swift +++ b/Sources/ApolloAPI/DataDict.swift @@ -48,7 +48,6 @@ public struct DataDict: Hashable { _storage.deferredFragments } - #warning("TODO, remove deferredFragments default value when we set these up in executor") public init( data: [String: AnyHashable], fulfilledFragments: Set, From a7870b3a367e195d1e86819a4761596c580274f3 Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Wed, 13 Dec 2023 15:12:05 -0800 Subject: [PATCH 07/11] chore(deps): Update to graphql-js 17.0.0-alpha.3 (apollographql/apollo-ios-dev#194) --- .../Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift | 2 +- .../Sources/GraphQLCompiler/JavaScript/package.json | 2 +- .../Sources/GraphQLCompiler/JavaScript/rollup.config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift index 959501fa9..afaa59530 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift @@ -1 +1 @@ -let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){if(!e)throw new Error(null!=t?t:"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(!1),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet","nullabilityAssertion"],Argument:["name","value"],ListNullabilityOperator:["nullabilityAssertion"],NonNullAssertion:["nullabilityAssertion"],ErrorBoundary:["nullabilityAssertion"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}var d,f,h,m;function E(e){return 9===e||32===e}function T(e){return e>=48&&e<=57}function y(e){return e>=97&&e<=122||e>=65&&e<=90}function N(e){return y(e)||95===e}function v(e){return y(e)||T(e)||95===e}function I(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function g(e){let t=0;for(;t",e.EOF="",e.BANG="!",e.QUESTION_MARK="?",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(m||(m={}));class Lexer{constructor(e){const t=new Token(m.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==m.EOF)do{if(e.next)e=e.next;else{const t=w(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===m.COMMENT);return e}}function S(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function O(e,t){return b(e.charCodeAt(t))&&L(e.charCodeAt(t+1))}function b(e){return e>=55296&&e<=56319}function L(e){return e>=56320&&e<=57343}function A(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return m.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function D(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function w(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function U(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function V(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oB)return"[Array]";const n=Math.min(j,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>B)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+J(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const q="production"===globalThis.process?.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Y(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||M(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||M(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function K(e,t){return new Parser(e,t).parseDocument()}class Parser{constructor(e,t={}){const n=function(e){return q(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(m.NAME);return this.node(e,{kind:h.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:h.DOCUMENT,definitions:this.many(m.SOF,this.parseDefinition,m.EOF)})}parseDefinition(){if(this.peek(m.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===m.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(m.BRACE_L))return this.node(e,{kind:h.OPERATION_DEFINITION,operation:d.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(m.NAME)&&(n=this.parseName()),this.node(e,{kind:h.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(m.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(m.PAREN_L,this.parseVariableDefinition,m.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(m.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(m.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(m.DOLLAR),this.node(e,{kind:h.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:h.SELECTION_SET,selections:this.many(m.BRACE_L,this.parseSelection,m.BRACE_R)})}parseSelection(){return this.peek(m.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(m.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:h.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),nullabilityAssertion:this.parseNullabilityAssertion(),directives:this.parseDirectives(!1),selectionSet:this.peek(m.BRACE_L)?this.parseSelectionSet():void 0})}parseNullabilityAssertion(){if(!0!==this._options.experimentalClientControlledNullability)return;const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseNullabilityAssertion();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_NULLABILITY_OPERATOR,nullabilityAssertion:n})}return this.expectOptionalToken(m.BANG)?t=this.node(e,{kind:h.NON_NULL_ASSERTION,nullabilityAssertion:t}):this.expectOptionalToken(m.QUESTION_MARK)&&(t=this.node(e,{kind:h.ERROR_BOUNDARY,nullabilityAssertion:t})),t}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(m.PAREN_L,t,m.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(m.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(m.NAME)?this.node(e,{kind:h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case m.BRACKET_L:return this.parseList(e);case m.BRACE_L:return this.parseObject(e);case m.INT:return this.advanceLexer(),this.node(t,{kind:h.INT,value:t.value});case m.FLOAT:return this.advanceLexer(),this.node(t,{kind:h.FLOAT,value:t.value});case m.STRING:case m.BLOCK_STRING:return this.parseStringLiteral();case m.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:h.BOOLEAN,value:!0});case"false":return this.node(t,{kind:h.BOOLEAN,value:!1});case"null":return this.node(t,{kind:h.NULL});default:return this.node(t,{kind:h.ENUM,value:t.value})}case m.DOLLAR:if(e){if(this.expectToken(m.DOLLAR),this._lexer.token.kind===m.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:h.STRING,value:e.value,block:e.kind===m.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:h.LIST,values:this.any(m.BRACKET_L,(()=>this.parseValueLiteral(e)),m.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:h.OBJECT,fields:this.any(m.BRACE_L,(()=>this.parseObjectField(e)),m.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(m.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(m.AT),this.node(t,{kind:h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(m.BANG)?this.node(e,{kind:h.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:h.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(m.STRING)||this.peek(m.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);return this.node(e,{kind:h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(m.COLON);const n=this.parseNamedType();return this.node(e,{kind:h.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(m.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseFieldDefinition,m.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(m.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(m.PAREN_L,this.parseInputValueDef,m.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(m.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(m.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:h.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(m.EQUALS)?this.delimitedMany(m.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(m.BRACE_L,this.parseEnumValueDefinition,m.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${X(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseInputValueDef,m.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===m.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(m.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(m.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${z(e)}, found ${X(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==m.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${X(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===m.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${X(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==m.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function X(e){const t=e.value;return z(e.kind)+(null!=t?` "${t}"`:"")}function z(e){return function(e){return e===m.BANG||e===m.QUESTION_MARK||e===m.DOLLAR||e===m.AMP||e===m.PAREN_L||e===m.PAREN_R||e===m.SPREAD||e===m.COLON||e===m.EQUALS||e===m.AT||e===m.BRACKET_L||e===m.BRACKET_R||e===m.BRACE_L||e===m.PIPE||e===m.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function H(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function W(e){return Z("and",e)}function Z(e,t){switch(0!==t.length||n(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t[t.length-1];return r.join(", ")+", "+e+" "+i}const ee=5;function te(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";n&&(i+=n+" ");return i+Z("or",r.slice(0,ee).map((e=>`"${e}"`)))+"?"}function ne(e){return e}function re(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function ie(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function oe(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function se(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-ae,o=t.charCodeAt(r)}while(ue(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const ae=48,ce=57;function ue(e){return!isNaN(e)&&ae<=e&&e<=ce}function le(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:se(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=pe(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=pe(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function pe(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ge(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Se("(",ge(e.variableDefinitions,", "),")"),n=ge([e.operation,ge([e.name,t]),ge(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Se(" = ",n)+Se(" ",ge(r," "))},SelectionSet:{leave:({selections:e})=>_e(e)},Field:{leave({alias:e,name:t,arguments:n,nullabilityAssertion:r,directives:i,selectionSet:o}){const s=ge([Se("",e,": "),t],"");let a=s+Se("(",ge(n,", "),")");return a.length>80&&(a=s+Se("(\n",Oe(ge(n,"\n")),"\n)")),ge([a,r,Se(" ",ge(i," ")),Se(" ",o)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},ListNullabilityOperator:{leave:({nullabilityAssertion:e})=>ge(["[",e,"]"])},NonNullAssertion:{leave:({nullabilityAssertion:e})=>ge([e,"!"])},ErrorBoundary:{leave:({nullabilityAssertion:e})=>ge([e,"?"])},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Se(" ",ge(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>ge(["...",Se("on ",e),ge(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Se("(",ge(n,", "),")")} on ${t} ${Se("",ge(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every((e=>0===e.length||E(e.charCodeAt(0)))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!t?.minimize&&(!i||e.length>70||u||o||s);let p="";const d=i&&E(e.charCodeAt(0));return(l&&!d||o)&&(p+="\n"),p+=n,(l||u)&&(p+="\n"),'"""'+p+'"""'}(e):`"${e.replace(fe,he)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ge(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{ "+ge(e,", ")+" }"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Se("(",ge(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Se("",e,"\n")+ge(["schema",ge(t," "),_e(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Se("",e,"\n")+ge(["scalar",t,ge(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Se("",e,"\n")+ge(["type",t,Se("implements ",ge(n," & ")),ge(r," "),_e(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Se("",e,"\n")+t+(be(n)?Se("(\n",Oe(ge(n,"\n")),"\n)"):Se("(",ge(n,", "),")"))+": "+r+Se(" ",ge(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Se("",e,"\n")+ge([t+": "+n,Se("= ",r),ge(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Se("",e,"\n")+ge(["interface",t,Se("implements ",ge(n," & ")),ge(r," "),_e(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Se("",e,"\n")+ge(["union",t,ge(n," "),Se("= ",ge(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Se("",e,"\n")+ge(["enum",t,ge(n," "),_e(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Se("",e,"\n")+ge([t,ge(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Se("",e,"\n")+ge(["input",t,ge(n," "),_e(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Se("",e,"\n")+"directive @"+t+(be(n)?Se("(\n",Oe(ge(n,"\n")),"\n)"):Se("(",ge(n,", "),")"))+(r?" repeatable":"")+" on "+ge(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ge(["extend schema",ge(e," "),_e(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ge(["extend scalar",e,ge(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["extend type",e,Se("implements ",ge(t," & ")),ge(n," "),_e(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["extend interface",e,Se("implements ",ge(t," & ")),ge(n," "),_e(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>ge(["extend union",e,ge(t," "),Se("= ",ge(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>ge(["extend enum",e,ge(t," "),_e(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>ge(["extend input",e,ge(t," "),_e(n)]," ")}};function ge(e,t=""){return e?.filter((e=>e)).join(t)??""}function _e(e){return Se("{\n",Oe(ge(e,"\n")),"\n}")}function Se(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Oe(e){return Se(" ",e.replace(/\n/g,"\n "))}function be(e){return e?.some((e=>e.includes("\n")))??!1}function Le(e,t){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map((e=>Le(e,t)));case h.OBJECT:return ie(e.fields,(e=>e.name.value),(e=>Le(e.value,t)));case h.VARIABLE:return t?.[e.name.value]}}function Ae(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tt(Le(e,n))),this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||M(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=()=>We(e),this._interfaces=()=>He(e)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:et(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function He(e){return Xe(e.interfaces??[])}function We(e){return oe(ze(e.fields),((e,t)=>{const n=e.args??{};return{name:Ae(t),description:e.description,type:e.type,args:Ze(n),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:de(e.extensions),astNode:e.astNode}}))}function Ze(e){return Object.entries(e).map((([e,t])=>({name:Ae(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:de(t.extensions),astNode:t.astNode})))}function et(e){return oe(e,(e=>({description:e.description,type:e.type,args:tt(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function tt(e){return ie(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function nt(e){return Qe(e.type)&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=We.bind(void 0,e),this._interfaces=He.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:et(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=rt.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function rt(e){return Xe(e.types)}class GraphQLEnumType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=Object.entries(e.values).map((([e,t])=>({name:De(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:de(t.extensions),astNode:t.astNode}))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=re(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Y(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=Y(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+it(this,t))}const t=this.getValue(e);if(null==t)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+it(this,e));return t.value}parseLiteral(e,t){if(e.kind!==h.ENUM){const t=ve(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+it(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=ve(e);throw new GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+it(this,t),{nodes:e})}return n.value}toConfig(){const e=ie(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function it(e,t){return te("the enum value",le(t,e.getValues().map((e=>e.name))))}class GraphQLInputObjectType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=ot.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=oe(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ot(e){return oe(ze(e.fields),((t,n)=>(!("resolve"in t)||M(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ae(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:de(t.extensions),astNode:t.astNode})))}function st(e){return Qe(e.type)&&void 0===e.defaultValue}function at(e,t){return e===t||(Qe(e)&&Qe(t)||!(!$e(e)||!$e(t)))&&at(e.ofType,t.ofType)}function ct(e,t,n){return t===n||(Qe(n)?!!Qe(t)&&ct(e,t.ofType,n.ofType):Qe(t)?ct(e,t.ofType,n):$e(n)?!!$e(t)&&ct(e,t.ofType,n.ofType):!$e(t)&&(je(n)&&(xe(t)||Fe(t))&&e.isSubType(n,t)))}function ut(e,t,n){return t===n||(je(t)?je(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!je(n)&&e.isSubType(n,t))}const lt=2147483647,pt=-2147483648,dt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=Nt(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Y(t)}`);if(n>lt||nlt||elt||te.name===t))}function Nt(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function vt(e){return q(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Ae(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=de(e.extensions),this.astNode=e.astNode;const t=e.args??{};this.args=Ze(t)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:tt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const It=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(mt),description:"Included when true."}}}),gt=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(mt),description:"Skipped when true."}}}),_t=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(mt),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:ht,description:"Unique name"}}}),St=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{if:{type:new GraphQLNonNull(mt),description:"Stream when true or undefined.",defaultValue:!0},label:{type:ht,description:"Unique name"},initialCount:{defaultValue:0,type:dt,description:"Number of items to return immediately"}}}),Ot="No longer supported",bt=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:ht,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Ot}}}),Lt=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(ht),description:"The URL that specifies the behavior of this scalar."}}}),At=Object.freeze([It,gt,bt,Lt]);function Dt(e){return At.some((({name:t})=>t===e.name))}function wt(e,r){if(Qe(r)){const t=wt(e,r.ofType);return t?.kind===h.NULL?null:t}if(null===e)return{kind:h.NULL};if(void 0===e)return null;if($e(r)){const t=r.ofType;if("object"==typeof(i=e)&&"function"==typeof i?.[Symbol.iterator]){const n=[];for(const r of e){const e=wt(r,t);null!=e&&n.push(e)}return{kind:h.LIST,values:n}}return wt(e,t)}var i;if(Ge(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=wt(e[t.name],t.type);r&&n.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:t.name},value:r})}return{kind:h.OBJECT,fields:n}}if(Pe(r)){const t=r.serialize(e);if(null==t)return null;if("boolean"==typeof t)return{kind:h.BOOLEAN,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return kt.test(e)?{kind:h.INT,value:e}:{kind:h.FLOAT,value:e}}if("string"==typeof t)return Ce(r)?{kind:h.ENUM,value:t}:r===Et&&kt.test(t)?{kind:h.INT,value:t}:{kind:h.STRING,value:t};throw new TypeError(`Cannot convert value to AST: ${Y(t)}.`)}n(!1,"Unexpected input type: "+Y(r))}const kt=/^-?(?:0|[1-9][0-9]*)$/,Ft=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ht,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Ct))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Ct),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ct,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ct,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(xt))),resolve:e=>e.getDirectives()}})}),xt=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(mt),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Rt))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),Rt=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ct=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(Vt),resolve:e=>ke(e)?Ut.SCALAR:Fe(e)?Ut.OBJECT:xe(e)?Ut.INTERFACE:Re(e)?Ut.UNION:Ce(e)?Ut.ENUM:Ge(e)?Ut.INPUT_OBJECT:$e(e)?Ut.LIST:Qe(e)?Ut.NON_NULL:void n(!1,`Unexpected type: "${Y(e)}".`)},name:{type:ht,resolve:e=>"name"in e?e.name:void 0},description:{type:ht,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:ht,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Gt)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Fe(e)||xe(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e){if(Fe(e)||xe(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e,t,n,{schema:r}){if(je(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Qt)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Ce(e)){const n=e.getValues();return t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull($t)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Ge(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Ct,resolve:e=>"ofType"in e?e.ofType:void 0}})}),Gt=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(mt),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ht,resolve:e=>e.deprecationReason}})}),$t=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},defaultValue:{type:ht,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=wt(n,t);return r?ve(r):null}},isDeprecated:{type:new GraphQLNonNull(mt),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ht,resolve:e=>e.deprecationReason}})}),Qt=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(mt),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ht,resolve:e=>e.deprecationReason}})});var Ut;!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(Ut||(Ut={}));const Vt=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ut.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Ut.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ut.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ut.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ut.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ut.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ut.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ut.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Pt={name:"__schema",type:new GraphQLNonNull(Ft),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Mt={name:"__type",type:Ct,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(ht),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},jt={name:"__typename",type:new GraphQLNonNull(ht),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Bt=Object.freeze([Ft,xt,Rt,Ct,Gt,$t,Qt,Vt]);function Yt(e){return Bt.some((({name:t})=>e.name===t))}function Jt(e){if(!function(e){return q(e,GraphQLSchema)}(e))throw new Error(`Expected ${Y(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??At;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),qt(n,t);null!=this._queryType&&qt(this._queryType,t),null!=this._mutationType&&qt(this._mutationType,t),null!=this._subscriptionType&&qt(this._subscriptionType,t);for(const e of this._directives)if(vt(e))for(const n of e.args)qt(n.type,t);qt(Ft,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,xe(e)){for(const t of e.getInterfaces())if(xe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Fe(e))for(const t of e.getInterfaces())if(xe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Re(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(Re(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Pt.name:return this.getQueryType()===e?Pt:void 0;case Mt.name:return this.getQueryType()===e?Mt:void 0;case jt.name:return jt}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function qt(e,t){const n=Ke(e);if(!t.has(n))if(t.add(n),Re(n))for(const e of n.getTypes())qt(e,t);else if(Fe(n)||xe(n)){for(const e of n.getInterfaces())qt(e,t);for(const e of Object.values(n.getFields())){qt(e.type,t);for(const n of e.args)qt(n.type,t)}}else if(Ge(n))for(const e of Object.values(n.getFields()))qt(e.type,t);return t}function Kt(e){if(Jt(e),e.__validationErrors)return e.__validationErrors;const t=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(Fe(i))n.add(i,r);else{const n=H(r),o=Y(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,Xt(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=W(i);e.reportError(`All root types must be different, "${r.name}" type is used as ${n} root types.`,i.map((e=>Xt(t,e))))}}(t),function(e){for(const t of e.schema.getDirectives())if(vt(t)){zt(e,t);for(const n of t.args)zt(e,n),Ue(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode),nt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[an(n.astNode),n.astNode?.type])}else e.reportError(`Expected directive but got: ${Y(t)}.`,t?.astNode)}(t),function(e){const t=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(Qe(t.type)&&Ge(t.type.ofType)){const o=t.type.ofType,s=r[o.name];if(n.push(t),void 0===s)i(o);else{const t=n.slice(s),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const r of Object.values(n))qe(r)?(Yt(r)||zt(e,r),Fe(r)||xe(r)?(Ht(e,r),Wt(e,r)):Re(r)?tn(e,r):Ce(r)?nn(e,r):Ge(r)&&(rn(e,r),t(r))):e.reportError(`Expected GraphQL named type but got: ${Y(r)}.`,r.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function Xt(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function zt(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ht(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n){zt(e,r),Ve(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${Y(r.type)}.`,r.astNode?.type);for(const n of r.args){const i=n.name;zt(e,n),Ue(n.type)||e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode?.type),nt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[an(n.astNode),n.astNode?.type])}}}function Wt(e,t){const n=new Set;for(const r of t.getInterfaces())xe(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t.name} can only implement ${r.name} once.`,on(t,r)):(n.add(r.name),en(e,t,r),Zt(e,t,r)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,on(t,r)):e.reportError(`Type ${Y(t)} must only implement Interface types, it cannot implement ${Y(r)}.`,on(t,r))}function Zt(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=i.name,s=r[o];if(s){ct(e.schema,s.type,i.type)||e.reportError(`Interface field ${n.name}.${o} expects type ${Y(i.type)} but ${t.name}.${o} is type ${Y(s.type)}.`,[i.astNode?.type,s.astNode?.type]);for(const r of i.args){const i=r.name,a=s.args.find((e=>e.name===i));a?at(r.type,a.type)||e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expects type ${Y(r.type)} but ${t.name}.${o}(${i}:) is type ${Y(a.type)}.`,[r.astNode?.type,a.astNode?.type]):e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expected but ${t.name}.${o} does not provide it.`,[r.astNode,s.astNode])}for(const r of s.args){const s=r.name;!i.args.find((e=>e.name===s))&&nt(r)&&e.reportError(`Object field ${t.name}.${o} includes required argument ${s} that is missing from the Interface field ${n.name}.${o}.`,[r.astNode,i.astNode])}}else e.reportError(`Interface field ${n.name}.${o} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function en(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...on(n,i),...on(t,n)])}function tn(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,sn(t,i.name)):(r.add(i.name),Fe(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${Y(i)}.`,sn(t,String(i))))}function nn(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)zt(e,t)}function rn(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)zt(e,r),Ue(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${Y(r.type)}.`,r.astNode?.type),st(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[an(r.astNode),r.astNode?.type])}function on(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function sn(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function an(e){return e?.directives?.find((e=>e.name.value===bt.name))}function cn(e,t){switch(t.kind){case h.LIST_TYPE:{const n=cn(e,t.type);return n&&new GraphQLList(n)}case h.NON_NULL_TYPE:{const n=cn(e,t.type);return n&&new GraphQLNonNull(n)}case h.NAMED_TYPE:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??un,t&&(Ue(t)&&this._inputTypeStack.push(t),Me(t)&&this._parentTypeStack.push(t),Ve(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case h.SELECTION_SET:{const e=Ke(this.getType());this._parentTypeStack.push(Me(e)?e:void 0);break}case h.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ve(i)?i:void 0);break}case h.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case h.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push(Fe(n)?n:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?cn(t,n):Ke(this.getType());this._typeStack.push(Ve(r)?r:void 0);break}case h.VARIABLE_DEFINITION:{const n=cn(t,e.type);this._inputTypeStack.push(Ue(n)?n:void 0);break}case h.ARGUMENT:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(Ue(n)?n:void 0);break}case h.LIST:{const e=Je(this.getInputType()),t=$e(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Ue(t)?t:void 0);break}case h.OBJECT_FIELD:{const t=Ke(this.getInputType());let n,r;Ge(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Ue(n)?n:void 0);break}case h.ENUM:{const t=Ke(this.getInputType());let n;Ce(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null}}}function un(e,t,n){return e.getField(t,n.name.value)}function ln(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=Ne(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=Ne(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function pn(e){return e.kind===h.OPERATION_DEFINITION||e.kind===h.FRAGMENT_DEFINITION}function dn(e){return e.kind===h.SCALAR_TYPE_DEFINITION||e.kind===h.OBJECT_TYPE_DEFINITION||e.kind===h.INTERFACE_TYPE_DEFINITION||e.kind===h.UNION_TYPE_DEFINITION||e.kind===h.ENUM_TYPE_DEFINITION||e.kind===h.INPUT_OBJECT_TYPE_DEFINITION}function fn(e){return e.kind===h.SCALAR_TYPE_EXTENSION||e.kind===h.OBJECT_TYPE_EXTENSION||e.kind===h.INTERFACE_TYPE_EXTENSION||e.kind===h.UNION_TYPE_EXTENSION||e.kind===h.ENUM_TYPE_EXTENSION||e.kind===h.INPUT_OBJECT_TYPE_EXTENSION}function hn(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t[e.name]=e.args.map((e=>e.name));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t[e.name.value]=n.map((e=>e.name.value))}return{Directive(n){const r=n.name.value,i=t[r];if(n.arguments&&i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=le(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+te(o),{nodes:t}))}}return!1}}}function mn(e){const t=Object.create(null),r=e.getSchema(),i=r?r.getDirectives():At;for(const e of i)t[e.name]=e.locations;const o=e.getDocument().definitions;for(const e of o)e.kind===h.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t[c];if(!u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e[e.length-1];switch("kind"in t||n(!1),t.kind){case h.OPERATION_DEFINITION:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case h.FIELD:return f.FIELD;case h.FRAGMENT_SPREAD:return f.FRAGMENT_SPREAD;case h.INLINE_FRAGMENT:return f.INLINE_FRAGMENT;case h.FRAGMENT_DEFINITION:return f.FRAGMENT_DEFINITION;case h.VARIABLE_DEFINITION:return f.VARIABLE_DEFINITION;case h.SCHEMA_DEFINITION:case h.SCHEMA_EXTENSION:return f.SCHEMA;case h.SCALAR_TYPE_DEFINITION:case h.SCALAR_TYPE_EXTENSION:return f.SCALAR;case h.OBJECT_TYPE_DEFINITION:case h.OBJECT_TYPE_EXTENSION:return f.OBJECT;case h.FIELD_DEFINITION:return f.FIELD_DEFINITION;case h.INTERFACE_TYPE_DEFINITION:case h.INTERFACE_TYPE_EXTENSION:return f.INTERFACE;case h.UNION_TYPE_DEFINITION:case h.UNION_TYPE_EXTENSION:return f.UNION;case h.ENUM_TYPE_DEFINITION:case h.ENUM_TYPE_EXTENSION:return f.ENUM;case h.ENUM_VALUE_DEFINITION:return f.ENUM_VALUE;case h.INPUT_OBJECT_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_EXTENSION:return f.INPUT_OBJECT;case h.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||n(!1),t.kind===h.INPUT_OBJECT_TYPE_DEFINITION?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(!1,"Unexpected kind: "+Y(t.kind))}}(a);l&&!u.includes(l)&&e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function En(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(dn).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===h.SCHEMA_DEFINITION||dn(e)||e.kind===h.DIRECTIVE_DEFINITION}(c)||function(e){return e.kind===h.SCHEMA_EXTENSION||fn(e)}(c)));if(o&&Tn.has(a))return;const u=le(a,o?[...Tn,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+te(u),{nodes:t}))}var c}}}const Tn=new Set([...Tt,...Bt].map((e=>e.name)));function yn(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Nn(e){switch(e.kind){case h.OBJECT:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Nn(e.value)}))).sort(((e,t)=>se(e.name.value,t.name.value))))};case h.LIST:return{...e,values:e.values.map(Nn)};case h.INT:case h.FLOAT:case h.STRING:case h.BOOLEAN:case h.NULL:case h.ENUM:case h.VARIABLE:return e}var t}function vn(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+vn(t))).join(" and "):e}function In(e,t,n,r,i,o,s){const a=e.getFragment(s);if(!a)return;const[c,u]=Dn(e,n,a);if(o!==c){_n(e,t,n,r,i,o,c);for(const a of u)r.has(a,s,i)||(r.add(a,s,i),In(e,t,n,r,i,o,a))}}function gn(e,t,n,r,i,o,s){if(o===s)return;if(r.has(o,s,i))return;r.add(o,s,i);const a=e.getFragment(o),c=e.getFragment(s);if(!a||!c)return;const[u,l]=Dn(e,n,a),[p,d]=Dn(e,n,c);_n(e,t,n,r,i,u,p);for(const s of d)gn(e,t,n,r,i,o,s);for(const o of l)gn(e,t,n,r,i,o,s)}function _n(e,t,n,r,i,o,s){for(const[a,c]of Object.entries(o)){const o=s[a];if(o)for(const s of c)for(const c of o){const o=Sn(e,n,r,i,a,s,c);o&&t.push(o)}}}function Sn(e,t,n,r,i,o,s){const[a,c,u]=o,[l,p,d]=s,f=r||a!==l&&Fe(a)&&Fe(l);if(!f){const e=c.name.value,t=p.name.value;if(e!==t)return[[i,`"${e}" and "${t}" are different fields`],[c],[p]];if(On(c)!==On(p))return[[i,"they have differing arguments"],[c],[p]]}if(!function(e,t){const n=bn(e),r=bn(t);if(!n&&!r)return!0;if(n&&r)return On(n)===On(r);return!1}(c.directives??[],p.directives??[]))return[[i,"they have differing stream directives"],[c],[p]];const h=u?.type,m=d?.type;if(h&&m&&Ln(h,m))return[[i,`they return conflicting types "${Y(h)}" and "${Y(m)}"`],[c],[p]];const E=c.selectionSet,T=p.selectionSet;if(E&&T){const r=function(e,t,n,r,i,o,s,a){const c=[],[u,l]=An(e,t,i,o),[p,d]=An(e,t,s,a);_n(e,c,t,n,r,u,p);for(const i of d)In(e,c,t,n,r,u,i);for(const i of l)In(e,c,t,n,r,p,i);for(const i of l)for(const o of d)gn(e,c,t,n,r,i,o);return c}(e,t,n,f,Ke(h),E,Ke(m),T);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,i,c,p)}}function On(e){const t=e.arguments??[];return ve(Nn({kind:h.OBJECT,fields:t.map((e=>({kind:h.OBJECT_FIELD,name:e.name,value:e.value})))}))}function bn(e){return e.find((e=>"stream"===e.name.value))}function Ln(e,t){return $e(e)?!$e(t)||Ln(e.ofType,t.ofType):!!$e(t)||(Qe(e)?!Qe(t)||Ln(e.ofType,t.ofType):!!Qe(t)||!(!Pe(e)&&!Pe(t))&&e!==t)}function An(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),s=new Set;wn(e,n,r,o,s);const a=[o,[...s]];return t.set(r,a),a}function Dn(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=cn(e.getSchema(),n.typeCondition);return An(e,t,i,n.selectionSet)}function wn(e,t,n,r,i){for(const o of n.selections)switch(o.kind){case h.FIELD:{const e=o.name.value;let n;(Fe(t)||xe(t))&&(n=t.getFields()[e]);const i=o.alias?o.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,o,n]);break}case h.FRAGMENT_SPREAD:i.add(o.name.value);break;case h.INLINE_FRAGMENT:{const n=o.typeCondition,s=n?cn(e.getSchema(),n):t;wn(e,s,o.selectionSet,r,i);break}}}class PairSet{constructor(){this._data=new Map}has(e,t,n){const[r,i]=ee.name));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t[e.name.value]=re(n.filter(xn),(e=>e.name.value))}return{Directive:{leave(n){const r=n.name.value,i=t[r];if(i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of Object.entries(i))if(!o.has(t)){const i=we(s.type)?Y(s.type):ve(s.type);e.reportError(new GraphQLError(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function xn(e){return e.type.kind===h.NON_NULL_TYPE&&null==e.defaultValue}function Rn(e,t,r){if(e){if(e.kind===h.VARIABLE){const n=e.name.value;if(null==r||void 0===r[n])return;const i=r[n];if(null===i&&Qe(t))return;return i}if(Qe(t)){if(e.kind===h.NULL)return;return Rn(e,t.ofType,r)}if(e.kind===h.NULL)return null;if($e(t)){const n=t.ofType;if(e.kind===h.LIST){const t=[];for(const i of e.values)if(Cn(i,r)){if(Qe(n))return;t.push(null)}else{const e=Rn(i,n,r);if(void 0===e)return;t.push(e)}return t}const i=Rn(e,n,r);if(void 0===i)return;return[i]}if(Ge(t)){if(e.kind!==h.OBJECT)return;const n=Object.create(null),i=re(e.fields,(e=>e.name.value));for(const e of Object.values(t.getFields())){const t=i[e.name];if(!t||Cn(t.value,r)){if(void 0!==e.defaultValue)n[e.name]=e.defaultValue;else if(Qe(e.type))return;continue}const o=Rn(t.value,e.type,r);if(void 0===o)return;n[e.name]=o}return n}if(Pe(t)){let n;try{n=t.parseLiteral(e,r)}catch(e){return}if(void 0===n)return;return n}n(!1,"Unexpected input type: "+Y(t))}}function Cn(e,t){return e.kind===h.VARIABLE&&(null==t||void 0===t[e.name.value])}function Gn(e,t,n){const r=t.directives?.find((t=>t.name.value===e.name));if(r)return function(e,t,n){const r={},i=re(t.arguments??[],(e=>e.name.value));for(const a of e.args){const e=a.name,c=a.type,u=i[e];if(!u){if(void 0!==a.defaultValue)r[e]=a.defaultValue;else if(Qe(c))throw new GraphQLError(`Argument "${e}" of required type "${Y(c)}" was not provided.`,{nodes:t});continue}const l=u.value;let p=l.kind===h.NULL;if(l.kind===h.VARIABLE){const t=l.name.value;if(null==n||(o=n,s=t,!Object.prototype.hasOwnProperty.call(o,s))){if(void 0!==a.defaultValue)r[e]=a.defaultValue;else if(Qe(c))throw new GraphQLError(`Argument "${e}" of required type "${Y(c)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:l});continue}p=null==n[t]}if(p&&Qe(c))throw new GraphQLError(`Argument "${e}" of non-null type "${Y(c)}" must not be null.`,{nodes:l});const d=Rn(l,c,n);if(void 0===d)throw new GraphQLError(`Argument "${e}" has invalid value ${ve(l)}.`,{nodes:l});r[e]=d}var o,s;return r}(e,r,n)}function $n(e,t,n,r,i){const o=new AccumulatorMap,s=[];return Qn(e,t,n,r,i,o,s,new Set),{fields:o,patches:s}}function Qn(e,t,n,r,i,o,s,a){for(const u of i.selections)switch(u.kind){case h.FIELD:if(!Vn(n,u))continue;o.add((c=u).alias?c.alias.value:c.name.value,u);break;case h.INLINE_FRAGMENT:{if(!Vn(n,u)||!Pn(e,u,r))continue;const i=Un(n,u);if(i){const o=new AccumulatorMap;Qn(e,t,n,r,u.selectionSet,o,s,a),s.push({label:i.label,fields:o})}else Qn(e,t,n,r,u.selectionSet,o,s,a);break}case h.FRAGMENT_SPREAD:{const i=u.name.value;if(!Vn(n,u))continue;const c=Un(n,u);if(a.has(i)&&!c)continue;const l=t[i];if(!l||!Pn(e,l,r))continue;if(c||a.add(i),c){const i=new AccumulatorMap;Qn(e,t,n,r,l.selectionSet,i,s,a),s.push({label:c.label,fields:i})}else Qn(e,t,n,r,l.selectionSet,o,s,a);break}}var c}function Un(e,t){const n=Gn(_t,t,e);if(n&&!1!==n.if)return{label:"string"==typeof n.label?n.label:void 0}}function Vn(e,t){const n=Gn(gt,t,e);if(!0===n?.if)return!1;const r=Gn(It,t,e);return!1!==r?.if}function Pn(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=cn(e,r);return i===n||!!je(i)&&e.isSubType(i,n)}function Mn(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function jn(e){return{Field:t,Directive:t};function t(t){const n=Mn(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function Bn(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t[e.name]=!e.isRepeatable;const i=e.getDocument().definitions;for(const e of i)e.kind===h.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const o=Object.create(null),s=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION)r=o;else if(dn(n)||fn(n)){const e=n.name.value;r=s[e],void 0===r&&(s[e]=r=Object.create(null))}else r=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(r[n]?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}function Yn(e,t){return!!(Fe(e)||xe(e)||Ge(e))&&null!=e.getFields()[t]}function Jn(e){const t=[];let r=Object.create(null);return{ObjectValue:{enter(){t.push(r),r=Object.create(null)},leave(){const e=t.pop();null!=e||n(!1),r=e}},ObjectField(t){const n=t.name.value;r[n]?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[r[n],t.name]})):r[n]=t.name}}}function qn(e,t){const n=e.getInputType();if(!n)return;const r=Ke(n);if(Pe(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${ve(t)}.`,{nodes:t}))}}catch(r){const i=Y(n);r instanceof GraphQLError?e.reportError(r):e.reportError(new GraphQLError(`Expected value of type "${i}", found ${ve(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${ve(t)}.`,{nodes:t}))}}function Kn(e,t,n,r,i){if(Qe(r)&&!Qe(t)){if(!(null!=n&&n.kind!==h.NULL)&&!(void 0!==i))return!1;return ct(e,t,r.ofType)}return ct(e,t,r)}const Xn=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!pn(n)){const t=n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(t[r.value]?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===h.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===h.FRAGMENT_DEFINITION&&(a[e.name.value]=e);const{fields:c}=$n(n,a,o,r,t.selectionSet);if(c.size>1){const t=[...c.values()].slice(1).flat();e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){t[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}},En,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=cn(e.getSchema(),n);if(t&&!Me(t)){const t=ve(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=cn(e.getSchema(),t.typeCondition);if(n&&!Me(n)){const n=ve(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=cn(e.getSchema(),t.type);if(void 0!==n&&!Ue(n)){const n=t.variable.name.value,r=ve(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Pe(Ke(n))){if(r){const i=t.name.value,o=Y(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){const r=t.name.value,i=Y(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=te("to use an inline fragment on",function(e,t,n){if(!je(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:xe(t)&&e.isSubType(t,n)?-1:xe(n)&&e.isSubType(n,t)?1:se(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=te(function(e,t){if(Fe(e)||xe(e)){return le(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n.name}".`+o,{nodes:t}))}}}}},function(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return t[r]?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},yn,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Me(n)&&Me(r)&&!ut(e.getSchema(),n,r)){const i=Y(r),o=Y(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=cn(e.getSchema(),n.typeCondition);if(Me(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!ut(e.getSchema(),r,i)){const o=Y(i),s=Y(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=Mn(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i}of r){const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},mn,Bn,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===_t.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i.name}".`,{nodes:t}))),i&&t.name.value===St.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i.name}".`,{nodes:t})))}}},function(e){const t=Object.create(null);return{Directive(n){if(n.name.value===_t.name||n.name.value===St.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;i.kind!==h.STRING?e.reportError(new GraphQLError(`Directive "${n.name.value}"'s label argument must be a static string.`,{nodes:n})):t[i.value]?e.reportError(new GraphQLError("Defer/Stream directive label argument must be unique.",{nodes:[t[i.value],n]})):t[i.value]=n}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===St.name&&!($e(n.type)||Be(n.type)&&$e(n.type.ofType))&&e.reportError(new GraphQLError(`Stream directive cannot be used on non-list field "${n.name}" on type "${r.name}".`,{nodes:t}))}}},function(e){return{...hn(e),Argument(t){const n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){const n=t.name.value,o=le(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+te(o),{nodes:t}))}}}},jn,function(e){return{ListValue(t){if(!$e(Je(e.getParentInputType())))return qn(e,t),!1},ObjectValue(t){const n=Ke(e.getInputType());if(!Ge(n))return qn(e,t),!1;const r=re(t.fields,(e=>e.name.value));for(const i of Object.values(n.getFields())){if(!r[i.name]&&st(i)){const r=Y(i.type);e.reportError(new GraphQLError(`Field "${n.name}.${i.name}" of required type "${r}" was not provided.`,{nodes:t}))}}},ObjectField(t){const n=Ke(e.getParentInputType());if(!e.getInputType()&&Ge(n)){const r=le(t.name.value,Object.keys(n.getFields()));e.reportError(new GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+te(r),{nodes:t}))}},NullValue(t){const n=e.getInputType();Qe(n)&&e.reportError(new GraphQLError(`Expected value of type "${Y(n)}", found ${ve(t)}.`,{nodes:t}))},EnumValue:t=>qn(e,t),IntValue:t=>qn(e,t),FloatValue:t=>qn(e,t),StringValue:t=>qn(e,t),BooleanValue:t=>qn(e,t)}},function(e){return{...Fn(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)if(!r.has(i.name)&&nt(i)){const r=Y(i.type);e.reportError(new GraphQLError(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,defaultValue:o}of r){const r=n.name.value,s=t[r];if(s&&i){const t=e.getSchema(),a=cn(t,s.type);if(a&&!Kn(t,a,s.defaultValue,i,o)){const t=Y(a),o=Y(i);e.reportError(new GraphQLError(`Variable "$${r}" of type "${t}" used in position expecting type "${o}".`,{nodes:[s,n]}))}}}}},VariableDefinition(e){t[e.variable.name.value]=e}}},function(e){const t=new PairSet,n=new Map;return{SelectionSet(r){const i=function(e,t,n,r,i){const o=[],[s,a]=An(e,t,r,i);if(function(e,t,n,r,i){for(const[o,s]of Object.entries(i))if(s.length>1)for(let i=0;i0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n[i];r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n[i]=t}return!1}},function(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(!n?.getType(i))return t[i]?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}))}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;r[i]||(r[i]=Object.create(null));const o=t.values??[],s=r[i];for(const t of o){const r=t.name.value,o=n[i];Ce(o)&&o.getValue(r)?e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;r[i]||(r[i]=Object.create(null));const o=t.fields??[],s=r[i];for(const t of o){const r=t.name.value;Yn(n[i],r)?e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=Mn(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(!n?.getDirective(i))return t[i]?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}))}}},En,mn,Bn,function(e){const t=e.getSchema(),r=Object.create(null);for(const t of e.getDocument().definitions)dn(t)&&(r[t.name.value]=t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r[o],a=t?.getType(o);let c;if(s?c=kn[s.kind]:a&&(c=function(e){if(ke(e))return h.SCALAR_TYPE_EXTENSION;if(Fe(e))return h.OBJECT_TYPE_EXTENSION;if(xe(e))return h.INTERFACE_TYPE_EXTENSION;if(Re(e))return h.UNION_TYPE_EXTENSION;if(Ce(e))return h.ENUM_TYPE_EXTENSION;if(Ge(e))return h.INPUT_OBJECT_TYPE_EXTENSION;n(!1,"Unexpected type: "+Y(e))}(a)),c){if(c!==i.kind){const t=function(e){switch(e){case h.SCALAR_TYPE_EXTENSION:return"scalar";case h.OBJECT_TYPE_EXTENSION:return"object";case h.INTERFACE_TYPE_EXTENSION:return"interface";case h.UNION_TYPE_EXTENSION:return"union";case h.ENUM_TYPE_EXTENSION:return"enum";case h.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:n(!1,"Unexpected kind: "+Y(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=le(o,Object.keys({...r,...t?.getTypeMap()}));e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+te(n),{nodes:i.name}))}}},hn,jn,Jn,Fn]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===h.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===h.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema);Te(e,ln(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Hn(e,t,n=Xn,r,i=new TypeInfo(e)){const o=r?.maxErrors??100;!function(e){const t=Kt(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const s=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),a=[],c=new ValidationContext(e,t,i,(e=>{if(a.length>=o)throw s;a.push(e)})),u=ye(n.map((e=>e(c))));try{Te(t,ln(i,u))}catch(e){if(e!==s)throw e;a.push(s)}return a}function Wn(e,t,n=zn){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return Te(e,ye(n.map((e=>e(i))))),r}function Zn(e,n){t(e)&&t(e.__schema)||M(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Y(e)}.`);const r=e.__schema,i=ie(r.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case Ut.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Ut.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>f(n),fields:()=>h(n)});case Ut.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>f(t),fields:()=>h(t)});case Ut.UNION:return function(e){if(!e.possibleTypes){const t=Y(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Ut.ENUM:return function(e){if(!e.enumValues){const t=Y(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:ie(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Ut.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=Y(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>T(e.inputFields)})}(e)}var t;var n;var r;const i=Y(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}(e)));for(const e of[...Tt,...Bt])i[e.name]&&(i[e.name]=e);const o=r.queryType?p(r.queryType):null,s=r.mutationType?p(r.mutationType):null,a=r.subscriptionType?p(r.subscriptionType):null,c=r.directives?r.directives.map((function(e){if(!e.args){const t=Y(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=Y(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:T(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:Object.values(i),directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Ut.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Ut.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(Ye(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Y(e)}.`);const n=i[t];if(!n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!Fe(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!xe(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){if(null===e.interfaces&&e.kind===Ut.INTERFACE)return[];if(!e.interfaces){const t=Y(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function h(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${Y(e)}.`);return ie(e.fields,(e=>e.name),E)}function E(e){const t=u(e.type);if(!Ve(t)){const e=Y(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=Y(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:T(e.args)}}function T(e){return ie(e,(e=>e.name),y)}function y(e){const t=u(e.type);if(!Ue(t)){const e=Y(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?Rn(function(e,t){const n=new Parser(e,t);n.expectToken(m.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(m.EOF),r}(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}}function er(e,t,n){Jt(e),!0!==n?.assumeValid&&!0!==n?.assumeValidSDL&&function(e,t){const n=Wn(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))}(t,e);const r=e.toConfig(),i=tr(r,t,n);return r===i?e:new GraphQLSchema(i)}function tr(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let m=!1;for(const e of t.definitions){switch(e.kind){case h.SCHEMA_DEFINITION:d=e;break;case h.SCHEMA_EXTENSION:f.push(e);break;case h.DIRECTIVE_DEFINITION:p.push(e);break;case h.SCALAR_TYPE_DEFINITION:case h.OBJECT_TYPE_DEFINITION:case h.INTERFACE_TYPE_DEFINITION:case h.UNION_TYPE_DEFINITION:case h.ENUM_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_DEFINITION:i.push(e);break;case h.SCALAR_TYPE_EXTENSION:o.add(e.name.value,e);break;case h.OBJECT_TYPE_EXTENSION:s.add(e.name.value,e);break;case h.INTERFACE_TYPE_EXTENSION:a.add(e.name.value,e);break;case h.UNION_TYPE_EXTENSION:c.add(e.name.value,e);break;case h.ENUM_TYPE_EXTENSION:u.add(e.name.value,e);break;case h.INPUT_OBJECT_TYPE_EXTENSION:l.add(e.name.value,e);break;default:continue}m=!0}if(!m)return e;const E=Object.create(null);for(const t of e.types)E[t.name]=v(t);for(const e of i){const t=e.name.value;E[t]=nr[t]??F(e)}const T={query:e.query&&N(e.query),mutation:e.mutation&&N(e.mutation),subscription:e.subscription&&N(e.subscription),...d&&_([d]),..._(f)};return{description:d?.description?.value,...T,types:Object.values(E),directives:[...e.directives.map((function(e){if(Dt(e))return e;const t=e.toConfig();return new GraphQLDirective({...t,args:oe(t.args,g)})})),...p.map((function(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:L(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1};function y(e){return $e(e)?new GraphQLList(y(e.ofType)):Qe(e)?new GraphQLNonNull(y(e.ofType)):N(e)}function N(e){return E[e.name]}function v(e){return Yt(e)||yt(e)?e:ke(e)?function(e){const t=e.toConfig(),n=o.get(t.name)??[];let r=t.specifiedByURL;for(const e of n)r=ir(e)??r;return new GraphQLScalarType({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Fe(e)?function(e){const t=e.toConfig(),n=s.get(t.name)??[];return new GraphQLObjectType({...t,interfaces:()=>[...e.getInterfaces().map(N),...w(n)],fields:()=>({...oe(t.fields,I),...b(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):xe(e)?function(e){const t=e.toConfig(),n=a.get(t.name)??[];return new GraphQLInterfaceType({...t,interfaces:()=>[...e.getInterfaces().map(N),...w(n)],fields:()=>({...oe(t.fields,I),...b(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Re(e)?function(e){const t=e.toConfig(),n=c.get(t.name)??[];return new GraphQLUnionType({...t,types:()=>[...e.getTypes().map(N),...k(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Ce(e)?function(e){const t=e.toConfig(),n=u.get(e.name)??[];return new GraphQLEnumType({...t,values:{...t.values,...D(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Ge(e)?function(e){const t=e.toConfig(),n=l.get(t.name)??[];return new GraphQLInputObjectType({...t,fields:()=>({...oe(t.fields,(e=>({...e,type:y(e.type)}))),...A(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):void n(!1,"Unexpected type: "+Y(e))}function I(e){return{...e,type:y(e.type),args:e.args&&oe(e.args,g)}}function g(e){return{...e,type:y(e.type)}}function _(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=S(n.type)}return t}function S(e){const t=e.name.value,n=nr[t]??E[t];if(void 0===n)throw new Error(`Unknown type: "${t}".`);return n}function O(e){return e.kind===h.LIST_TYPE?new GraphQLList(O(e.type)):e.kind===h.NON_NULL_TYPE?new GraphQLNonNull(O(e.type)):S(e)}function b(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:O(n.type),description:n.description?.value,args:L(n.arguments),deprecationReason:rr(n),astNode:n}}return t}function L(e){const t=e??[],n=Object.create(null);for(const e of t){const t=O(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Rn(e.defaultValue,t),deprecationReason:rr(e),astNode:e}}return n}function A(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=O(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Rn(n.defaultValue,e),deprecationReason:rr(n),astNode:n}}}return t}function D(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:rr(n),astNode:n}}return t}function w(e){return e.flatMap((e=>e.interfaces?.map(S)??[]))}function k(e){return e.flatMap((e=>e.types?.map(S)??[]))}function F(e){const t=e.name.value;switch(e.kind){case h.OBJECT_TYPE_DEFINITION:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case h.INTERFACE_TYPE_DEFINITION:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case h.ENUM_TYPE_DEFINITION:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:D(r),astNode:e,extensionASTNodes:n})}case h.UNION_TYPE_DEFINITION:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>k(r),astNode:e,extensionASTNodes:n})}case h.SCALAR_TYPE_DEFINITION:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:ir(e),astNode:e,extensionASTNodes:n})}case h.INPUT_OBJECT_TYPE_DEFINITION:{const n=l.get(t)??[],r=[e,...n];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>A(r),astNode:e,extensionASTNodes:n})}}}}const nr=re([...Tt,...Bt],(e=>e.name));function rr(e){const t=Gn(bt,e);return t?.reason}function ir(e){const t=Gn(Lt,e);return t?.url}function or(e,t){!0!==t?.assumeValid&&!0!==t?.assumeValidSDL&&function(e){const t=Wn(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const n=tr({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...At.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}function sr(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[cr(e),...i.map((e=>function(e){return mr(e)+"directive @"+e.name+dr(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(ke(e))return function(e){return mr(e)+`scalar ${e.name}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ve({kind:h.STRING,value:e.specifiedByURL})})`}(e)}(e);if(Fe(e))return function(e){return mr(e)+`type ${e.name}`+ur(e)+lr(e)}(e);if(xe(e))return function(e){return mr(e)+`interface ${e.name}`+ur(e)+lr(e)}(e);if(Re(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return mr(e)+"union "+e.name+n}(e);if(Ce(e))return function(e){const t=e.getValues().map(((e,t)=>mr(e," ",!t)+" "+e.name+hr(e.deprecationReason)));return mr(e)+`enum ${e.name}`+pr(t)}(e);if(Ge(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>mr(e," ",!t)+" "+fr(e)));return mr(e)+`input ${e.name}`+pr(t)}(e);n(!1,"Unexpected type: "+Y(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Dt(e)),ar)}function ar(e){return!yt(e)&&!Yt(e)}function cr(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();if(r&&"Subscription"!==r.name)return!1;return!0}(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),mr(e)+`schema {\n${t.join("\n")}\n}`}function ur(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function lr(e){return pr(Object.values(e.getFields()).map(((e,t)=>mr(e," ",!t)+" "+e.name+dr(e.args," ")+": "+String(e.type)+hr(e.deprecationReason))))}function pr(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function dr(e,t=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(fr).join(", ")+")":"(\n"+e.map(((e,n)=>mr(e," "+t,!n)+" "+t+fr(e))).join("\n")+"\n"+t+")"}function fr(e){const t=wt(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${ve(t)}`),n+hr(e.deprecationReason)}function hr(e){if(null==e)return"";if(e!==Ot){return` @deprecated(reason: ${ve({kind:h.STRING,value:e})})`}return" @deprecated"}function mr(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ve({kind:h.STRING,value:r,block:_(r)}).replace(/\n/g,"\n"+t)+"\n"}function Er(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:h.DOCUMENT,definitions:t}}const Tr=[yn];function yr(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Nr,vr,Ir,...n?[n]:[],...r?[r]:[],...Xn.filter((e=>!Tr.includes(e)))]}function Nr(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function vr(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Ir(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==_t.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))},FragmentSpread(t){if(t.directives)for(const n of t.directives)n.name.value==_t.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))}}}function gr(e){return{kind:h.NAME,value:e}}function _r(e){return{kind:h.STRING,value:e}}function Sr(e){return{kind:h.DIRECTIVE_DEFINITION,description:e.description?_r(e.description):void 0,name:gr(e.name),repeatable:!1,locations:e.locations.map((e=>gr(e))),arguments:e.args.map((e=>function(e){return{kind:h.INPUT_VALUE_DEFINITION,description:_r(e.description),name:gr(e.name),type:(t=Ke(e.type),{kind:h.NAMED_TYPE,name:gr(t.name)})};var t}(e)))}}const Or={kind:h.DIRECTIVE_DEFINITION,description:_r("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:gr("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[gr("QUERY"),gr("MUTATION"),gr("SUBSCRIPTION"),gr("FRAGMENT_DEFINITION")]},br={kind:h.DOCUMENT,definitions:[Or]};const Lr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Ar(e){return e.startsWith("__")}const Dr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};function wr(e,t){return t&&(e=function(e){return Te(e,{enter:e=>e.kind!==h.SELECTION_SET?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===h.FIELD||e.kind===h.FRAGMENT_DEFINITION||e.kind===h.INLINE_FRAGMENT)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Lr,...e.selectionSet.selections]}}}})}(e)),Te(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![h.FIELD,h.FRAGMENT_DEFINITION].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==Dr.kind&&e.name.value==Dr.name.value));return t?e:{...e,selections:[Dr,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==Dr.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){return e.name.value==Or.name.value?null:e}(e)}})}function kr(e){return null!=e}function Fr(e){switch(e.kind){case h.VARIABLE:return{kind:e.kind,value:e.name.value};case h.LIST:return{kind:e.kind,value:e.values.map(Fr)};case h.OBJECT:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=Fr(t.value),e)),{})};default:return e}}function xr(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function Rr(e,t,n,r){var i,o,s;const a=new Map;for(const e of t.definitions)e.kind===h.FRAGMENT_DEFINITION&&a.set(e.name.value,e);const c=[],u=new Map,l=new Set,p=e.getQueryType();if(void 0===p)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const d={queryType:p,mutationType:null!==(i=e.getMutationType())&&void 0!==i?i:void 0,subscriptionType:null!==(o=e.getSubscriptionType())&&void 0!==o?o:void 0};for(const e of t.definitions)e.kind===h.OPERATION_DEFINITION&&c.push(m(e));for(const[e,t]of a.entries())u.set(e,E(t));return{rootTypes:d,operations:c,fragments:Array.from(u.values()),referencedTypes:Array.from(l.values()),schemaDocumentation:null!==(s=e.description)&&void 0!==s?s:void 0};function f(t){if(!l.has(t)){if(l.add(t),xe(t))for(const n of e.getPossibleTypes(t))f(Ke(n));if(Re(t)){const e=t.getTypes();for(t of e)f(Ke(t))}if(Ge(t)&&function(e){const t=e.getFields();for(const e in t){f(Ke(t[e].type))}}(t),Fe(t))for(const e of t.getInterfaces())f(Ke(e))}}function m(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=xr(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?Fr(t.defaultValue):void 0,i=cn(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return f(Ke(i)),{name:n,type:i,defaultValue:r}})),u=ve(wr(t,n)),l=e.getRootType(s),[p]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(l),{name:o,operationType:s,variables:c,rootType:l,selectionSet:T(t.selectionSet,l,a),directives:p,referencedFragments:Array.from(a.values()),source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=xr(t),s=ve(wr(t,n)),a=new Set,c=cn(e,t.typeCondition),[u]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(Ke(c)),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:T(t.selectionSet,c,a),directives:u,referencedFragments:Array.from(a.values())}}function T(t,n,i){return{parentType:n,selections:t.selections.map((t=>function(t,n,i){var o,s,c,l;const[p,d]=null!==(o=N(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case h.FIELD:{const m=t.name.value;if("__typename"==m)return;const v=null===(s=t.alias)||void 0===s?void 0:s.value,I=function(e,t,n){return n===Pt.name&&e.getQueryType()===t?Pt:n===Mt.name&&e.getQueryType()===t?Mt:n===jt.name&&(Fe(t)||xe(t)||Re(t))?jt:Fe(t)||xe(t)?t.getFields()[n]:void 0}(e,n,m);if(!I)throw new GraphQLError(`Cannot query field "${m}" on type "${String(n)}"`,{nodes:t});const g=I.type,_=Ke(I.type);f(Ke(_));const{description:S,deprecationReason:O}=I;let b={kind:"Field",name:m,alias:v,type:g,arguments:y(I,t.arguments),inclusionConditions:d,description:!Ar(m)&&S?S:void 0,deprecationReason:O||void 0,directives:p};function L(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if($e(g)||Qe(g)&&$e(g.ofType)?L(t,null===(c=r.disallowedFieldNames)||void 0===c?void 0:c.entityList,r.schemaNamespace):Me(_)&&L(t,null===(l=r.disallowedFieldNames)||void 0===l?void 0:l.entity,r.schemaNamespace),Me(_)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${m}" on type "${String(n)}" requires selection set`,{nodes:t});b.selectionSet=T(A,_,i)}return b}case h.INLINE_FRAGMENT:{const D=t.typeCondition,w=D?cn(e,D):n;return f(w),{kind:"InlineFragment",selectionSet:T(t.selectionSet,w,i),inclusionConditions:d,directives:p}}case h.FRAGMENT_SPREAD:{const k=t.name.value,F=function(e){let t=u.get(e);if(t)return t;const n=a.get(e);return n?(a.delete(e),t=E(n),u.set(e,t),t):void 0}(k);if(!F)throw new GraphQLError(`Unknown fragment "${k}".`,{nodes:t.name});i.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,i))).filter(kr)}}function y(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:Fr(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function N(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:y(o,i.arguments)});const s=v(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function v(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case h.BOOLEAN:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case h.VARIABLE:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function Cr(){return{kind:h.DOCUMENT,definitions:[Sr(_t)]}}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r){return Rr(e,t,n,r)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(K(r));var r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==Or.name.value))?e:Er([e,br])}(Er(n));r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==_t.name))?e:Er([e,Cr()])}(r),t||function(e){const t=Wn(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(r);const i=t?er(function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=Zn(t);return n}(t.body),r,{assumeValid:!0,assumeValidSDL:!0}):or(r,{assumeValid:!0,assumeValidSDL:!0});return function(e){const t=Kt(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(i),i},e.mergeDocuments=function(e){return Er(e)},e.parseOperationDocument=function(e){return K(e)},e.printSchemaToSDL=function(e){return sr(e)},e.validateDocument=function(e,t,n){return Hn(e,t,yr(n))},e}({});"# \ No newline at end of file +let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){if(!e)throw new Error(null!=t?t:"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(!1),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet","nullabilityAssertion"],Argument:["name","value"],ListNullabilityOperator:["nullabilityAssertion"],NonNullAssertion:["nullabilityAssertion"],ErrorBoundary:["nullabilityAssertion"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}var d,f,h,m;function E(e){return 9===e||32===e}function T(e){return e>=48&&e<=57}function y(e){return e>=97&&e<=122||e>=65&&e<=90}function N(e){return y(e)||95===e}function v(e){return y(e)||T(e)||95===e}function I(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function g(e){let t=0;for(;t",e.EOF="",e.BANG="!",e.QUESTION_MARK="?",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(m||(m={}));class Lexer{constructor(e){const t=new Token(m.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==m.EOF)do{if(e.next)e=e.next;else{const t=D(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===m.COMMENT);return e}}function O(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function S(e,t){return L(e.charCodeAt(t))&&b(e.charCodeAt(t+1))}function L(e){return e>=55296&&e<=56319}function b(e){return e>=56320&&e<=57343}function A(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return m.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function w(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function D(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function U(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oB)return"[Array]";const n=Math.min(j,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>B)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+J(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const K=null!=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Y(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function q(e,t){return new Parser(e,t).parseDocument()}class Parser{constructor(e,t={}){const n=function(e){return K(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(m.NAME);return this.node(e,{kind:h.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:h.DOCUMENT,definitions:this.many(m.SOF,this.parseDefinition,m.EOF)})}parseDefinition(){if(this.peek(m.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===m.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(m.BRACE_L))return this.node(e,{kind:h.OPERATION_DEFINITION,operation:d.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(m.NAME)&&(n=this.parseName()),this.node(e,{kind:h.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(m.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(m.PAREN_L,this.parseVariableDefinition,m.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(m.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(m.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(m.DOLLAR),this.node(e,{kind:h.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:h.SELECTION_SET,selections:this.many(m.BRACE_L,this.parseSelection,m.BRACE_R)})}parseSelection(){return this.peek(m.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(m.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:h.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),nullabilityAssertion:this.parseNullabilityAssertion(),directives:this.parseDirectives(!1),selectionSet:this.peek(m.BRACE_L)?this.parseSelectionSet():void 0})}parseNullabilityAssertion(){if(!0!==this._options.experimentalClientControlledNullability)return;const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseNullabilityAssertion();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_NULLABILITY_OPERATOR,nullabilityAssertion:n})}return this.expectOptionalToken(m.BANG)?t=this.node(e,{kind:h.NON_NULL_ASSERTION,nullabilityAssertion:t}):this.expectOptionalToken(m.QUESTION_MARK)&&(t=this.node(e,{kind:h.ERROR_BOUNDARY,nullabilityAssertion:t})),t}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(m.PAREN_L,t,m.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(m.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(m.NAME)?this.node(e,{kind:h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case m.BRACKET_L:return this.parseList(e);case m.BRACE_L:return this.parseObject(e);case m.INT:return this.advanceLexer(),this.node(t,{kind:h.INT,value:t.value});case m.FLOAT:return this.advanceLexer(),this.node(t,{kind:h.FLOAT,value:t.value});case m.STRING:case m.BLOCK_STRING:return this.parseStringLiteral();case m.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:h.BOOLEAN,value:!0});case"false":return this.node(t,{kind:h.BOOLEAN,value:!1});case"null":return this.node(t,{kind:h.NULL});default:return this.node(t,{kind:h.ENUM,value:t.value})}case m.DOLLAR:if(e){if(this.expectToken(m.DOLLAR),this._lexer.token.kind===m.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:h.STRING,value:e.value,block:e.kind===m.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:h.LIST,values:this.any(m.BRACKET_L,(()=>this.parseValueLiteral(e)),m.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:h.OBJECT,fields:this.any(m.BRACE_L,(()=>this.parseObjectField(e)),m.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(m.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(m.AT),this.node(t,{kind:h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(m.BANG)?this.node(e,{kind:h.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:h.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(m.STRING)||this.peek(m.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);return this.node(e,{kind:h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(m.COLON);const n=this.parseNamedType();return this.node(e,{kind:h.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(m.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseFieldDefinition,m.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(m.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(m.PAREN_L,this.parseInputValueDef,m.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(m.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(m.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:h.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(m.EQUALS)?this.delimitedMany(m.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(m.BRACE_L,this.parseEnumValueDefinition,m.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${X(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseInputValueDef,m.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===m.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(m.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(m.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${z(e)}, found ${X(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==m.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${X(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===m.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${X(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==m.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function X(e){const t=e.value;return z(e.kind)+(null!=t?` "${t}"`:"")}function z(e){return function(e){return e===m.BANG||e===m.QUESTION_MARK||e===m.DOLLAR||e===m.AMP||e===m.PAREN_L||e===m.PAREN_R||e===m.SPREAD||e===m.COLON||e===m.EQUALS||e===m.AT||e===m.BRACKET_L||e===m.BRACKET_R||e===m.BRACE_L||e===m.PIPE||e===m.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function H(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function W(e){return Z("and",e)}function Z(e,t){switch(0!==t.length||n(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}const ee=5;function te(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Z("or",r.slice(0,ee).map((e=>`"${e}"`)))+"?"}function ne(e){return e}function re(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function ie(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function oe(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-se,o=t.charCodeAt(r)}while(ce(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const se=48,ae=57;function ce(e){return!isNaN(e)&&se<=e&&e<=ae}function ue(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:oe(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=le(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=le(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function le(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ie(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=_e("(",Ie(e.variableDefinitions,", "),")"),n=Ie([e.operation,Ie([e.name,t]),Ie(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+_e(" = ",n)+_e(" ",Ie(r," "))},SelectionSet:{leave:({selections:e})=>ge(e)},Field:{leave({alias:e,name:t,arguments:n,nullabilityAssertion:r,directives:i,selectionSet:o}){const s=Ie([_e("",e,": "),t],"");let a=s+_e("(",Ie(n,", "),")");return a.length>80&&(a=s+_e("(\n",Oe(Ie(n,"\n")),"\n)")),Ie([a,r,_e(" ",Ie(i," ")),_e(" ",o)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},ListNullabilityOperator:{leave:({nullabilityAssertion:e})=>Ie(["[",e,"]"])},NonNullAssertion:{leave:({nullabilityAssertion:e})=>Ie([e,"!"])},ErrorBoundary:{leave:({nullabilityAssertion:e})=>Ie([e,"?"])},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+_e(" ",Ie(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ie(["...",_e("on ",e),Ie(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${_e("(",Ie(n,", "),")")} on ${t} ${_e("",Ie(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e,t){const n=e.replaceAll('"""','\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every((e=>0===e.length||E(e.charCodeAt(0)))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!t?.minimize&&(!i||e.length>70||u||o||s);let p="";const d=i&&E(e.charCodeAt(0));return(l&&!d||o)&&(p+="\n"),p+=n,(l||u)&&(p+="\n"),'"""'+p+'"""'}(e):`"${e.replace(de,fe)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+Ie(e,", ")+"]";return t.length>80?"[\n"+Oe(Ie(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+Ie(e,", ")+" }";return t.length>80?ge(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+_e("(",Ie(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>_e("",e,"\n")+Ie(["schema",Ie(t," "),ge(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>_e("",e,"\n")+Ie(["scalar",t,Ie(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>_e("",e,"\n")+Ie(["type",t,_e("implements ",Ie(n," & ")),Ie(r," "),ge(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>_e("",e,"\n")+t+(Se(n)?_e("(\n",Oe(Ie(n,"\n")),"\n)"):_e("(",Ie(n,", "),")"))+": "+r+_e(" ",Ie(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>_e("",e,"\n")+Ie([t+": "+n,_e("= ",r),Ie(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>_e("",e,"\n")+Ie(["interface",t,_e("implements ",Ie(n," & ")),Ie(r," "),ge(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>_e("",e,"\n")+Ie(["union",t,Ie(n," "),_e("= ",Ie(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>_e("",e,"\n")+Ie(["enum",t,Ie(n," "),ge(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>_e("",e,"\n")+Ie([t,Ie(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>_e("",e,"\n")+Ie(["input",t,Ie(n," "),ge(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>_e("",e,"\n")+"directive @"+t+(Se(n)?_e("(\n",Oe(Ie(n,"\n")),"\n)"):_e("(",Ie(n,", "),")"))+(r?" repeatable":"")+" on "+Ie(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ie(["extend schema",Ie(e," "),ge(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ie(["extend scalar",e,Ie(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ie(["extend type",e,_e("implements ",Ie(t," & ")),Ie(n," "),ge(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ie(["extend interface",e,_e("implements ",Ie(t," & ")),Ie(n," "),ge(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ie(["extend union",e,Ie(t," "),_e("= ",Ie(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ie(["extend enum",e,Ie(t," "),ge(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ie(["extend input",e,Ie(t," "),ge(n)]," ")}};function Ie(e,t=""){return e?.filter((e=>e)).join(t)??""}function ge(e){return _e("{\n",Oe(Ie(e,"\n")),"\n}")}function _e(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Oe(e){return _e(" ",e.replaceAll("\n","\n "))}function Se(e){return e?.some((e=>e.includes("\n")))??!1}function Le(e,t){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map((e=>Le(e,t)));case h.OBJECT:return re(e.fields,(e=>e.name.value),(e=>Le(e.value,t)));case h.VARIABLE:return t?.[e.name.value]}}function be(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tt(Le(e,n))),this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||P(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=be(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=He.bind(void 0,e.fields),this._interfaces=ze.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ze(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ze(e){return qe(e??[])}function He(e){return ie(Xe(e),((e,t)=>{const n=e.args??{};return{name:be(t),description:e.description,type:e.type,args:We(n),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:pe(e.extensions),astNode:e.astNode}}))}function We(e){return Object.entries(e).map((([e,t])=>({name:be(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:pe(t.extensions),astNode:t.astNode})))}function Ze(e){return ie(e,(e=>({description:e.description,type:e.type,args:et(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function et(e){return re(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function tt(e){return $e(e.type)&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=be(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=He.bind(void 0,e.fields),this._interfaces=ze.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ze(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=be(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=nt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function nt(e){return qe(e)}class GraphQLEnumType{constructor(e){this.name=be(e.name),this.description=e.description,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=Object.entries(e.values).map((([e,t])=>({name:Ae(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:pe(t.extensions),astNode:t.astNode}))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=function(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Y(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=Y(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+rt(this,t))}const t=this.getValue(e);if(null==t)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+rt(this,e));return t.value}parseLiteral(e,t){if(e.kind!==h.ENUM){const t=Ne(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+rt(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=Ne(e);throw new GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+rt(this,t),{nodes:e})}return n.value}toConfig(){const e=re(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function rt(e,t){return te("the enum value",ue(t,e.getValues().map((e=>e.name))))}class GraphQLInputObjectType{constructor(e){this.name=be(e.name),this.description=e.description,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=it.bind(void 0,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=ie(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function it(e){return ie(Xe(e),((e,t)=>({name:be(t),description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:pe(e.extensions),astNode:e.astNode})))}function ot(e){return $e(e.type)&&void 0===e.defaultValue}function st(e,t){return e===t||($e(e)&&$e(t)||!(!Ge(e)||!Ge(t)))&&st(e.ofType,t.ofType)}function at(e,t,n){return t===n||($e(n)?!!$e(t)&&at(e,t.ofType,n.ofType):$e(t)?at(e,t.ofType,n):Ge(n)?!!Ge(t)&&at(e,t.ofType,n.ofType):!Ge(t)&&(Pe(n)&&(Fe(t)||ke(t))&&e.isSubType(n,t)))}function ct(e,t,n){return t===n||(Pe(t)?Pe(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Pe(n)&&e.isSubType(n,t))}const ut=2147483647,lt=-2147483648,pt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=yt(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Y(t)}`);if(n>ut||nut||eut||te.name===t))}function yt(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Nt(e){return K(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=be(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=pe(e.extensions),this.astNode=e.astNode;const t=e.args??{};this.args=We(t)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:et(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const vt=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(ht),description:"Included when true."}}}),It=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(ht),description:"Skipped when true."}}}),gt=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(ht),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:ft,description:"Unique name"}}}),_t=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{if:{type:new GraphQLNonNull(ht),description:"Stream when true or undefined.",defaultValue:!0},label:{type:ft,description:"Unique name"},initialCount:{defaultValue:0,type:pt,description:"Number of items to return immediately"}}}),Ot="No longer supported",St=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:ft,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Ot}}}),Lt=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(ft),description:"The URL that specifies the behavior of this scalar."}}}),bt=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}}),At=Object.freeze([vt,It,St,Lt,bt]);function wt(e){return At.some((({name:t})=>t===e.name))}function Dt(e,r){if($e(r)){const t=Dt(e,r.ofType);return t?.kind===h.NULL?null:t}if(null===e)return{kind:h.NULL};if(void 0===e)return null;if(Ge(r)){const t=r.ofType;if("object"==typeof(i=e)&&"function"==typeof i?.[Symbol.iterator]){const n=[];for(const r of e){const e=Dt(r,t);null!=e&&n.push(e)}return{kind:h.LIST,values:n}}return Dt(e,t)}var i;if(Ce(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Dt(e[t.name],t.type);r&&n.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:t.name},value:r})}return{kind:h.OBJECT,fields:n}}if(Ue(r)){const t=r.serialize(e);if(null==t)return null;if("boolean"==typeof t)return{kind:h.BOOLEAN,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return kt.test(e)?{kind:h.INT,value:e}:{kind:h.FLOAT,value:e}}if("string"==typeof t)return Re(r)?{kind:h.ENUM,value:t}:r===mt&&kt.test(t)?{kind:h.INT,value:t}:{kind:h.STRING,value:t};throw new TypeError(`Cannot convert value to AST: ${Y(t)}.`)}n(!1,"Unexpected input type: "+Y(r))}const kt=/^-?(?:0|[1-9][0-9]*)$/,Ft=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ft,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Ct))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Ct),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ct,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ct,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(xt))),resolve:e=>e.getDirectives()}})}),xt=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(ht),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Rt))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),Rt=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ct=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(Ut),resolve:e=>De(e)?Mt.SCALAR:ke(e)?Mt.OBJECT:Fe(e)?Mt.INTERFACE:xe(e)?Mt.UNION:Re(e)?Mt.ENUM:Ce(e)?Mt.INPUT_OBJECT:Ge(e)?Mt.LIST:$e(e)?Mt.NON_NULL:void n(!1,`Unexpected type: "${Y(e)}".`)},name:{type:ft,resolve:e=>"name"in e?e.name:void 0},description:{type:ft,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:ft,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Gt)),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(ke(e)||Fe(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e){if(ke(e)||Fe(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e,t,n,{schema:r}){if(Pe(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Qt)),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Re(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull($t)),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Ce(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Ct,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:ht,resolve:e=>{if(Ce(e))return e.isOneOf}}})}),Gt=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(ht),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ft,resolve:e=>e.deprecationReason}})}),$t=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},defaultValue:{type:ft,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=Dt(n,t);return r?Ne(r):null}},isDeprecated:{type:new GraphQLNonNull(ht),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ft,resolve:e=>e.deprecationReason}})}),Qt=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(ht),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ft,resolve:e=>e.deprecationReason}})});var Mt;!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(Mt||(Mt={}));const Ut=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Mt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Mt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Mt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Mt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Mt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Mt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Mt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Mt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Vt={name:"__schema",type:new GraphQLNonNull(Ft),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Pt={name:"__type",type:Ct,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(ft),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},jt={name:"__typename",type:new GraphQLNonNull(ft),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Bt=Object.freeze([Ft,xt,Rt,Ct,Gt,$t,Qt,Ut]);function Yt(e){return Bt.some((({name:t})=>e.name===t))}function Jt(e){if(!function(e){return K(e,GraphQLSchema)}(e))throw new Error(`Expected ${Y(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??At;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Kt(n,t);null!=this._queryType&&Kt(this._queryType,t),null!=this._mutationType&&Kt(this._mutationType,t),null!=this._subscriptionType&&Kt(this._subscriptionType,t);for(const e of this._directives)if(Nt(e))for(const n of e.args)Kt(n.type,t);Kt(Ft,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Fe(e)){for(const t of e.getInterfaces())if(Fe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(ke(e))for(const t of e.getInterfaces())if(Fe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return xe(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(xe(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Vt.name:return this.getQueryType()===e?Vt:void 0;case Pt.name:return this.getQueryType()===e?Pt:void 0;case jt.name:return jt}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function Kt(e,t){const n=Ke(e);if(!t.has(n))if(t.add(n),xe(n))for(const e of n.getTypes())Kt(e,t);else if(ke(n)||Fe(n)){for(const e of n.getInterfaces())Kt(e,t);for(const e of Object.values(n.getFields())){Kt(e.type,t);for(const n of e.args)Kt(n.type,t)}}else if(Ce(n))for(const e of Object.values(n.getFields()))Kt(e.type,t);return t}function qt(e){if(Jt(e),e.__validationErrors)return e.__validationErrors;const t=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(ke(i))n.add(i,r);else{const n=H(r),o=Y(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,Xt(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=W(i);e.reportError(`All root types must be different, "${r.name}" type is used as ${n} root types.`,i.map((e=>Xt(t,e))))}}(t),function(e){for(const t of e.schema.getDirectives())if(Nt(t)){zt(e,t);for(const n of t.args)zt(e,n),Qe(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode),tt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[cn(n.astNode),n.astNode?.type])}else e.reportError(`Expected directive but got: ${Y(t)}.`,t?.astNode)}(t),function(e){const t=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if($e(t.type)&&Ce(t.type.ofType)){const o=t.type.ofType,s=r[o.name];if(n.push(t),void 0===s)i(o);else{const t=n.slice(s),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const r of Object.values(n))Je(r)?(Yt(r)||zt(e,r),ke(r)||Fe(r)?(Ht(e,r),Wt(e,r)):xe(r)?tn(e,r):Re(r)?nn(e,r):Ce(r)&&(rn(e,r),t(r))):e.reportError(`Expected GraphQL named type but got: ${Y(r)}.`,r.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function Xt(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function zt(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ht(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n){zt(e,r),Me(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${Y(r.type)}.`,r.astNode?.type);for(const n of r.args){const i=n.name;zt(e,n),Qe(n.type)||e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode?.type),tt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[cn(n.astNode),n.astNode?.type])}}}function Wt(e,t){const n=new Set;for(const r of t.getInterfaces())Fe(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t.name} can only implement ${r.name} once.`,sn(t,r)):(n.add(r.name),en(e,t,r),Zt(e,t,r)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,sn(t,r)):e.reportError(`Type ${Y(t)} must only implement Interface types, it cannot implement ${Y(r)}.`,sn(t,r))}function Zt(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=i.name,s=r[o];if(null!=s){at(e.schema,s.type,i.type)||e.reportError(`Interface field ${n.name}.${o} expects type ${Y(i.type)} but ${t.name}.${o} is type ${Y(s.type)}.`,[i.astNode?.type,s.astNode?.type]);for(const r of i.args){const i=r.name,a=s.args.find((e=>e.name===i));a?st(r.type,a.type)||e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expects type ${Y(r.type)} but ${t.name}.${o}(${i}:) is type ${Y(a.type)}.`,[r.astNode?.type,a.astNode?.type]):e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expected but ${t.name}.${o} does not provide it.`,[r.astNode,s.astNode])}for(const r of s.args){const s=r.name;!i.args.find((e=>e.name===s))&&tt(r)&&e.reportError(`Object field ${t.name}.${o} includes required argument ${s} that is missing from the Interface field ${n.name}.${o}.`,[r.astNode,i.astNode])}}else e.reportError(`Interface field ${n.name}.${o} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function en(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...sn(n,i),...sn(t,n)])}function tn(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,an(t,i.name)):(r.add(i.name),ke(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${Y(i)}.`,an(t,String(i))))}function nn(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)zt(e,t)}function rn(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)zt(e,r),Qe(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${Y(r.type)}.`,r.astNode?.type),ot(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[cn(r.astNode),r.astNode?.type]),t.isOneOf&&on(t,r,e)}function on(e,t,n){$e(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,t.astNode?.type),void 0!==t.defaultValue&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function sn(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function an(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function cn(e){return e?.directives?.find((e=>e.name.value===St.name))}function un(e,t){switch(t.kind){case h.LIST_TYPE:{const n=un(e,t.type);return n&&new GraphQLList(n)}case h.NON_NULL_TYPE:{const n=un(e,t.type);return n&&new GraphQLNonNull(n)}case h.NAMED_TYPE:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??ln,t&&(Qe(t)&&this._inputTypeStack.push(t),Ve(t)&&this._parentTypeStack.push(t),Me(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case h.SELECTION_SET:{const e=Ke(this.getType());this._parentTypeStack.push(Ve(e)?e:void 0);break}case h.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Me(i)?i:void 0);break}case h.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case h.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push(ke(n)?n:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?un(t,n):Ke(this.getType());this._typeStack.push(Me(r)?r:void 0);break}case h.VARIABLE_DEFINITION:{const n=un(t,e.type);this._inputTypeStack.push(Qe(n)?n:void 0);break}case h.ARGUMENT:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(Qe(n)?n:void 0);break}case h.LIST:{const e=Ye(this.getInputType()),t=Ge(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Qe(t)?t:void 0);break}case h.OBJECT_FIELD:{const t=Ke(this.getInputType());let n,r;Ce(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Qe(n)?n:void 0);break}case h.ENUM:{const t=Ke(this.getInputType());let n;Re(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null}}}function ln(e,t,n){return e.getField(t,n.name.value)}function pn(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=ye(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=ye(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function dn(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===h.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==h.VARIABLE)return!1;return!0}function fn(e){return e.kind===h.OPERATION_DEFINITION||e.kind===h.FRAGMENT_DEFINITION}function hn(e){return e.kind===h.SCALAR_TYPE_DEFINITION||e.kind===h.OBJECT_TYPE_DEFINITION||e.kind===h.INTERFACE_TYPE_DEFINITION||e.kind===h.UNION_TYPE_DEFINITION||e.kind===h.ENUM_TYPE_DEFINITION||e.kind===h.INPUT_OBJECT_TYPE_DEFINITION}function mn(e){return e.kind===h.SCALAR_TYPE_EXTENSION||e.kind===h.OBJECT_TYPE_EXTENSION||e.kind===h.INTERFACE_TYPE_EXTENSION||e.kind===h.UNION_TYPE_EXTENSION||e.kind===h.ENUM_TYPE_EXTENSION||e.kind===h.INPUT_OBJECT_TYPE_EXTENSION}function En(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=ue(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+te(o),{nodes:t}))}}return!1}}}function Tn(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():At;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===h.DIRECTIVE_DEFINITION&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(!1),t.kind){case h.OPERATION_DEFINITION:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case h.FIELD:return f.FIELD;case h.FRAGMENT_SPREAD:return f.FRAGMENT_SPREAD;case h.INLINE_FRAGMENT:return f.INLINE_FRAGMENT;case h.FRAGMENT_DEFINITION:return f.FRAGMENT_DEFINITION;case h.VARIABLE_DEFINITION:return f.VARIABLE_DEFINITION;case h.SCHEMA_DEFINITION:case h.SCHEMA_EXTENSION:return f.SCHEMA;case h.SCALAR_TYPE_DEFINITION:case h.SCALAR_TYPE_EXTENSION:return f.SCALAR;case h.OBJECT_TYPE_DEFINITION:case h.OBJECT_TYPE_EXTENSION:return f.OBJECT;case h.FIELD_DEFINITION:return f.FIELD_DEFINITION;case h.INTERFACE_TYPE_DEFINITION:case h.INTERFACE_TYPE_EXTENSION:return f.INTERFACE;case h.UNION_TYPE_DEFINITION:case h.UNION_TYPE_EXTENSION:return f.UNION;case h.ENUM_TYPE_DEFINITION:case h.ENUM_TYPE_EXTENSION:return f.ENUM;case h.ENUM_VALUE_DEFINITION:return f.ENUM_VALUE;case h.INPUT_OBJECT_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_EXTENSION:return f.INPUT_OBJECT;case h.INPUT_VALUE_DEFINITION:{const t=e.at(-3);return null!=t&&"kind"in t||n(!1),t.kind===h.INPUT_OBJECT_TYPE_DEFINITION?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(!1,"Unexpected kind: "+Y(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function yn(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(hn).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===h.SCHEMA_DEFINITION||hn(e)||e.kind===h.DIRECTIVE_DEFINITION}(c)||function(e){return e.kind===h.SCHEMA_EXTENSION||mn(e)}(c)));if(o&&Nn.has(a))return;const u=ue(a,o?[...Nn,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+te(u),{nodes:t}))}var c}}}const Nn=new Set([...Et,...Bt].map((e=>e.name)));function vn(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function In(e){switch(e.kind){case h.OBJECT:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:In(e.value)}))).sort(((e,t)=>oe(e.name.value,t.name.value))))};case h.LIST:return{...e,values:e.values.map(In)};case h.INT:case h.FLOAT:case h.STRING:case h.BOOLEAN:case h.NULL:case h.ENUM:case h.VARIABLE:return e}var t}function gn(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+gn(t))).join(" and "):e}function _n(e,t,n,r,i,o,s){const a=e.getFragment(s);if(!a)return;const[c,u]=Fn(e,n,a);if(o!==c){Sn(e,t,n,r,i,o,c);for(const a of u)r.has(a,s,i)||(r.add(a,s,i),_n(e,t,n,r,i,o,a))}}function On(e,t,n,r,i,o,s){if(o===s)return;if(r.has(o,s,i))return;r.add(o,s,i);const a=e.getFragment(o),c=e.getFragment(s);if(!a||!c)return;const[u,l]=Fn(e,n,a),[p,d]=Fn(e,n,c);Sn(e,t,n,r,i,u,p);for(const s of d)On(e,t,n,r,i,o,s);for(const o of l)On(e,t,n,r,i,o,s)}function Sn(e,t,n,r,i,o,s){for(const[a,c]of o.entries()){const o=s.get(a);if(null!=o)for(const s of c)for(const c of o){const o=Ln(e,n,r,i,a,s,c);o&&t.push(o)}}}function Ln(e,t,n,r,i,o,s){const[a,c,u]=o,[l,p,d]=s,f=r||a!==l&&ke(a)&&ke(l);if(!f){const e=c.name.value,t=p.name.value;if(e!==t)return[[i,`"${e}" and "${t}" are different fields`],[c],[p]];if(!bn(c,p))return[[i,"they have differing arguments"],[c],[p]]}if(!function(e,t){const n=wn(e),r=wn(t);if(!n&&!r)return!0;if(n&&r)return bn(n,r);return!1}(c.directives??[],p.directives??[]))return[[i,"they have differing stream directives"],[c],[p]];const h=u?.type,m=d?.type;if(h&&m&&Dn(h,m))return[[i,`they return conflicting types "${Y(h)}" and "${Y(m)}"`],[c],[p]];const E=c.selectionSet,T=p.selectionSet;if(E&&T){const r=function(e,t,n,r,i,o,s,a){const c=[],[u,l]=kn(e,t,i,o),[p,d]=kn(e,t,s,a);Sn(e,c,t,n,r,u,p);for(const i of d)_n(e,c,t,n,r,u,i);for(const i of l)_n(e,c,t,n,r,p,i);for(const i of l)for(const o of d)On(e,c,t,n,r,i,o);return c}(e,t,n,f,Ke(h),E,Ke(m),T);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,i,c,p)}}function bn(e,t){const n=e.arguments,r=t.arguments;if(void 0===n||0===n.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(n.length!==r.length)return!1;const i=new Map(r.map((({name:e,value:t})=>[e.value,t])));return n.every((e=>{const t=e.value,n=i.get(e.name.value);return void 0!==n&&An(t)===An(n)}))}function An(e){return Ne(In(e))}function wn(e){return e.find((e=>"stream"===e.name.value))}function Dn(e,t){return Ge(e)?!Ge(t)||Dn(e.ofType,t.ofType):!!Ge(t)||($e(e)?!$e(t)||Dn(e.ofType,t.ofType):!!$e(t)||!(!Ue(e)&&!Ue(t))&&e!==t)}function kn(e,t,n,r){const i=t.get(r);if(i)return i;const o=new Map,s=new Set;xn(e,n,r,o,s);const a=[o,[...s]];return t.set(r,a),a}function Fn(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=un(e.getSchema(),n.typeCondition);return kn(e,t,i,n.selectionSet)}function xn(e,t,n,r,i){for(const o of n.selections)switch(o.kind){case h.FIELD:{const e=o.name.value;let n;(ke(t)||Fe(t))&&(n=t.getFields()[e]);const i=o.alias?o.alias.value:e;let s=r.get(i);null==s&&(s=[],r.set(i,s)),s.push([t,o,n]);break}case h.FRAGMENT_SPREAD:i.add(o.name.value);break;case h.INLINE_FRAGMENT:{const n=o.typeCondition,s=n?un(e.getSchema(),n):t;xn(e,s,o.selectionSet,r,i);break}}}class PairSet{constructor(){this._data=new Map}has(e,t,n){const[r,i]=e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Gn).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=we(s.type)?Y(s.type):Ne(s.type);e.reportError(new GraphQLError(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Gn(e){return e.type.kind===h.NON_NULL_TYPE&&null==e.defaultValue}function $n(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Qn(e,t){for(const n of e.keys())if($n(n,t))return e.get(n)}function Mn(e,t,r){if(e){if(e.kind===h.VARIABLE){const n=e.name.value;if(null==r||void 0===r[n])return;const i=r[n];if(null===i&&$e(t))return;return i}if($e(t)){if(e.kind===h.NULL)return;return Mn(e,t.ofType,r)}if(e.kind===h.NULL)return null;if(Ge(t)){const n=t.ofType;if(e.kind===h.LIST){const t=[];for(const i of e.values)if(Un(i,r)){if($e(n))return;t.push(null)}else{const e=Mn(i,n,r);if(void 0===e)return;t.push(e)}return t}const i=Mn(e,n,r);if(void 0===i)return;return[i]}if(Ce(t)){if(e.kind!==h.OBJECT)return;const n=Object.create(null),i=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(t.getFields())){const t=i.get(e.name);if(null==t||Un(t.value,r)){if(void 0!==e.defaultValue)n[e.name]=e.defaultValue;else if($e(e.type))return;continue}const o=Mn(t.value,e.type,r);if(void 0===o)return;n[e.name]=o}if(t.isOneOf){const e=Object.keys(n);if(1!==e.length)return;if(null===n[e[0]])return}return n}if(Ue(t)){let n;try{n=t.parseLiteral(e,r)}catch(e){return}if(void 0===n)return;return n}n(!1,"Unexpected input type: "+Y(t))}}function Un(e,t){return e.kind===h.VARIABLE&&(null==t||void 0===t[e.name.value])}function Vn(e,t,n){const r=t.directives?.find((t=>t.name.value===e.name));if(r)return function(e,t,n){const r={},i=t.arguments??[],o=new Map(i.map((e=>[e.name.value,e])));for(const i of e.args){const e=i.name,s=i.type,a=o.get(e);if(null==a){if(void 0!==i.defaultValue)r[e]=i.defaultValue;else if($e(s))throw new GraphQLError(`Argument "${e}" of required type "${Y(s)}" was not provided.`,{nodes:t});continue}const c=a.value;let u=c.kind===h.NULL;if(c.kind===h.VARIABLE){const t=c.name.value;if(null==n||!Object.hasOwn(n,t)){if(void 0!==i.defaultValue)r[e]=i.defaultValue;else if($e(s))throw new GraphQLError(`Argument "${e}" of required type "${Y(s)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}u=null==n[t]}if(u&&$e(s))throw new GraphQLError(`Argument "${e}" of non-null type "${Y(s)}" must not be null.`,{nodes:c});const l=Mn(c,s,n);if(void 0===l)throw new GraphQLError(`Argument "${e}" has invalid value ${Ne(c)}.`,{nodes:c});r[e]=l}return r}(e,r,n)}const Pn=new Set([void 0]);function jn(e,t,n,r,i){const o={schema:e,fragments:t,variableValues:n,runtimeType:r,operation:i,fieldsByTarget:new Map,targetsByKey:new Map,newDeferUsages:[],visitedFragmentNames:new Set};return Bn(o,i.selectionSet),{...qn(o.targetsByKey,o.fieldsByTarget),newDeferUsages:o.newDeferUsages}}function Bn(e,t,n,r){const{schema:i,fragments:o,variableValues:s,runtimeType:a,operation:c,targetsByKey:u,fieldsByTarget:l,newDeferUsages:p,visitedFragmentNames:d}=e;for(const m of t.selections)switch(m.kind){case h.FIELD:{if(!Jn(s,m))continue;const e=(f=m).alias?f.alias.value:f.name.value,t=r??n;let i=u.get(e);void 0===i&&(i=new Set,u.set(e,i)),i.add(t);let o=l.get(t);void 0===o&&(o=new AccumulatorMap,l.set(t,o)),o.add(e,m);break}case h.INLINE_FRAGMENT:{if(!Jn(s,m)||!Kn(i,m,a))continue;const t=Yn(c,s,m);let o;if(t){const e=void 0===n?[n]:[n,...n.ancestors];o={...t,ancestors:e},p.push(o)}else o=r;Bn(e,m.selectionSet,n,o);break}case h.FRAGMENT_SPREAD:{const t=m.name.value;if(!Jn(s,m))continue;const u=Yn(c,s,m);if(d.has(t)&&!u)continue;const l=o[t];if(null==l||!Kn(i,l,a))continue;let f;if(u){const e=void 0===n?[n]:[n,...n.ancestors];f={...u,ancestors:e},p.push(f)}else d.add(t),f=r;Bn(e,l.selectionSet,n,f);break}}var f}function Yn(e,t,r){const i=Vn(gt,r,t);if(i&&!1!==i.if)return e.operation!==d.SUBSCRIPTION||n(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`."),{label:"string"==typeof i.label?i.label:void 0}}function Jn(e,t){const n=Vn(It,t,e);if(!0===n?.if)return!1;const r=Vn(vt,t,e);return!1!==r?.if}function Kn(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=un(e,r);return i===n||!!Pe(i)&&e.isSubType(i,n)}function qn(e,t,n=Pn){const{parentTargetKeys:r,targetSetDetailsMap:i}=function(e,t){const n=new Set,r=new Map;for(const[i,o]of e){const e=[];for(const t of o)(void 0===t||t.ancestors.every((e=>!o.has(e))))&&e.push(t);const s=new Set(e);if($n(s,t)){n.add(i);continue}let a=Qn(r,s);void 0===a&&(a={keys:new Set,shouldInitiateDefer:e.some((e=>!t.has(e)))},r.set(s,a)),a.keys.add(i)}return{parentTargetKeys:n,targetSetDetailsMap:r}}(e,n),o=r.size>0?Xn(r,n,e,t):new Map,s=new Map;for(const[n,r]of i){const{keys:i,shouldInitiateDefer:o}=r,a=Xn(i,n,e,t);s.set(n,{groupedFieldSet:a,shouldInitiateDefer:o})}return{groupedFieldSet:o,newGroupedFieldSetDetails:s}}function Xn(e,t,n,r){const i=new Map,o=t.values().next().value,s=r.get(o);for(const[o]of s)if(e.has(o)){let e=i.get(o);void 0===e&&(e={fields:[],targets:t},i.set(o,e));for(const t of n.get(o)){const n=r.get(t),i=n.get(o);n.delete(o),e.fields.push(...i.map((e=>({node:e,target:t}))))}}return i}function zn(e){return e.fields.map((e=>e.node))}function Hn(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function Wn(e){return{Field:t,Directive:t};function t(t){const n=Hn(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function Zn(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===h.DIRECTIVE_DEFINITION&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION)r=o;else if(hn(n)||mn(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function er(e,t){return!!(ke(e)||Fe(e)||Ce(e))&&null!=e.getFields()[t]}function tr(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(!1),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function nr(e,t){const n=e.getInputType();if(!n)return;const r=Ke(n);if(Ue(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${Ne(t)}.`,{nodes:t}))}}catch(r){const i=Y(n);r instanceof GraphQLError?e.reportError(r):e.reportError(new GraphQLError(`Expected value of type "${i}", found ${Ne(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${Ne(t)}.`,{nodes:t}))}}function rr(e,t,n,r,i){if($e(r)&&!$e(t)){if(!(null!=n&&n.kind!==h.NULL)&&!(void 0!==i))return!1;return at(e,t,r.ofType)}return at(e,t,r)}const ir=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!fn(n)){const t=n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===h.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===h.FRAGMENT_DEFINITION&&(a[e.name.value]=e);const{groupedFieldSet:c}=jn(n,a,o,r,t);if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>zn(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){zn(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:zn(t)}))}}}}}},yn,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=un(e.getSchema(),n);if(t&&!Ve(t)){const t=Ne(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=un(e.getSchema(),t.typeCondition);if(n&&!Ve(n)){const n=Ne(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=un(e.getSchema(),t.type);if(void 0!==n&&!Qe(n)){const n=t.variable.name.value,r=Ne(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Ue(Ke(n))){if(r){const i=t.name.value,o=Y(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){const r=t.name.value,i=Y(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=te("to use an inline fragment on",function(e,t,n){if(!Pe(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Fe(t)&&e.isSubType(t,n)?-1:Fe(n)&&e.isSubType(n,t)?1:oe(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=te(function(e,t){if(ke(e)||Fe(e)){return ue(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n.name}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},vn,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ve(n)&&Ve(r)&&!ct(e.getSchema(),n,r)){const i=Y(r),o=Y(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=un(e.getSchema(),n.typeCondition);if(Ve(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!ct(e.getSchema(),r,i)){const o=Y(i),s=Y(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=Hn(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i}of r){const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Tn,Zn,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===gt.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i.name}".`,{nodes:t}))),i&&t.name.value===_t.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i.name}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===h.FRAGMENT_DEFINITION&&t.has(a.name.value)||a.kind===h.OPERATION_DEFINITION&&a.operation===d.SUBSCRIPTION)&&(n.name.value===gt.name?dn(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===_t.name&&(dn(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===gt.name||n.name.value===_t.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==h.STRING)return void e.reportError(new GraphQLError(`Directive "${n.name.value}"'s label argument must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError("Defer/Stream directive label argument must be unique.",{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===_t.name&&!(Ge(n.type)||je(n.type)&&Ge(n.type.ofType))&&e.reportError(new GraphQLError(`Stream directive cannot be used on non-list field "${n.name}" on type "${r.name}".`,{nodes:t}))}}},function(e){return{...En(e),Argument(t){const n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){const n=t.name.value,o=ue(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+te(o),{nodes:t}))}}}},Wn,function(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!Ge(Ye(e.getParentInputType())))return nr(e,t),!1},ObjectValue(n){const r=Ke(e.getInputType());if(!Ce(r))return nr(e,n),!1;const i=new Map(n.fields.map((e=>[e.name.value,e])));for(const t of Object.values(r.getFields())){if(!i.get(t.name)&&ot(t)){const i=Y(t.type);e.reportError(new GraphQLError(`Field "${r.name}.${t.name}" of required type "${i}" was not provided.`,{nodes:n}))}}r.isOneOf&&function(e,t,n,r,i){const o=Array.from(r.keys());if(1!==o.length)return void e.reportError(new GraphQLError(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));const s=r.get(o[0])?.value,a=!s||s.kind===h.NULL,c=s?.kind===h.VARIABLE;if(a)return void e.reportError(new GraphQLError(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[t]}));if(c){const r=s.name.value;i[r].type.kind!==h.NON_NULL_TYPE&&e.reportError(new GraphQLError(`Variable "${r}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]}))}}(e,n,r,i,t)},ObjectField(t){const n=Ke(e.getParentInputType());if(!e.getInputType()&&Ce(n)){const r=ue(t.name.value,Object.keys(n.getFields()));e.reportError(new GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+te(r),{nodes:t}))}},NullValue(t){const n=e.getInputType();$e(n)&&e.reportError(new GraphQLError(`Expected value of type "${Y(n)}", found ${Ne(t)}.`,{nodes:t}))},EnumValue:t=>nr(e,t),IntValue:t=>nr(e,t),FloatValue:t=>nr(e,t),StringValue:t=>nr(e,t),BooleanValue:t=>nr(e,t)}},function(e){return{...Cn(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)if(!r.has(i.name)&&tt(i)){const r=Y(i.type);e.reportError(new GraphQLError(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,defaultValue:o}of r){const r=n.name.value,s=t.get(r);if(s&&i){const t=e.getSchema(),a=un(t,s.type);if(a&&!rr(t,a,s.defaultValue,i,o)){const t=Y(a),o=Y(i);e.reportError(new GraphQLError(`Variable "$${r}" of type "${t}" used in position expecting type "${o}".`,{nodes:[s,n]}))}}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new PairSet,n=new Map;return{SelectionSet(r){const i=function(e,t,n,r,i){const o=[],[s,a]=kn(e,t,r,i);if(function(e,t,n,r,i){for(const[o,s]of i.entries())if(s.length>1)for(let i=0;i0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(Re(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(er(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=Hn(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},yn,Tn,Zn,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)hn(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Rn[s.kind]:a&&(c=function(e){if(De(e))return h.SCALAR_TYPE_EXTENSION;if(ke(e))return h.OBJECT_TYPE_EXTENSION;if(Fe(e))return h.INTERFACE_TYPE_EXTENSION;if(xe(e))return h.UNION_TYPE_EXTENSION;if(Re(e))return h.ENUM_TYPE_EXTENSION;if(Ce(e))return h.INPUT_OBJECT_TYPE_EXTENSION;n(!1,"Unexpected type: "+Y(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case h.SCALAR_TYPE_EXTENSION:return"scalar";case h.OBJECT_TYPE_EXTENSION:return"object";case h.INTERFACE_TYPE_EXTENSION:return"interface";case h.UNION_TYPE_EXTENSION:return"union";case h.ENUM_TYPE_EXTENSION:return"enum";case h.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:n(!1,"Unexpected kind: "+Y(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=ue(o,[...r.keys(),...Object.keys(t?.getTypeMap()??{})]);e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+te(n),{nodes:i.name}))}}},En,Wn,tr,Cn]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===h.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===h.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema);Ee(e,pn(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function sr(e,t,n=ir,r,i=new TypeInfo(e)){const o=r?.maxErrors??100;!function(e){const t=qt(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const s=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),a=[],c=new ValidationContext(e,t,i,(e=>{if(a.length>=o)throw s;a.push(e)})),u=Te(n.map((e=>e(c))));try{Ee(t,pn(i,u))}catch(e){if(e!==s)throw e;a.push(s)}return a}function ar(e,t,n=or){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return Ee(e,Te(n.map((e=>e(i))))),r}function cr(e,n){t(e)&&t(e.__schema)||P(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Y(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...Et,...Bt])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Y(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Y(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Mt.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Mt.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(Be(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Y(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!ke(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Fe(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case Mt.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Mt.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>E(n)});case Mt.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>E(t)});case Mt.UNION:return function(e){if(null==e.possibleTypes){const t=Y(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Mt.ENUM:return function(e){if(null==e.enumValues){const t=Y(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:re(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Mt.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Y(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields)})}(e)}var t,n,r;const i=Y(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}function h(e){if(null===e.interfaces&&e.kind===Mt.INTERFACE)return[];if(null==e.interfaces){const t=Y(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function E(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Y(e)}.`);return re(e.fields,(e=>e.name),T)}function T(e){const t=u(e.type);if(!Me(t)){const e=Y(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Y(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return re(e,(e=>e.name),N)}function N(e){const t=u(e.type);if(!Qe(t)){const e=Y(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?Mn(function(e,t){const n=new Parser(e,t);n.expectToken(m.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(m.EOF),r}(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}}function ur(e,t,n){Jt(e),!0!==n?.assumeValid&&!0!==n?.assumeValidSDL&&function(e,t){const n=ar(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))}(t,e);const r=e.toConfig(),i=lr(r,t,n);return r===i?e:new GraphQLSchema(i)}function lr(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let m=!1;for(const e of t.definitions){switch(e.kind){case h.SCHEMA_DEFINITION:d=e;break;case h.SCHEMA_EXTENSION:f.push(e);break;case h.DIRECTIVE_DEFINITION:p.push(e);break;case h.SCALAR_TYPE_DEFINITION:case h.OBJECT_TYPE_DEFINITION:case h.INTERFACE_TYPE_DEFINITION:case h.UNION_TYPE_DEFINITION:case h.ENUM_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_DEFINITION:i.push(e);break;case h.SCALAR_TYPE_EXTENSION:o.add(e.name.value,e);break;case h.OBJECT_TYPE_EXTENSION:s.add(e.name.value,e);break;case h.INTERFACE_TYPE_EXTENSION:a.add(e.name.value,e);break;case h.UNION_TYPE_EXTENSION:c.add(e.name.value,e);break;case h.ENUM_TYPE_EXTENSION:u.add(e.name.value,e);break;case h.INPUT_OBJECT_TYPE_EXTENSION:l.add(e.name.value,e);break;default:continue}m=!0}if(!m)return e;const E=new Map(e.types.map((e=>[e.name,v(e)])));for(const e of i){const t=e.name.value;E.set(t,pr.get(t)??F(e))}const T={query:e.query&&N(e.query),mutation:e.mutation&&N(e.mutation),subscription:e.subscription&&N(e.subscription),...d&&_([d]),..._(f)};return{description:d?.description?.value??e.description,...T,types:Array.from(E.values()),directives:[...e.directives.map((function(e){if(wt(e))return e;const t=e.toConfig();return new GraphQLDirective({...t,args:ie(t.args,g)})})),...p.map((function(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})}))],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1};function y(e){return Ge(e)?new GraphQLList(y(e.ofType)):$e(e)?new GraphQLNonNull(y(e.ofType)):N(e)}function N(e){return E.get(e.name)}function v(e){return Yt(e)||Tt(e)?e:De(e)?function(e){const t=e.toConfig(),n=o.get(t.name)??[];let r=t.specifiedByURL;for(const e of n)r=fr(e)??r;return new GraphQLScalarType({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):ke(e)?function(e){const t=e.toConfig(),n=s.get(t.name)??[];return new GraphQLObjectType({...t,interfaces:()=>[...e.getInterfaces().map(N),...D(n)],fields:()=>({...ie(t.fields,I),...L(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Fe(e)?function(e){const t=e.toConfig(),n=a.get(t.name)??[];return new GraphQLInterfaceType({...t,interfaces:()=>[...e.getInterfaces().map(N),...D(n)],fields:()=>({...ie(t.fields,I),...L(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):xe(e)?function(e){const t=e.toConfig(),n=c.get(t.name)??[];return new GraphQLUnionType({...t,types:()=>[...e.getTypes().map(N),...k(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Re(e)?function(e){const t=e.toConfig(),n=u.get(e.name)??[];return new GraphQLEnumType({...t,values:{...t.values,...w(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Ce(e)?function(e){const t=e.toConfig(),n=l.get(t.name)??[];return new GraphQLInputObjectType({...t,fields:()=>({...ie(t.fields,(e=>({...e,type:y(e.type)}))),...A(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):void n(!1,"Unexpected type: "+Y(e))}function I(e){return{...e,type:y(e.type),args:e.args&&ie(e.args,g)}}function g(e){return{...e,type:y(e.type)}}function _(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=O(n.type)}return t}function O(e){const t=e.name.value,n=pr.get(t)??E.get(t);if(void 0===n)throw new Error(`Unknown type: "${t}".`);return n}function S(e){return e.kind===h.LIST_TYPE?new GraphQLList(S(e.type)):e.kind===h.NON_NULL_TYPE?new GraphQLNonNull(S(e.type)):O(e)}function L(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:S(n.type),description:n.description?.value,args:b(n.arguments),deprecationReason:dr(n),astNode:n}}return t}function b(e){const t=e??[],n=Object.create(null);for(const e of t){const t=S(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Mn(e.defaultValue,t),deprecationReason:dr(e),astNode:e}}return n}function A(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=S(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Mn(n.defaultValue,e),deprecationReason:dr(n),astNode:n}}}return t}function w(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:dr(n),astNode:n}}return t}function D(e){return e.flatMap((e=>e.interfaces?.map(O)??[]))}function k(e){return e.flatMap((e=>e.types?.map(O)??[]))}function F(e){const t=e.name.value;switch(e.kind){case h.OBJECT_TYPE_DEFINITION:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>D(r),fields:()=>L(r),astNode:e,extensionASTNodes:n})}case h.INTERFACE_TYPE_DEFINITION:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>D(r),fields:()=>L(r),astNode:e,extensionASTNodes:n})}case h.ENUM_TYPE_DEFINITION:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:w(r),astNode:e,extensionASTNodes:n})}case h.UNION_TYPE_DEFINITION:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>k(r),astNode:e,extensionASTNodes:n})}case h.SCALAR_TYPE_DEFINITION:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:fr(e),astNode:e,extensionASTNodes:n})}case h.INPUT_OBJECT_TYPE_DEFINITION:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>A(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Vn(bt,n)))})}}var n}}const pr=new Map([...Et,...Bt].map((e=>[e.name,e])));function dr(e){const t=Vn(St,e);return t?.reason}function fr(e){const t=Vn(Lt,e);return t?.url}function hr(e,t){!0!==t?.assumeValid&&!0!==t?.assumeValidSDL&&function(e){const t=ar(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const n=lr({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...At.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}function mr(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[Tr(e),...i.map((e=>function(e){return Or(e)+"directive @"+e.name+Ir(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(De(e))return function(e){return Or(e)+`scalar ${e.name}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${Ne({kind:h.STRING,value:e.specifiedByURL})})`}(e)}(e);if(ke(e))return function(e){return Or(e)+`type ${e.name}`+yr(e)+Nr(e)}(e);if(Fe(e))return function(e){return Or(e)+`interface ${e.name}`+yr(e)+Nr(e)}(e);if(xe(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return Or(e)+"union "+e.name+n}(e);if(Re(e))return function(e){const t=e.getValues().map(((e,t)=>Or(e," ",!t)+" "+e.name+_r(e.deprecationReason)));return Or(e)+`enum ${e.name}`+vr(t)}(e);if(Ce(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>Or(e," ",!t)+" "+gr(e)));return Or(e)+`input ${e.name}`+vr(t)}(e);n(!1,"Unexpected type: "+Y(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!wt(e)),Er)}function Er(e){return!Tt(e)&&!Yt(e)}function Tr(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:Or(e)+"schema {\n"+(t?` query: ${t.name}\n`:"")+(n?` mutation: ${n.name}\n`:"")+(r?` subscription: ${r.name}\n`:"")+"}"}function yr(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function Nr(e){return vr(Object.values(e.getFields()).map(((e,t)=>Or(e," ",!t)+" "+e.name+Ir(e.args," ")+": "+String(e.type)+_r(e.deprecationReason))))}function vr(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function Ir(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(gr).join(", ")+")":"(\n"+e.map(((e,n)=>Or(e," "+t,!n)+" "+t+gr(e))).join("\n")+"\n"+t+")"}function gr(e){const t=Dt(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${Ne(t)}`),n+_r(e.deprecationReason)}function _r(e){if(null==e)return"";if(e!==Ot){return` @deprecated(reason: ${Ne({kind:h.STRING,value:e})})`}return" @deprecated"}function Or(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+Ne({kind:h.STRING,value:r,block:_(r)}).replaceAll("\n","\n"+t)+"\n"}function Sr(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:h.DOCUMENT,definitions:t}}const Lr=[vn];function br(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Ar,wr,Dr,...n?[n]:[],...r?[r]:[],...ir.filter((e=>!Lr.includes(e)))]}function Ar(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function wr(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Dr(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==gt.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))},FragmentSpread(t){if(t.directives)for(const n of t.directives)n.name.value==gt.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))}}}function kr(e){return{kind:h.NAME,value:e}}function Fr(e){return{kind:h.STRING,value:e}}function xr(e){return{kind:h.DIRECTIVE_DEFINITION,description:e.description?Fr(e.description):void 0,name:kr(e.name),repeatable:!1,locations:e.locations.map((e=>kr(e))),arguments:e.args.map((e=>function(e){return{kind:h.INPUT_VALUE_DEFINITION,description:Fr(e.description),name:kr(e.name),type:(t=Ke(e.type),{kind:h.NAMED_TYPE,name:kr(t.name)})};var t}(e)))}}const Rr={kind:h.DIRECTIVE_DEFINITION,description:Fr("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:kr("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[kr("QUERY"),kr("MUTATION"),kr("SUBSCRIPTION"),kr("FRAGMENT_DEFINITION")]},Cr={kind:h.DOCUMENT,definitions:[Rr]};const Gr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function $r(e){return e.startsWith("__")}const Qr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};function Mr(e,t){return t&&(e=function(e){return Ee(e,{enter:e=>e.kind!==h.SELECTION_SET?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===h.FIELD||e.kind===h.FRAGMENT_DEFINITION||e.kind===h.INLINE_FRAGMENT)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Gr,...e.selectionSet.selections]}}}})}(e)),Ee(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![h.FIELD,h.FRAGMENT_DEFINITION].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==Qr.kind&&e.name.value==Qr.name.value));return t?e:{...e,selections:[Qr,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==Qr.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){return e.name.value==Rr.name.value?null:e}(e)}})}function Ur(e){return null!=e}function Vr(e){switch(e.kind){case h.VARIABLE:return{kind:e.kind,value:e.name.value};case h.LIST:return{kind:e.kind,value:e.values.map(Vr)};case h.OBJECT:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=Vr(t.value),e)),{})};default:return e}}function Pr(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function jr(e,t,n,r){var i,o,s;const a=new Map;for(const e of t.definitions)e.kind===h.FRAGMENT_DEFINITION&&a.set(e.name.value,e);const c=[],u=new Map,l=new Set,p=e.getQueryType();if(void 0===p)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const d={queryType:p,mutationType:null!==(i=e.getMutationType())&&void 0!==i?i:void 0,subscriptionType:null!==(o=e.getSubscriptionType())&&void 0!==o?o:void 0};for(const e of t.definitions)e.kind===h.OPERATION_DEFINITION&&c.push(m(e));for(const[e,t]of a.entries())u.set(e,E(t));return{rootTypes:d,operations:c,fragments:Array.from(u.values()),referencedTypes:Array.from(l.values()),schemaDocumentation:null!==(s=e.description)&&void 0!==s?s:void 0};function f(t){if(!l.has(t)){if(l.add(t),Fe(t))for(const n of e.getPossibleTypes(t))f(Ke(n));if(xe(t)){const e=t.getTypes();for(t of e)f(Ke(t))}if(Ce(t)&&function(e){const t=e.getFields();for(const e in t){f(Ke(t[e].type))}}(t),ke(t))for(const e of t.getInterfaces())f(Ke(e))}}function m(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=Pr(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?Vr(t.defaultValue):void 0,i=un(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return f(Ke(i)),{name:n,type:i,defaultValue:r}})),u=Ne(Mr(t,n)),l=e.getRootType(s),[p]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(l),{name:o,operationType:s,variables:c,rootType:l,selectionSet:T(t.selectionSet,l,a),directives:p,referencedFragments:Array.from(a.values()),source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=Pr(t),s=Ne(Mr(t,n)),a=new Set,c=un(e,t.typeCondition),[u]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(Ke(c)),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:T(t.selectionSet,c,a),directives:u,referencedFragments:Array.from(a.values())}}function T(t,n,i){return{parentType:n,selections:t.selections.map((t=>function(t,n,i){var o,s,c,l;const[p,d]=null!==(o=N(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case h.FIELD:{const m=t.name.value;if("__typename"==m)return;const v=null===(s=t.alias)||void 0===s?void 0:s.value,I=function(e,t,n){return n===Vt.name&&e.getQueryType()===t?Vt:n===Pt.name&&e.getQueryType()===t?Pt:n===jt.name&&(ke(t)||Fe(t)||xe(t))?jt:ke(t)||Fe(t)?t.getFields()[n]:void 0}(e,n,m);if(!I)throw new GraphQLError(`Cannot query field "${m}" on type "${String(n)}"`,{nodes:t});const g=I.type,_=Ke(I.type);f(Ke(_));const{description:O,deprecationReason:S}=I;let L={kind:"Field",name:m,alias:v,type:g,arguments:y(I,t.arguments),inclusionConditions:d,description:!$r(m)&&O?O:void 0,deprecationReason:S||void 0,directives:p};function b(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Ge(g)||$e(g)&&Ge(g.ofType)?b(t,null===(c=r.disallowedFieldNames)||void 0===c?void 0:c.entityList,r.schemaNamespace):Ve(_)&&b(t,null===(l=r.disallowedFieldNames)||void 0===l?void 0:l.entity,r.schemaNamespace),Ve(_)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${m}" on type "${String(n)}" requires selection set`,{nodes:t});L.selectionSet=T(A,_,i)}return L}case h.INLINE_FRAGMENT:{const w=t.typeCondition,D=w?un(e,w):n;return f(D),{kind:"InlineFragment",selectionSet:T(t.selectionSet,D,i),inclusionConditions:d,directives:p}}case h.FRAGMENT_SPREAD:{const k=t.name.value,F=function(e){let t=u.get(e);if(t)return t;const n=a.get(e);return n?(a.delete(e),t=E(n),u.set(e,t),t):void 0}(k);if(!F)throw new GraphQLError(`Unknown fragment "${k}".`,{nodes:t.name});i.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,i))).filter(Ur)}}function y(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:Vr(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function N(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:y(o,i.arguments)});const s=v(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function v(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case h.BOOLEAN:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case h.VARIABLE:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function Br(){return{kind:h.DOCUMENT,definitions:[xr(gt)]}}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r){return jr(e,t,n,r)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(q(r));var r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==Rr.name.value))?e:Sr([e,Cr])}(Sr(n));r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==gt.name))?e:Sr([e,Br()])}(r),t||function(e){const t=ar(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(r);const i=t?ur(function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=cr(t);return n}(t.body),r,{assumeValid:!0,assumeValidSDL:!0}):hr(r,{assumeValid:!0,assumeValidSDL:!0});return function(e){const t=qt(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(i),i},e.mergeDocuments=function(e){return Sr(e)},e.parseOperationDocument=function(e){return q(e)},e.printSchemaToSDL=function(e){return mr(e)},e.validateDocument=function(e,t,n){return sr(e,t,br(n))},e}({});"# \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json index a7bab200e..5f7360d06 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json @@ -13,7 +13,7 @@ "npm": ">=7" }, "dependencies": { - "graphql": "17.0.0-alpha.2", + "graphql": "17.0.0-alpha.3", "tslib": "^2.3.0" }, "devDependencies": { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/rollup.config.js b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/rollup.config.js index 066ff1b49..587431069 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/rollup.config.js +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/rollup.config.js @@ -22,7 +22,7 @@ const options = { }), replace({ preventAssignment: true, - "process.env.NODE_ENV": JSON.stringify("production"), + "globalThis.process.env.NODE_ENV": JSON.stringify("production"), }), terser({ keep_classnames: true, From 04ee6aa710bbd39d8f86e4cb420d45dd24938157 Mon Sep 17 00:00:00 2001 From: gh-action-runner Date: Wed, 13 Dec 2023 23:13:18 +0000 Subject: [PATCH 08/11] Squashed 'apollo-ios-codegen/' changes from 44b718a9..d8ac9b9e d8ac9b9e chore(deps): Update to graphql-js 17.0.0-alpha.3 (apollographql/apollo-ios-dev#194) git-subtree-dir: apollo-ios-codegen git-subtree-split: d8ac9b9eeeefb756417ac62856cf24bcbd74b0b8 --- Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift | 2 +- Sources/GraphQLCompiler/JavaScript/package.json | 2 +- Sources/GraphQLCompiler/JavaScript/rollup.config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift b/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift index 959501fa9..afaa59530 100644 --- a/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift +++ b/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift @@ -1 +1 @@ -let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){if(!e)throw new Error(null!=t?t:"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(!1),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet","nullabilityAssertion"],Argument:["name","value"],ListNullabilityOperator:["nullabilityAssertion"],NonNullAssertion:["nullabilityAssertion"],ErrorBoundary:["nullabilityAssertion"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}var d,f,h,m;function E(e){return 9===e||32===e}function T(e){return e>=48&&e<=57}function y(e){return e>=97&&e<=122||e>=65&&e<=90}function N(e){return y(e)||95===e}function v(e){return y(e)||T(e)||95===e}function I(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function g(e){let t=0;for(;t",e.EOF="",e.BANG="!",e.QUESTION_MARK="?",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(m||(m={}));class Lexer{constructor(e){const t=new Token(m.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==m.EOF)do{if(e.next)e=e.next;else{const t=w(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===m.COMMENT);return e}}function S(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function O(e,t){return b(e.charCodeAt(t))&&L(e.charCodeAt(t+1))}function b(e){return e>=55296&&e<=56319}function L(e){return e>=56320&&e<=57343}function A(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return m.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function D(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function w(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function U(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function V(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oB)return"[Array]";const n=Math.min(j,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>B)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+J(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const q="production"===globalThis.process?.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Y(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||M(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||M(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function K(e,t){return new Parser(e,t).parseDocument()}class Parser{constructor(e,t={}){const n=function(e){return q(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(m.NAME);return this.node(e,{kind:h.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:h.DOCUMENT,definitions:this.many(m.SOF,this.parseDefinition,m.EOF)})}parseDefinition(){if(this.peek(m.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===m.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(m.BRACE_L))return this.node(e,{kind:h.OPERATION_DEFINITION,operation:d.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(m.NAME)&&(n=this.parseName()),this.node(e,{kind:h.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(m.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(m.PAREN_L,this.parseVariableDefinition,m.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(m.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(m.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(m.DOLLAR),this.node(e,{kind:h.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:h.SELECTION_SET,selections:this.many(m.BRACE_L,this.parseSelection,m.BRACE_R)})}parseSelection(){return this.peek(m.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(m.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:h.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),nullabilityAssertion:this.parseNullabilityAssertion(),directives:this.parseDirectives(!1),selectionSet:this.peek(m.BRACE_L)?this.parseSelectionSet():void 0})}parseNullabilityAssertion(){if(!0!==this._options.experimentalClientControlledNullability)return;const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseNullabilityAssertion();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_NULLABILITY_OPERATOR,nullabilityAssertion:n})}return this.expectOptionalToken(m.BANG)?t=this.node(e,{kind:h.NON_NULL_ASSERTION,nullabilityAssertion:t}):this.expectOptionalToken(m.QUESTION_MARK)&&(t=this.node(e,{kind:h.ERROR_BOUNDARY,nullabilityAssertion:t})),t}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(m.PAREN_L,t,m.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(m.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(m.NAME)?this.node(e,{kind:h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case m.BRACKET_L:return this.parseList(e);case m.BRACE_L:return this.parseObject(e);case m.INT:return this.advanceLexer(),this.node(t,{kind:h.INT,value:t.value});case m.FLOAT:return this.advanceLexer(),this.node(t,{kind:h.FLOAT,value:t.value});case m.STRING:case m.BLOCK_STRING:return this.parseStringLiteral();case m.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:h.BOOLEAN,value:!0});case"false":return this.node(t,{kind:h.BOOLEAN,value:!1});case"null":return this.node(t,{kind:h.NULL});default:return this.node(t,{kind:h.ENUM,value:t.value})}case m.DOLLAR:if(e){if(this.expectToken(m.DOLLAR),this._lexer.token.kind===m.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:h.STRING,value:e.value,block:e.kind===m.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:h.LIST,values:this.any(m.BRACKET_L,(()=>this.parseValueLiteral(e)),m.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:h.OBJECT,fields:this.any(m.BRACE_L,(()=>this.parseObjectField(e)),m.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(m.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(m.AT),this.node(t,{kind:h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(m.BANG)?this.node(e,{kind:h.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:h.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(m.STRING)||this.peek(m.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);return this.node(e,{kind:h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(m.COLON);const n=this.parseNamedType();return this.node(e,{kind:h.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(m.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseFieldDefinition,m.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(m.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(m.PAREN_L,this.parseInputValueDef,m.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(m.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(m.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:h.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(m.EQUALS)?this.delimitedMany(m.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(m.BRACE_L,this.parseEnumValueDefinition,m.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${X(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseInputValueDef,m.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===m.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(m.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(m.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${z(e)}, found ${X(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==m.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${X(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===m.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${X(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==m.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function X(e){const t=e.value;return z(e.kind)+(null!=t?` "${t}"`:"")}function z(e){return function(e){return e===m.BANG||e===m.QUESTION_MARK||e===m.DOLLAR||e===m.AMP||e===m.PAREN_L||e===m.PAREN_R||e===m.SPREAD||e===m.COLON||e===m.EQUALS||e===m.AT||e===m.BRACKET_L||e===m.BRACKET_R||e===m.BRACE_L||e===m.PIPE||e===m.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function H(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function W(e){return Z("and",e)}function Z(e,t){switch(0!==t.length||n(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t[t.length-1];return r.join(", ")+", "+e+" "+i}const ee=5;function te(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";n&&(i+=n+" ");return i+Z("or",r.slice(0,ee).map((e=>`"${e}"`)))+"?"}function ne(e){return e}function re(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function ie(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function oe(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function se(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-ae,o=t.charCodeAt(r)}while(ue(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const ae=48,ce=57;function ue(e){return!isNaN(e)&&ae<=e&&e<=ce}function le(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:se(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=pe(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=pe(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function pe(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ge(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Se("(",ge(e.variableDefinitions,", "),")"),n=ge([e.operation,ge([e.name,t]),ge(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Se(" = ",n)+Se(" ",ge(r," "))},SelectionSet:{leave:({selections:e})=>_e(e)},Field:{leave({alias:e,name:t,arguments:n,nullabilityAssertion:r,directives:i,selectionSet:o}){const s=ge([Se("",e,": "),t],"");let a=s+Se("(",ge(n,", "),")");return a.length>80&&(a=s+Se("(\n",Oe(ge(n,"\n")),"\n)")),ge([a,r,Se(" ",ge(i," ")),Se(" ",o)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},ListNullabilityOperator:{leave:({nullabilityAssertion:e})=>ge(["[",e,"]"])},NonNullAssertion:{leave:({nullabilityAssertion:e})=>ge([e,"!"])},ErrorBoundary:{leave:({nullabilityAssertion:e})=>ge([e,"?"])},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Se(" ",ge(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>ge(["...",Se("on ",e),ge(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Se("(",ge(n,", "),")")} on ${t} ${Se("",ge(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every((e=>0===e.length||E(e.charCodeAt(0)))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!t?.minimize&&(!i||e.length>70||u||o||s);let p="";const d=i&&E(e.charCodeAt(0));return(l&&!d||o)&&(p+="\n"),p+=n,(l||u)&&(p+="\n"),'"""'+p+'"""'}(e):`"${e.replace(fe,he)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ge(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{ "+ge(e,", ")+" }"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Se("(",ge(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Se("",e,"\n")+ge(["schema",ge(t," "),_e(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Se("",e,"\n")+ge(["scalar",t,ge(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Se("",e,"\n")+ge(["type",t,Se("implements ",ge(n," & ")),ge(r," "),_e(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Se("",e,"\n")+t+(be(n)?Se("(\n",Oe(ge(n,"\n")),"\n)"):Se("(",ge(n,", "),")"))+": "+r+Se(" ",ge(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Se("",e,"\n")+ge([t+": "+n,Se("= ",r),ge(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Se("",e,"\n")+ge(["interface",t,Se("implements ",ge(n," & ")),ge(r," "),_e(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Se("",e,"\n")+ge(["union",t,ge(n," "),Se("= ",ge(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Se("",e,"\n")+ge(["enum",t,ge(n," "),_e(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Se("",e,"\n")+ge([t,ge(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Se("",e,"\n")+ge(["input",t,ge(n," "),_e(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Se("",e,"\n")+"directive @"+t+(be(n)?Se("(\n",Oe(ge(n,"\n")),"\n)"):Se("(",ge(n,", "),")"))+(r?" repeatable":"")+" on "+ge(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ge(["extend schema",ge(e," "),_e(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ge(["extend scalar",e,ge(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["extend type",e,Se("implements ",ge(t," & ")),ge(n," "),_e(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>ge(["extend interface",e,Se("implements ",ge(t," & ")),ge(n," "),_e(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>ge(["extend union",e,ge(t," "),Se("= ",ge(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>ge(["extend enum",e,ge(t," "),_e(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>ge(["extend input",e,ge(t," "),_e(n)]," ")}};function ge(e,t=""){return e?.filter((e=>e)).join(t)??""}function _e(e){return Se("{\n",Oe(ge(e,"\n")),"\n}")}function Se(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Oe(e){return Se(" ",e.replace(/\n/g,"\n "))}function be(e){return e?.some((e=>e.includes("\n")))??!1}function Le(e,t){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map((e=>Le(e,t)));case h.OBJECT:return ie(e.fields,(e=>e.name.value),(e=>Le(e.value,t)));case h.VARIABLE:return t?.[e.name.value]}}function Ae(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tt(Le(e,n))),this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||M(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=()=>We(e),this._interfaces=()=>He(e)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:et(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function He(e){return Xe(e.interfaces??[])}function We(e){return oe(ze(e.fields),((e,t)=>{const n=e.args??{};return{name:Ae(t),description:e.description,type:e.type,args:Ze(n),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:de(e.extensions),astNode:e.astNode}}))}function Ze(e){return Object.entries(e).map((([e,t])=>({name:Ae(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:de(t.extensions),astNode:t.astNode})))}function et(e){return oe(e,(e=>({description:e.description,type:e.type,args:tt(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function tt(e){return ie(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function nt(e){return Qe(e.type)&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=We.bind(void 0,e),this._interfaces=He.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:et(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=rt.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function rt(e){return Xe(e.types)}class GraphQLEnumType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=Object.entries(e.values).map((([e,t])=>({name:De(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:de(t.extensions),astNode:t.astNode}))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=re(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Y(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=Y(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+it(this,t))}const t=this.getValue(e);if(null==t)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+it(this,e));return t.value}parseLiteral(e,t){if(e.kind!==h.ENUM){const t=ve(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+it(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=ve(e);throw new GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+it(this,t),{nodes:e})}return n.value}toConfig(){const e=ie(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function it(e,t){return te("the enum value",le(t,e.getValues().map((e=>e.name))))}class GraphQLInputObjectType{constructor(e){this.name=Ae(e.name),this.description=e.description,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=ot.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=oe(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ot(e){return oe(ze(e.fields),((t,n)=>(!("resolve"in t)||M(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ae(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:de(t.extensions),astNode:t.astNode})))}function st(e){return Qe(e.type)&&void 0===e.defaultValue}function at(e,t){return e===t||(Qe(e)&&Qe(t)||!(!$e(e)||!$e(t)))&&at(e.ofType,t.ofType)}function ct(e,t,n){return t===n||(Qe(n)?!!Qe(t)&&ct(e,t.ofType,n.ofType):Qe(t)?ct(e,t.ofType,n):$e(n)?!!$e(t)&&ct(e,t.ofType,n.ofType):!$e(t)&&(je(n)&&(xe(t)||Fe(t))&&e.isSubType(n,t)))}function ut(e,t,n){return t===n||(je(t)?je(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!je(n)&&e.isSubType(n,t))}const lt=2147483647,pt=-2147483648,dt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=Nt(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Y(t)}`);if(n>lt||nlt||elt||te.name===t))}function Nt(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function vt(e){return q(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Ae(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=de(e.extensions),this.astNode=e.astNode;const t=e.args??{};this.args=Ze(t)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:tt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const It=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(mt),description:"Included when true."}}}),gt=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(mt),description:"Skipped when true."}}}),_t=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(mt),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:ht,description:"Unique name"}}}),St=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{if:{type:new GraphQLNonNull(mt),description:"Stream when true or undefined.",defaultValue:!0},label:{type:ht,description:"Unique name"},initialCount:{defaultValue:0,type:dt,description:"Number of items to return immediately"}}}),Ot="No longer supported",bt=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:ht,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Ot}}}),Lt=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(ht),description:"The URL that specifies the behavior of this scalar."}}}),At=Object.freeze([It,gt,bt,Lt]);function Dt(e){return At.some((({name:t})=>t===e.name))}function wt(e,r){if(Qe(r)){const t=wt(e,r.ofType);return t?.kind===h.NULL?null:t}if(null===e)return{kind:h.NULL};if(void 0===e)return null;if($e(r)){const t=r.ofType;if("object"==typeof(i=e)&&"function"==typeof i?.[Symbol.iterator]){const n=[];for(const r of e){const e=wt(r,t);null!=e&&n.push(e)}return{kind:h.LIST,values:n}}return wt(e,t)}var i;if(Ge(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=wt(e[t.name],t.type);r&&n.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:t.name},value:r})}return{kind:h.OBJECT,fields:n}}if(Pe(r)){const t=r.serialize(e);if(null==t)return null;if("boolean"==typeof t)return{kind:h.BOOLEAN,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return kt.test(e)?{kind:h.INT,value:e}:{kind:h.FLOAT,value:e}}if("string"==typeof t)return Ce(r)?{kind:h.ENUM,value:t}:r===Et&&kt.test(t)?{kind:h.INT,value:t}:{kind:h.STRING,value:t};throw new TypeError(`Cannot convert value to AST: ${Y(t)}.`)}n(!1,"Unexpected input type: "+Y(r))}const kt=/^-?(?:0|[1-9][0-9]*)$/,Ft=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ht,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Ct))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Ct),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ct,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ct,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(xt))),resolve:e=>e.getDirectives()}})}),xt=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(mt),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Rt))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),Rt=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ct=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(Vt),resolve:e=>ke(e)?Ut.SCALAR:Fe(e)?Ut.OBJECT:xe(e)?Ut.INTERFACE:Re(e)?Ut.UNION:Ce(e)?Ut.ENUM:Ge(e)?Ut.INPUT_OBJECT:$e(e)?Ut.LIST:Qe(e)?Ut.NON_NULL:void n(!1,`Unexpected type: "${Y(e)}".`)},name:{type:ht,resolve:e=>"name"in e?e.name:void 0},description:{type:ht,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:ht,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Gt)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Fe(e)||xe(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e){if(Fe(e)||xe(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e,t,n,{schema:r}){if(je(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Qt)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Ce(e)){const n=e.getValues();return t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull($t)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Ge(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Ct,resolve:e=>"ofType"in e?e.ofType:void 0}})}),Gt=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(mt),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ht,resolve:e=>e.deprecationReason}})}),$t=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},defaultValue:{type:ht,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=wt(n,t);return r?ve(r):null}},isDeprecated:{type:new GraphQLNonNull(mt),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ht,resolve:e=>e.deprecationReason}})}),Qt=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(ht),resolve:e=>e.name},description:{type:ht,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(mt),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ht,resolve:e=>e.deprecationReason}})});var Ut;!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(Ut||(Ut={}));const Vt=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ut.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Ut.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ut.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ut.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ut.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ut.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ut.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ut.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Pt={name:"__schema",type:new GraphQLNonNull(Ft),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Mt={name:"__type",type:Ct,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(ht),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},jt={name:"__typename",type:new GraphQLNonNull(ht),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Bt=Object.freeze([Ft,xt,Rt,Ct,Gt,$t,Qt,Vt]);function Yt(e){return Bt.some((({name:t})=>e.name===t))}function Jt(e){if(!function(e){return q(e,GraphQLSchema)}(e))throw new Error(`Expected ${Y(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=de(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??At;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),qt(n,t);null!=this._queryType&&qt(this._queryType,t),null!=this._mutationType&&qt(this._mutationType,t),null!=this._subscriptionType&&qt(this._subscriptionType,t);for(const e of this._directives)if(vt(e))for(const n of e.args)qt(n.type,t);qt(Ft,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,xe(e)){for(const t of e.getInterfaces())if(xe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Fe(e))for(const t of e.getInterfaces())if(xe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Re(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(Re(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Pt.name:return this.getQueryType()===e?Pt:void 0;case Mt.name:return this.getQueryType()===e?Mt:void 0;case jt.name:return jt}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function qt(e,t){const n=Ke(e);if(!t.has(n))if(t.add(n),Re(n))for(const e of n.getTypes())qt(e,t);else if(Fe(n)||xe(n)){for(const e of n.getInterfaces())qt(e,t);for(const e of Object.values(n.getFields())){qt(e.type,t);for(const n of e.args)qt(n.type,t)}}else if(Ge(n))for(const e of Object.values(n.getFields()))qt(e.type,t);return t}function Kt(e){if(Jt(e),e.__validationErrors)return e.__validationErrors;const t=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(Fe(i))n.add(i,r);else{const n=H(r),o=Y(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,Xt(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=W(i);e.reportError(`All root types must be different, "${r.name}" type is used as ${n} root types.`,i.map((e=>Xt(t,e))))}}(t),function(e){for(const t of e.schema.getDirectives())if(vt(t)){zt(e,t);for(const n of t.args)zt(e,n),Ue(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode),nt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[an(n.astNode),n.astNode?.type])}else e.reportError(`Expected directive but got: ${Y(t)}.`,t?.astNode)}(t),function(e){const t=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(Qe(t.type)&&Ge(t.type.ofType)){const o=t.type.ofType,s=r[o.name];if(n.push(t),void 0===s)i(o);else{const t=n.slice(s),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const r of Object.values(n))qe(r)?(Yt(r)||zt(e,r),Fe(r)||xe(r)?(Ht(e,r),Wt(e,r)):Re(r)?tn(e,r):Ce(r)?nn(e,r):Ge(r)&&(rn(e,r),t(r))):e.reportError(`Expected GraphQL named type but got: ${Y(r)}.`,r.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function Xt(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function zt(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ht(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n){zt(e,r),Ve(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${Y(r.type)}.`,r.astNode?.type);for(const n of r.args){const i=n.name;zt(e,n),Ue(n.type)||e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode?.type),nt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[an(n.astNode),n.astNode?.type])}}}function Wt(e,t){const n=new Set;for(const r of t.getInterfaces())xe(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t.name} can only implement ${r.name} once.`,on(t,r)):(n.add(r.name),en(e,t,r),Zt(e,t,r)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,on(t,r)):e.reportError(`Type ${Y(t)} must only implement Interface types, it cannot implement ${Y(r)}.`,on(t,r))}function Zt(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=i.name,s=r[o];if(s){ct(e.schema,s.type,i.type)||e.reportError(`Interface field ${n.name}.${o} expects type ${Y(i.type)} but ${t.name}.${o} is type ${Y(s.type)}.`,[i.astNode?.type,s.astNode?.type]);for(const r of i.args){const i=r.name,a=s.args.find((e=>e.name===i));a?at(r.type,a.type)||e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expects type ${Y(r.type)} but ${t.name}.${o}(${i}:) is type ${Y(a.type)}.`,[r.astNode?.type,a.astNode?.type]):e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expected but ${t.name}.${o} does not provide it.`,[r.astNode,s.astNode])}for(const r of s.args){const s=r.name;!i.args.find((e=>e.name===s))&&nt(r)&&e.reportError(`Object field ${t.name}.${o} includes required argument ${s} that is missing from the Interface field ${n.name}.${o}.`,[r.astNode,i.astNode])}}else e.reportError(`Interface field ${n.name}.${o} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function en(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...on(n,i),...on(t,n)])}function tn(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,sn(t,i.name)):(r.add(i.name),Fe(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${Y(i)}.`,sn(t,String(i))))}function nn(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)zt(e,t)}function rn(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)zt(e,r),Ue(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${Y(r.type)}.`,r.astNode?.type),st(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[an(r.astNode),r.astNode?.type])}function on(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function sn(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function an(e){return e?.directives?.find((e=>e.name.value===bt.name))}function cn(e,t){switch(t.kind){case h.LIST_TYPE:{const n=cn(e,t.type);return n&&new GraphQLList(n)}case h.NON_NULL_TYPE:{const n=cn(e,t.type);return n&&new GraphQLNonNull(n)}case h.NAMED_TYPE:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??un,t&&(Ue(t)&&this._inputTypeStack.push(t),Me(t)&&this._parentTypeStack.push(t),Ve(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case h.SELECTION_SET:{const e=Ke(this.getType());this._parentTypeStack.push(Me(e)?e:void 0);break}case h.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ve(i)?i:void 0);break}case h.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case h.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push(Fe(n)?n:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?cn(t,n):Ke(this.getType());this._typeStack.push(Ve(r)?r:void 0);break}case h.VARIABLE_DEFINITION:{const n=cn(t,e.type);this._inputTypeStack.push(Ue(n)?n:void 0);break}case h.ARGUMENT:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(Ue(n)?n:void 0);break}case h.LIST:{const e=Je(this.getInputType()),t=$e(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Ue(t)?t:void 0);break}case h.OBJECT_FIELD:{const t=Ke(this.getInputType());let n,r;Ge(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Ue(n)?n:void 0);break}case h.ENUM:{const t=Ke(this.getInputType());let n;Ce(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null}}}function un(e,t,n){return e.getField(t,n.name.value)}function ln(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=Ne(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=Ne(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function pn(e){return e.kind===h.OPERATION_DEFINITION||e.kind===h.FRAGMENT_DEFINITION}function dn(e){return e.kind===h.SCALAR_TYPE_DEFINITION||e.kind===h.OBJECT_TYPE_DEFINITION||e.kind===h.INTERFACE_TYPE_DEFINITION||e.kind===h.UNION_TYPE_DEFINITION||e.kind===h.ENUM_TYPE_DEFINITION||e.kind===h.INPUT_OBJECT_TYPE_DEFINITION}function fn(e){return e.kind===h.SCALAR_TYPE_EXTENSION||e.kind===h.OBJECT_TYPE_EXTENSION||e.kind===h.INTERFACE_TYPE_EXTENSION||e.kind===h.UNION_TYPE_EXTENSION||e.kind===h.ENUM_TYPE_EXTENSION||e.kind===h.INPUT_OBJECT_TYPE_EXTENSION}function hn(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t[e.name]=e.args.map((e=>e.name));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t[e.name.value]=n.map((e=>e.name.value))}return{Directive(n){const r=n.name.value,i=t[r];if(n.arguments&&i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=le(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+te(o),{nodes:t}))}}return!1}}}function mn(e){const t=Object.create(null),r=e.getSchema(),i=r?r.getDirectives():At;for(const e of i)t[e.name]=e.locations;const o=e.getDocument().definitions;for(const e of o)e.kind===h.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t[c];if(!u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e[e.length-1];switch("kind"in t||n(!1),t.kind){case h.OPERATION_DEFINITION:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case h.FIELD:return f.FIELD;case h.FRAGMENT_SPREAD:return f.FRAGMENT_SPREAD;case h.INLINE_FRAGMENT:return f.INLINE_FRAGMENT;case h.FRAGMENT_DEFINITION:return f.FRAGMENT_DEFINITION;case h.VARIABLE_DEFINITION:return f.VARIABLE_DEFINITION;case h.SCHEMA_DEFINITION:case h.SCHEMA_EXTENSION:return f.SCHEMA;case h.SCALAR_TYPE_DEFINITION:case h.SCALAR_TYPE_EXTENSION:return f.SCALAR;case h.OBJECT_TYPE_DEFINITION:case h.OBJECT_TYPE_EXTENSION:return f.OBJECT;case h.FIELD_DEFINITION:return f.FIELD_DEFINITION;case h.INTERFACE_TYPE_DEFINITION:case h.INTERFACE_TYPE_EXTENSION:return f.INTERFACE;case h.UNION_TYPE_DEFINITION:case h.UNION_TYPE_EXTENSION:return f.UNION;case h.ENUM_TYPE_DEFINITION:case h.ENUM_TYPE_EXTENSION:return f.ENUM;case h.ENUM_VALUE_DEFINITION:return f.ENUM_VALUE;case h.INPUT_OBJECT_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_EXTENSION:return f.INPUT_OBJECT;case h.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||n(!1),t.kind===h.INPUT_OBJECT_TYPE_DEFINITION?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(!1,"Unexpected kind: "+Y(t.kind))}}(a);l&&!u.includes(l)&&e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function En(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(dn).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===h.SCHEMA_DEFINITION||dn(e)||e.kind===h.DIRECTIVE_DEFINITION}(c)||function(e){return e.kind===h.SCHEMA_EXTENSION||fn(e)}(c)));if(o&&Tn.has(a))return;const u=le(a,o?[...Tn,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+te(u),{nodes:t}))}var c}}}const Tn=new Set([...Tt,...Bt].map((e=>e.name)));function yn(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Nn(e){switch(e.kind){case h.OBJECT:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Nn(e.value)}))).sort(((e,t)=>se(e.name.value,t.name.value))))};case h.LIST:return{...e,values:e.values.map(Nn)};case h.INT:case h.FLOAT:case h.STRING:case h.BOOLEAN:case h.NULL:case h.ENUM:case h.VARIABLE:return e}var t}function vn(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+vn(t))).join(" and "):e}function In(e,t,n,r,i,o,s){const a=e.getFragment(s);if(!a)return;const[c,u]=Dn(e,n,a);if(o!==c){_n(e,t,n,r,i,o,c);for(const a of u)r.has(a,s,i)||(r.add(a,s,i),In(e,t,n,r,i,o,a))}}function gn(e,t,n,r,i,o,s){if(o===s)return;if(r.has(o,s,i))return;r.add(o,s,i);const a=e.getFragment(o),c=e.getFragment(s);if(!a||!c)return;const[u,l]=Dn(e,n,a),[p,d]=Dn(e,n,c);_n(e,t,n,r,i,u,p);for(const s of d)gn(e,t,n,r,i,o,s);for(const o of l)gn(e,t,n,r,i,o,s)}function _n(e,t,n,r,i,o,s){for(const[a,c]of Object.entries(o)){const o=s[a];if(o)for(const s of c)for(const c of o){const o=Sn(e,n,r,i,a,s,c);o&&t.push(o)}}}function Sn(e,t,n,r,i,o,s){const[a,c,u]=o,[l,p,d]=s,f=r||a!==l&&Fe(a)&&Fe(l);if(!f){const e=c.name.value,t=p.name.value;if(e!==t)return[[i,`"${e}" and "${t}" are different fields`],[c],[p]];if(On(c)!==On(p))return[[i,"they have differing arguments"],[c],[p]]}if(!function(e,t){const n=bn(e),r=bn(t);if(!n&&!r)return!0;if(n&&r)return On(n)===On(r);return!1}(c.directives??[],p.directives??[]))return[[i,"they have differing stream directives"],[c],[p]];const h=u?.type,m=d?.type;if(h&&m&&Ln(h,m))return[[i,`they return conflicting types "${Y(h)}" and "${Y(m)}"`],[c],[p]];const E=c.selectionSet,T=p.selectionSet;if(E&&T){const r=function(e,t,n,r,i,o,s,a){const c=[],[u,l]=An(e,t,i,o),[p,d]=An(e,t,s,a);_n(e,c,t,n,r,u,p);for(const i of d)In(e,c,t,n,r,u,i);for(const i of l)In(e,c,t,n,r,p,i);for(const i of l)for(const o of d)gn(e,c,t,n,r,i,o);return c}(e,t,n,f,Ke(h),E,Ke(m),T);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,i,c,p)}}function On(e){const t=e.arguments??[];return ve(Nn({kind:h.OBJECT,fields:t.map((e=>({kind:h.OBJECT_FIELD,name:e.name,value:e.value})))}))}function bn(e){return e.find((e=>"stream"===e.name.value))}function Ln(e,t){return $e(e)?!$e(t)||Ln(e.ofType,t.ofType):!!$e(t)||(Qe(e)?!Qe(t)||Ln(e.ofType,t.ofType):!!Qe(t)||!(!Pe(e)&&!Pe(t))&&e!==t)}function An(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),s=new Set;wn(e,n,r,o,s);const a=[o,[...s]];return t.set(r,a),a}function Dn(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=cn(e.getSchema(),n.typeCondition);return An(e,t,i,n.selectionSet)}function wn(e,t,n,r,i){for(const o of n.selections)switch(o.kind){case h.FIELD:{const e=o.name.value;let n;(Fe(t)||xe(t))&&(n=t.getFields()[e]);const i=o.alias?o.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,o,n]);break}case h.FRAGMENT_SPREAD:i.add(o.name.value);break;case h.INLINE_FRAGMENT:{const n=o.typeCondition,s=n?cn(e.getSchema(),n):t;wn(e,s,o.selectionSet,r,i);break}}}class PairSet{constructor(){this._data=new Map}has(e,t,n){const[r,i]=ee.name));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t[e.name.value]=re(n.filter(xn),(e=>e.name.value))}return{Directive:{leave(n){const r=n.name.value,i=t[r];if(i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of Object.entries(i))if(!o.has(t)){const i=we(s.type)?Y(s.type):ve(s.type);e.reportError(new GraphQLError(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function xn(e){return e.type.kind===h.NON_NULL_TYPE&&null==e.defaultValue}function Rn(e,t,r){if(e){if(e.kind===h.VARIABLE){const n=e.name.value;if(null==r||void 0===r[n])return;const i=r[n];if(null===i&&Qe(t))return;return i}if(Qe(t)){if(e.kind===h.NULL)return;return Rn(e,t.ofType,r)}if(e.kind===h.NULL)return null;if($e(t)){const n=t.ofType;if(e.kind===h.LIST){const t=[];for(const i of e.values)if(Cn(i,r)){if(Qe(n))return;t.push(null)}else{const e=Rn(i,n,r);if(void 0===e)return;t.push(e)}return t}const i=Rn(e,n,r);if(void 0===i)return;return[i]}if(Ge(t)){if(e.kind!==h.OBJECT)return;const n=Object.create(null),i=re(e.fields,(e=>e.name.value));for(const e of Object.values(t.getFields())){const t=i[e.name];if(!t||Cn(t.value,r)){if(void 0!==e.defaultValue)n[e.name]=e.defaultValue;else if(Qe(e.type))return;continue}const o=Rn(t.value,e.type,r);if(void 0===o)return;n[e.name]=o}return n}if(Pe(t)){let n;try{n=t.parseLiteral(e,r)}catch(e){return}if(void 0===n)return;return n}n(!1,"Unexpected input type: "+Y(t))}}function Cn(e,t){return e.kind===h.VARIABLE&&(null==t||void 0===t[e.name.value])}function Gn(e,t,n){const r=t.directives?.find((t=>t.name.value===e.name));if(r)return function(e,t,n){const r={},i=re(t.arguments??[],(e=>e.name.value));for(const a of e.args){const e=a.name,c=a.type,u=i[e];if(!u){if(void 0!==a.defaultValue)r[e]=a.defaultValue;else if(Qe(c))throw new GraphQLError(`Argument "${e}" of required type "${Y(c)}" was not provided.`,{nodes:t});continue}const l=u.value;let p=l.kind===h.NULL;if(l.kind===h.VARIABLE){const t=l.name.value;if(null==n||(o=n,s=t,!Object.prototype.hasOwnProperty.call(o,s))){if(void 0!==a.defaultValue)r[e]=a.defaultValue;else if(Qe(c))throw new GraphQLError(`Argument "${e}" of required type "${Y(c)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:l});continue}p=null==n[t]}if(p&&Qe(c))throw new GraphQLError(`Argument "${e}" of non-null type "${Y(c)}" must not be null.`,{nodes:l});const d=Rn(l,c,n);if(void 0===d)throw new GraphQLError(`Argument "${e}" has invalid value ${ve(l)}.`,{nodes:l});r[e]=d}var o,s;return r}(e,r,n)}function $n(e,t,n,r,i){const o=new AccumulatorMap,s=[];return Qn(e,t,n,r,i,o,s,new Set),{fields:o,patches:s}}function Qn(e,t,n,r,i,o,s,a){for(const u of i.selections)switch(u.kind){case h.FIELD:if(!Vn(n,u))continue;o.add((c=u).alias?c.alias.value:c.name.value,u);break;case h.INLINE_FRAGMENT:{if(!Vn(n,u)||!Pn(e,u,r))continue;const i=Un(n,u);if(i){const o=new AccumulatorMap;Qn(e,t,n,r,u.selectionSet,o,s,a),s.push({label:i.label,fields:o})}else Qn(e,t,n,r,u.selectionSet,o,s,a);break}case h.FRAGMENT_SPREAD:{const i=u.name.value;if(!Vn(n,u))continue;const c=Un(n,u);if(a.has(i)&&!c)continue;const l=t[i];if(!l||!Pn(e,l,r))continue;if(c||a.add(i),c){const i=new AccumulatorMap;Qn(e,t,n,r,l.selectionSet,i,s,a),s.push({label:c.label,fields:i})}else Qn(e,t,n,r,l.selectionSet,o,s,a);break}}var c}function Un(e,t){const n=Gn(_t,t,e);if(n&&!1!==n.if)return{label:"string"==typeof n.label?n.label:void 0}}function Vn(e,t){const n=Gn(gt,t,e);if(!0===n?.if)return!1;const r=Gn(It,t,e);return!1!==r?.if}function Pn(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=cn(e,r);return i===n||!!je(i)&&e.isSubType(i,n)}function Mn(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function jn(e){return{Field:t,Directive:t};function t(t){const n=Mn(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function Bn(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t[e.name]=!e.isRepeatable;const i=e.getDocument().definitions;for(const e of i)e.kind===h.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const o=Object.create(null),s=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION)r=o;else if(dn(n)||fn(n)){const e=n.name.value;r=s[e],void 0===r&&(s[e]=r=Object.create(null))}else r=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(r[n]?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}function Yn(e,t){return!!(Fe(e)||xe(e)||Ge(e))&&null!=e.getFields()[t]}function Jn(e){const t=[];let r=Object.create(null);return{ObjectValue:{enter(){t.push(r),r=Object.create(null)},leave(){const e=t.pop();null!=e||n(!1),r=e}},ObjectField(t){const n=t.name.value;r[n]?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[r[n],t.name]})):r[n]=t.name}}}function qn(e,t){const n=e.getInputType();if(!n)return;const r=Ke(n);if(Pe(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${ve(t)}.`,{nodes:t}))}}catch(r){const i=Y(n);r instanceof GraphQLError?e.reportError(r):e.reportError(new GraphQLError(`Expected value of type "${i}", found ${ve(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${ve(t)}.`,{nodes:t}))}}function Kn(e,t,n,r,i){if(Qe(r)&&!Qe(t)){if(!(null!=n&&n.kind!==h.NULL)&&!(void 0!==i))return!1;return ct(e,t,r.ofType)}return ct(e,t,r)}const Xn=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!pn(n)){const t=n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(t[r.value]?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===h.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===h.FRAGMENT_DEFINITION&&(a[e.name.value]=e);const{fields:c}=$n(n,a,o,r,t.selectionSet);if(c.size>1){const t=[...c.values()].slice(1).flat();e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){t[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}},En,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=cn(e.getSchema(),n);if(t&&!Me(t)){const t=ve(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=cn(e.getSchema(),t.typeCondition);if(n&&!Me(n)){const n=ve(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=cn(e.getSchema(),t.type);if(void 0!==n&&!Ue(n)){const n=t.variable.name.value,r=ve(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Pe(Ke(n))){if(r){const i=t.name.value,o=Y(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){const r=t.name.value,i=Y(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=te("to use an inline fragment on",function(e,t,n){if(!je(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:xe(t)&&e.isSubType(t,n)?-1:xe(n)&&e.isSubType(n,t)?1:se(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=te(function(e,t){if(Fe(e)||xe(e)){return le(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n.name}".`+o,{nodes:t}))}}}}},function(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return t[r]?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},yn,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Me(n)&&Me(r)&&!ut(e.getSchema(),n,r)){const i=Y(r),o=Y(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=cn(e.getSchema(),n.typeCondition);if(Me(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!ut(e.getSchema(),r,i)){const o=Y(i),s=Y(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=Mn(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i}of r){const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},mn,Bn,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===_t.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i.name}".`,{nodes:t}))),i&&t.name.value===St.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i.name}".`,{nodes:t})))}}},function(e){const t=Object.create(null);return{Directive(n){if(n.name.value===_t.name||n.name.value===St.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;i.kind!==h.STRING?e.reportError(new GraphQLError(`Directive "${n.name.value}"'s label argument must be a static string.`,{nodes:n})):t[i.value]?e.reportError(new GraphQLError("Defer/Stream directive label argument must be unique.",{nodes:[t[i.value],n]})):t[i.value]=n}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===St.name&&!($e(n.type)||Be(n.type)&&$e(n.type.ofType))&&e.reportError(new GraphQLError(`Stream directive cannot be used on non-list field "${n.name}" on type "${r.name}".`,{nodes:t}))}}},function(e){return{...hn(e),Argument(t){const n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){const n=t.name.value,o=le(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+te(o),{nodes:t}))}}}},jn,function(e){return{ListValue(t){if(!$e(Je(e.getParentInputType())))return qn(e,t),!1},ObjectValue(t){const n=Ke(e.getInputType());if(!Ge(n))return qn(e,t),!1;const r=re(t.fields,(e=>e.name.value));for(const i of Object.values(n.getFields())){if(!r[i.name]&&st(i)){const r=Y(i.type);e.reportError(new GraphQLError(`Field "${n.name}.${i.name}" of required type "${r}" was not provided.`,{nodes:t}))}}},ObjectField(t){const n=Ke(e.getParentInputType());if(!e.getInputType()&&Ge(n)){const r=le(t.name.value,Object.keys(n.getFields()));e.reportError(new GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+te(r),{nodes:t}))}},NullValue(t){const n=e.getInputType();Qe(n)&&e.reportError(new GraphQLError(`Expected value of type "${Y(n)}", found ${ve(t)}.`,{nodes:t}))},EnumValue:t=>qn(e,t),IntValue:t=>qn(e,t),FloatValue:t=>qn(e,t),StringValue:t=>qn(e,t),BooleanValue:t=>qn(e,t)}},function(e){return{...Fn(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)if(!r.has(i.name)&&nt(i)){const r=Y(i.type);e.reportError(new GraphQLError(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,defaultValue:o}of r){const r=n.name.value,s=t[r];if(s&&i){const t=e.getSchema(),a=cn(t,s.type);if(a&&!Kn(t,a,s.defaultValue,i,o)){const t=Y(a),o=Y(i);e.reportError(new GraphQLError(`Variable "$${r}" of type "${t}" used in position expecting type "${o}".`,{nodes:[s,n]}))}}}}},VariableDefinition(e){t[e.variable.name.value]=e}}},function(e){const t=new PairSet,n=new Map;return{SelectionSet(r){const i=function(e,t,n,r,i){const o=[],[s,a]=An(e,t,r,i);if(function(e,t,n,r,i){for(const[o,s]of Object.entries(i))if(s.length>1)for(let i=0;i0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n[i];r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n[i]=t}return!1}},function(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(!n?.getType(i))return t[i]?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}))}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;r[i]||(r[i]=Object.create(null));const o=t.values??[],s=r[i];for(const t of o){const r=t.name.value,o=n[i];Ce(o)&&o.getValue(r)?e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;r[i]||(r[i]=Object.create(null));const o=t.fields??[],s=r[i];for(const t of o){const r=t.name.value;Yn(n[i],r)?e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=Mn(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(!n?.getDirective(i))return t[i]?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}))}}},En,mn,Bn,function(e){const t=e.getSchema(),r=Object.create(null);for(const t of e.getDocument().definitions)dn(t)&&(r[t.name.value]=t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r[o],a=t?.getType(o);let c;if(s?c=kn[s.kind]:a&&(c=function(e){if(ke(e))return h.SCALAR_TYPE_EXTENSION;if(Fe(e))return h.OBJECT_TYPE_EXTENSION;if(xe(e))return h.INTERFACE_TYPE_EXTENSION;if(Re(e))return h.UNION_TYPE_EXTENSION;if(Ce(e))return h.ENUM_TYPE_EXTENSION;if(Ge(e))return h.INPUT_OBJECT_TYPE_EXTENSION;n(!1,"Unexpected type: "+Y(e))}(a)),c){if(c!==i.kind){const t=function(e){switch(e){case h.SCALAR_TYPE_EXTENSION:return"scalar";case h.OBJECT_TYPE_EXTENSION:return"object";case h.INTERFACE_TYPE_EXTENSION:return"interface";case h.UNION_TYPE_EXTENSION:return"union";case h.ENUM_TYPE_EXTENSION:return"enum";case h.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:n(!1,"Unexpected kind: "+Y(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=le(o,Object.keys({...r,...t?.getTypeMap()}));e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+te(n),{nodes:i.name}))}}},hn,jn,Jn,Fn]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===h.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===h.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema);Te(e,ln(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Hn(e,t,n=Xn,r,i=new TypeInfo(e)){const o=r?.maxErrors??100;!function(e){const t=Kt(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const s=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),a=[],c=new ValidationContext(e,t,i,(e=>{if(a.length>=o)throw s;a.push(e)})),u=ye(n.map((e=>e(c))));try{Te(t,ln(i,u))}catch(e){if(e!==s)throw e;a.push(s)}return a}function Wn(e,t,n=zn){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return Te(e,ye(n.map((e=>e(i))))),r}function Zn(e,n){t(e)&&t(e.__schema)||M(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Y(e)}.`);const r=e.__schema,i=ie(r.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case Ut.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Ut.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>f(n),fields:()=>h(n)});case Ut.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>f(t),fields:()=>h(t)});case Ut.UNION:return function(e){if(!e.possibleTypes){const t=Y(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Ut.ENUM:return function(e){if(!e.enumValues){const t=Y(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:ie(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Ut.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=Y(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>T(e.inputFields)})}(e)}var t;var n;var r;const i=Y(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}(e)));for(const e of[...Tt,...Bt])i[e.name]&&(i[e.name]=e);const o=r.queryType?p(r.queryType):null,s=r.mutationType?p(r.mutationType):null,a=r.subscriptionType?p(r.subscriptionType):null,c=r.directives?r.directives.map((function(e){if(!e.args){const t=Y(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=Y(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:T(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:Object.values(i),directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Ut.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Ut.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(Ye(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Y(e)}.`);const n=i[t];if(!n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!Fe(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!xe(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){if(null===e.interfaces&&e.kind===Ut.INTERFACE)return[];if(!e.interfaces){const t=Y(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function h(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${Y(e)}.`);return ie(e.fields,(e=>e.name),E)}function E(e){const t=u(e.type);if(!Ve(t)){const e=Y(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=Y(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:T(e.args)}}function T(e){return ie(e,(e=>e.name),y)}function y(e){const t=u(e.type);if(!Ue(t)){const e=Y(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?Rn(function(e,t){const n=new Parser(e,t);n.expectToken(m.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(m.EOF),r}(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}}function er(e,t,n){Jt(e),!0!==n?.assumeValid&&!0!==n?.assumeValidSDL&&function(e,t){const n=Wn(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))}(t,e);const r=e.toConfig(),i=tr(r,t,n);return r===i?e:new GraphQLSchema(i)}function tr(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let m=!1;for(const e of t.definitions){switch(e.kind){case h.SCHEMA_DEFINITION:d=e;break;case h.SCHEMA_EXTENSION:f.push(e);break;case h.DIRECTIVE_DEFINITION:p.push(e);break;case h.SCALAR_TYPE_DEFINITION:case h.OBJECT_TYPE_DEFINITION:case h.INTERFACE_TYPE_DEFINITION:case h.UNION_TYPE_DEFINITION:case h.ENUM_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_DEFINITION:i.push(e);break;case h.SCALAR_TYPE_EXTENSION:o.add(e.name.value,e);break;case h.OBJECT_TYPE_EXTENSION:s.add(e.name.value,e);break;case h.INTERFACE_TYPE_EXTENSION:a.add(e.name.value,e);break;case h.UNION_TYPE_EXTENSION:c.add(e.name.value,e);break;case h.ENUM_TYPE_EXTENSION:u.add(e.name.value,e);break;case h.INPUT_OBJECT_TYPE_EXTENSION:l.add(e.name.value,e);break;default:continue}m=!0}if(!m)return e;const E=Object.create(null);for(const t of e.types)E[t.name]=v(t);for(const e of i){const t=e.name.value;E[t]=nr[t]??F(e)}const T={query:e.query&&N(e.query),mutation:e.mutation&&N(e.mutation),subscription:e.subscription&&N(e.subscription),...d&&_([d]),..._(f)};return{description:d?.description?.value,...T,types:Object.values(E),directives:[...e.directives.map((function(e){if(Dt(e))return e;const t=e.toConfig();return new GraphQLDirective({...t,args:oe(t.args,g)})})),...p.map((function(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:L(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1};function y(e){return $e(e)?new GraphQLList(y(e.ofType)):Qe(e)?new GraphQLNonNull(y(e.ofType)):N(e)}function N(e){return E[e.name]}function v(e){return Yt(e)||yt(e)?e:ke(e)?function(e){const t=e.toConfig(),n=o.get(t.name)??[];let r=t.specifiedByURL;for(const e of n)r=ir(e)??r;return new GraphQLScalarType({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Fe(e)?function(e){const t=e.toConfig(),n=s.get(t.name)??[];return new GraphQLObjectType({...t,interfaces:()=>[...e.getInterfaces().map(N),...w(n)],fields:()=>({...oe(t.fields,I),...b(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):xe(e)?function(e){const t=e.toConfig(),n=a.get(t.name)??[];return new GraphQLInterfaceType({...t,interfaces:()=>[...e.getInterfaces().map(N),...w(n)],fields:()=>({...oe(t.fields,I),...b(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Re(e)?function(e){const t=e.toConfig(),n=c.get(t.name)??[];return new GraphQLUnionType({...t,types:()=>[...e.getTypes().map(N),...k(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Ce(e)?function(e){const t=e.toConfig(),n=u.get(e.name)??[];return new GraphQLEnumType({...t,values:{...t.values,...D(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Ge(e)?function(e){const t=e.toConfig(),n=l.get(t.name)??[];return new GraphQLInputObjectType({...t,fields:()=>({...oe(t.fields,(e=>({...e,type:y(e.type)}))),...A(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):void n(!1,"Unexpected type: "+Y(e))}function I(e){return{...e,type:y(e.type),args:e.args&&oe(e.args,g)}}function g(e){return{...e,type:y(e.type)}}function _(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=S(n.type)}return t}function S(e){const t=e.name.value,n=nr[t]??E[t];if(void 0===n)throw new Error(`Unknown type: "${t}".`);return n}function O(e){return e.kind===h.LIST_TYPE?new GraphQLList(O(e.type)):e.kind===h.NON_NULL_TYPE?new GraphQLNonNull(O(e.type)):S(e)}function b(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:O(n.type),description:n.description?.value,args:L(n.arguments),deprecationReason:rr(n),astNode:n}}return t}function L(e){const t=e??[],n=Object.create(null);for(const e of t){const t=O(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Rn(e.defaultValue,t),deprecationReason:rr(e),astNode:e}}return n}function A(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=O(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Rn(n.defaultValue,e),deprecationReason:rr(n),astNode:n}}}return t}function D(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:rr(n),astNode:n}}return t}function w(e){return e.flatMap((e=>e.interfaces?.map(S)??[]))}function k(e){return e.flatMap((e=>e.types?.map(S)??[]))}function F(e){const t=e.name.value;switch(e.kind){case h.OBJECT_TYPE_DEFINITION:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case h.INTERFACE_TYPE_DEFINITION:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case h.ENUM_TYPE_DEFINITION:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:D(r),astNode:e,extensionASTNodes:n})}case h.UNION_TYPE_DEFINITION:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>k(r),astNode:e,extensionASTNodes:n})}case h.SCALAR_TYPE_DEFINITION:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:ir(e),astNode:e,extensionASTNodes:n})}case h.INPUT_OBJECT_TYPE_DEFINITION:{const n=l.get(t)??[],r=[e,...n];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>A(r),astNode:e,extensionASTNodes:n})}}}}const nr=re([...Tt,...Bt],(e=>e.name));function rr(e){const t=Gn(bt,e);return t?.reason}function ir(e){const t=Gn(Lt,e);return t?.url}function or(e,t){!0!==t?.assumeValid&&!0!==t?.assumeValidSDL&&function(e){const t=Wn(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const n=tr({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...At.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}function sr(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[cr(e),...i.map((e=>function(e){return mr(e)+"directive @"+e.name+dr(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(ke(e))return function(e){return mr(e)+`scalar ${e.name}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ve({kind:h.STRING,value:e.specifiedByURL})})`}(e)}(e);if(Fe(e))return function(e){return mr(e)+`type ${e.name}`+ur(e)+lr(e)}(e);if(xe(e))return function(e){return mr(e)+`interface ${e.name}`+ur(e)+lr(e)}(e);if(Re(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return mr(e)+"union "+e.name+n}(e);if(Ce(e))return function(e){const t=e.getValues().map(((e,t)=>mr(e," ",!t)+" "+e.name+hr(e.deprecationReason)));return mr(e)+`enum ${e.name}`+pr(t)}(e);if(Ge(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>mr(e," ",!t)+" "+fr(e)));return mr(e)+`input ${e.name}`+pr(t)}(e);n(!1,"Unexpected type: "+Y(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Dt(e)),ar)}function ar(e){return!yt(e)&&!Yt(e)}function cr(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();if(r&&"Subscription"!==r.name)return!1;return!0}(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),mr(e)+`schema {\n${t.join("\n")}\n}`}function ur(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function lr(e){return pr(Object.values(e.getFields()).map(((e,t)=>mr(e," ",!t)+" "+e.name+dr(e.args," ")+": "+String(e.type)+hr(e.deprecationReason))))}function pr(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function dr(e,t=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(fr).join(", ")+")":"(\n"+e.map(((e,n)=>mr(e," "+t,!n)+" "+t+fr(e))).join("\n")+"\n"+t+")"}function fr(e){const t=wt(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${ve(t)}`),n+hr(e.deprecationReason)}function hr(e){if(null==e)return"";if(e!==Ot){return` @deprecated(reason: ${ve({kind:h.STRING,value:e})})`}return" @deprecated"}function mr(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ve({kind:h.STRING,value:r,block:_(r)}).replace(/\n/g,"\n"+t)+"\n"}function Er(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:h.DOCUMENT,definitions:t}}const Tr=[yn];function yr(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Nr,vr,Ir,...n?[n]:[],...r?[r]:[],...Xn.filter((e=>!Tr.includes(e)))]}function Nr(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function vr(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Ir(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==_t.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))},FragmentSpread(t){if(t.directives)for(const n of t.directives)n.name.value==_t.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))}}}function gr(e){return{kind:h.NAME,value:e}}function _r(e){return{kind:h.STRING,value:e}}function Sr(e){return{kind:h.DIRECTIVE_DEFINITION,description:e.description?_r(e.description):void 0,name:gr(e.name),repeatable:!1,locations:e.locations.map((e=>gr(e))),arguments:e.args.map((e=>function(e){return{kind:h.INPUT_VALUE_DEFINITION,description:_r(e.description),name:gr(e.name),type:(t=Ke(e.type),{kind:h.NAMED_TYPE,name:gr(t.name)})};var t}(e)))}}const Or={kind:h.DIRECTIVE_DEFINITION,description:_r("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:gr("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[gr("QUERY"),gr("MUTATION"),gr("SUBSCRIPTION"),gr("FRAGMENT_DEFINITION")]},br={kind:h.DOCUMENT,definitions:[Or]};const Lr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Ar(e){return e.startsWith("__")}const Dr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};function wr(e,t){return t&&(e=function(e){return Te(e,{enter:e=>e.kind!==h.SELECTION_SET?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===h.FIELD||e.kind===h.FRAGMENT_DEFINITION||e.kind===h.INLINE_FRAGMENT)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Lr,...e.selectionSet.selections]}}}})}(e)),Te(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![h.FIELD,h.FRAGMENT_DEFINITION].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==Dr.kind&&e.name.value==Dr.name.value));return t?e:{...e,selections:[Dr,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==Dr.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){return e.name.value==Or.name.value?null:e}(e)}})}function kr(e){return null!=e}function Fr(e){switch(e.kind){case h.VARIABLE:return{kind:e.kind,value:e.name.value};case h.LIST:return{kind:e.kind,value:e.values.map(Fr)};case h.OBJECT:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=Fr(t.value),e)),{})};default:return e}}function xr(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function Rr(e,t,n,r){var i,o,s;const a=new Map;for(const e of t.definitions)e.kind===h.FRAGMENT_DEFINITION&&a.set(e.name.value,e);const c=[],u=new Map,l=new Set,p=e.getQueryType();if(void 0===p)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const d={queryType:p,mutationType:null!==(i=e.getMutationType())&&void 0!==i?i:void 0,subscriptionType:null!==(o=e.getSubscriptionType())&&void 0!==o?o:void 0};for(const e of t.definitions)e.kind===h.OPERATION_DEFINITION&&c.push(m(e));for(const[e,t]of a.entries())u.set(e,E(t));return{rootTypes:d,operations:c,fragments:Array.from(u.values()),referencedTypes:Array.from(l.values()),schemaDocumentation:null!==(s=e.description)&&void 0!==s?s:void 0};function f(t){if(!l.has(t)){if(l.add(t),xe(t))for(const n of e.getPossibleTypes(t))f(Ke(n));if(Re(t)){const e=t.getTypes();for(t of e)f(Ke(t))}if(Ge(t)&&function(e){const t=e.getFields();for(const e in t){f(Ke(t[e].type))}}(t),Fe(t))for(const e of t.getInterfaces())f(Ke(e))}}function m(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=xr(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?Fr(t.defaultValue):void 0,i=cn(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return f(Ke(i)),{name:n,type:i,defaultValue:r}})),u=ve(wr(t,n)),l=e.getRootType(s),[p]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(l),{name:o,operationType:s,variables:c,rootType:l,selectionSet:T(t.selectionSet,l,a),directives:p,referencedFragments:Array.from(a.values()),source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=xr(t),s=ve(wr(t,n)),a=new Set,c=cn(e,t.typeCondition),[u]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(Ke(c)),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:T(t.selectionSet,c,a),directives:u,referencedFragments:Array.from(a.values())}}function T(t,n,i){return{parentType:n,selections:t.selections.map((t=>function(t,n,i){var o,s,c,l;const[p,d]=null!==(o=N(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case h.FIELD:{const m=t.name.value;if("__typename"==m)return;const v=null===(s=t.alias)||void 0===s?void 0:s.value,I=function(e,t,n){return n===Pt.name&&e.getQueryType()===t?Pt:n===Mt.name&&e.getQueryType()===t?Mt:n===jt.name&&(Fe(t)||xe(t)||Re(t))?jt:Fe(t)||xe(t)?t.getFields()[n]:void 0}(e,n,m);if(!I)throw new GraphQLError(`Cannot query field "${m}" on type "${String(n)}"`,{nodes:t});const g=I.type,_=Ke(I.type);f(Ke(_));const{description:S,deprecationReason:O}=I;let b={kind:"Field",name:m,alias:v,type:g,arguments:y(I,t.arguments),inclusionConditions:d,description:!Ar(m)&&S?S:void 0,deprecationReason:O||void 0,directives:p};function L(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if($e(g)||Qe(g)&&$e(g.ofType)?L(t,null===(c=r.disallowedFieldNames)||void 0===c?void 0:c.entityList,r.schemaNamespace):Me(_)&&L(t,null===(l=r.disallowedFieldNames)||void 0===l?void 0:l.entity,r.schemaNamespace),Me(_)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${m}" on type "${String(n)}" requires selection set`,{nodes:t});b.selectionSet=T(A,_,i)}return b}case h.INLINE_FRAGMENT:{const D=t.typeCondition,w=D?cn(e,D):n;return f(w),{kind:"InlineFragment",selectionSet:T(t.selectionSet,w,i),inclusionConditions:d,directives:p}}case h.FRAGMENT_SPREAD:{const k=t.name.value,F=function(e){let t=u.get(e);if(t)return t;const n=a.get(e);return n?(a.delete(e),t=E(n),u.set(e,t),t):void 0}(k);if(!F)throw new GraphQLError(`Unknown fragment "${k}".`,{nodes:t.name});i.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,i))).filter(kr)}}function y(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:Fr(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function N(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:y(o,i.arguments)});const s=v(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function v(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case h.BOOLEAN:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case h.VARIABLE:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function Cr(){return{kind:h.DOCUMENT,definitions:[Sr(_t)]}}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r){return Rr(e,t,n,r)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(K(r));var r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==Or.name.value))?e:Er([e,br])}(Er(n));r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==_t.name))?e:Er([e,Cr()])}(r),t||function(e){const t=Wn(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(r);const i=t?er(function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=Zn(t);return n}(t.body),r,{assumeValid:!0,assumeValidSDL:!0}):or(r,{assumeValid:!0,assumeValidSDL:!0});return function(e){const t=Kt(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(i),i},e.mergeDocuments=function(e){return Er(e)},e.parseOperationDocument=function(e){return K(e)},e.printSchemaToSDL=function(e){return sr(e)},e.validateDocument=function(e,t,n){return Hn(e,t,yr(n))},e}({});"# \ No newline at end of file +let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){if(!e)throw new Error(null!=t?t:"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(!1),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet","nullabilityAssertion"],Argument:["name","value"],ListNullabilityOperator:["nullabilityAssertion"],NonNullAssertion:["nullabilityAssertion"],ErrorBoundary:["nullabilityAssertion"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}var d,f,h,m;function E(e){return 9===e||32===e}function T(e){return e>=48&&e<=57}function y(e){return e>=97&&e<=122||e>=65&&e<=90}function N(e){return y(e)||95===e}function v(e){return y(e)||T(e)||95===e}function I(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function g(e){let t=0;for(;t",e.EOF="",e.BANG="!",e.QUESTION_MARK="?",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(m||(m={}));class Lexer{constructor(e){const t=new Token(m.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==m.EOF)do{if(e.next)e=e.next;else{const t=D(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===m.COMMENT);return e}}function O(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function S(e,t){return L(e.charCodeAt(t))&&b(e.charCodeAt(t+1))}function L(e){return e>=55296&&e<=56319}function b(e){return e>=56320&&e<=57343}function A(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return m.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function w(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function D(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function U(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oB)return"[Array]";const n=Math.min(j,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>B)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+J(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const K=null!=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Y(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function q(e,t){return new Parser(e,t).parseDocument()}class Parser{constructor(e,t={}){const n=function(e){return K(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(m.NAME);return this.node(e,{kind:h.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:h.DOCUMENT,definitions:this.many(m.SOF,this.parseDefinition,m.EOF)})}parseDefinition(){if(this.peek(m.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===m.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(m.BRACE_L))return this.node(e,{kind:h.OPERATION_DEFINITION,operation:d.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(m.NAME)&&(n=this.parseName()),this.node(e,{kind:h.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(m.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(m.PAREN_L,this.parseVariableDefinition,m.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(m.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(m.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(m.DOLLAR),this.node(e,{kind:h.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:h.SELECTION_SET,selections:this.many(m.BRACE_L,this.parseSelection,m.BRACE_R)})}parseSelection(){return this.peek(m.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(m.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:h.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),nullabilityAssertion:this.parseNullabilityAssertion(),directives:this.parseDirectives(!1),selectionSet:this.peek(m.BRACE_L)?this.parseSelectionSet():void 0})}parseNullabilityAssertion(){if(!0!==this._options.experimentalClientControlledNullability)return;const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseNullabilityAssertion();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_NULLABILITY_OPERATOR,nullabilityAssertion:n})}return this.expectOptionalToken(m.BANG)?t=this.node(e,{kind:h.NON_NULL_ASSERTION,nullabilityAssertion:t}):this.expectOptionalToken(m.QUESTION_MARK)&&(t=this.node(e,{kind:h.ERROR_BOUNDARY,nullabilityAssertion:t})),t}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(m.PAREN_L,t,m.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(m.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(m.NAME)?this.node(e,{kind:h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case m.BRACKET_L:return this.parseList(e);case m.BRACE_L:return this.parseObject(e);case m.INT:return this.advanceLexer(),this.node(t,{kind:h.INT,value:t.value});case m.FLOAT:return this.advanceLexer(),this.node(t,{kind:h.FLOAT,value:t.value});case m.STRING:case m.BLOCK_STRING:return this.parseStringLiteral();case m.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:h.BOOLEAN,value:!0});case"false":return this.node(t,{kind:h.BOOLEAN,value:!1});case"null":return this.node(t,{kind:h.NULL});default:return this.node(t,{kind:h.ENUM,value:t.value})}case m.DOLLAR:if(e){if(this.expectToken(m.DOLLAR),this._lexer.token.kind===m.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:h.STRING,value:e.value,block:e.kind===m.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:h.LIST,values:this.any(m.BRACKET_L,(()=>this.parseValueLiteral(e)),m.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:h.OBJECT,fields:this.any(m.BRACE_L,(()=>this.parseObjectField(e)),m.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(m.COLON),this.node(t,{kind:h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(m.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(m.AT),this.node(t,{kind:h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(m.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(m.BRACKET_R),t=this.node(e,{kind:h.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(m.BANG)?this.node(e,{kind:h.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:h.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(m.STRING)||this.peek(m.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);return this.node(e,{kind:h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(m.COLON);const n=this.parseNamedType();return this.node(e,{kind:h.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(m.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseFieldDefinition,m.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(m.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(m.PAREN_L,this.parseInputValueDef,m.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(m.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(m.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:h.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(m.EQUALS)?this.delimitedMany(m.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(m.BRACE_L,this.parseEnumValueDefinition,m.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${X(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(m.BRACE_L,this.parseInputValueDef,m.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===m.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(m.BRACE_L,this.parseOperationTypeDefinition,m.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:h.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(m.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(m.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${z(e)}, found ${X(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==m.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${X(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===m.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${X(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==m.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function X(e){const t=e.value;return z(e.kind)+(null!=t?` "${t}"`:"")}function z(e){return function(e){return e===m.BANG||e===m.QUESTION_MARK||e===m.DOLLAR||e===m.AMP||e===m.PAREN_L||e===m.PAREN_R||e===m.SPREAD||e===m.COLON||e===m.EQUALS||e===m.AT||e===m.BRACKET_L||e===m.BRACKET_R||e===m.BRACE_L||e===m.PIPE||e===m.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function H(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function W(e){return Z("and",e)}function Z(e,t){switch(0!==t.length||n(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}const ee=5;function te(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Z("or",r.slice(0,ee).map((e=>`"${e}"`)))+"?"}function ne(e){return e}function re(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function ie(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function oe(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-se,o=t.charCodeAt(r)}while(ce(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const se=48,ae=57;function ce(e){return!isNaN(e)&&se<=e&&e<=ae}function ue(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:oe(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=le(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=le(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function le(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ie(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=_e("(",Ie(e.variableDefinitions,", "),")"),n=Ie([e.operation,Ie([e.name,t]),Ie(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+_e(" = ",n)+_e(" ",Ie(r," "))},SelectionSet:{leave:({selections:e})=>ge(e)},Field:{leave({alias:e,name:t,arguments:n,nullabilityAssertion:r,directives:i,selectionSet:o}){const s=Ie([_e("",e,": "),t],"");let a=s+_e("(",Ie(n,", "),")");return a.length>80&&(a=s+_e("(\n",Oe(Ie(n,"\n")),"\n)")),Ie([a,r,_e(" ",Ie(i," ")),_e(" ",o)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},ListNullabilityOperator:{leave:({nullabilityAssertion:e})=>Ie(["[",e,"]"])},NonNullAssertion:{leave:({nullabilityAssertion:e})=>Ie([e,"!"])},ErrorBoundary:{leave:({nullabilityAssertion:e})=>Ie([e,"?"])},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+_e(" ",Ie(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ie(["...",_e("on ",e),Ie(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${_e("(",Ie(n,", "),")")} on ${t} ${_e("",Ie(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e,t){const n=e.replaceAll('"""','\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every((e=>0===e.length||E(e.charCodeAt(0)))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),u=a||c,l=!t?.minimize&&(!i||e.length>70||u||o||s);let p="";const d=i&&E(e.charCodeAt(0));return(l&&!d||o)&&(p+="\n"),p+=n,(l||u)&&(p+="\n"),'"""'+p+'"""'}(e):`"${e.replace(de,fe)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+Ie(e,", ")+"]";return t.length>80?"[\n"+Oe(Ie(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+Ie(e,", ")+" }";return t.length>80?ge(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+_e("(",Ie(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>_e("",e,"\n")+Ie(["schema",Ie(t," "),ge(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>_e("",e,"\n")+Ie(["scalar",t,Ie(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>_e("",e,"\n")+Ie(["type",t,_e("implements ",Ie(n," & ")),Ie(r," "),ge(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>_e("",e,"\n")+t+(Se(n)?_e("(\n",Oe(Ie(n,"\n")),"\n)"):_e("(",Ie(n,", "),")"))+": "+r+_e(" ",Ie(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>_e("",e,"\n")+Ie([t+": "+n,_e("= ",r),Ie(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>_e("",e,"\n")+Ie(["interface",t,_e("implements ",Ie(n," & ")),Ie(r," "),ge(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>_e("",e,"\n")+Ie(["union",t,Ie(n," "),_e("= ",Ie(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>_e("",e,"\n")+Ie(["enum",t,Ie(n," "),ge(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>_e("",e,"\n")+Ie([t,Ie(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>_e("",e,"\n")+Ie(["input",t,Ie(n," "),ge(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>_e("",e,"\n")+"directive @"+t+(Se(n)?_e("(\n",Oe(Ie(n,"\n")),"\n)"):_e("(",Ie(n,", "),")"))+(r?" repeatable":"")+" on "+Ie(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ie(["extend schema",Ie(e," "),ge(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ie(["extend scalar",e,Ie(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ie(["extend type",e,_e("implements ",Ie(t," & ")),Ie(n," "),ge(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ie(["extend interface",e,_e("implements ",Ie(t," & ")),Ie(n," "),ge(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ie(["extend union",e,Ie(t," "),_e("= ",Ie(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ie(["extend enum",e,Ie(t," "),ge(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ie(["extend input",e,Ie(t," "),ge(n)]," ")}};function Ie(e,t=""){return e?.filter((e=>e)).join(t)??""}function ge(e){return _e("{\n",Oe(Ie(e,"\n")),"\n}")}function _e(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Oe(e){return _e(" ",e.replaceAll("\n","\n "))}function Se(e){return e?.some((e=>e.includes("\n")))??!1}function Le(e,t){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map((e=>Le(e,t)));case h.OBJECT:return re(e.fields,(e=>e.name.value),(e=>Le(e.value,t)));case h.VARIABLE:return t?.[e.name.value]}}function be(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tt(Le(e,n))),this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||P(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=be(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=He.bind(void 0,e.fields),this._interfaces=ze.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ze(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ze(e){return qe(e??[])}function He(e){return ie(Xe(e),((e,t)=>{const n=e.args??{};return{name:be(t),description:e.description,type:e.type,args:We(n),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:pe(e.extensions),astNode:e.astNode}}))}function We(e){return Object.entries(e).map((([e,t])=>({name:be(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:pe(t.extensions),astNode:t.astNode})))}function Ze(e){return ie(e,(e=>({description:e.description,type:e.type,args:et(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function et(e){return re(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function tt(e){return $e(e.type)&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=be(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=He.bind(void 0,e.fields),this._interfaces=ze.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ze(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=be(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=nt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function nt(e){return qe(e)}class GraphQLEnumType{constructor(e){this.name=be(e.name),this.description=e.description,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=Object.entries(e.values).map((([e,t])=>({name:Ae(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:pe(t.extensions),astNode:t.astNode}))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=function(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Y(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=Y(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+rt(this,t))}const t=this.getValue(e);if(null==t)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+rt(this,e));return t.value}parseLiteral(e,t){if(e.kind!==h.ENUM){const t=Ne(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+rt(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=Ne(e);throw new GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+rt(this,t),{nodes:e})}return n.value}toConfig(){const e=re(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function rt(e,t){return te("the enum value",ue(t,e.getValues().map((e=>e.name))))}class GraphQLInputObjectType{constructor(e){this.name=be(e.name),this.description=e.description,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=it.bind(void 0,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=ie(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function it(e){return ie(Xe(e),((e,t)=>({name:be(t),description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:pe(e.extensions),astNode:e.astNode})))}function ot(e){return $e(e.type)&&void 0===e.defaultValue}function st(e,t){return e===t||($e(e)&&$e(t)||!(!Ge(e)||!Ge(t)))&&st(e.ofType,t.ofType)}function at(e,t,n){return t===n||($e(n)?!!$e(t)&&at(e,t.ofType,n.ofType):$e(t)?at(e,t.ofType,n):Ge(n)?!!Ge(t)&&at(e,t.ofType,n.ofType):!Ge(t)&&(Pe(n)&&(Fe(t)||ke(t))&&e.isSubType(n,t)))}function ct(e,t,n){return t===n||(Pe(t)?Pe(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Pe(n)&&e.isSubType(n,t))}const ut=2147483647,lt=-2147483648,pt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=yt(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Y(t)}`);if(n>ut||nut||eut||te.name===t))}function yt(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Nt(e){return K(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=be(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=pe(e.extensions),this.astNode=e.astNode;const t=e.args??{};this.args=We(t)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:et(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const vt=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(ht),description:"Included when true."}}}),It=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(ht),description:"Skipped when true."}}}),gt=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(ht),description:"Deferred when true or undefined.",defaultValue:!0},label:{type:ft,description:"Unique name"}}}),_t=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{if:{type:new GraphQLNonNull(ht),description:"Stream when true or undefined.",defaultValue:!0},label:{type:ft,description:"Unique name"},initialCount:{defaultValue:0,type:pt,description:"Number of items to return immediately"}}}),Ot="No longer supported",St=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:ft,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Ot}}}),Lt=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(ft),description:"The URL that specifies the behavior of this scalar."}}}),bt=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}}),At=Object.freeze([vt,It,St,Lt,bt]);function wt(e){return At.some((({name:t})=>t===e.name))}function Dt(e,r){if($e(r)){const t=Dt(e,r.ofType);return t?.kind===h.NULL?null:t}if(null===e)return{kind:h.NULL};if(void 0===e)return null;if(Ge(r)){const t=r.ofType;if("object"==typeof(i=e)&&"function"==typeof i?.[Symbol.iterator]){const n=[];for(const r of e){const e=Dt(r,t);null!=e&&n.push(e)}return{kind:h.LIST,values:n}}return Dt(e,t)}var i;if(Ce(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Dt(e[t.name],t.type);r&&n.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:t.name},value:r})}return{kind:h.OBJECT,fields:n}}if(Ue(r)){const t=r.serialize(e);if(null==t)return null;if("boolean"==typeof t)return{kind:h.BOOLEAN,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return kt.test(e)?{kind:h.INT,value:e}:{kind:h.FLOAT,value:e}}if("string"==typeof t)return Re(r)?{kind:h.ENUM,value:t}:r===mt&&kt.test(t)?{kind:h.INT,value:t}:{kind:h.STRING,value:t};throw new TypeError(`Cannot convert value to AST: ${Y(t)}.`)}n(!1,"Unexpected input type: "+Y(r))}const kt=/^-?(?:0|[1-9][0-9]*)$/,Ft=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ft,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Ct))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Ct),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ct,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ct,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(xt))),resolve:e=>e.getDirectives()}})}),xt=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(ht),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Rt))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),Rt=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ct=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(Ut),resolve:e=>De(e)?Mt.SCALAR:ke(e)?Mt.OBJECT:Fe(e)?Mt.INTERFACE:xe(e)?Mt.UNION:Re(e)?Mt.ENUM:Ce(e)?Mt.INPUT_OBJECT:Ge(e)?Mt.LIST:$e(e)?Mt.NON_NULL:void n(!1,`Unexpected type: "${Y(e)}".`)},name:{type:ft,resolve:e=>"name"in e?e.name:void 0},description:{type:ft,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:ft,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Gt)),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(ke(e)||Fe(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e){if(ke(e)||Fe(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Ct)),resolve(e,t,n,{schema:r}){if(Pe(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Qt)),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Re(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull($t)),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Ce(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Ct,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:ht,resolve:e=>{if(Ce(e))return e.isOneOf}}})}),Gt=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull($t))),args:{includeDeprecated:{type:ht,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(ht),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ft,resolve:e=>e.deprecationReason}})}),$t=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},type:{type:new GraphQLNonNull(Ct),resolve:e=>e.type},defaultValue:{type:ft,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=Dt(n,t);return r?Ne(r):null}},isDeprecated:{type:new GraphQLNonNull(ht),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ft,resolve:e=>e.deprecationReason}})}),Qt=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(ft),resolve:e=>e.name},description:{type:ft,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(ht),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:ft,resolve:e=>e.deprecationReason}})});var Mt;!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(Mt||(Mt={}));const Ut=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Mt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Mt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Mt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Mt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Mt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Mt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Mt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Mt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Vt={name:"__schema",type:new GraphQLNonNull(Ft),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Pt={name:"__type",type:Ct,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(ft),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},jt={name:"__typename",type:new GraphQLNonNull(ft),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Bt=Object.freeze([Ft,xt,Rt,Ct,Gt,$t,Qt,Ut]);function Yt(e){return Bt.some((({name:t})=>e.name===t))}function Jt(e){if(!function(e){return K(e,GraphQLSchema)}(e))throw new Error(`Expected ${Y(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=pe(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??At;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Kt(n,t);null!=this._queryType&&Kt(this._queryType,t),null!=this._mutationType&&Kt(this._mutationType,t),null!=this._subscriptionType&&Kt(this._subscriptionType,t);for(const e of this._directives)if(Nt(e))for(const n of e.args)Kt(n.type,t);Kt(Ft,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Fe(e)){for(const t of e.getInterfaces())if(Fe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(ke(e))for(const t of e.getInterfaces())if(Fe(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return xe(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(xe(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Vt.name:return this.getQueryType()===e?Vt:void 0;case Pt.name:return this.getQueryType()===e?Pt:void 0;case jt.name:return jt}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function Kt(e,t){const n=Ke(e);if(!t.has(n))if(t.add(n),xe(n))for(const e of n.getTypes())Kt(e,t);else if(ke(n)||Fe(n)){for(const e of n.getInterfaces())Kt(e,t);for(const e of Object.values(n.getFields())){Kt(e.type,t);for(const n of e.args)Kt(n.type,t)}}else if(Ce(n))for(const e of Object.values(n.getFields()))Kt(e.type,t);return t}function qt(e){if(Jt(e),e.__validationErrors)return e.__validationErrors;const t=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(ke(i))n.add(i,r);else{const n=H(r),o=Y(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,Xt(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=W(i);e.reportError(`All root types must be different, "${r.name}" type is used as ${n} root types.`,i.map((e=>Xt(t,e))))}}(t),function(e){for(const t of e.schema.getDirectives())if(Nt(t)){zt(e,t);for(const n of t.args)zt(e,n),Qe(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode),tt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[cn(n.astNode),n.astNode?.type])}else e.reportError(`Expected directive but got: ${Y(t)}.`,t?.astNode)}(t),function(e){const t=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if($e(t.type)&&Ce(t.type.ofType)){const o=t.type.ofType,s=r[o.name];if(n.push(t),void 0===s)i(o);else{const t=n.slice(s),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const r of Object.values(n))Je(r)?(Yt(r)||zt(e,r),ke(r)||Fe(r)?(Ht(e,r),Wt(e,r)):xe(r)?tn(e,r):Re(r)?nn(e,r):Ce(r)&&(rn(e,r),t(r))):e.reportError(`Expected GraphQL named type but got: ${Y(r)}.`,r.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function Xt(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function zt(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ht(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n){zt(e,r),Me(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${Y(r.type)}.`,r.astNode?.type);for(const n of r.args){const i=n.name;zt(e,n),Qe(n.type)||e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${Y(n.type)}.`,n.astNode?.type),tt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[cn(n.astNode),n.astNode?.type])}}}function Wt(e,t){const n=new Set;for(const r of t.getInterfaces())Fe(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t.name} can only implement ${r.name} once.`,sn(t,r)):(n.add(r.name),en(e,t,r),Zt(e,t,r)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,sn(t,r)):e.reportError(`Type ${Y(t)} must only implement Interface types, it cannot implement ${Y(r)}.`,sn(t,r))}function Zt(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=i.name,s=r[o];if(null!=s){at(e.schema,s.type,i.type)||e.reportError(`Interface field ${n.name}.${o} expects type ${Y(i.type)} but ${t.name}.${o} is type ${Y(s.type)}.`,[i.astNode?.type,s.astNode?.type]);for(const r of i.args){const i=r.name,a=s.args.find((e=>e.name===i));a?st(r.type,a.type)||e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expects type ${Y(r.type)} but ${t.name}.${o}(${i}:) is type ${Y(a.type)}.`,[r.astNode?.type,a.astNode?.type]):e.reportError(`Interface field argument ${n.name}.${o}(${i}:) expected but ${t.name}.${o} does not provide it.`,[r.astNode,s.astNode])}for(const r of s.args){const s=r.name;!i.args.find((e=>e.name===s))&&tt(r)&&e.reportError(`Object field ${t.name}.${o} includes required argument ${s} that is missing from the Interface field ${n.name}.${o}.`,[r.astNode,i.astNode])}}else e.reportError(`Interface field ${n.name}.${o} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function en(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...sn(n,i),...sn(t,n)])}function tn(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,an(t,i.name)):(r.add(i.name),ke(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${Y(i)}.`,an(t,String(i))))}function nn(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)zt(e,t)}function rn(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)zt(e,r),Qe(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${Y(r.type)}.`,r.astNode?.type),ot(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[cn(r.astNode),r.astNode?.type]),t.isOneOf&&on(t,r,e)}function on(e,t,n){$e(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,t.astNode?.type),void 0!==t.defaultValue&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function sn(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function an(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function cn(e){return e?.directives?.find((e=>e.name.value===St.name))}function un(e,t){switch(t.kind){case h.LIST_TYPE:{const n=un(e,t.type);return n&&new GraphQLList(n)}case h.NON_NULL_TYPE:{const n=un(e,t.type);return n&&new GraphQLNonNull(n)}case h.NAMED_TYPE:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??ln,t&&(Qe(t)&&this._inputTypeStack.push(t),Ve(t)&&this._parentTypeStack.push(t),Me(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case h.SELECTION_SET:{const e=Ke(this.getType());this._parentTypeStack.push(Ve(e)?e:void 0);break}case h.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Me(i)?i:void 0);break}case h.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case h.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push(ke(n)?n:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?un(t,n):Ke(this.getType());this._typeStack.push(Me(r)?r:void 0);break}case h.VARIABLE_DEFINITION:{const n=un(t,e.type);this._inputTypeStack.push(Qe(n)?n:void 0);break}case h.ARGUMENT:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(Qe(n)?n:void 0);break}case h.LIST:{const e=Ye(this.getInputType()),t=Ge(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Qe(t)?t:void 0);break}case h.OBJECT_FIELD:{const t=Ke(this.getInputType());let n,r;Ce(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Qe(n)?n:void 0);break}case h.ENUM:{const t=Ke(this.getInputType());let n;Re(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null}}}function ln(e,t,n){return e.getField(t,n.name.value)}function pn(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=ye(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=ye(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function dn(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===h.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==h.VARIABLE)return!1;return!0}function fn(e){return e.kind===h.OPERATION_DEFINITION||e.kind===h.FRAGMENT_DEFINITION}function hn(e){return e.kind===h.SCALAR_TYPE_DEFINITION||e.kind===h.OBJECT_TYPE_DEFINITION||e.kind===h.INTERFACE_TYPE_DEFINITION||e.kind===h.UNION_TYPE_DEFINITION||e.kind===h.ENUM_TYPE_DEFINITION||e.kind===h.INPUT_OBJECT_TYPE_DEFINITION}function mn(e){return e.kind===h.SCALAR_TYPE_EXTENSION||e.kind===h.OBJECT_TYPE_EXTENSION||e.kind===h.INTERFACE_TYPE_EXTENSION||e.kind===h.UNION_TYPE_EXTENSION||e.kind===h.ENUM_TYPE_EXTENSION||e.kind===h.INPUT_OBJECT_TYPE_EXTENSION}function En(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=ue(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+te(o),{nodes:t}))}}return!1}}}function Tn(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():At;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===h.DIRECTIVE_DEFINITION&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(!1),t.kind){case h.OPERATION_DEFINITION:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case h.FIELD:return f.FIELD;case h.FRAGMENT_SPREAD:return f.FRAGMENT_SPREAD;case h.INLINE_FRAGMENT:return f.INLINE_FRAGMENT;case h.FRAGMENT_DEFINITION:return f.FRAGMENT_DEFINITION;case h.VARIABLE_DEFINITION:return f.VARIABLE_DEFINITION;case h.SCHEMA_DEFINITION:case h.SCHEMA_EXTENSION:return f.SCHEMA;case h.SCALAR_TYPE_DEFINITION:case h.SCALAR_TYPE_EXTENSION:return f.SCALAR;case h.OBJECT_TYPE_DEFINITION:case h.OBJECT_TYPE_EXTENSION:return f.OBJECT;case h.FIELD_DEFINITION:return f.FIELD_DEFINITION;case h.INTERFACE_TYPE_DEFINITION:case h.INTERFACE_TYPE_EXTENSION:return f.INTERFACE;case h.UNION_TYPE_DEFINITION:case h.UNION_TYPE_EXTENSION:return f.UNION;case h.ENUM_TYPE_DEFINITION:case h.ENUM_TYPE_EXTENSION:return f.ENUM;case h.ENUM_VALUE_DEFINITION:return f.ENUM_VALUE;case h.INPUT_OBJECT_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_EXTENSION:return f.INPUT_OBJECT;case h.INPUT_VALUE_DEFINITION:{const t=e.at(-3);return null!=t&&"kind"in t||n(!1),t.kind===h.INPUT_OBJECT_TYPE_DEFINITION?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(!1,"Unexpected kind: "+Y(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function yn(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(hn).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===h.SCHEMA_DEFINITION||hn(e)||e.kind===h.DIRECTIVE_DEFINITION}(c)||function(e){return e.kind===h.SCHEMA_EXTENSION||mn(e)}(c)));if(o&&Nn.has(a))return;const u=ue(a,o?[...Nn,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+te(u),{nodes:t}))}var c}}}const Nn=new Set([...Et,...Bt].map((e=>e.name)));function vn(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function In(e){switch(e.kind){case h.OBJECT:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:In(e.value)}))).sort(((e,t)=>oe(e.name.value,t.name.value))))};case h.LIST:return{...e,values:e.values.map(In)};case h.INT:case h.FLOAT:case h.STRING:case h.BOOLEAN:case h.NULL:case h.ENUM:case h.VARIABLE:return e}var t}function gn(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+gn(t))).join(" and "):e}function _n(e,t,n,r,i,o,s){const a=e.getFragment(s);if(!a)return;const[c,u]=Fn(e,n,a);if(o!==c){Sn(e,t,n,r,i,o,c);for(const a of u)r.has(a,s,i)||(r.add(a,s,i),_n(e,t,n,r,i,o,a))}}function On(e,t,n,r,i,o,s){if(o===s)return;if(r.has(o,s,i))return;r.add(o,s,i);const a=e.getFragment(o),c=e.getFragment(s);if(!a||!c)return;const[u,l]=Fn(e,n,a),[p,d]=Fn(e,n,c);Sn(e,t,n,r,i,u,p);for(const s of d)On(e,t,n,r,i,o,s);for(const o of l)On(e,t,n,r,i,o,s)}function Sn(e,t,n,r,i,o,s){for(const[a,c]of o.entries()){const o=s.get(a);if(null!=o)for(const s of c)for(const c of o){const o=Ln(e,n,r,i,a,s,c);o&&t.push(o)}}}function Ln(e,t,n,r,i,o,s){const[a,c,u]=o,[l,p,d]=s,f=r||a!==l&&ke(a)&&ke(l);if(!f){const e=c.name.value,t=p.name.value;if(e!==t)return[[i,`"${e}" and "${t}" are different fields`],[c],[p]];if(!bn(c,p))return[[i,"they have differing arguments"],[c],[p]]}if(!function(e,t){const n=wn(e),r=wn(t);if(!n&&!r)return!0;if(n&&r)return bn(n,r);return!1}(c.directives??[],p.directives??[]))return[[i,"they have differing stream directives"],[c],[p]];const h=u?.type,m=d?.type;if(h&&m&&Dn(h,m))return[[i,`they return conflicting types "${Y(h)}" and "${Y(m)}"`],[c],[p]];const E=c.selectionSet,T=p.selectionSet;if(E&&T){const r=function(e,t,n,r,i,o,s,a){const c=[],[u,l]=kn(e,t,i,o),[p,d]=kn(e,t,s,a);Sn(e,c,t,n,r,u,p);for(const i of d)_n(e,c,t,n,r,u,i);for(const i of l)_n(e,c,t,n,r,p,i);for(const i of l)for(const o of d)On(e,c,t,n,r,i,o);return c}(e,t,n,f,Ke(h),E,Ke(m),T);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,i,c,p)}}function bn(e,t){const n=e.arguments,r=t.arguments;if(void 0===n||0===n.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(n.length!==r.length)return!1;const i=new Map(r.map((({name:e,value:t})=>[e.value,t])));return n.every((e=>{const t=e.value,n=i.get(e.name.value);return void 0!==n&&An(t)===An(n)}))}function An(e){return Ne(In(e))}function wn(e){return e.find((e=>"stream"===e.name.value))}function Dn(e,t){return Ge(e)?!Ge(t)||Dn(e.ofType,t.ofType):!!Ge(t)||($e(e)?!$e(t)||Dn(e.ofType,t.ofType):!!$e(t)||!(!Ue(e)&&!Ue(t))&&e!==t)}function kn(e,t,n,r){const i=t.get(r);if(i)return i;const o=new Map,s=new Set;xn(e,n,r,o,s);const a=[o,[...s]];return t.set(r,a),a}function Fn(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=un(e.getSchema(),n.typeCondition);return kn(e,t,i,n.selectionSet)}function xn(e,t,n,r,i){for(const o of n.selections)switch(o.kind){case h.FIELD:{const e=o.name.value;let n;(ke(t)||Fe(t))&&(n=t.getFields()[e]);const i=o.alias?o.alias.value:e;let s=r.get(i);null==s&&(s=[],r.set(i,s)),s.push([t,o,n]);break}case h.FRAGMENT_SPREAD:i.add(o.name.value);break;case h.INLINE_FRAGMENT:{const n=o.typeCondition,s=n?un(e.getSchema(),n):t;xn(e,s,o.selectionSet,r,i);break}}}class PairSet{constructor(){this._data=new Map}has(e,t,n){const[r,i]=e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===h.DIRECTIVE_DEFINITION){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Gn).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=we(s.type)?Y(s.type):Ne(s.type);e.reportError(new GraphQLError(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Gn(e){return e.type.kind===h.NON_NULL_TYPE&&null==e.defaultValue}function $n(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Qn(e,t){for(const n of e.keys())if($n(n,t))return e.get(n)}function Mn(e,t,r){if(e){if(e.kind===h.VARIABLE){const n=e.name.value;if(null==r||void 0===r[n])return;const i=r[n];if(null===i&&$e(t))return;return i}if($e(t)){if(e.kind===h.NULL)return;return Mn(e,t.ofType,r)}if(e.kind===h.NULL)return null;if(Ge(t)){const n=t.ofType;if(e.kind===h.LIST){const t=[];for(const i of e.values)if(Un(i,r)){if($e(n))return;t.push(null)}else{const e=Mn(i,n,r);if(void 0===e)return;t.push(e)}return t}const i=Mn(e,n,r);if(void 0===i)return;return[i]}if(Ce(t)){if(e.kind!==h.OBJECT)return;const n=Object.create(null),i=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(t.getFields())){const t=i.get(e.name);if(null==t||Un(t.value,r)){if(void 0!==e.defaultValue)n[e.name]=e.defaultValue;else if($e(e.type))return;continue}const o=Mn(t.value,e.type,r);if(void 0===o)return;n[e.name]=o}if(t.isOneOf){const e=Object.keys(n);if(1!==e.length)return;if(null===n[e[0]])return}return n}if(Ue(t)){let n;try{n=t.parseLiteral(e,r)}catch(e){return}if(void 0===n)return;return n}n(!1,"Unexpected input type: "+Y(t))}}function Un(e,t){return e.kind===h.VARIABLE&&(null==t||void 0===t[e.name.value])}function Vn(e,t,n){const r=t.directives?.find((t=>t.name.value===e.name));if(r)return function(e,t,n){const r={},i=t.arguments??[],o=new Map(i.map((e=>[e.name.value,e])));for(const i of e.args){const e=i.name,s=i.type,a=o.get(e);if(null==a){if(void 0!==i.defaultValue)r[e]=i.defaultValue;else if($e(s))throw new GraphQLError(`Argument "${e}" of required type "${Y(s)}" was not provided.`,{nodes:t});continue}const c=a.value;let u=c.kind===h.NULL;if(c.kind===h.VARIABLE){const t=c.name.value;if(null==n||!Object.hasOwn(n,t)){if(void 0!==i.defaultValue)r[e]=i.defaultValue;else if($e(s))throw new GraphQLError(`Argument "${e}" of required type "${Y(s)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}u=null==n[t]}if(u&&$e(s))throw new GraphQLError(`Argument "${e}" of non-null type "${Y(s)}" must not be null.`,{nodes:c});const l=Mn(c,s,n);if(void 0===l)throw new GraphQLError(`Argument "${e}" has invalid value ${Ne(c)}.`,{nodes:c});r[e]=l}return r}(e,r,n)}const Pn=new Set([void 0]);function jn(e,t,n,r,i){const o={schema:e,fragments:t,variableValues:n,runtimeType:r,operation:i,fieldsByTarget:new Map,targetsByKey:new Map,newDeferUsages:[],visitedFragmentNames:new Set};return Bn(o,i.selectionSet),{...qn(o.targetsByKey,o.fieldsByTarget),newDeferUsages:o.newDeferUsages}}function Bn(e,t,n,r){const{schema:i,fragments:o,variableValues:s,runtimeType:a,operation:c,targetsByKey:u,fieldsByTarget:l,newDeferUsages:p,visitedFragmentNames:d}=e;for(const m of t.selections)switch(m.kind){case h.FIELD:{if(!Jn(s,m))continue;const e=(f=m).alias?f.alias.value:f.name.value,t=r??n;let i=u.get(e);void 0===i&&(i=new Set,u.set(e,i)),i.add(t);let o=l.get(t);void 0===o&&(o=new AccumulatorMap,l.set(t,o)),o.add(e,m);break}case h.INLINE_FRAGMENT:{if(!Jn(s,m)||!Kn(i,m,a))continue;const t=Yn(c,s,m);let o;if(t){const e=void 0===n?[n]:[n,...n.ancestors];o={...t,ancestors:e},p.push(o)}else o=r;Bn(e,m.selectionSet,n,o);break}case h.FRAGMENT_SPREAD:{const t=m.name.value;if(!Jn(s,m))continue;const u=Yn(c,s,m);if(d.has(t)&&!u)continue;const l=o[t];if(null==l||!Kn(i,l,a))continue;let f;if(u){const e=void 0===n?[n]:[n,...n.ancestors];f={...u,ancestors:e},p.push(f)}else d.add(t),f=r;Bn(e,l.selectionSet,n,f);break}}var f}function Yn(e,t,r){const i=Vn(gt,r,t);if(i&&!1!==i.if)return e.operation!==d.SUBSCRIPTION||n(!1,"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`."),{label:"string"==typeof i.label?i.label:void 0}}function Jn(e,t){const n=Vn(It,t,e);if(!0===n?.if)return!1;const r=Vn(vt,t,e);return!1!==r?.if}function Kn(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=un(e,r);return i===n||!!Pe(i)&&e.isSubType(i,n)}function qn(e,t,n=Pn){const{parentTargetKeys:r,targetSetDetailsMap:i}=function(e,t){const n=new Set,r=new Map;for(const[i,o]of e){const e=[];for(const t of o)(void 0===t||t.ancestors.every((e=>!o.has(e))))&&e.push(t);const s=new Set(e);if($n(s,t)){n.add(i);continue}let a=Qn(r,s);void 0===a&&(a={keys:new Set,shouldInitiateDefer:e.some((e=>!t.has(e)))},r.set(s,a)),a.keys.add(i)}return{parentTargetKeys:n,targetSetDetailsMap:r}}(e,n),o=r.size>0?Xn(r,n,e,t):new Map,s=new Map;for(const[n,r]of i){const{keys:i,shouldInitiateDefer:o}=r,a=Xn(i,n,e,t);s.set(n,{groupedFieldSet:a,shouldInitiateDefer:o})}return{groupedFieldSet:o,newGroupedFieldSetDetails:s}}function Xn(e,t,n,r){const i=new Map,o=t.values().next().value,s=r.get(o);for(const[o]of s)if(e.has(o)){let e=i.get(o);void 0===e&&(e={fields:[],targets:t},i.set(o,e));for(const t of n.get(o)){const n=r.get(t),i=n.get(o);n.delete(o),e.fields.push(...i.map((e=>({node:e,target:t}))))}}return i}function zn(e){return e.fields.map((e=>e.node))}function Hn(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function Wn(e){return{Field:t,Directive:t};function t(t){const n=Hn(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function Zn(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():At;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===h.DIRECTIVE_DEFINITION&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION)r=o;else if(hn(n)||mn(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function er(e,t){return!!(ke(e)||Fe(e)||Ce(e))&&null!=e.getFields()[t]}function tr(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(!1),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function nr(e,t){const n=e.getInputType();if(!n)return;const r=Ke(n);if(Ue(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${Ne(t)}.`,{nodes:t}))}}catch(r){const i=Y(n);r instanceof GraphQLError?e.reportError(r):e.reportError(new GraphQLError(`Expected value of type "${i}", found ${Ne(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=Y(n);e.reportError(new GraphQLError(`Expected value of type "${r}", found ${Ne(t)}.`,{nodes:t}))}}function rr(e,t,n,r,i){if($e(r)&&!$e(t)){if(!(null!=n&&n.kind!==h.NULL)&&!(void 0!==i))return!1;return at(e,t,r.ofType)}return at(e,t,r)}const ir=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!fn(n)){const t=n.kind===h.SCHEMA_DEFINITION||n.kind===h.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===h.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===h.FRAGMENT_DEFINITION&&(a[e.name.value]=e);const{groupedFieldSet:c}=jn(n,a,o,r,t);if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>zn(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){zn(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:zn(t)}))}}}}}},yn,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=un(e.getSchema(),n);if(t&&!Ve(t)){const t=Ne(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=un(e.getSchema(),t.typeCondition);if(n&&!Ve(n)){const n=Ne(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=un(e.getSchema(),t.type);if(void 0!==n&&!Qe(n)){const n=t.variable.name.value,r=Ne(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Ue(Ke(n))){if(r){const i=t.name.value,o=Y(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(!r){const r=t.name.value,i=Y(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=te("to use an inline fragment on",function(e,t,n){if(!Pe(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Fe(t)&&e.isSubType(t,n)?-1:Fe(n)&&e.isSubType(n,t)?1:oe(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=te(function(e,t){if(ke(e)||Fe(e)){return ue(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n.name}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},vn,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ve(n)&&Ve(r)&&!ct(e.getSchema(),n,r)){const i=Y(r),o=Y(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=un(e.getSchema(),n.typeCondition);if(Ve(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!ct(e.getSchema(),r,i)){const o=Y(i),s=Y(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=Hn(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i}of r){const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Tn,Zn,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===gt.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i.name}".`,{nodes:t}))),i&&t.name.value===_t.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i.name}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===h.FRAGMENT_DEFINITION&&t.has(a.name.value)||a.kind===h.OPERATION_DEFINITION&&a.operation===d.SUBSCRIPTION)&&(n.name.value===gt.name?dn(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===_t.name&&(dn(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===gt.name||n.name.value===_t.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==h.STRING)return void e.reportError(new GraphQLError(`Directive "${n.name.value}"'s label argument must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError("Defer/Stream directive label argument must be unique.",{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===_t.name&&!(Ge(n.type)||je(n.type)&&Ge(n.type.ofType))&&e.reportError(new GraphQLError(`Stream directive cannot be used on non-list field "${n.name}" on type "${r.name}".`,{nodes:t}))}}},function(e){return{...En(e),Argument(t){const n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){const n=t.name.value,o=ue(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+te(o),{nodes:t}))}}}},Wn,function(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!Ge(Ye(e.getParentInputType())))return nr(e,t),!1},ObjectValue(n){const r=Ke(e.getInputType());if(!Ce(r))return nr(e,n),!1;const i=new Map(n.fields.map((e=>[e.name.value,e])));for(const t of Object.values(r.getFields())){if(!i.get(t.name)&&ot(t)){const i=Y(t.type);e.reportError(new GraphQLError(`Field "${r.name}.${t.name}" of required type "${i}" was not provided.`,{nodes:n}))}}r.isOneOf&&function(e,t,n,r,i){const o=Array.from(r.keys());if(1!==o.length)return void e.reportError(new GraphQLError(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));const s=r.get(o[0])?.value,a=!s||s.kind===h.NULL,c=s?.kind===h.VARIABLE;if(a)return void e.reportError(new GraphQLError(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[t]}));if(c){const r=s.name.value;i[r].type.kind!==h.NON_NULL_TYPE&&e.reportError(new GraphQLError(`Variable "${r}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]}))}}(e,n,r,i,t)},ObjectField(t){const n=Ke(e.getParentInputType());if(!e.getInputType()&&Ce(n)){const r=ue(t.name.value,Object.keys(n.getFields()));e.reportError(new GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+te(r),{nodes:t}))}},NullValue(t){const n=e.getInputType();$e(n)&&e.reportError(new GraphQLError(`Expected value of type "${Y(n)}", found ${Ne(t)}.`,{nodes:t}))},EnumValue:t=>nr(e,t),IntValue:t=>nr(e,t),FloatValue:t=>nr(e,t),StringValue:t=>nr(e,t),BooleanValue:t=>nr(e,t)}},function(e){return{...Cn(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)if(!r.has(i.name)&&tt(i)){const r=Y(i.type);e.reportError(new GraphQLError(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,defaultValue:o}of r){const r=n.name.value,s=t.get(r);if(s&&i){const t=e.getSchema(),a=un(t,s.type);if(a&&!rr(t,a,s.defaultValue,i,o)){const t=Y(a),o=Y(i);e.reportError(new GraphQLError(`Variable "$${r}" of type "${t}" used in position expecting type "${o}".`,{nodes:[s,n]}))}}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new PairSet,n=new Map;return{SelectionSet(r){const i=function(e,t,n,r,i){const o=[],[s,a]=kn(e,t,r,i);if(function(e,t,n,r,i){for(const[o,s]of i.entries())if(s.length>1)for(let i=0;i0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(Re(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(er(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=Hn(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},yn,Tn,Zn,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)hn(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Rn[s.kind]:a&&(c=function(e){if(De(e))return h.SCALAR_TYPE_EXTENSION;if(ke(e))return h.OBJECT_TYPE_EXTENSION;if(Fe(e))return h.INTERFACE_TYPE_EXTENSION;if(xe(e))return h.UNION_TYPE_EXTENSION;if(Re(e))return h.ENUM_TYPE_EXTENSION;if(Ce(e))return h.INPUT_OBJECT_TYPE_EXTENSION;n(!1,"Unexpected type: "+Y(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case h.SCALAR_TYPE_EXTENSION:return"scalar";case h.OBJECT_TYPE_EXTENSION:return"object";case h.INTERFACE_TYPE_EXTENSION:return"interface";case h.UNION_TYPE_EXTENSION:return"union";case h.ENUM_TYPE_EXTENSION:return"enum";case h.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:n(!1,"Unexpected kind: "+Y(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=ue(o,[...r.keys(),...Object.keys(t?.getTypeMap()??{})]);e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+te(n),{nodes:i.name}))}}},En,Wn,tr,Cn]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===h.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===h.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema);Ee(e,pn(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function sr(e,t,n=ir,r,i=new TypeInfo(e)){const o=r?.maxErrors??100;!function(e){const t=qt(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const s=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),a=[],c=new ValidationContext(e,t,i,(e=>{if(a.length>=o)throw s;a.push(e)})),u=Te(n.map((e=>e(c))));try{Ee(t,pn(i,u))}catch(e){if(e!==s)throw e;a.push(s)}return a}function ar(e,t,n=or){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return Ee(e,Te(n.map((e=>e(i))))),r}function cr(e,n){t(e)&&t(e.__schema)||P(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Y(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...Et,...Bt])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Y(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Y(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Mt.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Mt.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(Be(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Y(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!ke(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Fe(e))throw new Error(`Expected ${Y(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case Mt.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Mt.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>E(n)});case Mt.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>E(t)});case Mt.UNION:return function(e){if(null==e.possibleTypes){const t=Y(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Mt.ENUM:return function(e){if(null==e.enumValues){const t=Y(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:re(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Mt.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Y(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields)})}(e)}var t,n,r;const i=Y(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}function h(e){if(null===e.interfaces&&e.kind===Mt.INTERFACE)return[];if(null==e.interfaces){const t=Y(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function E(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Y(e)}.`);return re(e.fields,(e=>e.name),T)}function T(e){const t=u(e.type);if(!Me(t)){const e=Y(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Y(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return re(e,(e=>e.name),N)}function N(e){const t=u(e.type);if(!Qe(t)){const e=Y(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?Mn(function(e,t){const n=new Parser(e,t);n.expectToken(m.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(m.EOF),r}(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}}function ur(e,t,n){Jt(e),!0!==n?.assumeValid&&!0!==n?.assumeValidSDL&&function(e,t){const n=ar(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))}(t,e);const r=e.toConfig(),i=lr(r,t,n);return r===i?e:new GraphQLSchema(i)}function lr(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let m=!1;for(const e of t.definitions){switch(e.kind){case h.SCHEMA_DEFINITION:d=e;break;case h.SCHEMA_EXTENSION:f.push(e);break;case h.DIRECTIVE_DEFINITION:p.push(e);break;case h.SCALAR_TYPE_DEFINITION:case h.OBJECT_TYPE_DEFINITION:case h.INTERFACE_TYPE_DEFINITION:case h.UNION_TYPE_DEFINITION:case h.ENUM_TYPE_DEFINITION:case h.INPUT_OBJECT_TYPE_DEFINITION:i.push(e);break;case h.SCALAR_TYPE_EXTENSION:o.add(e.name.value,e);break;case h.OBJECT_TYPE_EXTENSION:s.add(e.name.value,e);break;case h.INTERFACE_TYPE_EXTENSION:a.add(e.name.value,e);break;case h.UNION_TYPE_EXTENSION:c.add(e.name.value,e);break;case h.ENUM_TYPE_EXTENSION:u.add(e.name.value,e);break;case h.INPUT_OBJECT_TYPE_EXTENSION:l.add(e.name.value,e);break;default:continue}m=!0}if(!m)return e;const E=new Map(e.types.map((e=>[e.name,v(e)])));for(const e of i){const t=e.name.value;E.set(t,pr.get(t)??F(e))}const T={query:e.query&&N(e.query),mutation:e.mutation&&N(e.mutation),subscription:e.subscription&&N(e.subscription),...d&&_([d]),..._(f)};return{description:d?.description?.value??e.description,...T,types:Array.from(E.values()),directives:[...e.directives.map((function(e){if(wt(e))return e;const t=e.toConfig();return new GraphQLDirective({...t,args:ie(t.args,g)})})),...p.map((function(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})}))],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1};function y(e){return Ge(e)?new GraphQLList(y(e.ofType)):$e(e)?new GraphQLNonNull(y(e.ofType)):N(e)}function N(e){return E.get(e.name)}function v(e){return Yt(e)||Tt(e)?e:De(e)?function(e){const t=e.toConfig(),n=o.get(t.name)??[];let r=t.specifiedByURL;for(const e of n)r=fr(e)??r;return new GraphQLScalarType({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):ke(e)?function(e){const t=e.toConfig(),n=s.get(t.name)??[];return new GraphQLObjectType({...t,interfaces:()=>[...e.getInterfaces().map(N),...D(n)],fields:()=>({...ie(t.fields,I),...L(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Fe(e)?function(e){const t=e.toConfig(),n=a.get(t.name)??[];return new GraphQLInterfaceType({...t,interfaces:()=>[...e.getInterfaces().map(N),...D(n)],fields:()=>({...ie(t.fields,I),...L(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):xe(e)?function(e){const t=e.toConfig(),n=c.get(t.name)??[];return new GraphQLUnionType({...t,types:()=>[...e.getTypes().map(N),...k(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Re(e)?function(e){const t=e.toConfig(),n=u.get(e.name)??[];return new GraphQLEnumType({...t,values:{...t.values,...w(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):Ce(e)?function(e){const t=e.toConfig(),n=l.get(t.name)??[];return new GraphQLInputObjectType({...t,fields:()=>({...ie(t.fields,(e=>({...e,type:y(e.type)}))),...A(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e):void n(!1,"Unexpected type: "+Y(e))}function I(e){return{...e,type:y(e.type),args:e.args&&ie(e.args,g)}}function g(e){return{...e,type:y(e.type)}}function _(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=O(n.type)}return t}function O(e){const t=e.name.value,n=pr.get(t)??E.get(t);if(void 0===n)throw new Error(`Unknown type: "${t}".`);return n}function S(e){return e.kind===h.LIST_TYPE?new GraphQLList(S(e.type)):e.kind===h.NON_NULL_TYPE?new GraphQLNonNull(S(e.type)):O(e)}function L(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:S(n.type),description:n.description?.value,args:b(n.arguments),deprecationReason:dr(n),astNode:n}}return t}function b(e){const t=e??[],n=Object.create(null);for(const e of t){const t=S(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Mn(e.defaultValue,t),deprecationReason:dr(e),astNode:e}}return n}function A(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=S(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Mn(n.defaultValue,e),deprecationReason:dr(n),astNode:n}}}return t}function w(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:dr(n),astNode:n}}return t}function D(e){return e.flatMap((e=>e.interfaces?.map(O)??[]))}function k(e){return e.flatMap((e=>e.types?.map(O)??[]))}function F(e){const t=e.name.value;switch(e.kind){case h.OBJECT_TYPE_DEFINITION:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>D(r),fields:()=>L(r),astNode:e,extensionASTNodes:n})}case h.INTERFACE_TYPE_DEFINITION:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>D(r),fields:()=>L(r),astNode:e,extensionASTNodes:n})}case h.ENUM_TYPE_DEFINITION:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:w(r),astNode:e,extensionASTNodes:n})}case h.UNION_TYPE_DEFINITION:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>k(r),astNode:e,extensionASTNodes:n})}case h.SCALAR_TYPE_DEFINITION:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:fr(e),astNode:e,extensionASTNodes:n})}case h.INPUT_OBJECT_TYPE_DEFINITION:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>A(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Vn(bt,n)))})}}var n}}const pr=new Map([...Et,...Bt].map((e=>[e.name,e])));function dr(e){const t=Vn(St,e);return t?.reason}function fr(e){const t=Vn(Lt,e);return t?.url}function hr(e,t){!0!==t?.assumeValid&&!0!==t?.assumeValidSDL&&function(e){const t=ar(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const n=lr({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...At.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}function mr(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[Tr(e),...i.map((e=>function(e){return Or(e)+"directive @"+e.name+Ir(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(De(e))return function(e){return Or(e)+`scalar ${e.name}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${Ne({kind:h.STRING,value:e.specifiedByURL})})`}(e)}(e);if(ke(e))return function(e){return Or(e)+`type ${e.name}`+yr(e)+Nr(e)}(e);if(Fe(e))return function(e){return Or(e)+`interface ${e.name}`+yr(e)+Nr(e)}(e);if(xe(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return Or(e)+"union "+e.name+n}(e);if(Re(e))return function(e){const t=e.getValues().map(((e,t)=>Or(e," ",!t)+" "+e.name+_r(e.deprecationReason)));return Or(e)+`enum ${e.name}`+vr(t)}(e);if(Ce(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>Or(e," ",!t)+" "+gr(e)));return Or(e)+`input ${e.name}`+vr(t)}(e);n(!1,"Unexpected type: "+Y(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!wt(e)),Er)}function Er(e){return!Tt(e)&&!Yt(e)}function Tr(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:Or(e)+"schema {\n"+(t?` query: ${t.name}\n`:"")+(n?` mutation: ${n.name}\n`:"")+(r?` subscription: ${r.name}\n`:"")+"}"}function yr(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function Nr(e){return vr(Object.values(e.getFields()).map(((e,t)=>Or(e," ",!t)+" "+e.name+Ir(e.args," ")+": "+String(e.type)+_r(e.deprecationReason))))}function vr(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function Ir(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(gr).join(", ")+")":"(\n"+e.map(((e,n)=>Or(e," "+t,!n)+" "+t+gr(e))).join("\n")+"\n"+t+")"}function gr(e){const t=Dt(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${Ne(t)}`),n+_r(e.deprecationReason)}function _r(e){if(null==e)return"";if(e!==Ot){return` @deprecated(reason: ${Ne({kind:h.STRING,value:e})})`}return" @deprecated"}function Or(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+Ne({kind:h.STRING,value:r,block:_(r)}).replaceAll("\n","\n"+t)+"\n"}function Sr(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:h.DOCUMENT,definitions:t}}const Lr=[vn];function br(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Ar,wr,Dr,...n?[n]:[],...r?[r]:[],...ir.filter((e=>!Lr.includes(e)))]}function Ar(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function wr(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Dr(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==gt.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))},FragmentSpread(t){if(t.directives)for(const n of t.directives)n.name.value==gt.name&&e.reportError(new GraphQLError("@defer support is disabled until the implementation is complete.",{nodes:t}))}}}function kr(e){return{kind:h.NAME,value:e}}function Fr(e){return{kind:h.STRING,value:e}}function xr(e){return{kind:h.DIRECTIVE_DEFINITION,description:e.description?Fr(e.description):void 0,name:kr(e.name),repeatable:!1,locations:e.locations.map((e=>kr(e))),arguments:e.args.map((e=>function(e){return{kind:h.INPUT_VALUE_DEFINITION,description:Fr(e.description),name:kr(e.name),type:(t=Ke(e.type),{kind:h.NAMED_TYPE,name:kr(t.name)})};var t}(e)))}}const Rr={kind:h.DIRECTIVE_DEFINITION,description:Fr("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:kr("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[kr("QUERY"),kr("MUTATION"),kr("SUBSCRIPTION"),kr("FRAGMENT_DEFINITION")]},Cr={kind:h.DOCUMENT,definitions:[Rr]};const Gr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function $r(e){return e.startsWith("__")}const Qr={kind:h.FIELD,name:{kind:h.NAME,value:"__typename"}};function Mr(e,t){return t&&(e=function(e){return Ee(e,{enter:e=>e.kind!==h.SELECTION_SET?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===h.FIELD||e.kind===h.FRAGMENT_DEFINITION||e.kind===h.INLINE_FRAGMENT)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Gr,...e.selectionSet.selections]}}}})}(e)),Ee(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![h.FIELD,h.FRAGMENT_DEFINITION].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==Qr.kind&&e.name.value==Qr.name.value));return t?e:{...e,selections:[Qr,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==Qr.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){return e.name.value==Rr.name.value?null:e}(e)}})}function Ur(e){return null!=e}function Vr(e){switch(e.kind){case h.VARIABLE:return{kind:e.kind,value:e.name.value};case h.LIST:return{kind:e.kind,value:e.values.map(Vr)};case h.OBJECT:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=Vr(t.value),e)),{})};default:return e}}function Pr(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function jr(e,t,n,r){var i,o,s;const a=new Map;for(const e of t.definitions)e.kind===h.FRAGMENT_DEFINITION&&a.set(e.name.value,e);const c=[],u=new Map,l=new Set,p=e.getQueryType();if(void 0===p)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const d={queryType:p,mutationType:null!==(i=e.getMutationType())&&void 0!==i?i:void 0,subscriptionType:null!==(o=e.getSubscriptionType())&&void 0!==o?o:void 0};for(const e of t.definitions)e.kind===h.OPERATION_DEFINITION&&c.push(m(e));for(const[e,t]of a.entries())u.set(e,E(t));return{rootTypes:d,operations:c,fragments:Array.from(u.values()),referencedTypes:Array.from(l.values()),schemaDocumentation:null!==(s=e.description)&&void 0!==s?s:void 0};function f(t){if(!l.has(t)){if(l.add(t),Fe(t))for(const n of e.getPossibleTypes(t))f(Ke(n));if(xe(t)){const e=t.getTypes();for(t of e)f(Ke(t))}if(Ce(t)&&function(e){const t=e.getFields();for(const e in t){f(Ke(t[e].type))}}(t),ke(t))for(const e of t.getInterfaces())f(Ke(e))}}function m(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=Pr(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?Vr(t.defaultValue):void 0,i=un(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return f(Ke(i)),{name:n,type:i,defaultValue:r}})),u=Ne(Mr(t,n)),l=e.getRootType(s),[p]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(l),{name:o,operationType:s,variables:c,rootType:l,selectionSet:T(t.selectionSet,l,a),directives:p,referencedFragments:Array.from(a.values()),source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=Pr(t),s=Ne(Mr(t,n)),a=new Set,c=un(e,t.typeCondition),[u]=null!==(r=N(t.directives))&&void 0!==r?r:[void 0,void 0];return f(Ke(c)),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:T(t.selectionSet,c,a),directives:u,referencedFragments:Array.from(a.values())}}function T(t,n,i){return{parentType:n,selections:t.selections.map((t=>function(t,n,i){var o,s,c,l;const[p,d]=null!==(o=N(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case h.FIELD:{const m=t.name.value;if("__typename"==m)return;const v=null===(s=t.alias)||void 0===s?void 0:s.value,I=function(e,t,n){return n===Vt.name&&e.getQueryType()===t?Vt:n===Pt.name&&e.getQueryType()===t?Pt:n===jt.name&&(ke(t)||Fe(t)||xe(t))?jt:ke(t)||Fe(t)?t.getFields()[n]:void 0}(e,n,m);if(!I)throw new GraphQLError(`Cannot query field "${m}" on type "${String(n)}"`,{nodes:t});const g=I.type,_=Ke(I.type);f(Ke(_));const{description:O,deprecationReason:S}=I;let L={kind:"Field",name:m,alias:v,type:g,arguments:y(I,t.arguments),inclusionConditions:d,description:!$r(m)&&O?O:void 0,deprecationReason:S||void 0,directives:p};function b(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Ge(g)||$e(g)&&Ge(g.ofType)?b(t,null===(c=r.disallowedFieldNames)||void 0===c?void 0:c.entityList,r.schemaNamespace):Ve(_)&&b(t,null===(l=r.disallowedFieldNames)||void 0===l?void 0:l.entity,r.schemaNamespace),Ve(_)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${m}" on type "${String(n)}" requires selection set`,{nodes:t});L.selectionSet=T(A,_,i)}return L}case h.INLINE_FRAGMENT:{const w=t.typeCondition,D=w?un(e,w):n;return f(D),{kind:"InlineFragment",selectionSet:T(t.selectionSet,D,i),inclusionConditions:d,directives:p}}case h.FRAGMENT_SPREAD:{const k=t.name.value,F=function(e){let t=u.get(e);if(t)return t;const n=a.get(e);return n?(a.delete(e),t=E(n),u.set(e,t),t):void 0}(k);if(!F)throw new GraphQLError(`Unknown fragment "${k}".`,{nodes:t.name});i.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,i))).filter(Ur)}}function y(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:Vr(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function N(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:y(o,i.arguments)});const s=v(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function v(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case h.BOOLEAN:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case h.VARIABLE:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function Br(){return{kind:h.DOCUMENT,definitions:[xr(gt)]}}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r){return jr(e,t,n,r)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(q(r));var r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==Rr.name.value))?e:Sr([e,Cr])}(Sr(n));r=function(e){return e.definitions.some((e=>e.kind==h.DIRECTIVE_DEFINITION&&e.name.value==gt.name))?e:Sr([e,Br()])}(r),t||function(e){const t=ar(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(r);const i=t?ur(function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=cr(t);return n}(t.body),r,{assumeValid:!0,assumeValidSDL:!0}):hr(r,{assumeValid:!0,assumeValidSDL:!0});return function(e){const t=qt(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}(i),i},e.mergeDocuments=function(e){return Sr(e)},e.parseOperationDocument=function(e){return q(e)},e.printSchemaToSDL=function(e){return mr(e)},e.validateDocument=function(e,t,n){return sr(e,t,br(n))},e}({});"# \ No newline at end of file diff --git a/Sources/GraphQLCompiler/JavaScript/package.json b/Sources/GraphQLCompiler/JavaScript/package.json index a7bab200e..5f7360d06 100644 --- a/Sources/GraphQLCompiler/JavaScript/package.json +++ b/Sources/GraphQLCompiler/JavaScript/package.json @@ -13,7 +13,7 @@ "npm": ">=7" }, "dependencies": { - "graphql": "17.0.0-alpha.2", + "graphql": "17.0.0-alpha.3", "tslib": "^2.3.0" }, "devDependencies": { diff --git a/Sources/GraphQLCompiler/JavaScript/rollup.config.js b/Sources/GraphQLCompiler/JavaScript/rollup.config.js index 066ff1b49..587431069 100644 --- a/Sources/GraphQLCompiler/JavaScript/rollup.config.js +++ b/Sources/GraphQLCompiler/JavaScript/rollup.config.js @@ -22,7 +22,7 @@ const options = { }), replace({ preventAssignment: true, - "process.env.NODE_ENV": JSON.stringify("production"), + "globalThis.process.env.NODE_ENV": JSON.stringify("production"), }), terser({ keep_classnames: true, From e4cbf45cd311fab789059de58e09af7ab55a9795 Mon Sep 17 00:00:00 2001 From: Jeff Auriemma Date: Thu, 14 Dec 2023 16:21:16 -0500 Subject: [PATCH 09/11] 2023-12-14 Roadmap update --- apollo-ios/ROADMAP.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apollo-ios/ROADMAP.md b/apollo-ios/ROADMAP.md index 71effe3e6..7cd9f62a9 100644 --- a/apollo-ios/ROADMAP.md +++ b/apollo-ios/ROADMAP.md @@ -1,6 +1,6 @@ # 🔮 Apollo iOS Roadmap -**Last updated: 2023-11-16** +**Last updated: 2023-12-14** For up to date release notes, refer to the project's [Changelog](https://github.com/apollographql/apollo-ios/blob/main/CHANGELOG.md). @@ -26,13 +26,12 @@ As we identify feature sets that we intend to ship, we'll add to and update the _Approximate Date: TBD - PR from an external contributor is in review_ - Support for Relay-style (cursor-based), offset-based, and arbitrary pagination patterns -- `@connection` directive support - This feature will be considered experimental, meaning that the public API could change in backwards-incompatible ways until it is declared stable in a future release - This package will be versioned independently from Apollo iOS, beginning with `0.1.0` ### [`@defer` support](https://github.com/apollographql/apollo-ios/issues/2395) -_Approximate Date: Under review.._ +_Approximate Date: 2024-01-11 (preview)_ The `@defer` directive enables your queries to receive data for specific fields asynchronously. This is helpful whenever some fields in a query take much longer to resolve than others. [Apollo Kotlin](https://www.apollographql.com/docs/kotlin/fetching/defer/) and [Apollo Client (web)](https://www.apollographql.com/docs/react/data/defer/) currently support this syntax, so if you're interested in learning more check out their documentation. Apollo iOS will release support for this directive in a `1.x` minor version. This will be released as an experimental feature. From 64e4f6425133703daf94eac3ce820e01350fffab Mon Sep 17 00:00:00 2001 From: gh-action-runner Date: Thu, 14 Dec 2023 21:22:50 +0000 Subject: [PATCH 10/11] Squashed 'apollo-ios/' changes from 5cebbacc..f584fe66 f584fe66 2023-12-14 Roadmap update git-subtree-dir: apollo-ios git-subtree-split: f584fe669c528e2eef62f7ca0ff039fdc503a6cf --- ROADMAP.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 71effe3e6..7cd9f62a9 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,6 +1,6 @@ # 🔮 Apollo iOS Roadmap -**Last updated: 2023-11-16** +**Last updated: 2023-12-14** For up to date release notes, refer to the project's [Changelog](https://github.com/apollographql/apollo-ios/blob/main/CHANGELOG.md). @@ -26,13 +26,12 @@ As we identify feature sets that we intend to ship, we'll add to and update the _Approximate Date: TBD - PR from an external contributor is in review_ - Support for Relay-style (cursor-based), offset-based, and arbitrary pagination patterns -- `@connection` directive support - This feature will be considered experimental, meaning that the public API could change in backwards-incompatible ways until it is declared stable in a future release - This package will be versioned independently from Apollo iOS, beginning with `0.1.0` ### [`@defer` support](https://github.com/apollographql/apollo-ios/issues/2395) -_Approximate Date: Under review.._ +_Approximate Date: 2024-01-11 (preview)_ The `@defer` directive enables your queries to receive data for specific fields asynchronously. This is helpful whenever some fields in a query take much longer to resolve than others. [Apollo Kotlin](https://www.apollographql.com/docs/kotlin/fetching/defer/) and [Apollo Client (web)](https://www.apollographql.com/docs/react/data/defer/) currently support this syntax, so if you're interested in learning more check out their documentation. Apollo iOS will release support for this directive in a `1.x` minor version. This will be released as an experimental feature. From 707e93de9fded015c316efa251c464b60287cf1e Mon Sep 17 00:00:00 2001 From: Zach FettersMoore Date: Fri, 15 Dec 2023 17:14:06 -0500 Subject: [PATCH 11/11] Tuist updates (apollographql/apollo-ios-dev#201) --- .tuist-version | 2 +- .../Workspace-Target-Framework.xcconfig | 3 +- .../Enums/ApolloTarget.swift | 40 ++++++++++++++----- .../Settings/Settings+Apollo.swift | 7 +++- .../Targets/Target+AnimalKingdomAPI.swift | 4 +- ...get+ApolloCodegenInternalTestHelpers.swift | 4 +- .../Target+ApolloCodegenLibWrapper.swift | 4 +- .../Targets/Target+ApolloCodegenTests.swift | 4 +- .../Target+ApolloInternalTestHelpers.swift | 4 +- .../Target+ApolloPaginationTests.swift | 4 +- .../Target+ApolloPerformanceTests.swift | 4 +- .../Target+ApolloServerIntegrationTests.swift | 4 +- .../Targets/Target+ApolloTests.swift | 4 +- .../Targets/Target+ApolloWrapper.swift | 4 +- .../Targets/Target+CodegenCLITests.swift | 4 +- .../Targets/Target+GitHubAPI.swift | 4 +- .../Targets/Target+StarWarsAPI.swift | 4 +- .../Targets/Target+SubscriptionAPI.swift | 4 +- .../Targets/Target+UploadAPI.swift | 4 +- 19 files changed, 68 insertions(+), 44 deletions(-) diff --git a/.tuist-version b/.tuist-version index 209f5795d..fe5d7123a 100644 --- a/.tuist-version +++ b/.tuist-version @@ -1 +1 @@ -3.19.0 \ No newline at end of file +3.35.5 \ No newline at end of file diff --git a/Configuration/Shared/Workspace-Target-Framework.xcconfig b/Configuration/Shared/Workspace-Target-Framework.xcconfig index f02138d8d..bb0901c18 100644 --- a/Configuration/Shared/Workspace-Target-Framework.xcconfig +++ b/Configuration/Shared/Workspace-Target-Framework.xcconfig @@ -12,4 +12,5 @@ FRAMEWORK_VERSION[sdk=macosx*] = A APPLICATION_EXTENSION_API_ONLY = YES -DEFINES_MODULE = YES +DEFINES_MODULE = NO + diff --git a/Tuist/ProjectDescriptionHelpers/Enums/ApolloTarget.swift b/Tuist/ProjectDescriptionHelpers/Enums/ApolloTarget.swift index b4a683ae8..7f4fe92a1 100644 --- a/Tuist/ProjectDescriptionHelpers/Enums/ApolloTarget.swift +++ b/Tuist/ProjectDescriptionHelpers/Enums/ApolloTarget.swift @@ -87,28 +87,48 @@ public enum ApolloTarget { return "Apollo-Target-UploadAPI" } } + + public var destinations: Destinations { + switch self { + case .animalKingdomAPI, + .apolloCodegenLibWrapper, + .apolloCodegenInternalTestHelpers, + .apolloCodegenTests, + .apolloInternalTestHelpers, + .apolloPaginationTests, + .apolloPerformanceTests, + .apolloServerIntegrationTests, + .apolloTests, + .apolloWrapper, + .codegenCLITests, + .gitHubAPI, + .starWarsAPI, + .subscriptionAPI, + .uploadAPI: + return Destinations([.mac]) + } + } - public var deploymentTarget: DeploymentTarget { - var version = "10.15" + public var deploymentTargets: DeploymentTargets { switch self { case .animalKingdomAPI, - .apolloCodegenLibWrapper, .apolloWrapper, .gitHubAPI, .starWarsAPI, .subscriptionAPI, .uploadAPI: - version = "10.15" - case .apolloCodegenInternalTestHelpers, - .apolloCodegenTests, - .apolloInternalTestHelpers, + return DeploymentTargets(macOS: "10.15") + case .apolloInternalTestHelpers, .apolloPerformanceTests, .apolloServerIntegrationTests, .apolloTests, - .apolloPaginationTests, + .apolloPaginationTests: + return DeploymentTargets(macOS: "12.0") + case .apolloCodegenInternalTestHelpers, + .apolloCodegenLibWrapper, + .apolloCodegenTests, .codegenCLITests: - version = "12.5" + return DeploymentTargets(macOS: "12.0") } - return .macOS(targetVersion: version) } } diff --git a/Tuist/ProjectDescriptionHelpers/Settings/Settings+Apollo.swift b/Tuist/ProjectDescriptionHelpers/Settings/Settings+Apollo.swift index 35038409d..7c0877308 100644 --- a/Tuist/ProjectDescriptionHelpers/Settings/Settings+Apollo.swift +++ b/Tuist/ProjectDescriptionHelpers/Settings/Settings+Apollo.swift @@ -7,11 +7,14 @@ extension Settings { let debugConfig = Configuration.debug(name: .debug, xcconfig: configPath) let releaseConfig = Configuration.release(name: .release, xcconfig: configPath) let performanceTestingConfig = Configuration.release(name: .performanceTesting, xcconfig: configPath) - let settings = Settings.settings(configurations: [ + let settings = Settings.settings( + configurations: [ debugConfig, releaseConfig, performanceTestingConfig - ]) + ], + defaultSettings: .none + ) return settings } diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+AnimalKingdomAPI.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+AnimalKingdomAPI.swift index eeeb8c2d3..e4c9c3e9c 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+AnimalKingdomAPI.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+AnimalKingdomAPI.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Sources/\(target.name)/Info.plist"), sources: [ "Sources/\(target.name)/\(target.name)/Sources/**", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenInternalTestHelpers.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenInternalTestHelpers.swift index 1b861ed27..59bef90b1 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenInternalTestHelpers.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenInternalTestHelpers.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), sources: [ "Tests/\(target.name)/**", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenLibWrapper.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenLibWrapper.swift index e29a48abd..08d808826 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenLibWrapper.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenLibWrapper.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), dependencies: [ .package(product: "ApolloCodegenLib") diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenTests.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenTests.swift index fbea34d2e..918d8b7bf 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenTests.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloCodegenTests.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .unitTests, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), sources: [ "Tests/\(target.name)/**", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloInternalTestHelpers.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloInternalTestHelpers.swift index 69e267e42..746693cca 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloInternalTestHelpers.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloInternalTestHelpers.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), sources: [ "Tests/\(target.name)/**", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPaginationTests.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPaginationTests.swift index 7317e1307..f9456e53d 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPaginationTests.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPaginationTests.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .unitTests, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, sources: [ "Tests/\(target.name)/**", ], diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPerformanceTests.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPerformanceTests.swift index 88230ec34..03fb474b6 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPerformanceTests.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloPerformanceTests.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .unitTests, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), sources: [ "Tests/\(target.name)/**", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloServerIntegrationTests.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloServerIntegrationTests.swift index aece6861a..f9ce831d3 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloServerIntegrationTests.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloServerIntegrationTests.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .unitTests, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), sources: [ "Tests/\(target.name)/**", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloTests.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloTests.swift index fc9414158..add5da31c 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloTests.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloTests.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .unitTests, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), sources: [ "Tests/\(target.name)/**", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloWrapper.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloWrapper.swift index 9cce844a4..78d04f1a5 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloWrapper.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+ApolloWrapper.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), dependencies: [ .package(product: "Apollo") diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+CodegenCLITests.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+CodegenCLITests.swift index 3c8e94a41..d107b8156 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+CodegenCLITests.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+CodegenCLITests.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .unitTests, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Tests/\(target.name)/Info.plist"), sources: [ "Tests/\(target.name)/*.swift", diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+GitHubAPI.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+GitHubAPI.swift index bfefc3c1f..e736df097 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+GitHubAPI.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+GitHubAPI.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Sources/\(target.name)/Info.plist"), sources: [ "Sources/\(target.name)/\(target.name)/Sources/**" diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+StarWarsAPI.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+StarWarsAPI.swift index d2f472e53..ee36c175b 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+StarWarsAPI.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+StarWarsAPI.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Sources/\(target.name)/Info.plist"), sources: [ "Sources/\(target.name)/\(target.name)/Sources/**" diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+SubscriptionAPI.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+SubscriptionAPI.swift index 465a89120..08112951b 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+SubscriptionAPI.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+SubscriptionAPI.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Sources/\(target.name)/Info.plist"), sources: [ "Sources/\(target.name)/\(target.name)/Sources/**" diff --git a/Tuist/ProjectDescriptionHelpers/Targets/Target+UploadAPI.swift b/Tuist/ProjectDescriptionHelpers/Targets/Target+UploadAPI.swift index a1fa45a79..7813d1f62 100644 --- a/Tuist/ProjectDescriptionHelpers/Targets/Target+UploadAPI.swift +++ b/Tuist/ProjectDescriptionHelpers/Targets/Target+UploadAPI.swift @@ -7,10 +7,10 @@ extension Target { return Target( name: target.name, - platform: .macOS, + destinations: target.destinations, product: .framework, bundleId: "com.apollographql.\(target.name.lowercased())", - deploymentTarget: target.deploymentTarget, + deploymentTargets: target.deploymentTargets, infoPlist: .file(path: "Sources/\(target.name)/Info.plist"), sources: [ "Sources/\(target.name)/\(target.name)/Sources/**"