@kyro-cms/core 0.12.60 → 0.12.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{bootstrap-VUWX45QN.js → bootstrap-WB6FDH2T.js} +1 -1
- package/dist/bootstrap-XDT4MRML.cjs +1 -0
- package/dist/{chunk-33E4YN62.js → chunk-26MOA3HJ.js} +10 -10
- package/dist/{chunk-M56F4LQ5.cjs → chunk-3XLXKGEU.cjs} +1 -1
- package/dist/{chunk-WQCLLM4S.cjs → chunk-4FHWIGHO.cjs} +10 -10
- package/dist/chunk-4ZWLNGLS.js +2 -0
- package/dist/{chunk-VOQUO2EZ.cjs → chunk-5DWQGEM2.cjs} +22 -22
- package/dist/{chunk-OXGJOYEO.js → chunk-637PTUHF.js} +1 -1
- package/dist/chunk-6QWX3DEB.cjs +120 -0
- package/dist/{chunk-ZMG7Z3KF.js → chunk-75BFTYBS.js} +23 -23
- package/dist/{chunk-YZEMLLD2.js → chunk-AWQGDMOE.js} +3 -3
- package/dist/chunk-D6SDGHY6.js +2 -0
- package/dist/{chunk-MP5VC5ER.cjs → chunk-FP5UK272.cjs} +1 -1
- package/dist/{chunk-AK754S3T.cjs → chunk-FSL3NLRT.cjs} +2 -2
- package/dist/{chunk-RTHJ6SS5.js → chunk-GQGFNTDZ.js} +1 -1
- package/dist/chunk-HKYBQYAJ.cjs +19 -0
- package/dist/{chunk-TDGSIF5H.cjs → chunk-JU3UAZRY.cjs} +10 -11
- package/dist/chunk-KMFLHGD5.cjs +1 -0
- package/dist/{chunk-NTKIONEC.cjs → chunk-LOP464VR.cjs} +1 -1
- package/dist/{chunk-R25WLKX4.js → chunk-N6MNQIQU.js} +101 -101
- package/dist/{chunk-BHR7OAU4.cjs → chunk-OPTVCCQQ.cjs} +101 -101
- package/dist/chunk-RDFGJHEG.js +2 -0
- package/dist/chunk-RILJCH6H.js +121 -0
- package/dist/{chunk-KCHPADCH.cjs → chunk-SOCBJPYB.cjs} +1 -1
- package/dist/chunk-T4JJVUGT.js +20 -0
- package/dist/{chunk-7N6TW4JB.js → chunk-TBTQXIHP.js} +1 -1
- package/dist/{chunk-KNOFTUQV.js → chunk-VJODUKKM.js} +11 -12
- package/dist/{chunk-DUO523BH.cjs → chunk-ZHA446FA.cjs} +1 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +1 -1
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +2 -1
- package/dist/drizzle/index.d.ts +2 -1
- package/dist/drizzle/index.js +1 -1
- package/dist/fields/index.cjs +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/graphql/index.cjs +1 -1
- package/dist/graphql/index.d.cts +2 -0
- package/dist/graphql/index.d.ts +2 -0
- package/dist/graphql/index.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{local-2IFOTHAA.js → local-4MZ7KOL3.js} +1 -1
- package/dist/{local-UESCNPQP.cjs → local-NDTKWJQ6.cjs} +1 -1
- package/dist/postgres-auth-adapter-SK3N3OSS.js +1 -1
- package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +1 -1
- package/dist/postgres-js-GXZX3AGZ.cjs +1 -0
- package/dist/{postgres-js-4CI7FMYS.js → postgres-js-WE3NBRFO.js} +1 -1
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +3 -3
- package/dist/rest/index.d.ts +3 -3
- package/dist/rest/index.js +1 -1
- package/dist/{sqlite-adapter-4TPNROJK.js → sqlite-adapter-52PL52VU.js} +1 -1
- package/dist/{sqlite-adapter-ZTABLT2X.cjs → sqlite-adapter-MNNZZXGX.cjs} +1 -1
- package/dist/trpc/index.cjs +1 -1
- package/dist/trpc/index.js +1 -1
- package/package.json +2 -2
- package/dist/bootstrap-JF6Q4L6P.cjs +0 -1
- package/dist/chunk-5LPNEYK5.cjs +0 -1
- package/dist/chunk-72VOOMJI.js +0 -20
- package/dist/chunk-AO2IXWV4.js +0 -2
- package/dist/chunk-OUMUIICN.cjs +0 -264
- package/dist/chunk-PA4ZZREG.js +0 -2
- package/dist/chunk-PCVQNVSU.cjs +0 -19
- package/dist/chunk-SQBTIMWF.js +0 -2
- package/dist/chunk-T4TSELDS.js +0 -265
- package/dist/postgres-js-3Y54EXVQ.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {h
|
|
2
|
-
g();g();g();g();var Mi=Object.freeze({major:16,minor:14,patch:2,preReleaseTag:null});g();function F(e,t){throw new Error(t)}g();g();g();g();function ae(e){return typeof e=="object"&&e!==null}g();g();function W(e,t){throw new Error(t??"Unexpected invariant triggered.")}var ji=/\r\n|[\n\r]/g;function Xe(e,t){let n=0,r=1;for(let i of e.body.matchAll(ji)){if(typeof i.index=="number"||W(),i.index>=t)break;n=i.index+i[0].length,r+=1;}return {line:r,column:t+1-n}}g();function
|
|
3
|
-
`,f=r.split(/\r\n|[\n\r]/g),d=f[i];if(d.length>120){let h=Math.floor(
|
|
4
|
-
`)}function Gi(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var m=class e extends Error{constructor(t,...n){var r,i,s;let{nodes:o,source:a,positions:
|
|
1
|
+
import {e,h}from'./chunk-GQGFNTDZ.js';import {a}from'./chunk-TBHNE4VV.js';import {g}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
+
g();g();g();g();var Mi=Object.freeze({major:16,minor:14,patch:2,preReleaseTag:null});g();function F(e,t){throw new Error(t)}g();g();g();g();function ae(e){return typeof e=="object"&&e!==null}g();g();function W(e,t){throw new Error(t??"Unexpected invariant triggered.")}var ji=/\r\n|[\n\r]/g;function Xe(e,t){let n=0,r=1;for(let i of e.body.matchAll(ji)){if(typeof i.index=="number"||W(),i.index>=t)break;n=i.index+i[0].length,r+=1;}return {line:r,column:t+1-n}}g();function kn(e){return Yt(e.source,Xe(e.source,e.start))}function Yt(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u}
|
|
3
|
+
`,f=r.split(/\r\n|[\n\r]/g),d=f[i];if(d.length>120){let h=Math.floor(u/80),v=u%80,g=[];for(let A=0;A<d.length;A+=80)g.push(d.slice(A,A+80));return c+Jr([[`${o} |`,g[0]],...g.slice(1,h+1).map(A=>["|",A]),["|","^".padStart(v)],["|",g[h+1]]])}return c+Jr([[`${o-1} |`,f[i-1]],[`${o} |`,d],["|","^".padStart(u)],[`${o+1} |`,f[i+1]]])}function Jr(e){let t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
|
|
4
|
+
`)}function Gi(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var m=class e extends Error{constructor(t,...n){var r,i,s;let{nodes:o,source:a,positions:u,path:c,originalError:f,extensions:d}=Gi(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=f??void 0,this.nodes=Xr(Array.isArray(o)?o:o?[o]:void 0);let h=Xr((r=this.nodes)===null||r===void 0?void 0:r.map(g=>g.loc).filter(g=>g!=null));this.source=a??(h==null||(i=h[0])===null||i===void 0?void 0:i.source),this.positions=u??h?.map(g=>g.start),this.locations=u&&a?u.map(g=>Xe(a,g)):h?.map(g=>Xe(g.source,g.start));let v=ae(f?.extensions)?f?.extensions:void 0;this.extensions=(s=d??v)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:true,enumerable:true},name:{enumerable:false},nodes:{enumerable:false},source:{enumerable:false},positions:{enumerable:false},originalError:{enumerable:false}}),f!=null&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:true,configurable:true}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:true,configurable:true});}get[Symbol.toStringTag](){return "GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
|
|
5
5
|
|
|
6
|
-
`+
|
|
6
|
+
`+kn(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
|
|
7
7
|
|
|
8
|
-
`+Yt(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function Xr(e){return e===void 0||e.length===0?void 0:e}function J(e,t,n){return new m(`Syntax Error: ${n}`,{source:e,positions:[t]})}g();var ht=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r;}get[Symbol.toStringTag](){return "Location"}toJSON(){return {start:this.start,end:this.end}}},ze=class{constructor(t,n,r,i,s,o){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=s,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}}},yt={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","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","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],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"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Pi=new Set(Object.keys(yt));function Tt(e){let t=e?.kind;return typeof t=="string"&&Pi.has(t)}var Z;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription";})(Z||(Z={}));g();var _;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",e.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION";})(_||(_={}));g();var
|
|
8
|
+
`+Yt(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function Xr(e){return e===void 0||e.length===0?void 0:e}function J(e,t,n){return new m(`Syntax Error: ${n}`,{source:e,positions:[t]})}g();var ht=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r;}get[Symbol.toStringTag](){return "Location"}toJSON(){return {start:this.start,end:this.end}}},ze=class{constructor(t,n,r,i,s,o){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=s,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}}},yt={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","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","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],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"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Pi=new Set(Object.keys(yt));function Tt(e){let t=e?.kind;return typeof t=="string"&&Pi.has(t)}var Z;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription";})(Z||(Z={}));g();var _;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",e.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION";})(_||(_={}));g();var p;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.DIRECTIVE_EXTENSION="DirectiveExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate";})(p||(p={}));g();g();g();function Kt(e){return e===9||e===32}function We(e){return e>=48&&e<=57}function zr(e){return e>=97&&e<=122||e>=65&&e<=90}function Et(e){return zr(e)||e===95}function Jt(e){return zr(e)||We(e)||e===95}function Wr(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<e.length;++o){var s;let a=e[o],u=Qi(a);u!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&u<n&&(n=u));}return e.map((o,a)=>a===0?o:o.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function Qi(e){let t=0;for(;t<e.length&&Kt(e.charCodeAt(t));)++t;return t}function Hr(e){if(e==="")return true;let t=true,n=false,r=true,i=false;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return false;case 13:return false;case 10:if(t&&!i)return false;i=true,t=true,n=false;break;case 9:case 32:n||(n=t);break;default:r&&(r=n),t=false;}return !(t||r&&i)}function Zr(e,t){let n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(v=>v.length===0||Kt(v.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,f=(!i||e.length>70||c||s||o),d="",h=i&&Kt(e.charCodeAt(0));return (f&&!h||s)&&(d+=`
|
|
9
9
|
`),d+=n,(f||c)&&(d+=`
|
|
10
|
-
`),'"""'+d+'"""'}g();var y;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",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";})(y||(y={}));var gt=class{constructor(t){let n=new ze(y.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0;}get[Symbol.toStringTag](){return "Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==y.EOF)do if(t.next)t=t.next;else {let n=Bi(this,t.end);t.next=n,n.prev=t,t=n;}while(t.kind===y.COMMENT);return t}};function ti(e){return e===y.BANG||e===y.DOLLAR||e===y.AMP||e===y.PAREN_L||e===y.PAREN_R||e===y.DOT||e===y.SPREAD||e===y.COLON||e===y.EQUALS||e===y.AT||e===y.BRACKET_L||e===y.BRACKET_R||e===y.BRACE_L||e===y.PIPE||e===y.BRACE_R}function He(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Xt(e,t){return ni(e.charCodeAt(t))&&ri(e.charCodeAt(t+1))}function ni(e){return e>=55296&&e<=56319}function ri(e){return e>=56320&&e<=57343}function Me(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return y.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return "U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ee(e,t,n,r,i){let s=e.line,o=1+n-e.lineStart;return new ze(t,n,r,s,o,i)}function Bi(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return qi(e,i);case 33:return ee(e,y.BANG,i,i+1);case 36:return ee(e,y.DOLLAR,i,i+1);case 38:return ee(e,y.AMP,i,i+1);case 40:return ee(e,y.PAREN_L,i,i+1);case 41:return ee(e,y.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return ee(e,y.SPREAD,i,i+3);break;case 58:return ee(e,y.COLON,i,i+1);case 61:return ee(e,y.EQUALS,i,i+1);case 64:return ee(e,y.AT,i,i+1);case 91:return ee(e,y.BRACKET_L,i,i+1);case 93:return ee(e,y.BRACKET_R,i,i+1);case 123:return ee(e,y.BRACE_L,i,i+1);case 124:return ee(e,y.PIPE,i,i+1);case 125:return ee(e,y.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Wi(e,i):Ki(e,i)}if(We(s)||s===45)return Yi(e,i,s);if(Et(s))return Hi(e,i);throw J(e.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:He(s)||Xt(n,i)?`Unexpected character: ${Me(e,i)}.`:`Invalid character: ${Me(e,i)}.`)}return ee(e,y.EOF,r,r)}function qi(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let s=n.charCodeAt(i);if(s===10||s===13)break;if(He(s))++i;else if(Xt(n,i))i+=2;else break}return ee(e,y.COMMENT,t,i,n.slice(t+1,i))}function Yi(e,t,n){let r=e.source.body,i=t,s=n,o=false;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),We(s))throw J(e.source,i,`Invalid number, unexpected digit after 0: ${Me(e,i)}.`)}else i=
|
|
11
|
-
`,size:2};case 114:return {value:"\r",size:2};case 116:return {value:" ",size:2}}throw J(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Wi(e,t){let n=e.source.body,r=n.length,i=e.lineStart,s=t+3,o=s,a="",
|
|
12
|
-
`));return e.line+=
|
|
10
|
+
`),'"""'+d+'"""'}g();var y;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",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";})(y||(y={}));var gt=class{constructor(t){let n=new ze(y.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0;}get[Symbol.toStringTag](){return "Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==y.EOF)do if(t.next)t=t.next;else {let n=Bi(this,t.end);t.next=n,n.prev=t,t=n;}while(t.kind===y.COMMENT);return t}};function ti(e){return e===y.BANG||e===y.DOLLAR||e===y.AMP||e===y.PAREN_L||e===y.PAREN_R||e===y.DOT||e===y.SPREAD||e===y.COLON||e===y.EQUALS||e===y.AT||e===y.BRACKET_L||e===y.BRACKET_R||e===y.BRACE_L||e===y.PIPE||e===y.BRACE_R}function He(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Xt(e,t){return ni(e.charCodeAt(t))&&ri(e.charCodeAt(t+1))}function ni(e){return e>=55296&&e<=56319}function ri(e){return e>=56320&&e<=57343}function Me(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return y.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return "U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ee(e,t,n,r,i){let s=e.line,o=1+n-e.lineStart;return new ze(t,n,r,s,o,i)}function Bi(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return qi(e,i);case 33:return ee(e,y.BANG,i,i+1);case 36:return ee(e,y.DOLLAR,i,i+1);case 38:return ee(e,y.AMP,i,i+1);case 40:return ee(e,y.PAREN_L,i,i+1);case 41:return ee(e,y.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return ee(e,y.SPREAD,i,i+3);break;case 58:return ee(e,y.COLON,i,i+1);case 61:return ee(e,y.EQUALS,i,i+1);case 64:return ee(e,y.AT,i,i+1);case 91:return ee(e,y.BRACKET_L,i,i+1);case 93:return ee(e,y.BRACKET_R,i,i+1);case 123:return ee(e,y.BRACE_L,i,i+1);case 124:return ee(e,y.PIPE,i,i+1);case 125:return ee(e,y.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Wi(e,i):Ki(e,i)}if(We(s)||s===45)return Yi(e,i,s);if(Et(s))return Hi(e,i);throw J(e.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:He(s)||Xt(n,i)?`Unexpected character: ${Me(e,i)}.`:`Invalid character: ${Me(e,i)}.`)}return ee(e,y.EOF,r,r)}function qi(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let s=n.charCodeAt(i);if(s===10||s===13)break;if(He(s))++i;else if(Xt(n,i))i+=2;else break}return ee(e,y.COMMENT,t,i,n.slice(t+1,i))}function Yi(e,t,n){let r=e.source.body,i=t,s=n,o=false;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),We(s))throw J(e.source,i,`Invalid number, unexpected digit after 0: ${Me(e,i)}.`)}else i=Fn(e,i,s),s=r.charCodeAt(i);if(s===46&&(o=true,s=r.charCodeAt(++i),i=Fn(e,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=true,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Fn(e,i,s),s=r.charCodeAt(i)),s===46||Et(s))throw J(e.source,i,`Invalid number, expected digit but got: ${Me(e,i)}.`);return ee(e,o?y.FLOAT:y.INT,t,i,r.slice(t,i))}function Fn(e,t,n){if(!We(n))throw J(e.source,t,`Invalid number, expected digit but got: ${Me(e,t)}.`);let r=e.source.body,i=t+1;for(;We(r.charCodeAt(i));)++i;return i}function Ki(e,t){let n=e.source.body,r=n.length,i=t+1,s=i,o="";for(;i<r;){let a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),ee(e,y.STRING,t,i+1,o);if(a===92){o+=n.slice(s,i);let u=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?Ji(e,i):Xi(e,i):zi(e,i);o+=u.value,i+=u.size,s=i;continue}if(a===10||a===13)break;if(He(a))++i;else if(Xt(n,i))i+=2;else throw J(e.source,i,`Invalid character within String: ${Me(e,i)}.`)}throw J(e.source,i,"Unterminated string.")}function Ji(e,t){let n=e.source.body,r=0,i=3;for(;i<12;){let s=n.charCodeAt(t+i++);if(s===125){if(i<5||!He(r))break;return {value:String.fromCodePoint(r),size:i}}if(r=r<<4|Nt(s),r<0)break}throw J(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Xi(e,t){let n=e.source.body,r=ei(n,t+2);if(He(r))return {value:String.fromCodePoint(r),size:6};if(ni(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let i=ei(n,t+8);if(ri(i))return {value:String.fromCodePoint(r,i),size:12}}throw J(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function ei(e,t){return Nt(e.charCodeAt(t))<<12|Nt(e.charCodeAt(t+1))<<8|Nt(e.charCodeAt(t+2))<<4|Nt(e.charCodeAt(t+3))}function Nt(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function zi(e,t){let 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:`
|
|
11
|
+
`,size:2};case 114:return {value:"\r",size:2};case 116:return {value:" ",size:2}}throw J(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Wi(e,t){let n=e.source.body,r=n.length,i=e.lineStart,s=t+3,o=s,a="",u=[];for(;s<r;){let c=n.charCodeAt(s);if(c===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),u.push(a);let f=ee(e,y.BLOCK_STRING,t,s+3,Wr(u).join(`
|
|
12
|
+
`));return e.line+=u.length-1,e.lineStart=i,f}if(c===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(c===10||c===13){a+=n.slice(o,s),u.push(a),c===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(He(c))++s;else if(Xt(n,s))s+=2;else throw J(e.source,s,`Invalid character within String: ${Me(e,s)}.`)}throw J(e.source,s,"Unterminated string.")}function Hi(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let s=n.charCodeAt(i);if(Jt(s))++i;else break}return ee(e,y.NAME,t,i,n.slice(t,i))}g();g();function N(e){return zt(e,[])}function zt(e,t){switch(typeof e){case "string":return JSON.stringify(e);case "function":return e.name?`[function ${e.name}]`:"[function]";case "object":return Zi(e,t);default:return String(e)}}function Zi(e,t){if(e===null)return "null";if(t.includes(e))return "[Circular]";let n=[...t,e];if(es(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:zt(r,n)}else if(Array.isArray(e))return ns(e,n);return ts(e,n)}function es(e){return typeof e.toJSON=="function"}function ts(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+rs(e)+"]":"{ "+n.map(([i,s])=>i+": "+zt(s,t)).join(", ")+" }"}function ns(e,t){if(e.length===0)return "[]";if(t.length>2)return "[Array]";let n=Math.min(10,e.length),r=e.length-n,i=[];for(let s=0;s<n;++s)i.push(zt(e[s],t));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function rs(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}g();var is=globalThis.process&&process.env.NODE_ENV==="production",ue=is?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return true;if(typeof t=="object"&&t!==null){var r;let i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(r=t.constructor)===null||r===void 0?void 0:r.name;if(i===s){let o=N(t);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
|
|
13
13
|
|
|
14
14
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
15
15
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -20,9 +20,9 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
20
20
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
21
21
|
versions may have different capabilities and behavior. The data from one
|
|
22
22
|
version used in the function from another could produce confusing and
|
|
23
|
-
spurious results.`)}}return false};var Ze=class{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||F(false,`Body must be a string. Received: ${N(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||F(false,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||F(false,"column in locationOffset is 1-indexed and must be positive.");}get[Symbol.toStringTag](){return "Source"}};function ii(e){return ue(e,Ze)}function si(e,t){let n=new Fn(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:false,value:n.tokenCount}),r}var Fn=class{constructor(t,n={}){let{lexer:r,...i}=n;if(r)this._lexer=r;else {let s=ii(t)?t:new Ze(t);this._lexer=new gt(s);}this._options=i,this._tokenCounter=0;}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(y.NAME);return this.node(t,{kind:u.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:u.DOCUMENT,definitions:this.many(y.SOF,this.parseDefinition,y.EOF)})}parseDefinition(){if(this.peek(y.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===y.BRACE_L)throw J(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===y.NAME){switch(n.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()}switch(n.value){case "query":case "mutation":case "subscription":return this.parseOperationDefinition();case "fragment":return this.parseFragmentDefinition()}if(t)throw J(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(y.BRACE_L))return this.node(t,{kind:u.OPERATION_DEFINITION,operation:Z.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),r=this.parseOperationType(),i;return this.peek(y.NAME)&&(i=this.parseName()),this.node(t,{kind:u.OPERATION_DEFINITION,operation:r,description:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(y.NAME);switch(t.value){case "query":return Z.QUERY;case "mutation":return Z.MUTATION;case "subscription":return Z.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(y.PAREN_L,this.parseVariableDefinition,y.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:u.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(y.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(y.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(y.DOLLAR),this.node(t,{kind:u.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:u.SELECTION_SET,selections:this.many(y.BRACE_L,this.parseSelection,y.BRACE_R)})}parseSelection(){return this.peek(y.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(y.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:u.FIELD,alias:r,name:i,arguments:this.parseArguments(false),directives:this.parseDirectives(false),selectionSet:this.peek(y.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(y.PAREN_L,n,y.PAREN_R)}parseArgument(t=false){let n=this._lexer.token,r=this.parseName();return this.expectToken(y.COLON),this.node(n,{kind:u.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(true)}parseFragment(){let t=this._lexer.token;this.expectToken(y.SPREAD);let n=this.expectOptionalKeyword("on");return !n&&this.peek(y.NAME)?this.node(t,{kind:u.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(false)}):this.node(t,{kind:u.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===true?this.node(t,{kind:u.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:u.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case y.BRACKET_L:return this.parseList(t);case y.BRACE_L:return this.parseObject(t);case y.INT:return this.advanceLexer(),this.node(n,{kind:u.INT,value:n.value});case y.FLOAT:return this.advanceLexer(),this.node(n,{kind:u.FLOAT,value:n.value});case y.STRING:case y.BLOCK_STRING:return this.parseStringLiteral();case y.NAME:switch(this.advanceLexer(),n.value){case "true":return this.node(n,{kind:u.BOOLEAN,value:true});case "false":return this.node(n,{kind:u.BOOLEAN,value:false});case "null":return this.node(n,{kind:u.NULL});default:return this.node(n,{kind:u.ENUM,value:n.value})}case y.DOLLAR:if(t)if(this.expectToken(y.DOLLAR),this._lexer.token.kind===y.NAME){let r=this._lexer.token.value;throw J(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(true)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:u.STRING,value:t.value,block:t.kind===y.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:u.LIST,values:this.any(y.BRACKET_L,n,y.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:u.OBJECT,fields:this.any(y.BRACE_L,n,y.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(y.COLON),this.node(n,{kind:u.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(y.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(true)}parseDirective(t){let n=this._lexer.token;return this.expectToken(y.AT),this.node(n,{kind:u.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(y.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(y.BRACKET_R),n=this.node(t,{kind:u.LIST_TYPE,type:r});}else n=this.parseNamedType();return this.expectOptionalToken(y.BANG)?this.node(t,{kind:u.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:u.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(y.STRING)||this.peek(y.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(y.BRACE_L,this.parseOperationTypeDefinition,y.BRACE_R);return this.node(t,{kind:u.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(y.COLON);let r=this.parseNamedType();return this.node(t,{kind:u.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:u.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:u.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(y.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(y.BRACE_L,this.parseFieldDefinition,y.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(y.COLON);let s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:u.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(y.PAREN_L,this.parseInputValueDef,y.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(y.COLON);let i=this.parseTypeReference(),s;this.expectOptionalToken(y.EQUALS)&&(s=this.parseConstValueLiteral());let o=this.parseConstDirectives();return this.node(t,{kind:u.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:u.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:u.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(y.EQUALS)?this.delimitedMany(y.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:u.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(y.BRACE_L,this.parseEnumValueDefinition,y.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:u.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw J(this._lexer.source,this._lexer.token.start,`${Wt(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:u.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(y.BRACE_L,this.parseInputValueDef,y.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===y.NAME)switch(t.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();case "directive":if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension();break}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(y.BRACE_L,this.parseOperationTypeDefinition,y.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:u.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:u.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:u.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:u.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:u.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:u.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:u.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinitionExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(y.AT);let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:u.DIRECTIVE_EXTENSION,name:n,directives:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(y.AT);let r=this.parseName(),i=this.parseArgumentDefs(),s=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:u.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,directives:s,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(y.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(_,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(y.AT),r=this.parseName(),i;!n&&this.expectOptionalToken(y.DOT)&&(i=this.parseName());let s;return (n||i)&&this.expectOptionalToken(y.PAREN_L)&&(s=this.parseName(),this.expectToken(y.COLON),this.expectToken(y.PAREN_R)),n?s?this.node(t,{kind:u.DIRECTIVE_ARGUMENT_COORDINATE,name:r,argumentName:s}):this.node(t,{kind:u.DIRECTIVE_COORDINATE,name:r}):i?s?this.node(t,{kind:u.ARGUMENT_COORDINATE,name:r,fieldName:i,argumentName:s}):this.node(t,{kind:u.MEMBER_COORDINATE,name:r,memberName:i}):this.node(t,{kind:u.TYPE_COORDINATE,name:r})}node(t,n){return this._options.noLocation!==true&&(n.loc=new ht(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw J(this._lexer.source,n.start,`Expected ${oi(t)}, found ${Wt(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),true):false}expectKeyword(t){let n=this._lexer.token;if(n.kind===y.NAME&&n.value===t)this.advanceLexer();else throw J(this._lexer.source,n.start,`Expected "${t}", found ${Wt(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===y.NAME&&n.value===t?(this.advanceLexer(),true):false}unexpected(t){let n=t??this._lexer.token;return J(this._lexer.source,n.start,`Unexpected ${Wt(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return []}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==y.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw J(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function Wt(e){let t=e.value;return oi(e.kind)+(t!=null?` "${t}"`:"")}function oi(e){return ti(e)?`"${e}"`:e}g();g();g();g();function se(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let s=r.map(p=>`"${p}"`);switch(s.length){case 0:return "";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}let o=s.slice(0,5),a=o.pop();return i+o.join(", ")+", or "+a+"?"}g();function Cn(e){return e}g();function Ie(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}g();function vt(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}g();function je(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}g();g();function et(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),s=t.charCodeAt(r);if(Ht(i)&&Ht(s)){let o=0;do++n,o=o*10+i-$n,i=e.charCodeAt(n);while(Ht(i)&&o>0);let a=0;do++r,a=a*10+s-$n,s=t.charCodeAt(r);while(Ht(s)&&a>0);if(o<a)return -1;if(o>a)return 1}else {if(i<s)return -1;if(i>s)return 1;++n,++r;}}return e.length-t.length}var $n=48,ss=57;function Ht(e){return !isNaN(e)&&$n<=e&&e<=ss}function pe(e,t){let n=Object.create(null),r=new Un(e),i=Math.floor(e.length*.4)+1;for(let s of t){let o=r.measure(s,i);o!==void 0&&(n[s]=o);}return Object.keys(n).sort((s,o)=>{let a=n[s]-n[o];return a!==0?a:et(s,o)})}var Un=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=ai(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)];}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=ai(r),s=this._inputArray;if(i.length<s.length){let f=i;i=s,s=f;}let o=i.length,a=s.length;if(o-a>n)return;let p=this._rows;for(let f=0;f<=a;f++)p[0][f]=f;for(let f=1;f<=o;f++){let d=p[(f-1)%3],h=p[f%3],v=h[0]=f;for(let g=1;g<=a;g++){let A=i[f-1]===s[g-1]?0:1,w=Math.min(d[g]+1,h[g-1]+1,d[g-1]+A);if(f>1&&g>1&&i[f-1]===s[g-2]&&i[f-2]===s[g-1]){let L=p[(f-2)%3][g-2];w=Math.min(w,L+1);}w<v&&(v=w),h[g]=w;}if(v>n)return}let c=p[o%3][a];return c<=n?c:void 0}};function ai(e){let t=e.length,n=new Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}g();function ce(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}g();g();function ui(e){return `"${e.replace(os,as)}"`}var os=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function as(e){return us[e.charCodeAt(0)]}var us=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];g();var tt=Object.freeze({});function Ge(e,t,n=yt){let r=new Map;for(let L of Object.values(u))r.set(L,nt(t,L));let i,s=Array.isArray(e),o=[e],a=-1,p=[],c=e,f,d,h=[],v=[];do{a++;let L=a===o.length,P=L&&p.length!==0;if(L){if(f=v.length===0?void 0:h[h.length-1],c=d,d=v.pop(),P)if(s){c=c.slice();let I=0;for(let[Y,z]of p){let Q=Y-I;z===null?(c.splice(Q,1),I++):c[Q]=z;}}else {c={...c};for(let[I,Y]of p)c[I]=Y;}a=i.index,o=i.keys,p=i.edits,s=i.inArray,i=i.prev;}else if(d){if(f=s?a:o[a],c=d[f],c==null)continue;h.push(f);}let K;if(!Array.isArray(c)){var g,A;Tt(c)||F(false,`Invalid AST Node: ${N(c)}.`);let I=L?(g=r.get(c.kind))===null||g===void 0?void 0:g.leave:(A=r.get(c.kind))===null||A===void 0?void 0:A.enter;if(K=I?.call(t,c,f,d,h,v),K===tt)break;if(K===false){if(!L){h.pop();continue}}else if(K!==void 0&&(p.push([f,K]),!L))if(Tt(K))c=K;else {h.pop();continue}}if(K===void 0&&P&&p.push([f,c]),L)h.pop();else {var w;i={inArray:s,index:a,keys:o,edits:p,prev:i},s=Array.isArray(c),o=s?c:(w=n[c.kind])!==null&&w!==void 0?w:[],a=-1,p=[],d&&v.push(d),d=c;}}while(i!==void 0);return p.length!==0?p[p.length-1][1]:e}function Vn(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(u)){let i=false,s=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let p=0;p<e.length;++p){let{enter:c,leave:f}=nt(e[p],r);i||(i=c!=null||f!=null),s[p]=c,o[p]=f;}if(!i)continue;let a={enter(...p){let c=p[0];for(let d=0;d<e.length;d++)if(t[d]===null){var f;let h=(f=s[d])===null||f===void 0?void 0:f.apply(e[d],p);if(h===false)t[d]=c;else if(h===tt)t[d]=tt;else if(h!==void 0)return h}},leave(...p){let c=p[0];for(let d=0;d<e.length;d++)if(t[d]===null){var f;let h=(f=o[d])===null||f===void 0?void 0:f.apply(e[d],p);if(h===tt)t[d]=tt;else if(h!==void 0&&h!==false)return h}else t[d]===c&&(t[d]=null);}};n[r]=a;}return n}function nt(e,t){let n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function U(e){return Ge(e,cs)}var ps=80,cs={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>O(e.definitions,`
|
|
23
|
+
spurious results.`)}}return false};var Ze=class{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||F(false,`Body must be a string. Received: ${N(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||F(false,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||F(false,"column in locationOffset is 1-indexed and must be positive.");}get[Symbol.toStringTag](){return "Source"}};function ii(e){return ue(e,Ze)}function si(e,t){let n=new Cn(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:false,value:n.tokenCount}),r}var Cn=class{constructor(t,n={}){let{lexer:r,...i}=n;if(r)this._lexer=r;else {let s=ii(t)?t:new Ze(t);this._lexer=new gt(s);}this._options=i,this._tokenCounter=0;}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(y.NAME);return this.node(t,{kind:p.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:p.DOCUMENT,definitions:this.many(y.SOF,this.parseDefinition,y.EOF)})}parseDefinition(){if(this.peek(y.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===y.BRACE_L)throw J(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===y.NAME){switch(n.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()}switch(n.value){case "query":case "mutation":case "subscription":return this.parseOperationDefinition();case "fragment":return this.parseFragmentDefinition()}if(t)throw J(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(y.BRACE_L))return this.node(t,{kind:p.OPERATION_DEFINITION,operation:Z.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),r=this.parseOperationType(),i;return this.peek(y.NAME)&&(i=this.parseName()),this.node(t,{kind:p.OPERATION_DEFINITION,operation:r,description:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(y.NAME);switch(t.value){case "query":return Z.QUERY;case "mutation":return Z.MUTATION;case "subscription":return Z.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(y.PAREN_L,this.parseVariableDefinition,y.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:p.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(y.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(y.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(y.DOLLAR),this.node(t,{kind:p.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:p.SELECTION_SET,selections:this.many(y.BRACE_L,this.parseSelection,y.BRACE_R)})}parseSelection(){return this.peek(y.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(y.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:p.FIELD,alias:r,name:i,arguments:this.parseArguments(false),directives:this.parseDirectives(false),selectionSet:this.peek(y.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(y.PAREN_L,n,y.PAREN_R)}parseArgument(t=false){let n=this._lexer.token,r=this.parseName();return this.expectToken(y.COLON),this.node(n,{kind:p.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(true)}parseFragment(){let t=this._lexer.token;this.expectToken(y.SPREAD);let n=this.expectOptionalKeyword("on");return !n&&this.peek(y.NAME)?this.node(t,{kind:p.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(false)}):this.node(t,{kind:p.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===true?this.node(t,{kind:p.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:p.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(false),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case y.BRACKET_L:return this.parseList(t);case y.BRACE_L:return this.parseObject(t);case y.INT:return this.advanceLexer(),this.node(n,{kind:p.INT,value:n.value});case y.FLOAT:return this.advanceLexer(),this.node(n,{kind:p.FLOAT,value:n.value});case y.STRING:case y.BLOCK_STRING:return this.parseStringLiteral();case y.NAME:switch(this.advanceLexer(),n.value){case "true":return this.node(n,{kind:p.BOOLEAN,value:true});case "false":return this.node(n,{kind:p.BOOLEAN,value:false});case "null":return this.node(n,{kind:p.NULL});default:return this.node(n,{kind:p.ENUM,value:n.value})}case y.DOLLAR:if(t)if(this.expectToken(y.DOLLAR),this._lexer.token.kind===y.NAME){let r=this._lexer.token.value;throw J(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(true)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:p.STRING,value:t.value,block:t.kind===y.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:p.LIST,values:this.any(y.BRACKET_L,n,y.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:p.OBJECT,fields:this.any(y.BRACE_L,n,y.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(y.COLON),this.node(n,{kind:p.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(y.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(true)}parseDirective(t){let n=this._lexer.token;return this.expectToken(y.AT),this.node(n,{kind:p.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(y.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(y.BRACKET_R),n=this.node(t,{kind:p.LIST_TYPE,type:r});}else n=this.parseNamedType();return this.expectOptionalToken(y.BANG)?this.node(t,{kind:p.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:p.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(y.STRING)||this.peek(y.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(y.BRACE_L,this.parseOperationTypeDefinition,y.BRACE_R);return this.node(t,{kind:p.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(y.COLON);let r=this.parseNamedType();return this.node(t,{kind:p.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:p.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:p.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(y.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(y.BRACE_L,this.parseFieldDefinition,y.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(y.COLON);let s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:p.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(y.PAREN_L,this.parseInputValueDef,y.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(y.COLON);let i=this.parseTypeReference(),s;this.expectOptionalToken(y.EQUALS)&&(s=this.parseConstValueLiteral());let o=this.parseConstDirectives();return this.node(t,{kind:p.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:p.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:p.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(y.EQUALS)?this.delimitedMany(y.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:p.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(y.BRACE_L,this.parseEnumValueDefinition,y.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:p.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw J(this._lexer.source,this._lexer.token.start,`${Wt(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(y.BRACE_L,this.parseInputValueDef,y.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===y.NAME)switch(t.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();case "directive":if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension();break}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(y.BRACE_L,this.parseOperationTypeDefinition,y.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:p.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:p.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:p.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:p.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:p.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinitionExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(y.AT);let n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:p.DIRECTIVE_EXTENSION,name:n,directives:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(y.AT);let r=this.parseName(),i=this.parseArgumentDefs(),s=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:p.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,directives:s,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(y.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(_,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(y.AT),r=this.parseName(),i;!n&&this.expectOptionalToken(y.DOT)&&(i=this.parseName());let s;return (n||i)&&this.expectOptionalToken(y.PAREN_L)&&(s=this.parseName(),this.expectToken(y.COLON),this.expectToken(y.PAREN_R)),n?s?this.node(t,{kind:p.DIRECTIVE_ARGUMENT_COORDINATE,name:r,argumentName:s}):this.node(t,{kind:p.DIRECTIVE_COORDINATE,name:r}):i?s?this.node(t,{kind:p.ARGUMENT_COORDINATE,name:r,fieldName:i,argumentName:s}):this.node(t,{kind:p.MEMBER_COORDINATE,name:r,memberName:i}):this.node(t,{kind:p.TYPE_COORDINATE,name:r})}node(t,n){return this._options.noLocation!==true&&(n.loc=new ht(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw J(this._lexer.source,n.start,`Expected ${oi(t)}, found ${Wt(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),true):false}expectKeyword(t){let n=this._lexer.token;if(n.kind===y.NAME&&n.value===t)this.advanceLexer();else throw J(this._lexer.source,n.start,`Expected "${t}", found ${Wt(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===y.NAME&&n.value===t?(this.advanceLexer(),true):false}unexpected(t){let n=t??this._lexer.token;return J(this._lexer.source,n.start,`Unexpected ${Wt(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return []}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==y.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw J(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function Wt(e){let t=e.value;return oi(e.kind)+(t!=null?` "${t}"`:"")}function oi(e){return ti(e)?`"${e}"`:e}g();g();g();g();function se(e,t){let[n,r]=t?[e,t]:[void 0,e],i=" Did you mean ";n&&(i+=n+" ");let s=r.map(u=>`"${u}"`);switch(s.length){case 0:return "";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}let o=s.slice(0,5),a=o.pop();return i+o.join(", ")+", or "+a+"?"}g();function $n(e){return e}g();function Ie(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}g();function vt(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}g();function je(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}g();g();function et(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),s=t.charCodeAt(r);if(Ht(i)&&Ht(s)){let o=0;do++n,o=o*10+i-Un,i=e.charCodeAt(n);while(Ht(i)&&o>0);let a=0;do++r,a=a*10+s-Un,s=t.charCodeAt(r);while(Ht(s)&&a>0);if(o<a)return -1;if(o>a)return 1}else {if(i<s)return -1;if(i>s)return 1;++n,++r;}}return e.length-t.length}var Un=48,ss=57;function Ht(e){return !isNaN(e)&&Un<=e&&e<=ss}function pe(e,t){let n=Object.create(null),r=new Vn(e),i=Math.floor(e.length*.4)+1;for(let s of t){let o=r.measure(s,i);o!==void 0&&(n[s]=o);}return Object.keys(n).sort((s,o)=>{let a=n[s]-n[o];return a!==0?a:et(s,o)})}var Vn=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=ai(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)];}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=ai(r),s=this._inputArray;if(i.length<s.length){let f=i;i=s,s=f;}let o=i.length,a=s.length;if(o-a>n)return;let u=this._rows;for(let f=0;f<=a;f++)u[0][f]=f;for(let f=1;f<=o;f++){let d=u[(f-1)%3],h=u[f%3],v=h[0]=f;for(let g=1;g<=a;g++){let A=i[f-1]===s[g-1]?0:1,w=Math.min(d[g]+1,h[g-1]+1,d[g-1]+A);if(f>1&&g>1&&i[f-1]===s[g-2]&&i[f-2]===s[g-1]){let L=u[(f-2)%3][g-2];w=Math.min(w,L+1);}w<v&&(v=w),h[g]=w;}if(v>n)return}let c=u[o%3][a];return c<=n?c:void 0}};function ai(e){let t=e.length,n=new Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}g();function ce(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}g();g();function ui(e){return `"${e.replace(os,as)}"`}var os=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function as(e){return us[e.charCodeAt(0)]}var us=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];g();var tt=Object.freeze({});function Ge(e,t,n=yt){let r=new Map;for(let L of Object.values(p))r.set(L,nt(t,L));let i,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,f,d,h=[],v=[];do{a++;let L=a===o.length,P=L&&u.length!==0;if(L){if(f=v.length===0?void 0:h[h.length-1],c=d,d=v.pop(),P)if(s){c=c.slice();let I=0;for(let[Y,z]of u){let Q=Y-I;z===null?(c.splice(Q,1),I++):c[Q]=z;}}else {c={...c};for(let[I,Y]of u)c[I]=Y;}a=i.index,o=i.keys,u=i.edits,s=i.inArray,i=i.prev;}else if(d){if(f=s?a:o[a],c=d[f],c==null)continue;h.push(f);}let K;if(!Array.isArray(c)){var g,A;Tt(c)||F(false,`Invalid AST Node: ${N(c)}.`);let I=L?(g=r.get(c.kind))===null||g===void 0?void 0:g.leave:(A=r.get(c.kind))===null||A===void 0?void 0:A.enter;if(K=I?.call(t,c,f,d,h,v),K===tt)break;if(K===false){if(!L){h.pop();continue}}else if(K!==void 0&&(u.push([f,K]),!L))if(Tt(K))c=K;else {h.pop();continue}}if(K===void 0&&P&&u.push([f,c]),L)h.pop();else {var w;i={inArray:s,index:a,keys:o,edits:u,prev:i},s=Array.isArray(c),o=s?c:(w=n[c.kind])!==null&&w!==void 0?w:[],a=-1,u=[],d&&v.push(d),d=c;}}while(i!==void 0);return u.length!==0?u[u.length-1][1]:e}function Mn(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(p)){let i=false,s=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let u=0;u<e.length;++u){let{enter:c,leave:f}=nt(e[u],r);i||(i=c!=null||f!=null),s[u]=c,o[u]=f;}if(!i)continue;let a={enter(...u){let c=u[0];for(let d=0;d<e.length;d++)if(t[d]===null){var f;let h=(f=s[d])===null||f===void 0?void 0:f.apply(e[d],u);if(h===false)t[d]=c;else if(h===tt)t[d]=tt;else if(h!==void 0)return h}},leave(...u){let c=u[0];for(let d=0;d<e.length;d++)if(t[d]===null){var f;let h=(f=o[d])===null||f===void 0?void 0:f.apply(e[d],u);if(h===tt)t[d]=tt;else if(h!==void 0&&h!==false)return h}else t[d]===c&&(t[d]=null);}};n[r]=a;}return n}function nt(e,t){let n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function U(e){return Ge(e,cs)}var ps=80,cs={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>O(e.definitions,`
|
|
24
24
|
|
|
25
|
-
`)},OperationDefinition:{leave(e){let t=
|
|
25
|
+
`)},OperationDefinition:{leave(e){let t=jn(e.variableDefinitions)?x(`(
|
|
26
26
|
`,O(e.variableDefinitions,`
|
|
27
27
|
`),`
|
|
28
28
|
)`):x("(",O(e.variableDefinitions,", "),")"),n=x("",e.description,`
|
|
@@ -35,7 +35,7 @@ spurious results.`)}}return false};var Ze=class{constructor(t,n="GraphQL reques
|
|
|
35
35
|
`)+O(["schema",O(t," "),Oe(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>x("",e,`
|
|
36
36
|
`)+O(["scalar",t,O(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>x("",e,`
|
|
37
37
|
`)+O(["type",t,x("implements ",O(n," & ")),O(r," "),Oe(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>x("",e,`
|
|
38
|
-
`)+t+(
|
|
38
|
+
`)+t+(jn(n)?x(`(
|
|
39
39
|
`,Zt(O(n,`
|
|
40
40
|
`)),`
|
|
41
41
|
)`):x("(",O(n,", "),")"))+": "+r+x(" ",O(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>x("",e,`
|
|
@@ -45,31 +45,31 @@ spurious results.`)}}return false};var Ze=class{constructor(t,n="GraphQL reques
|
|
|
45
45
|
`)+O(["enum",t,O(n," "),Oe(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>x("",e,`
|
|
46
46
|
`)+O([t,O(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>x("",e,`
|
|
47
47
|
`)+O(["input",t,O(n," "),Oe(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:s})=>x("",e,`
|
|
48
|
-
`)+"directive @"+t+(
|
|
48
|
+
`)+"directive @"+t+(jn(n)?x(`(
|
|
49
49
|
`,Zt(O(n,`
|
|
50
50
|
`)),`
|
|
51
51
|
)`):x("(",O(n,", "),")"))+x(" ",O(r," "))+(i?" repeatable":"")+" on "+O(s," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>O(["extend schema",O(e," "),Oe(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>O(["extend scalar",e,O(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>O(["extend type",e,x("implements ",O(t," & ")),O(n," "),Oe(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>O(["extend interface",e,x("implements ",O(t," & ")),O(n," "),Oe(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>O(["extend union",e,O(t," "),x("= ",O(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>O(["extend enum",e,O(t," "),Oe(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>O(["extend input",e,O(t," "),Oe(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>O(["extend directive @"+e,O(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>O([e,x(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>O([e,x(".",t),x("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>O(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>O(["@",e,x("(",t,":)")])}};function O(e,t=""){var n;return (n=e?.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function Oe(e){return x(`{
|
|
52
52
|
`,Zt(O(e,`
|
|
53
53
|
`)),`
|
|
54
54
|
}`)}function x(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Zt(e){return x(" ",e.replace(/\n/g,`
|
|
55
|
-
`))}function
|
|
56
|
-
`)))!==null&&t!==void 0?t:false}g();function rt(e,t){switch(e.kind){case u.NULL:return null;case u.INT:return parseInt(e.value,10);case u.FLOAT:return parseFloat(e.value);case u.STRING:case u.ENUM:case u.BOOLEAN:return e.value;case u.LIST:return e.values.map(n=>rt(n,t));case u.OBJECT:return vt(e.fields,n=>n.name.value,n=>rt(n.value,t));case u.VARIABLE:return t?.[e.name.value]}}g();function de(e){if(e!=null||F(false,"Must provide name."),typeof e=="string"||F(false,"Expected name to be a string."),e.length===0)throw new m("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!Jt(e.charCodeAt(t)))throw new m(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Et(e.charCodeAt(0)))throw new m(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function jn(e){if(e==="true"||e==="false"||e==="null")throw new m(`Enum values cannot be named: ${e}`);return de(e)}function st(e){return he(e)||C(e)||$(e)||ne(e)||X(e)||V(e)||B(e)||R(e)}function he(e){return ue(e,me)}function C(e){return ue(e,j)}function $(e){return ue(e,It)}function ne(e){return ue(e,ke)}function X(e){return ue(e,Fe)}function V(e){return ue(e,Ce)}function B(e){return ue(e,M)}function R(e){return ue(e,D)}function oe(e){return he(e)||X(e)||V(e)||Ot(e)&&oe(e.ofType)}function Le(e){return he(e)||C(e)||$(e)||ne(e)||X(e)||Ot(e)&&Le(e.ofType)}function le(e){return he(e)||X(e)}function ye(e){return C(e)||$(e)||ne(e)}function Te(e){return $(e)||ne(e)}var M=class{constructor(t){st(t)||F(false,`Expected ${N(t)} to be a GraphQL type.`),this.ofType=t;}get[Symbol.toStringTag](){return "GraphQLList"}toString(){return "["+String(this.ofType)+"]"}toJSON(){return this.toString()}},D=class{constructor(t){bt(t)||F(false,`Expected ${N(t)} to be a GraphQL nullable type.`),this.ofType=t;}get[Symbol.toStringTag](){return "GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};function Ot(e){return B(e)||R(e)}function bt(e){return st(e)&&!R(e)}function ot(e){if(e)return R(e)?e.ofType:e}function tn(e){return he(e)||C(e)||$(e)||ne(e)||X(e)||V(e)}function re(e){if(e){let t=e;for(;Ot(t);)t=t.ofType;return t}}function nn(e){return typeof e=="function"?e():e}function rn(e){return typeof e=="function"?e():e}var me=class{constructor(t){var n,r,i,s;let o=(n=t.parseValue)!==null&&n!==void 0?n:Cn;this.name=de(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:Cn,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,p)=>o(rt(a,p)),this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||F(false,`${this.name} must provide "specifiedByURL" as a string, but got: ${N(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||F(false,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||F(false,`${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()}},j=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>li(t),this._interfaces=()=>ci(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||F(false,`${this.name} must provide "isTypeOf" as a function, but got: ${N(t.isTypeOf)}.`);}get[Symbol.toStringTag](){return "GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return {name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fi(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function ci(e){var t;let n=nn((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||F(false,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function li(e){let t=rn(e.fields);return it(t)||F(false,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),je(t,(n,r)=>{var i;it(n)||F(false,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||F(false,`${e.name}.${r} field resolver must be a function if provided, but got: ${N(n.resolve)}.`);let s=(i=n.args)!==null&&i!==void 0?i:{};return it(s)||F(false,`${e.name}.${r} args must be an object with argument names as keys.`),{name:de(r),description:n.description,type:n.type,args:Gn(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:ce(n.extensions),astNode:n.astNode}})}function Gn(e){return Object.entries(e).map(([t,n])=>({name:de(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:ce(n.extensions),astNode:n.astNode}))}function it(e){return ae(e)&&!Array.isArray(e)}function fi(e){return je(e,t=>({description:t.description,type:t.type,args:Pn(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Pn(e){return vt(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function xe(e){return R(e.type)&&e.defaultValue===void 0}var It=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=li.bind(void 0,t),this._interfaces=ci.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||F(false,`${this.name} must provide "resolveType" as a function, but got: ${N(t.resolveType)}.`);}get[Symbol.toStringTag](){return "GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return {name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fi(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},ke=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=ls.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||F(false,`${this.name} must provide "resolveType" as a function, but got: ${N(t.resolveType)}.`);}get[Symbol.toStringTag](){return "GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(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 ls(e){let t=nn(e.types);return Array.isArray(t)||F(false,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var Fe=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:pi(this.name,t.values),this._valueLookup=null,this._nameLookup=null;}get[Symbol.toStringTag](){return "GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=pi(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=Ie(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));let n=this._valueLookup.get(t);if(n===void 0)throw new m(`Enum "${this.name}" cannot represent value: ${N(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=N(t);throw new m(`Enum "${this.name}" cannot represent non-string value: ${r}.`+en(this,r))}let n=this.getValue(t);if(n==null)throw new m(`Value "${t}" does not exist in "${this.name}" enum.`+en(this,t));return n.value}parseLiteral(t,n){if(t.kind!==u.ENUM){let i=U(t);throw new m(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+en(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=U(t);throw new m(`Value "${i}" does not exist in "${this.name}" enum.`+en(this,i),{nodes:t})}return r.value}toConfig(){let t=vt(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return {name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function en(e,t){let n=e.getValues().map(i=>i.name),r=pe(t,n);return se("the enum value",r)}function pi(e,t){return it(t)||F(false,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(it(r)||F(false,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${N(r)}.`),{name:jn(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:ce(r.extensions),astNode:r.astNode}))}var Ce=class{constructor(t){var n,r;this.name=de(t.name),this.description=t.description,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=t.isOneOf)!==null&&r!==void 0?r:false,this._fields=fs.bind(void 0,t);}get[Symbol.toStringTag](){return "GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=je(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return {name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function fs(e){let t=rn(e.fields);return it(t)||F(false,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),je(t,(n,r)=>(!("resolve"in n)||F(false,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:de(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:ce(n.extensions),astNode:n.astNode}))}function at(e){return R(e.type)&&e.defaultValue===void 0}function _t(e,t){return e===t?true:R(e)&&R(t)||B(e)&&B(t)?_t(e.ofType,t.ofType):false}function Re(e,t,n){return t===n?true:R(n)?R(t)?Re(e,t.ofType,n.ofType):false:R(t)?Re(e,t.ofType,n):B(n)?B(t)?Re(e,t.ofType,n.ofType):false:B(t)?false:Te(n)&&($(t)||C(t))&&e.isSubType(n,t)}function sn(e,t,n){return t===n?true:Te(t)?Te(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):Te(n)?e.isSubType(n,t):false}g();g();var St=2147483647,Dt=-2147483648,be=new me({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){let t=Rt(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new m(`Int cannot represent non-integer value: ${N(t)}`);if(n>St||n<Dt)throw new m("Int cannot represent non 32-bit signed integer value: "+N(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new m(`Int cannot represent non-integer value: ${N(e)}`);if(e>St||e<Dt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==u.INT)throw new m(`Int cannot represent non-integer value: ${U(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>St||t<Dt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),At=new me({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=Rt(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new m(`Float cannot represent non numeric value: ${N(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new m(`Float cannot represent non numeric value: ${N(e)}`);return e},parseLiteral(e){if(e.kind!==u.FLOAT&&e.kind!==u.INT)throw new m(`Float cannot represent non numeric value: ${U(e)}`,e);return parseFloat(e.value)}}),S=new me({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=Rt(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new m(`String cannot represent value: ${N(e)}`)},parseValue(e){if(typeof e!="string")throw new m(`String cannot represent a non string value: ${N(e)}`);return e},parseLiteral(e){if(e.kind!==u.STRING)throw new m(`String cannot represent a non string value: ${U(e)}`,{nodes:e});return e.value}}),q=new me({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Rt(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new m(`Boolean cannot represent a non boolean value: ${N(t)}`)},parseValue(e){if(typeof e!="boolean")throw new m(`Boolean cannot represent a non boolean value: ${N(e)}`);return e},parseLiteral(e){if(e.kind!==u.BOOLEAN)throw new m(`Boolean cannot represent a non boolean value: ${U(e)}`,{nodes:e});return e.value}}),Lt=new me({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=Rt(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new m(`ID cannot represent value: ${N(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new m(`ID cannot represent value: ${N(e)}`)},parseLiteral(e){if(e.kind!==u.STRING&&e.kind!==u.INT)throw new m("ID cannot represent a non-string and non-integer value: "+U(e),{nodes:e});return e.value}}),xt=Object.freeze([S,be,At,q,Lt]);function on(e){return xt.some(({name:t})=>e.name===t)}function Rt(e){if(ae(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!ae(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function ut(e){return ue(e,Ae)}var Ae=class{constructor(t){var n,r,i;this.name=de(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:false,this.deprecationReason=t.deprecationReason,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],Array.isArray(t.locations)||F(false,`@${t.name} locations must be an Array.`);let s=(i=t.args)!==null&&i!==void 0?i:{};ae(s)&&!Array.isArray(s)||F(false,`@${t.name} args must be an object with argument names as keys.`),this.args=Gn(s);}get[Symbol.toStringTag](){return "GraphQLDirective"}toConfig(){return {name:this.name,description:this.description,locations:this.locations,args:Pn(this.args),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return "@"+this.name}toJSON(){return this.toString()}},wt=new Ae({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[_.FIELD,_.FRAGMENT_SPREAD,_.INLINE_FRAGMENT],args:{if:{type:new D(q),description:"Included when true."}}}),kt=new Ae({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[_.FIELD,_.FRAGMENT_SPREAD,_.INLINE_FRAGMENT],args:{if:{type:new D(q),description:"Skipped when true."}}}),Ft="No longer supported",Ct=new Ae({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[_.FIELD_DEFINITION,_.ARGUMENT_DEFINITION,_.INPUT_FIELD_DEFINITION,_.ENUM_VALUE,_.DIRECTIVE_DEFINITION],args:{reason:{type:S,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:Ft}}}),Qn=new Ae({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[_.SCALAR],args:{url:{type:new D(S),description:"The URL that specifies the behavior of this scalar."}}}),Bn=new Ae({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[_.INPUT_OBJECT],args:{}}),Ee=Object.freeze([wt,kt,Ct,Qn,Bn]);function an(e){return Ee.some(({name:t})=>t===e.name)}g();g();g();function un(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function we(e,t){if(R(t)){let n=we(e,t.ofType);return n?.kind===u.NULL?null:n}if(e===null)return {kind:u.NULL};if(e===void 0)return null;if(B(t)){let n=t.ofType;if(un(e)){let r=[];for(let i of e){let s=we(i,n);s!=null&&r.push(s);}return {kind:u.LIST,values:r}}return we(e,n)}if(V(t)){if(!ae(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=we(e[r.name],r.type);i&&n.push({kind:u.OBJECT_FIELD,name:{kind:u.NAME,value:r.name},value:i});}return {kind:u.OBJECT,fields:n}}if(le(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return {kind:u.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return di.test(r)?{kind:u.INT,value:r}:{kind:u.FLOAT,value:r}}if(typeof n=="string")return X(t)?{kind:u.ENUM,value:n}:t===Lt&&di.test(n)?{kind:u.INT,value:n}:{kind:u.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${N(n)}.`)}W(false,"Unexpected input type: "+N(t));}var di=/^-?(?:0|[1-9][0-9]*)$/;var pt=new j({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:S,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new D(new M(new D(Ne))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new D(Ne),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ne,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ne,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new D(new M(new D(pn))),args:{includeDeprecated:{type:new D(q),defaultValue:false}},resolve:(e,{includeDeprecated:t})=>t?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),pn=new j({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
55
|
+
`))}function jn(e){var t;return (t=e?.some(n=>n.includes(`
|
|
56
|
+
`)))!==null&&t!==void 0?t:false}g();function rt(e,t){switch(e.kind){case p.NULL:return null;case p.INT:return parseInt(e.value,10);case p.FLOAT:return parseFloat(e.value);case p.STRING:case p.ENUM:case p.BOOLEAN:return e.value;case p.LIST:return e.values.map(n=>rt(n,t));case p.OBJECT:return vt(e.fields,n=>n.name.value,n=>rt(n.value,t));case p.VARIABLE:return t?.[e.name.value]}}g();function de(e){if(e!=null||F(false,"Must provide name."),typeof e=="string"||F(false,"Expected name to be a string."),e.length===0)throw new m("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!Jt(e.charCodeAt(t)))throw new m(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Et(e.charCodeAt(0)))throw new m(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Gn(e){if(e==="true"||e==="false"||e==="null")throw new m(`Enum values cannot be named: ${e}`);return de(e)}function st(e){return he(e)||C(e)||$(e)||ne(e)||X(e)||V(e)||B(e)||R(e)}function he(e){return ue(e,me)}function C(e){return ue(e,j)}function $(e){return ue(e,It)}function ne(e){return ue(e,ke)}function X(e){return ue(e,Fe)}function V(e){return ue(e,Ce)}function B(e){return ue(e,M)}function R(e){return ue(e,D)}function oe(e){return he(e)||X(e)||V(e)||Ot(e)&&oe(e.ofType)}function Le(e){return he(e)||C(e)||$(e)||ne(e)||X(e)||Ot(e)&&Le(e.ofType)}function le(e){return he(e)||X(e)}function ye(e){return C(e)||$(e)||ne(e)}function Te(e){return $(e)||ne(e)}var M=class{constructor(t){st(t)||F(false,`Expected ${N(t)} to be a GraphQL type.`),this.ofType=t;}get[Symbol.toStringTag](){return "GraphQLList"}toString(){return "["+String(this.ofType)+"]"}toJSON(){return this.toString()}},D=class{constructor(t){bt(t)||F(false,`Expected ${N(t)} to be a GraphQL nullable type.`),this.ofType=t;}get[Symbol.toStringTag](){return "GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};function Ot(e){return B(e)||R(e)}function bt(e){return st(e)&&!R(e)}function ot(e){if(e)return R(e)?e.ofType:e}function tn(e){return he(e)||C(e)||$(e)||ne(e)||X(e)||V(e)}function re(e){if(e){let t=e;for(;Ot(t);)t=t.ofType;return t}}function nn(e){return typeof e=="function"?e():e}function rn(e){return typeof e=="function"?e():e}var me=class{constructor(t){var n,r,i,s;let o=(n=t.parseValue)!==null&&n!==void 0?n:$n;this.name=de(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:$n,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,u)=>o(rt(a,u)),this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||F(false,`${this.name} must provide "specifiedByURL" as a string, but got: ${N(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||F(false,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||F(false,`${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()}},j=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>li(t),this._interfaces=()=>ci(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||F(false,`${this.name} must provide "isTypeOf" as a function, but got: ${N(t.isTypeOf)}.`);}get[Symbol.toStringTag](){return "GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return {name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fi(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function ci(e){var t;let n=nn((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||F(false,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function li(e){let t=rn(e.fields);return it(t)||F(false,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),je(t,(n,r)=>{var i;it(n)||F(false,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||F(false,`${e.name}.${r} field resolver must be a function if provided, but got: ${N(n.resolve)}.`);let s=(i=n.args)!==null&&i!==void 0?i:{};return it(s)||F(false,`${e.name}.${r} args must be an object with argument names as keys.`),{name:de(r),description:n.description,type:n.type,args:Pn(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:ce(n.extensions),astNode:n.astNode}})}function Pn(e){return Object.entries(e).map(([t,n])=>({name:de(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:ce(n.extensions),astNode:n.astNode}))}function it(e){return ae(e)&&!Array.isArray(e)}function fi(e){return je(e,t=>({description:t.description,type:t.type,args:Qn(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Qn(e){return vt(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function xe(e){return R(e.type)&&e.defaultValue===void 0}var It=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=li.bind(void 0,t),this._interfaces=ci.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||F(false,`${this.name} must provide "resolveType" as a function, but got: ${N(t.resolveType)}.`);}get[Symbol.toStringTag](){return "GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return {name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fi(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},ke=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=ls.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||F(false,`${this.name} must provide "resolveType" as a function, but got: ${N(t.resolveType)}.`);}get[Symbol.toStringTag](){return "GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(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 ls(e){let t=nn(e.types);return Array.isArray(t)||F(false,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var Fe=class{constructor(t){var n;this.name=de(t.name),this.description=t.description,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:pi(this.name,t.values),this._valueLookup=null,this._nameLookup=null;}get[Symbol.toStringTag](){return "GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=pi(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=Ie(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));let n=this._valueLookup.get(t);if(n===void 0)throw new m(`Enum "${this.name}" cannot represent value: ${N(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let r=N(t);throw new m(`Enum "${this.name}" cannot represent non-string value: ${r}.`+en(this,r))}let n=this.getValue(t);if(n==null)throw new m(`Value "${t}" does not exist in "${this.name}" enum.`+en(this,t));return n.value}parseLiteral(t,n){if(t.kind!==p.ENUM){let i=U(t);throw new m(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+en(this,i),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=U(t);throw new m(`Value "${i}" does not exist in "${this.name}" enum.`+en(this,i),{nodes:t})}return r.value}toConfig(){let t=vt(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return {name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function en(e,t){let n=e.getValues().map(i=>i.name),r=pe(t,n);return se("the enum value",r)}function pi(e,t){return it(t)||F(false,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(it(r)||F(false,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${N(r)}.`),{name:Gn(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:ce(r.extensions),astNode:r.astNode}))}var Ce=class{constructor(t){var n,r;this.name=de(t.name),this.description=t.description,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=t.isOneOf)!==null&&r!==void 0?r:false,this._fields=fs.bind(void 0,t);}get[Symbol.toStringTag](){return "GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=je(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return {name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function fs(e){let t=rn(e.fields);return it(t)||F(false,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),je(t,(n,r)=>(!("resolve"in n)||F(false,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:de(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:ce(n.extensions),astNode:n.astNode}))}function at(e){return R(e.type)&&e.defaultValue===void 0}function _t(e,t){return e===t?true:R(e)&&R(t)||B(e)&&B(t)?_t(e.ofType,t.ofType):false}function Re(e,t,n){return t===n?true:R(n)?R(t)?Re(e,t.ofType,n.ofType):false:R(t)?Re(e,t.ofType,n):B(n)?B(t)?Re(e,t.ofType,n.ofType):false:B(t)?false:Te(n)&&($(t)||C(t))&&e.isSubType(n,t)}function sn(e,t,n){return t===n?true:Te(t)?Te(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):Te(n)?e.isSubType(n,t):false}g();g();var St=2147483647,Dt=-2147483648,be=new me({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){let t=Rt(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new m(`Int cannot represent non-integer value: ${N(t)}`);if(n>St||n<Dt)throw new m("Int cannot represent non 32-bit signed integer value: "+N(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new m(`Int cannot represent non-integer value: ${N(e)}`);if(e>St||e<Dt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==p.INT)throw new m(`Int cannot represent non-integer value: ${U(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>St||t<Dt)throw new m(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),At=new me({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=Rt(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new m(`Float cannot represent non numeric value: ${N(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new m(`Float cannot represent non numeric value: ${N(e)}`);return e},parseLiteral(e){if(e.kind!==p.FLOAT&&e.kind!==p.INT)throw new m(`Float cannot represent non numeric value: ${U(e)}`,e);return parseFloat(e.value)}}),S=new me({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=Rt(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new m(`String cannot represent value: ${N(e)}`)},parseValue(e){if(typeof e!="string")throw new m(`String cannot represent a non string value: ${N(e)}`);return e},parseLiteral(e){if(e.kind!==p.STRING)throw new m(`String cannot represent a non string value: ${U(e)}`,{nodes:e});return e.value}}),q=new me({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Rt(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new m(`Boolean cannot represent a non boolean value: ${N(t)}`)},parseValue(e){if(typeof e!="boolean")throw new m(`Boolean cannot represent a non boolean value: ${N(e)}`);return e},parseLiteral(e){if(e.kind!==p.BOOLEAN)throw new m(`Boolean cannot represent a non boolean value: ${U(e)}`,{nodes:e});return e.value}}),Lt=new me({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=Rt(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new m(`ID cannot represent value: ${N(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new m(`ID cannot represent value: ${N(e)}`)},parseLiteral(e){if(e.kind!==p.STRING&&e.kind!==p.INT)throw new m("ID cannot represent a non-string and non-integer value: "+U(e),{nodes:e});return e.value}}),xt=Object.freeze([S,be,At,q,Lt]);function on(e){return xt.some(({name:t})=>e.name===t)}function Rt(e){if(ae(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!ae(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function ut(e){return ue(e,Ae)}var Ae=class{constructor(t){var n,r,i;this.name=de(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:false,this.deprecationReason=t.deprecationReason,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],Array.isArray(t.locations)||F(false,`@${t.name} locations must be an Array.`);let s=(i=t.args)!==null&&i!==void 0?i:{};ae(s)&&!Array.isArray(s)||F(false,`@${t.name} args must be an object with argument names as keys.`),this.args=Pn(s);}get[Symbol.toStringTag](){return "GraphQLDirective"}toConfig(){return {name:this.name,description:this.description,locations:this.locations,args:Qn(this.args),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return "@"+this.name}toJSON(){return this.toString()}},wt=new Ae({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[_.FIELD,_.FRAGMENT_SPREAD,_.INLINE_FRAGMENT],args:{if:{type:new D(q),description:"Included when true."}}}),kt=new Ae({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[_.FIELD,_.FRAGMENT_SPREAD,_.INLINE_FRAGMENT],args:{if:{type:new D(q),description:"Skipped when true."}}}),Ft="No longer supported",Ct=new Ae({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[_.FIELD_DEFINITION,_.ARGUMENT_DEFINITION,_.INPUT_FIELD_DEFINITION,_.ENUM_VALUE,_.DIRECTIVE_DEFINITION],args:{reason:{type:S,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:Ft}}}),Bn=new Ae({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[_.SCALAR],args:{url:{type:new D(S),description:"The URL that specifies the behavior of this scalar."}}}),qn=new Ae({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[_.INPUT_OBJECT],args:{}}),Ee=Object.freeze([wt,kt,Ct,Bn,qn]);function an(e){return Ee.some(({name:t})=>t===e.name)}g();g();g();function un(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function we(e,t){if(R(t)){let n=we(e,t.ofType);return n?.kind===p.NULL?null:n}if(e===null)return {kind:p.NULL};if(e===void 0)return null;if(B(t)){let n=t.ofType;if(un(e)){let r=[];for(let i of e){let s=we(i,n);s!=null&&r.push(s);}return {kind:p.LIST,values:r}}return we(e,n)}if(V(t)){if(!ae(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=we(e[r.name],r.type);i&&n.push({kind:p.OBJECT_FIELD,name:{kind:p.NAME,value:r.name},value:i});}return {kind:p.OBJECT,fields:n}}if(le(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return {kind:p.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return di.test(r)?{kind:p.INT,value:r}:{kind:p.FLOAT,value:r}}if(typeof n=="string")return X(t)?{kind:p.ENUM,value:n}:t===Lt&&di.test(n)?{kind:p.INT,value:n}:{kind:p.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${N(n)}.`)}W(false,"Unexpected input type: "+N(t));}var di=/^-?(?:0|[1-9][0-9]*)$/;var pt=new j({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:S,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new D(new M(new D(Ne))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new D(Ne),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ne,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ne,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new D(new M(new D(pn))),args:{includeDeprecated:{type:new D(q),defaultValue:false}},resolve:(e,{includeDeprecated:t})=>t?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),pn=new j({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
57
57
|
|
|
58
|
-
In 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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},isRepeatable:{type:new D(q),resolve:e=>e.isRepeatable},locations:{type:new D(new M(new D(cn))),resolve:e=>e.locations},args:{type:new D(new M(new D(ct))),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),cn=new Fe({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:_.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:_.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:_.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:_.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:_.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:_.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:_.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:_.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:_.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:_.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:_.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:_.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:_.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:_.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:_.UNION,description:"Location adjacent to a union definition."},ENUM:{value:_.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:_.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:_.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:_.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:_.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),Ne=new j({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 D(dn),resolve(e){if(he(e))return te.SCALAR;if(C(e))return te.OBJECT;if($(e))return te.INTERFACE;if(ne(e))return te.UNION;if(X(e))return te.ENUM;if(V(e))return te.INPUT_OBJECT;if(B(e))return te.LIST;if(R(e))return te.NON_NULL;W(false,`Unexpected type: "${N(e)}".`);}},name:{type:S,resolve:e=>"name"in e?e.name:void 0},description:{type:S,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:S,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new M(new D(ln)),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){if(C(e)||$(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new M(new D(Ne)),resolve(e){if(C(e)||$(e))return e.getInterfaces()}},possibleTypes:{type:new M(new D(Ne)),resolve(e,t,n,{schema:r}){if(Te(e))return r.getPossibleTypes(e)}},enumValues:{type:new M(new D(fn)),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){if(X(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new M(new D(ct)),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){if(V(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Ne,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:q,resolve:e=>{if(V(e))return e.isOneOf}}})}),ln=new j({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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},args:{type:new D(new M(new D(ct))),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new D(Ne),resolve:e=>e.type},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),ct=new j({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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},type:{type:new D(Ne),resolve:e=>e.type},defaultValue:{type:S,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=we(n,t);return r?U(r):null}},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),fn=new j({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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),te;(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";})(te||(te={}));var dn=new Fe({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:te.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:te.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:te.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:te.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:te.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:te.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:te.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:te.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),$t={name:"__schema",type:new D(pt),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},Ut={name:"__type",type:Ne,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new D(S),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},Vt={name:"__typename",type:new D(S),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},Mt=Object.freeze([pt,pn,cn,Ne,ln,ct,fn,dn]);function lt(e){return Mt.some(({name:t})=>e.name===t)}g();function qn(e){return ue(e,Pe)}function mn(e){if(!qn(e))throw new Error(`Expected ${N(e)} to be a GraphQL schema.`);return e}var Pe=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===true?[]:void 0,ae(t)||F(false,"Must provide configuration object."),!t.types||Array.isArray(t.types)||F(false,`"types" must be Array if provided but got: ${N(t.types)}.`),!t.directives||Array.isArray(t.directives)||F(false,`"directives" must be Array if provided but got: ${N(t.directives)}.`),this.description=t.description,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:Ee;let i=new Set(t.types);if(t.types!=null)for(let s of t.types)i.delete(s),_e(s,i);this._queryType!=null&&_e(this._queryType,i),this._mutationType!=null&&_e(this._mutationType,i),this._subscriptionType!=null&&_e(this._subscriptionType,i);for(let s of this._directives)if(ut(s))for(let o of s.args)_e(o.type,i);_e(pt,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of i){if(s==null)continue;let o=s.name;if(o||F(false,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,$(s)){for(let a of s.getInterfaces())if($(a)){let p=this._implementationsMap[a.name];p===void 0&&(p=this._implementationsMap[a.name]={objects:[],interfaces:[]}),p.interfaces.push(s);}}else if(C(s)){for(let a of s.getInterfaces())if($(a)){let p=this._implementationsMap[a.name];p===void 0&&(p=this._implementationsMap[a.name]={objects:[],interfaces:[]}),p.objects.push(s);}}}}get[Symbol.toStringTag](){return "GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Z.QUERY:return this.getQueryType();case Z.MUTATION:return this.getMutationType();case Z.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return ne(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),ne(t))for(let i of t.getTypes())r[i.name]=true;else {let i=this.getImplementations(t);for(let s of i.objects)r[s.name]=true;for(let s of i.interfaces)r[s.name]=true;}this._subTypeMap[t.name]=r;}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===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:this.__validationErrors!==void 0}}};function _e(e,t){let n=re(e);if(!t.has(n)){if(t.add(n),ne(n))for(let r of n.getTypes())_e(r,t);else if(C(n)||$(n)){for(let r of n.getInterfaces())_e(r,t);for(let r of Object.values(n.getFields())){_e(r.type,t);for(let i of r.args)_e(i.type,t);}}else if(V(n))for(let r of Object.values(n.getFields()))_e(r.type,t);}return t}function Jn(e){if(mn(e),e.__validationErrors)return e.__validationErrors;let t=new Kn(e);ds(t),ms(t),hs(t);let n=t.getErrors();return e.__validationErrors=n,n}function hn(e){let t=Jn(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
58
|
+
In 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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},isRepeatable:{type:new D(q),resolve:e=>e.isRepeatable},locations:{type:new D(new M(new D(cn))),resolve:e=>e.locations},args:{type:new D(new M(new D(ct))),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),cn=new Fe({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:_.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:_.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:_.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:_.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:_.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:_.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:_.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:_.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:_.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:_.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:_.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:_.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:_.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:_.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:_.UNION,description:"Location adjacent to a union definition."},ENUM:{value:_.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:_.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:_.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:_.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:_.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),Ne=new j({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 D(dn),resolve(e){if(he(e))return te.SCALAR;if(C(e))return te.OBJECT;if($(e))return te.INTERFACE;if(ne(e))return te.UNION;if(X(e))return te.ENUM;if(V(e))return te.INPUT_OBJECT;if(B(e))return te.LIST;if(R(e))return te.NON_NULL;W(false,`Unexpected type: "${N(e)}".`);}},name:{type:S,resolve:e=>"name"in e?e.name:void 0},description:{type:S,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:S,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new M(new D(ln)),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){if(C(e)||$(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new M(new D(Ne)),resolve(e){if(C(e)||$(e))return e.getInterfaces()}},possibleTypes:{type:new M(new D(Ne)),resolve(e,t,n,{schema:r}){if(Te(e))return r.getPossibleTypes(e)}},enumValues:{type:new M(new D(fn)),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){if(X(e)){let n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new M(new D(ct)),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){if(V(e)){let n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Ne,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:q,resolve:e=>{if(V(e))return e.isOneOf}}})}),ln=new j({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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},args:{type:new D(new M(new D(ct))),args:{includeDeprecated:{type:q,defaultValue:false}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new D(Ne),resolve:e=>e.type},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),ct=new j({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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},type:{type:new D(Ne),resolve:e=>e.type},defaultValue:{type:S,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,r=we(n,t);return r?U(r):null}},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),fn=new j({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 D(S),resolve:e=>e.name},description:{type:S,resolve:e=>e.description},isDeprecated:{type:new D(q),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:S,resolve:e=>e.deprecationReason}})}),te;(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";})(te||(te={}));var dn=new Fe({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:te.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:te.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:te.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:te.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:te.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:te.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:te.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:te.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),$t={name:"__schema",type:new D(pt),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},Ut={name:"__type",type:Ne,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new D(S),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},Vt={name:"__typename",type:new D(S),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},Mt=Object.freeze([pt,pn,cn,Ne,ln,ct,fn,dn]);function lt(e){return Mt.some(({name:t})=>e.name===t)}g();function Yn(e){return ue(e,Pe)}function mn(e){if(!Yn(e))throw new Error(`Expected ${N(e)} to be a GraphQL schema.`);return e}var Pe=class{constructor(t){var n,r;this.__validationErrors=t.assumeValid===true?[]:void 0,ae(t)||F(false,"Must provide configuration object."),!t.types||Array.isArray(t.types)||F(false,`"types" must be Array if provided but got: ${N(t.types)}.`),!t.directives||Array.isArray(t.directives)||F(false,`"directives" must be Array if provided but got: ${N(t.directives)}.`),this.description=t.description,this.extensions=ce(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:Ee;let i=new Set(t.types);if(t.types!=null)for(let s of t.types)i.delete(s),_e(s,i);this._queryType!=null&&_e(this._queryType,i),this._mutationType!=null&&_e(this._mutationType,i),this._subscriptionType!=null&&_e(this._subscriptionType,i);for(let s of this._directives)if(ut(s))for(let o of s.args)_e(o.type,i);_e(pt,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of i){if(s==null)continue;let o=s.name;if(o||F(false,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,$(s)){for(let a of s.getInterfaces())if($(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.interfaces.push(s);}}else if(C(s)){for(let a of s.getInterfaces())if($(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.objects.push(s);}}}}get[Symbol.toStringTag](){return "GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Z.QUERY:return this.getQueryType();case Z.MUTATION:return this.getMutationType();case Z.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return ne(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),ne(t))for(let i of t.getTypes())r[i.name]=true;else {let i=this.getImplementations(t);for(let s of i.objects)r[s.name]=true;for(let s of i.interfaces)r[s.name]=true;}this._subTypeMap[t.name]=r;}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===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:this.__validationErrors!==void 0}}};function _e(e,t){let n=re(e);if(!t.has(n)){if(t.add(n),ne(n))for(let r of n.getTypes())_e(r,t);else if(C(n)||$(n)){for(let r of n.getInterfaces())_e(r,t);for(let r of Object.values(n.getFields())){_e(r.type,t);for(let i of r.args)_e(i.type,t);}}else if(V(n))for(let r of Object.values(n.getFields()))_e(r.type,t);}return t}function Xn(e){if(mn(e),e.__validationErrors)return e.__validationErrors;let t=new Jn(e);ds(t),ms(t),hs(t);let n=t.getErrors();return e.__validationErrors=n,n}function hn(e){let t=Xn(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
59
59
|
|
|
60
|
-
`))}var Kn=class{constructor(t){this._errors=[],this.schema=t;}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new m(t,{nodes:r}));}getErrors(){return this._errors}};function ds(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!C(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${N(n)}.`,(r=Yn(t,Z.QUERY))!==null&&r!==void 0?r:n.astNode);}let i=t.getMutationType();if(i&&!C(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${N(i)}.`,(s=Yn(t,Z.MUTATION))!==null&&s!==void 0?s:i.astNode);}let o=t.getSubscriptionType();if(o&&!C(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${N(o)}.`,(a=Yn(t,Z.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode);}}function Yn(e,t){var n;return (n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return (i=r?.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function ms(e){for(let n of e.schema.getDirectives()){if(!ut(n)){e.reportError(`Expected directive but got: ${N(n)}.`,n?.astNode);continue}Qe(e,n),n.locations.length===0&&e.reportError(`Directive @${n.name} must include 1 or more locations.`,n.astNode);for(let r of n.args)if(Qe(e,r),oe(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${N(r.type)}.`,r.astNode),xe(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[Xn(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type]);}}}function Qe(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode);}function hs(e){let t=Is(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!tn(r)){e.reportError(`Expected GraphQL named type but got: ${N(r)}.`,r.astNode);continue}lt(r)||Qe(e,r),C(r)||$(r)?(mi(e,r),hi(e,r)):ne(r)?Es(e,r):X(r)?Ns(e,r):V(r)&&(gs(e,r),t(r));}}function mi(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(Qe(e,o),!Le(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${N(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type);}for(let a of o.args){let p=a.name;if(Qe(e,a),!oe(a.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${p}:) must be Input Type but got: ${N(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type);}if(xe(a)&&a.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${o.name}(${p}:) cannot be deprecated.`,[Xn(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type]);}}}}function hi(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!$(r)){e.reportError(`Type ${N(t)} must only implement Interface types, it cannot implement ${N(r)}.`,jt(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,jt(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,jt(t,r));continue}n[r.name]=true,Ts(e,t,r),ys(e,t,r);}}function ys(e,t,n){let r=t.getFields();for(let p of Object.values(n.getFields())){let c=p.name,f=r[c];if(!f){e.reportError(`Interface field ${n.name}.${c} expected but ${t.name} does not provide it.`,[p.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!Re(e.schema,f.type,p.type)){var i,s;e.reportError(`Interface field ${n.name}.${c} expects type ${N(p.type)} but ${t.name}.${c} is type ${N(f.type)}.`,[(i=p.astNode)===null||i===void 0?void 0:i.type,(s=f.astNode)===null||s===void 0?void 0:s.type]);}for(let d of p.args){let h=d.name,v=f.args.find(g=>g.name===h);if(!v){e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expected but ${t.name}.${c} does not provide it.`,[d.astNode,f.astNode]);continue}if(!_t(d.type,v.type)){var o,a;e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expects type ${N(d.type)} but ${t.name}.${c}(${h}:) is type ${N(v.type)}.`,[(o=d.astNode)===null||o===void 0?void 0:o.type,(a=v.astNode)===null||a===void 0?void 0:a.type]);}}for(let d of f.args){let h=d.name;!p.args.find(g=>g.name===h)&&xe(d)&&e.reportError(`Object field ${t.name}.${c} includes required argument ${h} that is missing from the Interface field ${n.name}.${c}.`,[d.astNode,p.astNode]);}}}function Ts(e,t,n){let r=t.getInterfaces();for(let 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}.`,[...jt(n,i),...jt(t,n)]);}function Es(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,yi(t,i.name));continue}r[i.name]=true,C(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${N(i)}.`,yi(t,String(i)));}}function Ns(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)Qe(e,r);}function gs(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of n){if(Qe(e,s),!oe(s.type)){var r;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${N(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type);}if(at(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[Xn(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type]);}t.isOneOf&&vs(t,s,e);}}function vs(e,t,n){if(R(t.type)){var r;n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,(r=t.astNode)===null||r===void 0?void 0:r.type);}t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode);}function Is(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=true,r[s.name]=n.length;let o=Object.values(s.getFields());for(let a of o)if(R(a.type)&&V(a.type.ofType)){let p=a.type.ofType,c=r[p.name];if(n.push(a),c===void 0)i(p);else {let f=n.slice(c),d=f.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${p.name}" within itself through a series of non-null fields: "${d}".`,f.map(h=>h.astNode));}n.pop();}r[s.name]=void 0;}}function jt(e,t){let{astNode:n,extensionASTNodes:r}=e;return (n!=null?[n,...r]:r).flatMap(s=>{var o;return (o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t.name)}function yi(e,t){let{astNode:n,extensionASTNodes:r}=e;return (n!=null?[n,...r]:r).flatMap(s=>{var o;return (o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t)}function Xn(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===Ct.name)}g();g();g();function H(e,t){switch(t.kind){case u.LIST_TYPE:{let n=H(e,t.type);return n&&new M(n)}case u.NON_NULL_TYPE:{let n=H(e,t.type);return n&&new D(n)}case u.NAMED_TYPE:return e.getType(t.name.value)}}var Be=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r??Os,n&&(oe(n)&&this._inputTypeStack.push(n),ye(n)&&this._parentTypeStack.push(n),Le(n)&&this._typeStack.push(n));}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(t){let n=this._schema;switch(t.kind){case u.SELECTION_SET:{let i=re(this.getType());this._parentTypeStack.push(ye(i)?i:void 0);break}case u.FIELD:{let i=this.getParentType(),s,o;i&&(s=this._getFieldDef(n,i,t),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push(Le(o)?o:void 0);break}case u.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case u.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push(C(i)?i:void 0);break}case u.INLINE_FRAGMENT:case u.FRAGMENT_DEFINITION:{let i=t.typeCondition,s=i?H(n,i):re(this.getType());this._typeStack.push(Le(s)?s:void 0);break}case u.VARIABLE_DEFINITION:{let i=H(n,t.type);this._inputTypeStack.push(oe(i)?i:void 0);break}case u.ARGUMENT:{var r;let i,s,o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(oe(s)?s:void 0);break}case u.LIST:{let i=ot(this.getInputType()),s=B(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(oe(s)?s:void 0);break}case u.OBJECT_FIELD:{let i=re(this.getInputType()),s,o;V(i)&&(o=i.getFields()[t.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(oe(s)?s:void 0);break}case u.ENUM:{let i=re(this.getInputType()),s;X(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}}}leave(t){switch(t.kind){case u.SELECTION_SET:this._parentTypeStack.pop();break;case u.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case u.DIRECTIVE:this._directive=null;break;case u.OPERATION_DEFINITION:case u.INLINE_FRAGMENT:case u.FRAGMENT_DEFINITION:this._typeStack.pop();break;case u.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case u.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case u.LIST:case u.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case u.ENUM:this._enumValue=null;break;}}};function Os(e,t,n){let r=n.name.value;if(r===$t.name&&e.getQueryType()===t)return $t;if(r===Ut.name&&e.getQueryType()===t)return Ut;if(r===Vt.name&&ye(t))return Vt;if(C(t)||$(t))return t.getFields()[r]}function Gt(e,t){return {enter(...n){let r=n[0];e.enter(r);let i=nt(t,r.kind).enter;if(i){let s=i.apply(t,n);return s!==void 0&&(e.leave(r),Tt(s)&&e.enter(s)),s}},leave(...n){let r=n[0],i=nt(t,r.kind).leave,s;return i&&(s=i.apply(t,n)),e.leave(r),s}}}g();g();g();function zn(e){return e.kind===u.OPERATION_DEFINITION||e.kind===u.FRAGMENT_DEFINITION}function Wn(e){return e.kind===u.SCHEMA_DEFINITION||$e(e)||e.kind===u.DIRECTIVE_DEFINITION}function $e(e){return e.kind===u.SCALAR_TYPE_DEFINITION||e.kind===u.OBJECT_TYPE_DEFINITION||e.kind===u.INTERFACE_TYPE_DEFINITION||e.kind===u.UNION_TYPE_DEFINITION||e.kind===u.ENUM_TYPE_DEFINITION||e.kind===u.INPUT_OBJECT_TYPE_DEFINITION}function Hn(e){return e.kind===u.SCHEMA_EXTENSION||e.kind===u.DIRECTIVE_EXTENSION||yn(e)}function yn(e){return e.kind===u.SCALAR_TYPE_EXTENSION||e.kind===u.OBJECT_TYPE_EXTENSION||e.kind===u.INTERFACE_TYPE_EXTENSION||e.kind===u.UNION_TYPE_EXTENSION||e.kind===u.ENUM_TYPE_EXTENSION||e.kind===u.INPUT_OBJECT_TYPE_EXTENSION}function Zn(e){return {Document(t){for(let n of t.definitions)if(!zn(n)){let r=n.kind===u.SCHEMA_DEFINITION||n.kind===u.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new m(`The ${r} definition is not executable.`,{nodes:n}));}return false}}}g();function er(e){return {Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),s=t.name.value,o=se("to use an inline fragment on",bs(i,n,s));o===""&&(o=se(_s(n,s))),e.reportError(new m(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:t}));}}}}function bs(e,t,n){if(!Te(t))return [];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(let a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1);}}return [...r].sort((o,a)=>{let p=i[a.name]-i[o.name];return p!==0?p:$(o)&&e.isSubType(o,a)?-1:$(a)&&e.isSubType(a,o)?1:et(o.name,a.name)}).map(o=>o.name)}function _s(e,t){if(C(e)||$(e)){let n=Object.keys(e.getFields());return pe(t,n)}return []}g();function tr(e){return {InlineFragment(t){let n=t.typeCondition;if(n){let r=H(e.getSchema(),n);if(r&&!ye(r)){let i=U(n);e.reportError(new m(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}));}}},FragmentDefinition(t){let n=H(e.getSchema(),t.typeCondition);if(n&&!ye(n)){let r=U(t.typeCondition);e.reportError(new m(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}));}}}}g();function nr(e){return {...rr(e),Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let s=t.name.value,o=r.args.map(p=>p.name),a=pe(s,o);e.reportError(new m(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+se(a),{nodes:t}));}}}}function rr(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Ee;for(let o of r)t[o.name]=o.args.map(a=>a.name);let i=e.getDocument().definitions;for(let o of i)if(o.kind===u.DIRECTIVE_DEFINITION){var s;let a=(s=o.arguments)!==null&&s!==void 0?s:[];t[o.name.value]=a.map(p=>p.name.value);}return {Directive(o){let a=o.name.value,p=t[a];if(o.arguments&&p)for(let c of o.arguments){let f=c.name.value;if(!p.includes(f)){let d=pe(f,p);e.reportError(new m(`Unknown argument "${f}" on directive "@${a}".`+se(d),{nodes:c}));}}return false}}}g();function Tn(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Ee;for(let s of r)t[s.name]=s.locations;let i=e.getDocument().definitions;for(let s of i)s.kind===u.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(o=>o.value));return {Directive(s,o,a,p,c){let f=s.name.value,d=t[f];if(!d){e.reportError(new m(`Unknown directive "@${f}".`,{nodes:s}));return}let h=Ss(c);h&&!d.includes(h)&&e.reportError(new m(`Directive "@${f}" may not be used on ${h}.`,{nodes:s}));}}}function Ss(e){let t=e[e.length-1];switch("kind"in t||W(),t.kind){case u.OPERATION_DEFINITION:return Ds(t.operation);case u.FIELD:return _.FIELD;case u.FRAGMENT_SPREAD:return _.FRAGMENT_SPREAD;case u.INLINE_FRAGMENT:return _.INLINE_FRAGMENT;case u.FRAGMENT_DEFINITION:return _.FRAGMENT_DEFINITION;case u.VARIABLE_DEFINITION:return _.VARIABLE_DEFINITION;case u.SCHEMA_DEFINITION:case u.SCHEMA_EXTENSION:return _.SCHEMA;case u.SCALAR_TYPE_DEFINITION:case u.SCALAR_TYPE_EXTENSION:return _.SCALAR;case u.OBJECT_TYPE_DEFINITION:case u.OBJECT_TYPE_EXTENSION:return _.OBJECT;case u.FIELD_DEFINITION:return _.FIELD_DEFINITION;case u.INTERFACE_TYPE_DEFINITION:case u.INTERFACE_TYPE_EXTENSION:return _.INTERFACE;case u.UNION_TYPE_DEFINITION:case u.UNION_TYPE_EXTENSION:return _.UNION;case u.ENUM_TYPE_DEFINITION:case u.ENUM_TYPE_EXTENSION:return _.ENUM;case u.ENUM_VALUE_DEFINITION:return _.ENUM_VALUE;case u.INPUT_OBJECT_TYPE_DEFINITION:case u.INPUT_OBJECT_TYPE_EXTENSION:return _.INPUT_OBJECT;case u.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return "kind"in n||W(),n.kind===u.INPUT_OBJECT_TYPE_DEFINITION?_.INPUT_FIELD_DEFINITION:_.ARGUMENT_DEFINITION}case u.DIRECTIVE_DEFINITION:case u.DIRECTIVE_EXTENSION:return _.DIRECTIVE_DEFINITION;default:W(false,"Unexpected kind: "+N(t.kind));}}function Ds(e){switch(e){case Z.QUERY:return _.QUERY;case Z.MUTATION:return _.MUTATION;case Z.SUBSCRIPTION:return _.SUBSCRIPTION}}g();function ir(e){return {FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new m(`Unknown fragment "${n}".`,{nodes:t.name}));}}}g();function En(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let s of e.getDocument().definitions)$e(s)&&(r[s.name.value]=true);let i=[...Object.keys(n),...Object.keys(r)];return {NamedType(s,o,a,p,c){let f=s.name.value;if(!n[f]&&!r[f]){var d;let h=(d=c[2])!==null&&d!==void 0?d:a,v=h!=null&&As(h);if(v&&Ti.includes(f))return;let g=pe(f,v?Ti.concat(i):i);e.reportError(new m(`Unknown type "${f}".`+se(g),{nodes:s}));}}}}var Ti=[...xt,...Mt].map(e=>e.name);function As(e){return "kind"in e&&(Wn(e)||Hn(e))}g();function sr(e){let t=0;return {Document(n){t=n.definitions.filter(r=>r.kind===u.OPERATION_DEFINITION).length;},OperationDefinition(n){!n.name&&t>1&&e.reportError(new m("This anonymous operation must be the only defined operation.",{nodes:n}));}}}g();g();var Ls=3;function ar(e){function t(n,r=Object.create(null),i=0){if(n.kind===u.FRAGMENT_SPREAD){let s=n.name.value;if(r[s]===true)return false;let o=e.getFragment(s);if(!o)return false;try{return r[s]=!0,t(o,r,i)}finally{r[s]=void 0;}}if(n.kind===u.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=Ls))return true;if("selectionSet"in n&&n.selectionSet){for(let s of n.selectionSet.selections)if(t(s,r,i))return true}return false}return {Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new m("Maximum introspection depth exceeded",{nodes:[n]})),false}}}g();function ur(e){let t=Object.create(null),n=[],r=Object.create(null);return {OperationDefinition:()=>false,FragmentDefinition(s){return i(s),false}};function i(s){if(t[s.name.value])return;let o=s.name.value;t[o]=true;let a=e.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(let p of a){let c=p.name.value,f=r[c];if(n.push(p),f===void 0){let d=e.getFragment(c);d&&i(d);}else {let d=n.slice(f),h=d.slice(0,-1).map(v=>'"'+v.name.value+'"').join(", ");e.reportError(new m(`Cannot spread fragment "${c}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:d}));}n.pop();}r[o]=void 0;}}}g();function pr(e){let t=Object.create(null);return {OperationDefinition:{enter(){t=Object.create(null);},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let s=i.name.value;t[s]!==true&&e.reportError(new m(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}));}}},VariableDefinition(n){t[n.variable.name.value]=true;}}}g();function cr(e){let t=[],n=[];return {OperationDefinition(r){return t.push(r),false},FragmentDefinition(r){return n.push(r),false},Document:{leave(){let r=Object.create(null);for(let i of t)for(let s of e.getRecursivelyReferencedFragments(i))r[s.name.value]=true;for(let i of n){let s=i.name.value;r[s]!==true&&e.reportError(new m(`Fragment "${s}" is never used.`,{nodes:i}));}}}}}g();function lr(e){let t=[];return {OperationDefinition:{enter(){t=[];},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:s}of i)r[s.name.value]=true;for(let s of t){let o=s.variable.name.value;r[o]!==true&&e.reportError(new m(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}));}}},VariableDefinition(n){t.push(n);}}}g();g();function Nn(e){switch(e.kind){case u.OBJECT:return {...e,fields:xs(e.fields)};case u.LIST:return {...e,values:e.values.map(Nn)};case u.INT:case u.FLOAT:case u.STRING:case u.BOOLEAN:case u.NULL:case u.ENUM:case u.VARIABLE:return e}}function xs(e){return e.map(t=>({...t,value:Nn(t.value)})).sort((t,n)=>et(t.name.value,n.name.value))}function Ni(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+Ni(n)).join(" and "):e}function hr(e){let t=new On,n=new mr,r=new Map;return {SelectionSet(i){let s=Rs(e,r,t,n,e.getParentType(),i);for(let[[o,a],p,c]of s){let f=Ni(a);e.reportError(new m(`Fields "${o}" conflict because ${f}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:p.concat(c)}));}}}}function Rs(e,t,n,r,i,s){let o=[],[a,p]=In(e,t,i,s);if(ks(e,o,t,n,r,a),p.length!==0)for(let c=0;c<p.length;c++){gn(e,o,t,n,r,false,a,p[c]);for(let f=c+1;f<p.length;f++)vn(e,o,t,n,r,false,p[c],p[f]);}return o}function gn(e,t,n,r,i,s,o,a){if(r.has(o,a,s))return;r.add(o,a,s);let p=e.getFragment(a);if(!p)return;let[c,f]=dr(e,n,p);if(o!==c){yr(e,t,n,r,i,s,o,c);for(let d of f)gn(e,t,n,r,i,s,o,d);}}function vn(e,t,n,r,i,s,o,a){if(o===a||i.has(o,a,s))return;i.add(o,a,s);let p=e.getFragment(o),c=e.getFragment(a);if(!p||!c)return;let[f,d]=dr(e,n,p),[h,v]=dr(e,n,c);yr(e,t,n,r,i,s,f,h);for(let g of v)vn(e,t,n,r,i,s,o,g);for(let g of d)vn(e,t,n,r,i,s,g,a);}function ws(e,t,n,r,i,s,o,a,p){let c=[],[f,d]=In(e,t,s,o),[h,v]=In(e,t,a,p);yr(e,c,t,n,r,i,f,h);for(let g of v)gn(e,c,t,n,r,i,f,g);for(let g of d)gn(e,c,t,n,r,i,h,g);for(let g of d)for(let A of v)vn(e,c,t,n,r,i,g,A);return c}function ks(e,t,n,r,i,s){for(let[o,a]of Object.entries(s))if(a.length>1)for(let p=0;p<a.length;p++)for(let c=p+1;c<a.length;c++){let f=gi(e,n,r,i,false,o,a[p],a[c]);f&&t.push(f);}}function yr(e,t,n,r,i,s,o,a){for(let[p,c]of Object.entries(o)){let f=a[p];if(f)for(let d of c)for(let h of f){let v=gi(e,n,r,i,s,p,d,h);v&&t.push(v);}}}function gi(e,t,n,r,i,s,o,a){let[p,c,f]=o,[d,h,v]=a,g=i||p!==d&&C(p)&&C(d);if(!g){let K=c.name.value,I=h.name.value;if(K!==I)return [[s,`"${K}" and "${I}" are different fields`],[c],[h]];if(!Fs(c,h))return [[s,"they have differing arguments"],[c],[h]]}let A=f?.type,w=v?.type;if(A&&w&&fr(A,w))return [[s,`they return conflicting types "${N(A)}" and "${N(w)}"`],[c],[h]];let L=c.selectionSet,P=h.selectionSet;if(L&&P){let K=ws(e,t,n,r,g,re(A),L,re(w),P);return Cs(K,s,c,h)}}function Fs(e,t){let n=e.arguments,r=t.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return false;let i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{let o=s.value,a=i.get(s.name.value);return a===void 0?false:Ei(o)===Ei(a)})}function Ei(e){return U(Nn(e))}function fr(e,t){return B(e)?B(t)?fr(e.ofType,t.ofType):true:B(t)?true:R(e)?R(t)?fr(e.ofType,t.ofType):true:R(t)?true:le(e)||le(t)?e!==t:false}function In(e,t,n,r){let i=t.get(r);if(i)return i;let s=Object.create(null),o=Object.create(null);vi(e,n,r,s,o);let a=[s,Object.keys(o)];return t.set(r,a),a}function dr(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=H(e.getSchema(),n.typeCondition);return In(e,t,i,n.selectionSet)}function vi(e,t,n,r,i){for(let s of n.selections)switch(s.kind){case u.FIELD:{let o=s.name.value,a;(C(t)||$(t))&&(a=t.getFields()[o]);let p=s.alias?s.alias.value:o;r[p]||(r[p]=[]),r[p].push([t,s,a]);break}case u.FRAGMENT_SPREAD:i[s.name.value]=true;break;case u.INLINE_FRAGMENT:{let o=s.typeCondition,a=o?H(e.getSchema(),o):t;vi(e,a,s.selectionSet,r,i);break}}}function Cs(e,t,n,r){if(e.length>0)return [[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}var On=class{constructor(){this._data=new Map;}has(t,n,r){var i;let s=(i=this._data.get(t))===null||i===void 0?void 0:i.get(n);return s===void 0?false:r?true:r===s}add(t,n,r){let i=this._data.get(t);i===void 0?this._data.set(t,new Map([[n,r]])):i.set(n,r);}},mr=class{constructor(){this._orderedPairSet=new On;}has(t,n,r){return t<n?this._orderedPairSet.has(t,n,r):this._orderedPairSet.has(n,t,r)}add(t,n,r){t<n?this._orderedPairSet.add(t,n,r):this._orderedPairSet.add(n,t,r);}};g();function Tr(e){return {InlineFragment(t){let n=e.getType(),r=e.getParentType();if(ye(n)&&ye(r)&&!sn(e.getSchema(),n,r)){let i=N(r),s=N(n);e.reportError(new m(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:t}));}},FragmentSpread(t){let n=t.name.value,r=$s(e,n),i=e.getParentType();if(r&&i&&!sn(e.getSchema(),r,i)){let s=N(i),o=N(r);e.reportError(new m(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:t}));}}}}function $s(e,t){let n=e.getFragment(t);if(n){let r=H(e.getSchema(),n.typeCondition);if(ye(r))return r}}g();({[u.SCALAR_TYPE_DEFINITION]:u.SCALAR_TYPE_EXTENSION,[u.OBJECT_TYPE_DEFINITION]:u.OBJECT_TYPE_EXTENSION,[u.INTERFACE_TYPE_DEFINITION]:u.INTERFACE_TYPE_EXTENSION,[u.UNION_TYPE_DEFINITION]:u.UNION_TYPE_EXTENSION,[u.ENUM_TYPE_DEFINITION]:u.ENUM_TYPE_EXTENSION,[u.INPUT_OBJECT_TYPE_DEFINITION]:u.INPUT_OBJECT_TYPE_EXTENSION});g();function Nr(e){return {...gr(e),Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return false;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(let s of r.args)if(!i.has(s.name)&&xe(s)){let o=N(s.type);e.reportError(new m(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}));}}}}}function gr(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r?.getDirectives())!==null&&t!==void 0?t:Ee;for(let a of i)n[a.name]=Ie(a.args.filter(xe),p=>p.name);let s=e.getDocument().definitions;for(let a of s)if(a.kind===u.DIRECTIVE_DEFINITION){var o;let p=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=Ie(p.filter(js),c=>c.name.value);}return {Directive:{leave(a){let p=a.name.value,c=n[p];if(c){var f;let d=(f=a.arguments)!==null&&f!==void 0?f:[],h=new Set(d.map(v=>v.name.value));for(let[v,g]of Object.entries(c))if(!h.has(v)){let A=st(g.type)?N(g.type):U(g.type);e.reportError(new m(`Directive "@${p}" argument "${v}" of type "${A}" is required, but it was not provided.`,{nodes:a}));}}}}}}function js(e){return e.type.kind===u.NON_NULL_TYPE&&e.defaultValue==null}g();function vr(e){return {Field(t){let n=e.getType(),r=t.selectionSet;if(n)if(le(re(n))){if(r){let i=t.name.value,s=N(n);e.reportError(new m(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}));}}else if(r){if(r.selections.length===0){let i=t.name.value,s=N(n);e.reportError(new m(`Field "${i}" of type "${s}" must have at least one field selected.`,{nodes:t}));}}else {let i=t.name.value,s=N(n);e.reportError(new m(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}));}}}}g();g();g();g();function Ii(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}g();g();function Ir(e,t,n){return {prev:e,key:t,typename:n}}function Se(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Oi(e,t,n=Gs){return Pt(e,t,n,void 0)}function Gs(e,t,n){let r="Invalid value "+N(t);throw e.length>0&&(r+=` at "value${Ii(e)}"`),n.message=r+": "+n.message,n}function Pt(e,t,n,r){if(R(t)){if(e!=null)return Pt(e,t.ofType,n,r);n(Se(r),e,new m(`Expected non-nullable type "${N(t)}" not to be null.`));return}if(e==null)return null;if(B(t)){let i=t.ofType;return un(e)?Array.from(e,(s,o)=>{let a=Ir(r,o,void 0);return Pt(s,i,n,a)}):[Pt(e,i,n,r)]}if(V(t)){if(!ae(e)||Array.isArray(e)){n(Se(r),e,new m(`Expected type "${t.name}" to be an object.`));return}let i=Object.create(null),s=t.getFields();for(let o of Object.values(s)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(R(o.type)){let p=N(o.type);n(Se(r),e,new m(`Field "${o.name}" of required type "${p}" was not provided.`));}continue}i[o.name]=Pt(a,o.type,n,Ir(r,o.name,t.name));}for(let o of Object.keys(e))if(!s[o]){let a=pe(o,Object.keys(t.getFields()));n(Se(r),e,new m(`Field "${o}" is not defined by type "${t.name}".`+se(a)));}if(t.isOneOf){let o=Object.keys(i);o.length!==1&&n(Se(r),e,new m(`Exactly one key must be specified for OneOf type "${t.name}".`));let a=o[0],p=i[a];p===null&&n(Se(r).concat(a),p,new m(`Field "${a}" must be non-null.`));}return {...i}}if(le(t)){let i;try{i=t.parseValue(e);}catch(s){s instanceof m?n(Se(r),e,s):n(Se(r),e,new m(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(Se(r),e,new m(`Expected type "${t.name}".`)),i}W(false,"Unexpected input type: "+N(t));}g();function Ue(e,t,n){if(e){if(e.kind===u.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0||!_i(n,r))return;let i=n[r];return i===null&&R(t)?void 0:i}if(R(t))return e.kind===u.NULL?void 0:Ue(e,t.ofType,n);if(e.kind===u.NULL)return null;if(B(t)){let r=t.ofType;if(e.kind===u.LIST){let s=[];for(let o of e.values)if(bi(o,n)){if(R(r))return;s.push(null);}else {let a=Ue(o,r,n);if(a===void 0)return;s.push(a);}return s}let i=Ue(e,r,n);return i===void 0?void 0:[i]}if(V(t)){if(e.kind!==u.OBJECT)return;let r=Object.create(null),i=Ie(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let o=i[s.name];if(!o||bi(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(R(s.type))return;continue}let a=Ue(o.value,s.type,n);if(a===void 0)return;r[s.name]=a;}if(t.isOneOf){let s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(le(t)){let r;try{r=t.parseLiteral(e,n);}catch{return}return r===void 0?void 0:r}W(false,"Unexpected input type: "+N(t));}}function bi(e,t){return e.kind===u.VARIABLE&&(t==null||t[e.name.value]===void 0||!_i(t,e.name.value))}function _i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Or(e,t,n){var r;let i=Object.create(null),s=(r=t.arguments)!==null&&r!==void 0?r:[],o=Ie(s,a=>a.name.value);for(let a of e.args){let p=a.name,c=a.type,f=o[p];if(!f){if(a.defaultValue!==void 0)i[p]=a.defaultValue;else if(R(c))throw new m(`Argument "${p}" of required type "${N(c)}" was not provided.`,{nodes:t});continue}let d=f.value,h=d.kind===u.NULL;if(d.kind===u.VARIABLE){let g=d.name.value;if(n==null||!Ps(n,g)){if(a.defaultValue!==void 0)i[p]=a.defaultValue;else if(R(c))throw new m(`Argument "${p}" of required type "${N(c)}" was provided the variable "$${g}" which was not provided a runtime value.`,{nodes:d});continue}h=n[g]==null;}if(h&&R(c))throw new m(`Argument "${p}" of non-null type "${N(c)}" must not be null.`,{nodes:d});let v=Ue(d,c,n);if(v===void 0)throw new m(`Argument "${p}" has invalid value ${U(d)}.`,{nodes:d});i[p]=v;}return {...i}}function Qt(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===e.name);if(i)return Or(e,i,n)}function Ps(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Di(e,t,n,r,i){let s=new Map;return _r(e,t,n,r,i,s,new Set),s}function _r(e,t,n,r,i,s,o){for(let a of i.selections)switch(a.kind){case u.FIELD:{if(!br(n,a))continue;let p=Qs(a),c=s.get(p);c!==void 0?c.push(a):s.set(p,[a]);break}case u.INLINE_FRAGMENT:{if(!br(n,a)||!Si(e,a,r))continue;_r(e,t,n,r,a.selectionSet,s,o);break}case u.FRAGMENT_SPREAD:{let p=a.name.value;if(o.has(p)||!br(n,a))continue;o.add(p);let c=t[p];if(!c||!Si(e,c,r))continue;_r(e,t,n,r,c.selectionSet,s,o);break}}}function br(e,t){let n=Qt(kt,t,e);if(n?.if===true)return false;let r=Qt(wt,t,e);return r?.if!==false}function Si(e,t,n){let r=t.typeCondition;if(!r)return true;let i=H(e,r);return i===n?true:Te(i)?e.isSubType(i,n):false}function Qs(e){return e.alias?e.alias.value:e.name.value}function Sr(e){return {OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,s=Object.create(null),o=e.getDocument(),a=Object.create(null);for(let c of o.definitions)c.kind===u.FRAGMENT_DEFINITION&&(a[c.name.value]=c);let p=Di(n,a,s,r,t.selectionSet);if(p.size>1){let d=[...p.values()].slice(1).flat();e.reportError(new m(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:d}));}for(let c of p.values())c[0].name.value.startsWith("__")&&e.reportError(new m(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}));}}}}}g();g();function ft(e,t){let n=new Map;for(let r of e){let i=t(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r);}return n}g();function bn(e){return {Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],s=ft(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new m(`There can be only one argument named "${o}".`,{nodes:a.map(p=>p.name)}));}}g();g();function _n(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Ee;for(let p of r)t[p.name]=!p.isRepeatable;let i=e.getDocument().definitions;for(let p of i)p.kind===u.DIRECTIVE_DEFINITION&&(t[p.name.value]=!p.repeatable);let s=Object.create(null),o=Object.create(null),a=Object.create(null);return {enter(p){if(!("directives"in p)||!p.directives)return;let c;if(p.kind===u.SCHEMA_DEFINITION||p.kind===u.SCHEMA_EXTENSION)c=s;else if($e(p)||yn(p)){let f=p.name.value;c=o[f],c===void 0&&(o[f]=c=Object.create(null));}else if(p.kind===u.DIRECTIVE_DEFINITION||p.kind===u.DIRECTIVE_EXTENSION){let f=p.name.value;c=a[f],c===void 0&&(a[f]=c=Object.create(null));}else c=Object.create(null);for(let f of p.directives){let d=f.name.value;t[d]&&(c[d]?e.reportError(new m(`The directive "@${d}" can only be used once at this location.`,{nodes:[c[d],f]})):c[d]=f);}}}}g();g();g();function Rr(e){let t=Object.create(null);return {OperationDefinition:()=>false,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new m(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,false}}}g();function Sn(e){let t=[],n=Object.create(null);return {ObjectValue:{enter(){t.push(n),n=Object.create(null);},leave(){let r=t.pop();r||W(),n=r;}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new m(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name;}}}g();function wr(e){let t=Object.create(null);return {OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new m(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),false},FragmentDefinition:()=>false}}g();g();g();function Cr(e){return {OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=ft(r,s=>s.variable.name.value);for(let[s,o]of i)o.length>1&&e.reportError(new m(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}));}}}g();function $r(e){return {ListValue(t){let n=ot(e.getParentInputType());if(!B(n))return qe(e,t),false},ObjectValue(t){let n=re(e.getInputType());if(!V(n))return qe(e,t),false;let r=Ie(t.fields,i=>i.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&at(i)){let o=N(i.type);e.reportError(new m(`Field "${n.name}.${i.name}" of required type "${o}" was not provided.`,{nodes:t}));}n.isOneOf&&qs(e,t,n,r);},ObjectField(t){let n=re(e.getParentInputType());if(!e.getInputType()&&V(n)){let i=pe(t.name.value,Object.keys(n.getFields()));e.reportError(new m(`Field "${t.name.value}" is not defined by type "${n.name}".`+se(i),{nodes:t}));}},NullValue(t){let n=e.getInputType();R(n)&&e.reportError(new m(`Expected value of type "${N(n)}", found ${U(t)}.`,{nodes:t}));},EnumValue:t=>qe(e,t),IntValue:t=>qe(e,t),FloatValue:t=>qe(e,t),StringValue:t=>qe(e,t),BooleanValue:t=>qe(e,t)}}function qe(e,t){let n=e.getInputType();if(!n)return;let r=re(n);if(!le(r)){let i=N(n);e.reportError(new m(`Expected value of type "${i}", found ${U(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let s=N(n);e.reportError(new m(`Expected value of type "${s}", found ${U(t)}.`,{nodes:t}));}}catch(i){let s=N(n);i instanceof m?e.reportError(i):e.reportError(new m(`Expected value of type "${s}", found ${U(t)}; `+i.message,{nodes:t,originalError:i}));}}function qs(e,t,n,r){var i;let s=Object.keys(r);if(s.length!==1){e.reportError(new m(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let a=(i=r[s[0]])===null||i===void 0?void 0:i.value;(!a||a.kind===u.NULL)&&e.reportError(new m(`Field "${n.name}.${s[0]}" must be non-null.`,{nodes:[t]}));}g();function Ur(e){return {VariableDefinition(t){let n=H(e.getSchema(),t.type);if(n!==void 0&&!oe(n)){let r=t.variable.name.value,i=U(t.type);e.reportError(new m(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}));}}}}g();function Vr(e){let t=Object.create(null);return {OperationDefinition:{enter(){t=Object.create(null);},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:s,defaultValue:o,parentType:a}of r){let p=i.name.value,c=t[p];if(c&&s){let f=e.getSchema(),d=H(f,c.type);if(d&&!Ys(f,d,c.defaultValue,s,o)){let h=N(d),v=N(s);e.reportError(new m(`Variable "$${p}" of type "${h}" used in position expecting type "${v}".`,{nodes:[c,i]}));}V(a)&&a.isOneOf&&bt(d)&&e.reportError(new m(`Variable "$${p}" is of type "${d}" but must be non-nullable to be used for OneOf Input Object "${a}".`,{nodes:[c,i]}));}}}},VariableDefinition(n){t[n.variable.name.value]=n;}}}function Ys(e,t,n,r,i){if(R(r)&&!R(t)){if(!(n!=null&&n.kind!==u.NULL)&&!(i!==void 0))return false;let a=r.ofType;return Re(e,t,a)}return Re(e,t,r)}var Mr=Object.freeze([ar]),Dn=Object.freeze([Zn,wr,sr,Sr,En,tr,Ur,vr,er,Rr,ir,cr,Tr,ur,Cr,pr,lr,Tn,_n,nr,bn,$r,Nr,Vr,hr,Sn,...Mr]);g();var jr=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n;}get[Symbol.toStringTag](){return "ASTValidationContext"}reportError(t){this._onError(t);}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else {n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===u.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n;}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let s of i.selections)s.kind===u.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(t,n);}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],s;for(;s=i.pop();)for(let o of this.getFragmentSpreads(s)){let a=o.name.value;if(r[a]!==true){r[a]=true;let p=this.getFragment(a);p&&(n.push(p),i.push(p.selectionSet));}}this._recursivelyReferencedFragments.set(t,n);}return n}};var Bt=class extends jr{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map;}get[Symbol.toStringTag](){return "ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new Be(this._schema);Ge(t,Gt(i,{VariableDefinition:()=>false,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue(),parentType:i.getParentInputType()});}})),n=r,this._variableUsages.set(t,n);}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n);}return n}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()}};var Js=je(yt,e=>e.filter(t=>t!=="description"));function Ai(e,t,n=Dn,r,i=new Be(e)){var s;let o=(s=r?.maxErrors)!==null&&s!==void 0?s:100;t||F(false,"Must provide document."),hn(e);let a=Object.freeze({}),p=[],c=new Bt(e,t,i,d=>{if(p.length>=o)throw p.push(new m("Too many validation errors, error limit reached. Validation aborted.")),a;p.push(d);}),f=Vn(n.map(d=>d(c)));try{Ge(t,Gt(i,f),Js);}catch(d){if(d!==a)throw d}return p}g();g();function Li(e){return e instanceof Error?e:new Gr(e)}var Gr=class extends Error{constructor(t){super("Unexpected error value: "+N(t)),this.name="NonErrorThrown",this.thrownValue=t;}};function xi(e,t,n){var r;let i=Li(e);return Xs(i)?i:new m(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function Xs(e){return Array.isArray(e.path)}g();g();g();g();g();g();g();function Ri(e,t){let n=null;for(let i of e.definitions)if(i.kind===u.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i;}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}g();function Qr(e){return Oo(e,t=>!an(t),Io)}function Io(e){return !on(e)&&!lt(e)}function Oo(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return [bo(e),...r.map(s=>wo(s)),...i.map(s=>Br(s))].filter(Boolean).join(`
|
|
60
|
+
`))}var Jn=class{constructor(t){this._errors=[],this.schema=t;}reportError(t,n){let r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new m(t,{nodes:r}));}getErrors(){return this._errors}};function ds(e){let t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!C(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${N(n)}.`,(r=Kn(t,Z.QUERY))!==null&&r!==void 0?r:n.astNode);}let i=t.getMutationType();if(i&&!C(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${N(i)}.`,(s=Kn(t,Z.MUTATION))!==null&&s!==void 0?s:i.astNode);}let o=t.getSubscriptionType();if(o&&!C(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${N(o)}.`,(a=Kn(t,Z.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode);}}function Kn(e,t){var n;return (n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return (i=r?.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function ms(e){for(let n of e.schema.getDirectives()){if(!ut(n)){e.reportError(`Expected directive but got: ${N(n)}.`,n?.astNode);continue}Qe(e,n),n.locations.length===0&&e.reportError(`Directive @${n.name} must include 1 or more locations.`,n.astNode);for(let r of n.args)if(Qe(e,r),oe(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${N(r.type)}.`,r.astNode),xe(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[zn(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type]);}}}function Qe(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode);}function hs(e){let t=Is(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!tn(r)){e.reportError(`Expected GraphQL named type but got: ${N(r)}.`,r.astNode);continue}lt(r)||Qe(e,r),C(r)||$(r)?(mi(e,r),hi(e,r)):ne(r)?Es(e,r):X(r)?Ns(e,r):V(r)&&(gs(e,r),t(r));}}function mi(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of n){if(Qe(e,o),!Le(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${N(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type);}for(let a of o.args){let u=a.name;if(Qe(e,a),!oe(a.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${u}:) must be Input Type but got: ${N(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type);}if(xe(a)&&a.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${o.name}(${u}:) cannot be deprecated.`,[zn(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type]);}}}}function hi(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!$(r)){e.reportError(`Type ${N(t)} must only implement Interface types, it cannot implement ${N(r)}.`,jt(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,jt(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,jt(t,r));continue}n[r.name]=true,Ts(e,t,r),ys(e,t,r);}}function ys(e,t,n){let r=t.getFields();for(let u of Object.values(n.getFields())){let c=u.name,f=r[c];if(!f){e.reportError(`Interface field ${n.name}.${c} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!Re(e.schema,f.type,u.type)){var i,s;e.reportError(`Interface field ${n.name}.${c} expects type ${N(u.type)} but ${t.name}.${c} is type ${N(f.type)}.`,[(i=u.astNode)===null||i===void 0?void 0:i.type,(s=f.astNode)===null||s===void 0?void 0:s.type]);}for(let d of u.args){let h=d.name,v=f.args.find(g=>g.name===h);if(!v){e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expected but ${t.name}.${c} does not provide it.`,[d.astNode,f.astNode]);continue}if(!_t(d.type,v.type)){var o,a;e.reportError(`Interface field argument ${n.name}.${c}(${h}:) expects type ${N(d.type)} but ${t.name}.${c}(${h}:) is type ${N(v.type)}.`,[(o=d.astNode)===null||o===void 0?void 0:o.type,(a=v.astNode)===null||a===void 0?void 0:a.type]);}}for(let d of f.args){let h=d.name;!u.args.find(g=>g.name===h)&&xe(d)&&e.reportError(`Object field ${t.name}.${c} includes required argument ${h} that is missing from the Interface field ${n.name}.${c}.`,[d.astNode,u.astNode]);}}}function Ts(e,t,n){let r=t.getInterfaces();for(let 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}.`,[...jt(n,i),...jt(t,n)]);}function Es(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,yi(t,i.name));continue}r[i.name]=true,C(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${N(i)}.`,yi(t,String(i)));}}function Ns(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)Qe(e,r);}function gs(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of n){if(Qe(e,s),!oe(s.type)){var r;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${N(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type);}if(at(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[zn(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type]);}t.isOneOf&&vs(t,s,e);}}function vs(e,t,n){if(R(t.type)){var r;n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,(r=t.astNode)===null||r===void 0?void 0:r.type);}t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode);}function Is(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=true,r[s.name]=n.length;let o=Object.values(s.getFields());for(let a of o)if(R(a.type)&&V(a.type.ofType)){let u=a.type.ofType,c=r[u.name];if(n.push(a),c===void 0)i(u);else {let f=n.slice(c),d=f.map(h=>h.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${d}".`,f.map(h=>h.astNode));}n.pop();}r[s.name]=void 0;}}function jt(e,t){let{astNode:n,extensionASTNodes:r}=e;return (n!=null?[n,...r]:r).flatMap(s=>{var o;return (o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t.name)}function yi(e,t){let{astNode:n,extensionASTNodes:r}=e;return (n!=null?[n,...r]:r).flatMap(s=>{var o;return (o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t)}function zn(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===Ct.name)}g();g();g();function H(e,t){switch(t.kind){case p.LIST_TYPE:{let n=H(e,t.type);return n&&new M(n)}case p.NON_NULL_TYPE:{let n=H(e,t.type);return n&&new D(n)}case p.NAMED_TYPE:return e.getType(t.name.value)}}var Be=class{constructor(t,n,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r??Os,n&&(oe(n)&&this._inputTypeStack.push(n),ye(n)&&this._parentTypeStack.push(n),Le(n)&&this._typeStack.push(n));}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(t){let n=this._schema;switch(t.kind){case p.SELECTION_SET:{let i=re(this.getType());this._parentTypeStack.push(ye(i)?i:void 0);break}case p.FIELD:{let i=this.getParentType(),s,o;i&&(s=this._getFieldDef(n,i,t),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push(Le(o)?o:void 0);break}case p.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case p.OPERATION_DEFINITION:{let i=n.getRootType(t.operation);this._typeStack.push(C(i)?i:void 0);break}case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:{let i=t.typeCondition,s=i?H(n,i):re(this.getType());this._typeStack.push(Le(s)?s:void 0);break}case p.VARIABLE_DEFINITION:{let i=H(n,t.type);this._inputTypeStack.push(oe(i)?i:void 0);break}case p.ARGUMENT:{var r;let i,s,o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(oe(s)?s:void 0);break}case p.LIST:{let i=ot(this.getInputType()),s=B(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(oe(s)?s:void 0);break}case p.OBJECT_FIELD:{let i=re(this.getInputType()),s,o;V(i)&&(o=i.getFields()[t.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(oe(s)?s:void 0);break}case p.ENUM:{let i=re(this.getInputType()),s;X(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}}}leave(t){switch(t.kind){case p.SELECTION_SET:this._parentTypeStack.pop();break;case p.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case p.DIRECTIVE:this._directive=null;break;case p.OPERATION_DEFINITION:case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:this._typeStack.pop();break;case p.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case p.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.LIST:case p.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.ENUM:this._enumValue=null;break;}}};function Os(e,t,n){let r=n.name.value;if(r===$t.name&&e.getQueryType()===t)return $t;if(r===Ut.name&&e.getQueryType()===t)return Ut;if(r===Vt.name&&ye(t))return Vt;if(C(t)||$(t))return t.getFields()[r]}function Gt(e,t){return {enter(...n){let r=n[0];e.enter(r);let i=nt(t,r.kind).enter;if(i){let s=i.apply(t,n);return s!==void 0&&(e.leave(r),Tt(s)&&e.enter(s)),s}},leave(...n){let r=n[0],i=nt(t,r.kind).leave,s;return i&&(s=i.apply(t,n)),e.leave(r),s}}}g();g();g();function Wn(e){return e.kind===p.OPERATION_DEFINITION||e.kind===p.FRAGMENT_DEFINITION}function Hn(e){return e.kind===p.SCHEMA_DEFINITION||$e(e)||e.kind===p.DIRECTIVE_DEFINITION}function $e(e){return e.kind===p.SCALAR_TYPE_DEFINITION||e.kind===p.OBJECT_TYPE_DEFINITION||e.kind===p.INTERFACE_TYPE_DEFINITION||e.kind===p.UNION_TYPE_DEFINITION||e.kind===p.ENUM_TYPE_DEFINITION||e.kind===p.INPUT_OBJECT_TYPE_DEFINITION}function Zn(e){return e.kind===p.SCHEMA_EXTENSION||e.kind===p.DIRECTIVE_EXTENSION||yn(e)}function yn(e){return e.kind===p.SCALAR_TYPE_EXTENSION||e.kind===p.OBJECT_TYPE_EXTENSION||e.kind===p.INTERFACE_TYPE_EXTENSION||e.kind===p.UNION_TYPE_EXTENSION||e.kind===p.ENUM_TYPE_EXTENSION||e.kind===p.INPUT_OBJECT_TYPE_EXTENSION}function er(e){return {Document(t){for(let n of t.definitions)if(!Wn(n)){let r=n.kind===p.SCHEMA_DEFINITION||n.kind===p.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new m(`The ${r} definition is not executable.`,{nodes:n}));}return false}}}g();function tr(e){return {Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),s=t.name.value,o=se("to use an inline fragment on",bs(i,n,s));o===""&&(o=se(_s(n,s))),e.reportError(new m(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:t}));}}}}function bs(e,t,n){if(!Te(t))return [];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(let a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1);}}return [...r].sort((o,a)=>{let u=i[a.name]-i[o.name];return u!==0?u:$(o)&&e.isSubType(o,a)?-1:$(a)&&e.isSubType(a,o)?1:et(o.name,a.name)}).map(o=>o.name)}function _s(e,t){if(C(e)||$(e)){let n=Object.keys(e.getFields());return pe(t,n)}return []}g();function nr(e){return {InlineFragment(t){let n=t.typeCondition;if(n){let r=H(e.getSchema(),n);if(r&&!ye(r)){let i=U(n);e.reportError(new m(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}));}}},FragmentDefinition(t){let n=H(e.getSchema(),t.typeCondition);if(n&&!ye(n)){let r=U(t.typeCondition);e.reportError(new m(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}));}}}}g();function rr(e){return {...ir(e),Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let s=t.name.value,o=r.args.map(u=>u.name),a=pe(s,o);e.reportError(new m(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+se(a),{nodes:t}));}}}}function ir(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Ee;for(let o of r)t[o.name]=o.args.map(a=>a.name);let i=e.getDocument().definitions;for(let o of i)if(o.kind===p.DIRECTIVE_DEFINITION){var s;let a=(s=o.arguments)!==null&&s!==void 0?s:[];t[o.name.value]=a.map(u=>u.name.value);}return {Directive(o){let a=o.name.value,u=t[a];if(o.arguments&&u)for(let c of o.arguments){let f=c.name.value;if(!u.includes(f)){let d=pe(f,u);e.reportError(new m(`Unknown argument "${f}" on directive "@${a}".`+se(d),{nodes:c}));}}return false}}}g();function Tn(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Ee;for(let s of r)t[s.name]=s.locations;let i=e.getDocument().definitions;for(let s of i)s.kind===p.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(o=>o.value));return {Directive(s,o,a,u,c){let f=s.name.value,d=t[f];if(!d){e.reportError(new m(`Unknown directive "@${f}".`,{nodes:s}));return}let h=Ss(c);h&&!d.includes(h)&&e.reportError(new m(`Directive "@${f}" may not be used on ${h}.`,{nodes:s}));}}}function Ss(e){let t=e[e.length-1];switch("kind"in t||W(),t.kind){case p.OPERATION_DEFINITION:return Ds(t.operation);case p.FIELD:return _.FIELD;case p.FRAGMENT_SPREAD:return _.FRAGMENT_SPREAD;case p.INLINE_FRAGMENT:return _.INLINE_FRAGMENT;case p.FRAGMENT_DEFINITION:return _.FRAGMENT_DEFINITION;case p.VARIABLE_DEFINITION:return _.VARIABLE_DEFINITION;case p.SCHEMA_DEFINITION:case p.SCHEMA_EXTENSION:return _.SCHEMA;case p.SCALAR_TYPE_DEFINITION:case p.SCALAR_TYPE_EXTENSION:return _.SCALAR;case p.OBJECT_TYPE_DEFINITION:case p.OBJECT_TYPE_EXTENSION:return _.OBJECT;case p.FIELD_DEFINITION:return _.FIELD_DEFINITION;case p.INTERFACE_TYPE_DEFINITION:case p.INTERFACE_TYPE_EXTENSION:return _.INTERFACE;case p.UNION_TYPE_DEFINITION:case p.UNION_TYPE_EXTENSION:return _.UNION;case p.ENUM_TYPE_DEFINITION:case p.ENUM_TYPE_EXTENSION:return _.ENUM;case p.ENUM_VALUE_DEFINITION:return _.ENUM_VALUE;case p.INPUT_OBJECT_TYPE_DEFINITION:case p.INPUT_OBJECT_TYPE_EXTENSION:return _.INPUT_OBJECT;case p.INPUT_VALUE_DEFINITION:{let n=e[e.length-3];return "kind"in n||W(),n.kind===p.INPUT_OBJECT_TYPE_DEFINITION?_.INPUT_FIELD_DEFINITION:_.ARGUMENT_DEFINITION}case p.DIRECTIVE_DEFINITION:case p.DIRECTIVE_EXTENSION:return _.DIRECTIVE_DEFINITION;default:W(false,"Unexpected kind: "+N(t.kind));}}function Ds(e){switch(e){case Z.QUERY:return _.QUERY;case Z.MUTATION:return _.MUTATION;case Z.SUBSCRIPTION:return _.SUBSCRIPTION}}g();function sr(e){return {FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new m(`Unknown fragment "${n}".`,{nodes:t.name}));}}}g();function En(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let s of e.getDocument().definitions)$e(s)&&(r[s.name.value]=true);let i=[...Object.keys(n),...Object.keys(r)];return {NamedType(s,o,a,u,c){let f=s.name.value;if(!n[f]&&!r[f]){var d;let h=(d=c[2])!==null&&d!==void 0?d:a,v=h!=null&&As(h);if(v&&Ti.includes(f))return;let g=pe(f,v?Ti.concat(i):i);e.reportError(new m(`Unknown type "${f}".`+se(g),{nodes:s}));}}}}var Ti=[...xt,...Mt].map(e=>e.name);function As(e){return "kind"in e&&(Hn(e)||Zn(e))}g();function or(e){let t=0;return {Document(n){t=n.definitions.filter(r=>r.kind===p.OPERATION_DEFINITION).length;},OperationDefinition(n){!n.name&&t>1&&e.reportError(new m("This anonymous operation must be the only defined operation.",{nodes:n}));}}}g();g();var Ls=3;function ur(e){function t(n,r=Object.create(null),i=0){if(n.kind===p.FRAGMENT_SPREAD){let s=n.name.value;if(r[s]===true)return false;let o=e.getFragment(s);if(!o)return false;try{return r[s]=!0,t(o,r,i)}finally{r[s]=void 0;}}if(n.kind===p.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=Ls))return true;if("selectionSet"in n&&n.selectionSet){for(let s of n.selectionSet.selections)if(t(s,r,i))return true}return false}return {Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new m("Maximum introspection depth exceeded",{nodes:[n]})),false}}}g();function pr(e){let t=Object.create(null),n=[],r=Object.create(null);return {OperationDefinition:()=>false,FragmentDefinition(s){return i(s),false}};function i(s){if(t[s.name.value])return;let o=s.name.value;t[o]=true;let a=e.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(let u of a){let c=u.name.value,f=r[c];if(n.push(u),f===void 0){let d=e.getFragment(c);d&&i(d);}else {let d=n.slice(f),h=d.slice(0,-1).map(v=>'"'+v.name.value+'"').join(", ");e.reportError(new m(`Cannot spread fragment "${c}" within itself`+(h!==""?` via ${h}.`:"."),{nodes:d}));}n.pop();}r[o]=void 0;}}}g();function cr(e){let t=Object.create(null);return {OperationDefinition:{enter(){t=Object.create(null);},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let s=i.name.value;t[s]!==true&&e.reportError(new m(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}));}}},VariableDefinition(n){t[n.variable.name.value]=true;}}}g();function lr(e){let t=[],n=[];return {OperationDefinition(r){return t.push(r),false},FragmentDefinition(r){return n.push(r),false},Document:{leave(){let r=Object.create(null);for(let i of t)for(let s of e.getRecursivelyReferencedFragments(i))r[s.name.value]=true;for(let i of n){let s=i.name.value;r[s]!==true&&e.reportError(new m(`Fragment "${s}" is never used.`,{nodes:i}));}}}}}g();function fr(e){let t=[];return {OperationDefinition:{enter(){t=[];},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:s}of i)r[s.name.value]=true;for(let s of t){let o=s.variable.name.value;r[o]!==true&&e.reportError(new m(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}));}}},VariableDefinition(n){t.push(n);}}}g();g();function Nn(e){switch(e.kind){case p.OBJECT:return {...e,fields:xs(e.fields)};case p.LIST:return {...e,values:e.values.map(Nn)};case p.INT:case p.FLOAT:case p.STRING:case p.BOOLEAN:case p.NULL:case p.ENUM:case p.VARIABLE:return e}}function xs(e){return e.map(t=>({...t,value:Nn(t.value)})).sort((t,n)=>et(t.name.value,n.name.value))}function Ni(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+Ni(n)).join(" and "):e}function yr(e){let t=new On,n=new hr,r=new Map;return {SelectionSet(i){let s=Rs(e,r,t,n,e.getParentType(),i);for(let[[o,a],u,c]of s){let f=Ni(a);e.reportError(new m(`Fields "${o}" conflict because ${f}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:u.concat(c)}));}}}}function Rs(e,t,n,r,i,s){let o=[],[a,u]=In(e,t,i,s);if(ks(e,o,t,n,r,a),u.length!==0)for(let c=0;c<u.length;c++){gn(e,o,t,n,r,false,a,u[c]);for(let f=c+1;f<u.length;f++)vn(e,o,t,n,r,false,u[c],u[f]);}return o}function gn(e,t,n,r,i,s,o,a){if(r.has(o,a,s))return;r.add(o,a,s);let u=e.getFragment(a);if(!u)return;let[c,f]=mr(e,n,u);if(o!==c){Tr(e,t,n,r,i,s,o,c);for(let d of f)gn(e,t,n,r,i,s,o,d);}}function vn(e,t,n,r,i,s,o,a){if(o===a||i.has(o,a,s))return;i.add(o,a,s);let u=e.getFragment(o),c=e.getFragment(a);if(!u||!c)return;let[f,d]=mr(e,n,u),[h,v]=mr(e,n,c);Tr(e,t,n,r,i,s,f,h);for(let g of v)vn(e,t,n,r,i,s,o,g);for(let g of d)vn(e,t,n,r,i,s,g,a);}function ws(e,t,n,r,i,s,o,a,u){let c=[],[f,d]=In(e,t,s,o),[h,v]=In(e,t,a,u);Tr(e,c,t,n,r,i,f,h);for(let g of v)gn(e,c,t,n,r,i,f,g);for(let g of d)gn(e,c,t,n,r,i,h,g);for(let g of d)for(let A of v)vn(e,c,t,n,r,i,g,A);return c}function ks(e,t,n,r,i,s){for(let[o,a]of Object.entries(s))if(a.length>1)for(let u=0;u<a.length;u++)for(let c=u+1;c<a.length;c++){let f=gi(e,n,r,i,false,o,a[u],a[c]);f&&t.push(f);}}function Tr(e,t,n,r,i,s,o,a){for(let[u,c]of Object.entries(o)){let f=a[u];if(f)for(let d of c)for(let h of f){let v=gi(e,n,r,i,s,u,d,h);v&&t.push(v);}}}function gi(e,t,n,r,i,s,o,a){let[u,c,f]=o,[d,h,v]=a,g=i||u!==d&&C(u)&&C(d);if(!g){let K=c.name.value,I=h.name.value;if(K!==I)return [[s,`"${K}" and "${I}" are different fields`],[c],[h]];if(!Fs(c,h))return [[s,"they have differing arguments"],[c],[h]]}let A=f?.type,w=v?.type;if(A&&w&&dr(A,w))return [[s,`they return conflicting types "${N(A)}" and "${N(w)}"`],[c],[h]];let L=c.selectionSet,P=h.selectionSet;if(L&&P){let K=ws(e,t,n,r,g,re(A),L,re(w),P);return Cs(K,s,c,h)}}function Fs(e,t){let n=e.arguments,r=t.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return false;let i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{let o=s.value,a=i.get(s.name.value);return a===void 0?false:Ei(o)===Ei(a)})}function Ei(e){return U(Nn(e))}function dr(e,t){return B(e)?B(t)?dr(e.ofType,t.ofType):true:B(t)?true:R(e)?R(t)?dr(e.ofType,t.ofType):true:R(t)?true:le(e)||le(t)?e!==t:false}function In(e,t,n,r){let i=t.get(r);if(i)return i;let s=Object.create(null),o=Object.create(null);vi(e,n,r,s,o);let a=[s,Object.keys(o)];return t.set(r,a),a}function mr(e,t,n){let r=t.get(n.selectionSet);if(r)return r;let i=H(e.getSchema(),n.typeCondition);return In(e,t,i,n.selectionSet)}function vi(e,t,n,r,i){for(let s of n.selections)switch(s.kind){case p.FIELD:{let o=s.name.value,a;(C(t)||$(t))&&(a=t.getFields()[o]);let u=s.alias?s.alias.value:o;r[u]||(r[u]=[]),r[u].push([t,s,a]);break}case p.FRAGMENT_SPREAD:i[s.name.value]=true;break;case p.INLINE_FRAGMENT:{let o=s.typeCondition,a=o?H(e.getSchema(),o):t;vi(e,a,s.selectionSet,r,i);break}}}function Cs(e,t,n,r){if(e.length>0)return [[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}var On=class{constructor(){this._data=new Map;}has(t,n,r){var i;let s=(i=this._data.get(t))===null||i===void 0?void 0:i.get(n);return s===void 0?false:r?true:r===s}add(t,n,r){let i=this._data.get(t);i===void 0?this._data.set(t,new Map([[n,r]])):i.set(n,r);}},hr=class{constructor(){this._orderedPairSet=new On;}has(t,n,r){return t<n?this._orderedPairSet.has(t,n,r):this._orderedPairSet.has(n,t,r)}add(t,n,r){t<n?this._orderedPairSet.add(t,n,r):this._orderedPairSet.add(n,t,r);}};g();function Er(e){return {InlineFragment(t){let n=e.getType(),r=e.getParentType();if(ye(n)&&ye(r)&&!sn(e.getSchema(),n,r)){let i=N(r),s=N(n);e.reportError(new m(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:t}));}},FragmentSpread(t){let n=t.name.value,r=$s(e,n),i=e.getParentType();if(r&&i&&!sn(e.getSchema(),r,i)){let s=N(i),o=N(r);e.reportError(new m(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:t}));}}}}function $s(e,t){let n=e.getFragment(t);if(n){let r=H(e.getSchema(),n.typeCondition);if(ye(r))return r}}g();({[p.SCALAR_TYPE_DEFINITION]:p.SCALAR_TYPE_EXTENSION,[p.OBJECT_TYPE_DEFINITION]:p.OBJECT_TYPE_EXTENSION,[p.INTERFACE_TYPE_DEFINITION]:p.INTERFACE_TYPE_EXTENSION,[p.UNION_TYPE_DEFINITION]:p.UNION_TYPE_EXTENSION,[p.ENUM_TYPE_DEFINITION]:p.ENUM_TYPE_EXTENSION,[p.INPUT_OBJECT_TYPE_DEFINITION]:p.INPUT_OBJECT_TYPE_EXTENSION});g();function gr(e){return {...vr(e),Field:{leave(t){var n;let r=e.getFieldDef();if(!r)return false;let i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(let s of r.args)if(!i.has(s.name)&&xe(s)){let o=N(s.type);e.reportError(new m(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}));}}}}}function vr(e){var t;let n=Object.create(null),r=e.getSchema(),i=(t=r?.getDirectives())!==null&&t!==void 0?t:Ee;for(let a of i)n[a.name]=Ie(a.args.filter(xe),u=>u.name);let s=e.getDocument().definitions;for(let a of s)if(a.kind===p.DIRECTIVE_DEFINITION){var o;let u=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=Ie(u.filter(js),c=>c.name.value);}return {Directive:{leave(a){let u=a.name.value,c=n[u];if(c){var f;let d=(f=a.arguments)!==null&&f!==void 0?f:[],h=new Set(d.map(v=>v.name.value));for(let[v,g]of Object.entries(c))if(!h.has(v)){let A=st(g.type)?N(g.type):U(g.type);e.reportError(new m(`Directive "@${u}" argument "${v}" of type "${A}" is required, but it was not provided.`,{nodes:a}));}}}}}}function js(e){return e.type.kind===p.NON_NULL_TYPE&&e.defaultValue==null}g();function Ir(e){return {Field(t){let n=e.getType(),r=t.selectionSet;if(n)if(le(re(n))){if(r){let i=t.name.value,s=N(n);e.reportError(new m(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}));}}else if(r){if(r.selections.length===0){let i=t.name.value,s=N(n);e.reportError(new m(`Field "${i}" of type "${s}" must have at least one field selected.`,{nodes:t}));}}else {let i=t.name.value,s=N(n);e.reportError(new m(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}));}}}}g();g();g();g();function Ii(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}g();g();function Or(e,t,n){return {prev:e,key:t,typename:n}}function Se(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Oi(e,t,n=Gs){return Pt(e,t,n,void 0)}function Gs(e,t,n){let r="Invalid value "+N(t);throw e.length>0&&(r+=` at "value${Ii(e)}"`),n.message=r+": "+n.message,n}function Pt(e,t,n,r){if(R(t)){if(e!=null)return Pt(e,t.ofType,n,r);n(Se(r),e,new m(`Expected non-nullable type "${N(t)}" not to be null.`));return}if(e==null)return null;if(B(t)){let i=t.ofType;return un(e)?Array.from(e,(s,o)=>{let a=Or(r,o,void 0);return Pt(s,i,n,a)}):[Pt(e,i,n,r)]}if(V(t)){if(!ae(e)||Array.isArray(e)){n(Se(r),e,new m(`Expected type "${t.name}" to be an object.`));return}let i=Object.create(null),s=t.getFields();for(let o of Object.values(s)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(R(o.type)){let u=N(o.type);n(Se(r),e,new m(`Field "${o.name}" of required type "${u}" was not provided.`));}continue}i[o.name]=Pt(a,o.type,n,Or(r,o.name,t.name));}for(let o of Object.keys(e))if(!s[o]){let a=pe(o,Object.keys(t.getFields()));n(Se(r),e,new m(`Field "${o}" is not defined by type "${t.name}".`+se(a)));}if(t.isOneOf){let o=Object.keys(i);o.length!==1&&n(Se(r),e,new m(`Exactly one key must be specified for OneOf type "${t.name}".`));let a=o[0],u=i[a];u===null&&n(Se(r).concat(a),u,new m(`Field "${a}" must be non-null.`));}return {...i}}if(le(t)){let i;try{i=t.parseValue(e);}catch(s){s instanceof m?n(Se(r),e,s):n(Se(r),e,new m(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(Se(r),e,new m(`Expected type "${t.name}".`)),i}W(false,"Unexpected input type: "+N(t));}g();function Ue(e,t,n){if(e){if(e.kind===p.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0||!_i(n,r))return;let i=n[r];return i===null&&R(t)?void 0:i}if(R(t))return e.kind===p.NULL?void 0:Ue(e,t.ofType,n);if(e.kind===p.NULL)return null;if(B(t)){let r=t.ofType;if(e.kind===p.LIST){let s=[];for(let o of e.values)if(bi(o,n)){if(R(r))return;s.push(null);}else {let a=Ue(o,r,n);if(a===void 0)return;s.push(a);}return s}let i=Ue(e,r,n);return i===void 0?void 0:[i]}if(V(t)){if(e.kind!==p.OBJECT)return;let r=Object.create(null),i=Ie(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let o=i[s.name];if(!o||bi(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(R(s.type))return;continue}let a=Ue(o.value,s.type,n);if(a===void 0)return;r[s.name]=a;}if(t.isOneOf){let s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(le(t)){let r;try{r=t.parseLiteral(e,n);}catch{return}return r===void 0?void 0:r}W(false,"Unexpected input type: "+N(t));}}function bi(e,t){return e.kind===p.VARIABLE&&(t==null||t[e.name.value]===void 0||!_i(t,e.name.value))}function _i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function br(e,t,n){var r;let i=Object.create(null),s=(r=t.arguments)!==null&&r!==void 0?r:[],o=Ie(s,a=>a.name.value);for(let a of e.args){let u=a.name,c=a.type,f=o[u];if(!f){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if(R(c))throw new m(`Argument "${u}" of required type "${N(c)}" was not provided.`,{nodes:t});continue}let d=f.value,h=d.kind===p.NULL;if(d.kind===p.VARIABLE){let g=d.name.value;if(n==null||!Ps(n,g)){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if(R(c))throw new m(`Argument "${u}" of required type "${N(c)}" was provided the variable "$${g}" which was not provided a runtime value.`,{nodes:d});continue}h=n[g]==null;}if(h&&R(c))throw new m(`Argument "${u}" of non-null type "${N(c)}" must not be null.`,{nodes:d});let v=Ue(d,c,n);if(v===void 0)throw new m(`Argument "${u}" has invalid value ${U(d)}.`,{nodes:d});i[u]=v;}return {...i}}function Qt(e,t,n){var r;let i=(r=t.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===e.name);if(i)return br(e,i,n)}function Ps(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Di(e,t,n,r,i){let s=new Map;return Sr(e,t,n,r,i,s,new Set),s}function Sr(e,t,n,r,i,s,o){for(let a of i.selections)switch(a.kind){case p.FIELD:{if(!_r(n,a))continue;let u=Qs(a),c=s.get(u);c!==void 0?c.push(a):s.set(u,[a]);break}case p.INLINE_FRAGMENT:{if(!_r(n,a)||!Si(e,a,r))continue;Sr(e,t,n,r,a.selectionSet,s,o);break}case p.FRAGMENT_SPREAD:{let u=a.name.value;if(o.has(u)||!_r(n,a))continue;o.add(u);let c=t[u];if(!c||!Si(e,c,r))continue;Sr(e,t,n,r,c.selectionSet,s,o);break}}}function _r(e,t){let n=Qt(kt,t,e);if(n?.if===true)return false;let r=Qt(wt,t,e);return r?.if!==false}function Si(e,t,n){let r=t.typeCondition;if(!r)return true;let i=H(e,r);return i===n?true:Te(i)?e.isSubType(i,n):false}function Qs(e){return e.alias?e.alias.value:e.name.value}function Dr(e){return {OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,s=Object.create(null),o=e.getDocument(),a=Object.create(null);for(let c of o.definitions)c.kind===p.FRAGMENT_DEFINITION&&(a[c.name.value]=c);let u=Di(n,a,s,r,t.selectionSet);if(u.size>1){let d=[...u.values()].slice(1).flat();e.reportError(new m(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:d}));}for(let c of u.values())c[0].name.value.startsWith("__")&&e.reportError(new m(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}));}}}}}g();g();function ft(e,t){let n=new Map;for(let r of e){let i=t(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r);}return n}g();function bn(e){return {Field:t,Directive:t};function t(n){var r;let i=(r=n.arguments)!==null&&r!==void 0?r:[],s=ft(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new m(`There can be only one argument named "${o}".`,{nodes:a.map(u=>u.name)}));}}g();g();function _n(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Ee;for(let u of r)t[u.name]=!u.isRepeatable;let i=e.getDocument().definitions;for(let u of i)u.kind===p.DIRECTIVE_DEFINITION&&(t[u.name.value]=!u.repeatable);let s=Object.create(null),o=Object.create(null),a=Object.create(null);return {enter(u){if(!("directives"in u)||!u.directives)return;let c;if(u.kind===p.SCHEMA_DEFINITION||u.kind===p.SCHEMA_EXTENSION)c=s;else if($e(u)||yn(u)){let f=u.name.value;c=o[f],c===void 0&&(o[f]=c=Object.create(null));}else if(u.kind===p.DIRECTIVE_DEFINITION||u.kind===p.DIRECTIVE_EXTENSION){let f=u.name.value;c=a[f],c===void 0&&(a[f]=c=Object.create(null));}else c=Object.create(null);for(let f of u.directives){let d=f.name.value;t[d]&&(c[d]?e.reportError(new m(`The directive "@${d}" can only be used once at this location.`,{nodes:[c[d],f]})):c[d]=f);}}}}g();g();g();function wr(e){let t=Object.create(null);return {OperationDefinition:()=>false,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new m(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,false}}}g();function Sn(e){let t=[],n=Object.create(null);return {ObjectValue:{enter(){t.push(n),n=Object.create(null);},leave(){let r=t.pop();r||W(),n=r;}},ObjectField(r){let i=r.name.value;n[i]?e.reportError(new m(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name;}}}g();function kr(e){let t=Object.create(null);return {OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new m(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),false},FragmentDefinition:()=>false}}g();g();g();function $r(e){return {OperationDefinition(t){var n;let r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=ft(r,s=>s.variable.name.value);for(let[s,o]of i)o.length>1&&e.reportError(new m(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}));}}}g();function Ur(e){return {ListValue(t){let n=ot(e.getParentInputType());if(!B(n))return qe(e,t),false},ObjectValue(t){let n=re(e.getInputType());if(!V(n))return qe(e,t),false;let r=Ie(t.fields,i=>i.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&at(i)){let o=N(i.type);e.reportError(new m(`Field "${n.name}.${i.name}" of required type "${o}" was not provided.`,{nodes:t}));}n.isOneOf&&qs(e,t,n,r);},ObjectField(t){let n=re(e.getParentInputType());if(!e.getInputType()&&V(n)){let i=pe(t.name.value,Object.keys(n.getFields()));e.reportError(new m(`Field "${t.name.value}" is not defined by type "${n.name}".`+se(i),{nodes:t}));}},NullValue(t){let n=e.getInputType();R(n)&&e.reportError(new m(`Expected value of type "${N(n)}", found ${U(t)}.`,{nodes:t}));},EnumValue:t=>qe(e,t),IntValue:t=>qe(e,t),FloatValue:t=>qe(e,t),StringValue:t=>qe(e,t),BooleanValue:t=>qe(e,t)}}function qe(e,t){let n=e.getInputType();if(!n)return;let r=re(n);if(!le(r)){let i=N(n);e.reportError(new m(`Expected value of type "${i}", found ${U(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let s=N(n);e.reportError(new m(`Expected value of type "${s}", found ${U(t)}.`,{nodes:t}));}}catch(i){let s=N(n);i instanceof m?e.reportError(i):e.reportError(new m(`Expected value of type "${s}", found ${U(t)}; `+i.message,{nodes:t,originalError:i}));}}function qs(e,t,n,r){var i;let s=Object.keys(r);if(s.length!==1){e.reportError(new m(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let a=(i=r[s[0]])===null||i===void 0?void 0:i.value;(!a||a.kind===p.NULL)&&e.reportError(new m(`Field "${n.name}.${s[0]}" must be non-null.`,{nodes:[t]}));}g();function Vr(e){return {VariableDefinition(t){let n=H(e.getSchema(),t.type);if(n!==void 0&&!oe(n)){let r=t.variable.name.value,i=U(t.type);e.reportError(new m(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}));}}}}g();function Mr(e){let t=Object.create(null);return {OperationDefinition:{enter(){t=Object.create(null);},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:s,defaultValue:o,parentType:a}of r){let u=i.name.value,c=t[u];if(c&&s){let f=e.getSchema(),d=H(f,c.type);if(d&&!Ys(f,d,c.defaultValue,s,o)){let h=N(d),v=N(s);e.reportError(new m(`Variable "$${u}" of type "${h}" used in position expecting type "${v}".`,{nodes:[c,i]}));}V(a)&&a.isOneOf&&bt(d)&&e.reportError(new m(`Variable "$${u}" is of type "${d}" but must be non-nullable to be used for OneOf Input Object "${a}".`,{nodes:[c,i]}));}}}},VariableDefinition(n){t[n.variable.name.value]=n;}}}function Ys(e,t,n,r,i){if(R(r)&&!R(t)){if(!(n!=null&&n.kind!==p.NULL)&&!(i!==void 0))return false;let a=r.ofType;return Re(e,t,a)}return Re(e,t,r)}var jr=Object.freeze([ur]),Dn=Object.freeze([er,kr,or,Dr,En,nr,Vr,Ir,tr,wr,sr,lr,Er,pr,$r,cr,fr,Tn,_n,rr,bn,Ur,gr,Mr,yr,Sn,...jr]);g();var Gr=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n;}get[Symbol.toStringTag](){return "ASTValidationContext"}reportError(t){this._onError(t);}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else {n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===p.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n;}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let s of i.selections)s.kind===p.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(t,n);}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=Object.create(null),i=[t.selectionSet],s;for(;s=i.pop();)for(let o of this.getFragmentSpreads(s)){let a=o.name.value;if(r[a]!==true){r[a]=true;let u=this.getFragment(a);u&&(n.push(u),i.push(u.selectionSet));}}this._recursivelyReferencedFragments.set(t,n);}return n}};var Bt=class extends Gr{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map;}get[Symbol.toStringTag](){return "ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let r=[],i=new Be(this._schema);Ge(t,Gt(i,{VariableDefinition:()=>false,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue(),parentType:i.getParentInputType()});}})),n=r,this._variableUsages.set(t,n);}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n);}return n}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()}};var Js=je(yt,e=>e.filter(t=>t!=="description"));function Ai(e,t,n=Dn,r,i=new Be(e)){var s;let o=(s=r?.maxErrors)!==null&&s!==void 0?s:100;t||F(false,"Must provide document."),hn(e);let a=Object.freeze({}),u=[],c=new Bt(e,t,i,d=>{if(u.length>=o)throw u.push(new m("Too many validation errors, error limit reached. Validation aborted.")),a;u.push(d);}),f=Mn(n.map(d=>d(c)));try{Ge(t,Gt(i,f),Js);}catch(d){if(d!==a)throw d}return u}g();g();function Li(e){return e instanceof Error?e:new Pr(e)}var Pr=class extends Error{constructor(t){super("Unexpected error value: "+N(t)),this.name="NonErrorThrown",this.thrownValue=t;}};function xi(e,t,n){var r;let i=Li(e);return Xs(i)?i:new m(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function Xs(e){return Array.isArray(e.path)}g();g();g();g();g();g();g();function Ri(e,t){let n=null;for(let i of e.definitions)if(i.kind===p.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i;}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}g();function Br(e){return Oo(e,t=>!an(t),Io)}function Io(e){return !on(e)&&!lt(e)}function Oo(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return [bo(e),...r.map(s=>wo(s)),...i.map(s=>qr(s))].filter(Boolean).join(`
|
|
61
61
|
|
|
62
62
|
`)}function bo(e){if(e.description==null&&_o(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),ve(e)+`schema {
|
|
63
63
|
${t.join(`
|
|
64
64
|
`)}
|
|
65
|
-
}`}function _o(e){let t=e.getQueryType();if(t&&t.name!=="Query")return false;let n=e.getMutationType();if(n&&n.name!=="Mutation")return false;let r=e.getSubscriptionType();return !(r&&r.name!=="Subscription")}function
|
|
65
|
+
}`}function _o(e){let t=e.getQueryType();if(t&&t.name!=="Query")return false;let n=e.getMutationType();if(n&&n.name!=="Mutation")return false;let r=e.getSubscriptionType();return !(r&&r.name!=="Subscription")}function qr(e){if(he(e))return So(e);if(C(e))return Do(e);if($(e))return Ao(e);if(ne(e))return Lo(e);if(X(e))return xo(e);if(V(e))return Ro(e);W(false,"Unexpected type: "+N(e));}function So(e){return ve(e)+`scalar ${e.name}`+ko(e)}function wi(e){let t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function Do(e){return ve(e)+`type ${e.name}`+wi(e)+ki(e)}function Ao(e){return ve(e)+`interface ${e.name}`+wi(e)+ki(e)}function Lo(e){let t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return ve(e)+"union "+e.name+n}function xo(e){let t=e.getValues().map((n,r)=>ve(n," ",!r)+" "+n.name+An(n.deprecationReason));return ve(e)+`enum ${e.name}`+Yr(t)}function Ro(e){let t=Object.values(e.getFields()).map((n,r)=>ve(n," ",!r)+" "+Qr(n));return ve(e)+`input ${e.name}`+(e.isOneOf?" @oneOf":"")+Yr(t)}function ki(e){let t=Object.values(e.getFields()).map((n,r)=>ve(n," ",!r)+" "+n.name+Fi(n.args," ")+": "+String(n.type)+An(n.deprecationReason));return Yr(t)}function Yr(e){return e.length!==0?` {
|
|
66
66
|
`+e.join(`
|
|
67
67
|
`)+`
|
|
68
|
-
}`:""}function Fi(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(
|
|
69
|
-
`+e.map((n,r)=>ve(n," "+t,!r)+" "+t+
|
|
68
|
+
}`:""}function Fi(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(Qr).join(", ")+")":`(
|
|
69
|
+
`+e.map((n,r)=>ve(n," "+t,!r)+" "+t+Qr(n)).join(`
|
|
70
70
|
`)+`
|
|
71
|
-
`+t+")"}function
|
|
71
|
+
`+t+")"}function Qr(e){let t=we(e.defaultValue,e.type),n=e.name+": "+String(e.type);return t&&(n+=` = ${U(t)}`),n+An(e.deprecationReason)}function wo(e){return ve(e)+"directive @"+e.name+Fi(e.args)+An(e.deprecationReason)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function An(e){return e==null?"":e!==Ft?` @deprecated(reason: ${U({kind:p.STRING,value:e})})`:" @deprecated"}function ko(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${U({kind:p.STRING,value:e.specifiedByURL})})`}function ve(e,t="",n=true){let{description:r}=e;if(r==null)return "";let i=U({kind:p.STRING,value:r,block:Hr(r)});return (t&&!n?`
|
|
72
72
|
`+t:t)+i.replace(/\n/g,`
|
|
73
73
|
`+t)+`
|
|
74
|
-
`}var Kr=class{db;tenantId;user;caches=new Map;pending=new Map;waiting=new Map;flushScheduled=false;constructor(t){this.db=t.db,this.tenantId=t.tenantId,this.user=t.user;}getCacheKey(t){return t}async load(t,n){let r=this.getCacheKey(t),i=this.caches.get(r);if(i||(i=new Map,this.caches.set(r,i)),i.has(n))return i.get(n);let s=this.pending.get(r);return s||(s=new Set,this.pending.set(r,s)),s.add(n),i.set(n,void 0),this.flushScheduled||(this.flushScheduled=true,queueMicrotask(()=>{this.flushScheduled=false,this.flushAll();})),new Promise(o=>{let a=this.waiting.get(`${r}:${n}`);a||(a=[],this.waiting.set(`${r}:${n}`,a)),a.push(o);})}async flushAll(){for(let[t,n]of this.pending){if(n.size===0)continue;let r=this.caches.get(t),i=await this.db.find({collection:t,where:{id:{in:Array.from(n)}},limit:n.size,tenantId:this.tenantId,draft:!!this.user});for(let s of i.docs||[])if(s&&s.id){r.set(s.id,s);let o=this.waiting.get(`${t}:${s.id}`);o&&(o.forEach(a=>a(s)),this.waiting.delete(`${t}:${s.id}`));}}for(let[t,n]of this.waiting)n.forEach(r=>r(void 0));this.waiting.clear(),this.pending.clear();}resolveOne(t,n){return this.caches.get(this.getCacheKey(t))?.get(n)}},fe=new me({name:"JSON",description:"Arbitrary JSON value",serialize(e){return e},parseValue(e){return e},parseLiteral(e){switch(e.kind){case u.STRING:return e.value;case u.INT:case u.FLOAT:return parseFloat(e.value);case u.BOOLEAN:return e.value;case u.OBJECT:{let t={};for(let n of e.fields)t[n.name.value]=fe.parseLiteral(n.value);return t}case u.LIST:return e.values.map(t=>fe.parseLiteral(t));case u.NULL:return null;default:return null}}});function Co(e){return t=>{let n=0;return {Field(){n++,n>e&&t.reportError(new Error(`Query exceeds max depth of ${e}`));},leaveField(){n--;}}}}function G(e){return e.split(/[-_]/).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function Yr(e){let t=G(e);return t.charAt(0).toLowerCase()+t.slice(1)}function ge(e){return e.endsWith("s")&&e.length>1?e.slice(0,-1):e}async function dt(e,t,n){let r=e.access?.[t];if(n.apiKey){if(n.apiKey.permissions?.length>0){let s=e.slug,a=`${s}:${t==="read"?"read":t==="create"?"create":"update"}`;return !h(n.apiKey.permissions,a)&&!h(n.apiKey.permissions,`${s}:admin`)?{allowed:false}:{allowed:true}}if(r){let s=await a(r,{req:n.req,user:n.user,tenantId:n.tenantId});return typeof s=="boolean"?{allowed:s}:{allowed:true,extraWhere:s}}return {allowed:true}}if(n.user){let s=e.slug,a=`${s}:${t==="read"?"read":t==="create"?"create":t==="update"?"update":"delete"}`;if(!a$1({id:n.user.id,email:n.user.email,role:n.user.role},a)&&!a$1({id:n.user.id,email:n.user.email,role:n.user.role},`${s}:admin`)&&!r)return {allowed:false}}if(!r)return n.user?{allowed:true}:{allowed:false};let i=await a(r,{req:n.req,user:n.user,tenantId:n.tenantId});return typeof i=="boolean"?{allowed:i}:{allowed:true,extraWhere:i}}async function Ci(e,t,n){let r=e.access?.[t];if(n.apiKey){if(n.apiKey.permissions?.length>0){let s=e.slug,o=`${s}:${t}`;return !h(n.apiKey.permissions,o)&&!h(n.apiKey.permissions,`${s}:admin`)&&!h(n.apiKey.permissions,`${s}:*`)?{allowed:false}:{allowed:true}}if(r){let s=await a(r,{req:n.req,user:n.user,tenantId:n.tenantId});return {allowed:typeof s=="boolean"?s:true}}return {allowed:true}}if(!r){if(!n.user)return {allowed:false};let s=n.user.role;return s==="super_admin"||s==="admin"?{allowed:true}:{allowed:false}}let i=await a(r,{req:n.req,user:n.user,tenantId:n.tenantId});return typeof i=="boolean"?{allowed:i}:{allowed:true}}function $i(e,t){return e?e.startsWith("http://")||e.startsWith("https://")||e.startsWith("blob:")||e.startsWith("data:")?e:`${(process.env.KYRO_BASE_URL||t||"http://localhost:4321").replace(/\/+$/,"")}${e.startsWith("/")?"":"/"}${e}`:null}function Ve(e,t){return e&&(e.url&&(e.url=$i(e.url,t)),e.thumbnailUrl&&(e.thumbnailUrl=$i(e.thumbnailUrl,t)),e)}function Ye(e,t,n,r=false,i="Root",s=new Map){switch(e.type){case "text":case "email":case "password":case "textarea":case "color":case "code":case "markdown":case "date":case "select":case "radio":return e.hasMany?new M(S):S;case "list":return new M(S);case "upload":{let o=e;if(r)return o.hasMany?new M(S):S;if(o.relationTo&&n?.[o.relationTo]){let a=n[o.relationTo];return o.hasMany?new M(a):a}return fe}case "image":{if(r)return S;let o=e;return o.relationTo&&n?.[o.relationTo]?n[o.relationTo]:fe}case "number":{let o=e.integer?be:At;return e.hasMany?new M(o):o}case "checkbox":return q;case "json":case "richtext":return fe;case "blocks":{if(r)return fe;let o=e,a=(o.blocks||[]).map(f=>{let d=`Block_${G(f.slug)}`,h=s.get(d);return h||(h=new j({name:d,fields:()=>{let v=Ke(f.fields||[],t,n,d,s);return v.blockType={type:S},v.name={type:S},v}}),s.set(d,h)),h});if(a.length===0)return fe;let p=`${i}_${G(o.name)}_Blocks`,c=s.get(p);return c||(c=new ke({name:p,types:a,resolveType:f=>`Block_${G(f.blockType||f.type)}`}),s.set(p,c)),new M(c)}case "tabs":{if(r)return fe;let o=e,a=`${i}_${G(o.name)}_Tabs`,p=s.get(a);return p||(p=new j({name:a,fields:()=>Ke(o.tabs?.flatMap(c=>c.fields||[])||[],t,n,a,s)}),s.set(a,p)),p}case "relationship":{let o=e.relationTo;if((o==="*"||Array.isArray(o)&&o.includes("*"))&&(o=t.getCollections().map(a=>a.slug)),typeof o=="string"){if(r)return e.hasMany?new M(S):S;if(n?.[o])return e.hasMany?new M(n[o]):n[o];let a=t.getCollection(o);if(a)return new j({name:`${G(o)}Ref`,fields:()=>({id:{type:S},...Ln(a,t,n,s)})})}else if(Array.isArray(o)){if(r)return e.hasMany?new M(fe):fe;let a=o.map(h=>{if(n?.[h])return n[h];let v=t.getCollection(h);if(v){let g=s.get(`${G(h)}Ref`);return g||(g=new j({name:`${G(h)}Ref`,fields:()=>({id:{type:S},...Ln(v,t,n,s)})}),s.set(`${G(h)}Ref`,g)),g}return null}).filter(Boolean);if(a.length===0)return fe;let p=`${i}_${G(e.name||"Ref")}_PolyUnion`,c=s.get(p);c||(c=new ke({name:p,types:a,resolveType:h=>{if(h.__collection&&h.__collection!=="*")return n?.[h.__collection]?n[h.__collection].name:`${G(h.__collection)}Ref`}}),s.set(p,c));let f=`${i}_${G(e.name||"Ref")}_PolyWrapper`,d=s.get(f);return d||(d=new j({name:f,fields:{relationTo:{type:S},value:{type:c}}}),s.set(f,d)),e.hasMany?new M(d):d}return fe}case "array":{if(r)return new M(fe);let o=e,a=`${i}_${G(o.name)}_ArrayItem`,p=s.get(a);return p||(p=new j({name:a,fields:()=>{let c=Ke(o.fields||[],t,n,a,s);return c.id={type:S},c}}),s.set(a,p)),new M(p)}case "group":{if(r)return fe;let o=e,a=`${i}_${G(o.name)}_Group`,p=s.get(a);return p||(p=new j({name:a,fields:()=>Ke(o.fields||[],t,n,a,s)}),s.set(a,p)),p}default:return S}}function Ke(e,t,n,r,i=new Map){let s={};for(let o of e){if(o.type==="tabs"&&!o.name){for(let a of o.tabs||[]){let p=Ke(a.fields||[],t,n,r,i);Object.assign(s,p);}continue}if(o.type==="row"||o.type==="collapsible"){let a=Ke(o.fields||[],t,n,r,i);Object.assign(s,a);continue}if(o.name&&o.admin?.hidden!==true){let a=$o(o,t,n,r,i);a&&(s[o.name]=a);}}return s}function Ln(e,t,n,r=new Map){return Ke(e.fields,t,n,G(ge(e.slug)),r)}function $o(e,t,n,r,i=new Map){if(!e.name)return null;let s=e.deprecated||void 0;if(e.type==="upload"){let a=Ye(e,t,n,false,r,i),p=e;return {type:e.required?new D(a):a,description:e.admin?.description||e.label,deprecationReason:s,resolve:async(c,f,d)=>{let h=d?.relationLoader,v=c?.[p.name],g=d?.req?.url?new URL(d.req.url).origin:void 0;if(!v)return null;if(p.hasMany){let w=Array.isArray(v)?v:[];return Promise.all(w.map(async L=>{let P=typeof L=="string"?L:L?.id;if(!P||typeof L=="object"&&L?.url)return Ve(L,g);if(h){let K=h.resolveOne(p.relationTo,P);if(K)return Ve(K,g);let I=await h.load(p.relationTo,P);return I?Ve(I,g):null}return {id:P}}))}let A=typeof v=="string"?v:v?.id;if(!A||typeof v=="object"&&v?.url)return Ve(v,g);if(h){let w=h.resolveOne(p.relationTo,A);if(w)return Ve(w,g);let L=await h.load(p.relationTo,A);return L?Ve(L,g):null}return {id:A}}}}if(e.type==="relationship"&&!e.hasMany){let a=Ye(e,t,n,false,r,i);return {type:e.required?new D(a):a,description:e.admin?.description||e.label,deprecationReason:s,resolve:async(p,c,f)=>{let d=f?.relationLoader,h=e,v=p?.[h.name];if(!v)return null;let g=Array.isArray(h.relationTo)||h.relationTo==="*",A=g?v?.relationTo:h.relationTo,w=g?v?.value:v;if(g&&typeof v=="string"&&(A=h.relationTo[0],w=v),g&&A==="*")return null;if(d&&typeof w=="string"&&typeof A=="string"&&A!=="*"){let L=d.resolveOne(A,w);if(L)return g?{relationTo:A,value:{...L,__collection:A}}:L;let P=await d.load(A,w);return P?g?{relationTo:A,value:{...P,__collection:A}}:P:null}return g?{relationTo:A,value:{id:w,__collection:A}}:{id:w}}}}if(e.type==="relationship"&&e.hasMany)return {type:Ye(e,t,n,false,r,i),description:e.admin?.description||e.label,deprecationReason:s,resolve:async(p,c,f)=>{let d=f?.relationLoader,h=e,v=p?.[h.name]||[];if(typeof v=="string")try{v=JSON.parse(v);}catch{}if(Array.isArray(v)||(v=[]),!v.length)return [];let g=Array.isArray(h.relationTo)||h.relationTo==="*";if(d){let A=[];for(let w of v){let L=g?w?.relationTo:h.relationTo,P=g?w?.value:w;if(g&&typeof w=="string"&&(L=h.relationTo[0],P=w),!(g&&L==="*")){if(typeof P=="string"&&typeof L=="string"&&L!=="*"){let K=d.resolveOne(L,P);if(K){A.push(g?{relationTo:L,value:{...K,__collection:L}}:K);continue}let I=await d.load(L,P);if(I){A.push(g?{relationTo:L,value:{...I,__collection:L}}:I);continue}continue}A.push(g?{relationTo:L,value:{id:P,__collection:L}}:{id:P});}}return A}return v.map(A=>{let w=g?A?.relationTo:h.relationTo,L=g?A?.value:A;return g&&typeof A=="string"&&(w=h.relationTo[0],L=A),g?{relationTo:w,value:{id:L}}:{id:L}})}};if(e.type==="blocks"){let a=Ye(e,t,n,false,r,i);return {type:e.required?new D(a):a,description:e.admin?.description||e.label,deprecationReason:s,resolve:p=>{let c=p?.[e.name];if(typeof c=="string")try{c=JSON.parse(c);}catch{}return Array.isArray(c)?c.map(f=>f&&f.data&&f.type?{...f.data,id:f.id,type:f.type,blockType:f.type,name:f.name}:f):c}}}let o=Ye(e,t,n,false,r,i);return {type:e.required?new D(o):o,description:e.admin?.description||e.label,deprecationReason:s,resolve:a=>{let p=a?.[e.name];if(typeof p=="string"&&["array","group","tabs","blocks","json","richtext","list"].includes(e.type))try{p=JSON.parse(p);}catch{}return p}}}function Ui(e){let{registry:t,db:n,user:r,req:i,tenantId:s,apiKey:o,settings:a}=e;if(a?.access?.apiAccess?.graphqlEnabled===false)throw new Error("GraphQL API is disabled");let c=t.getCollections(),f=t.getGlobals(),d={},h={},v=new Map;for(let I of c){d[I.slug]=new j({name:G(ge(I.slug)),fields:()=>({id:{type:S},...Ln(I,t,d,v),...I.timestamps?{createdAt:{type:S},updatedAt:{type:S}}:{},...I.tenantScoped?{tenantId:{type:S}}:{}})});let Y={};for(let z of I.fields)z.name&&z.name!=="id"&&(Y[z.name]={type:Ye(z,t,d,true)});h[I.slug]=new Ce({name:`${G(ge(I.slug))}Input`,fields:()=>Y});}let g={},A={};for(let I of f)g[I.slug]=new j({name:`${G(I.slug)}Global`,fields:()=>({id:{type:S},...Ln({slug:I.slug,fields:I.fields},t,d)})}),A[I.slug]=new Ce({name:`${G(I.slug)}GlobalInput`,fields:()=>{let Y={};for(let z of I.fields)z.name&&z.name!=="id"&&(Y[z.name]={type:Ye(z,t,d,true)});return Y}});let w={};for(let I of c){let Y=d[I.slug];Y&&(w[Yr(I.slug)]={type:new j({name:`${G(ge(I.slug))}FindResult`,fields:{docs:{type:new M(Y)},totalDocs:{type:be},page:{type:be},totalPages:{type:be},hasNextPage:{type:q},hasPrevPage:{type:q}}}),args:{where:{type:S},sort:{type:S},limit:{type:be},page:{type:be},draft:{type:q}},resolve:async(z,Q,b)=>{let k=await dt(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey});if(!k.allowed)throw new Error("Access denied");b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"});let ie={};if(Q.where)try{ie=JSON.parse(Q.where);}catch{}k.extraWhere&&(ie={...ie,...k.extraWhere});let De=Q.draft??!!b.user;return n.find({collection:I.slug,where:ie,sort:Q.sort,limit:Q.limit||10,page:Q.page||1,tenantId:b.tenantId,draft:De})}},w[Yr(ge(I.slug))]={type:Y,args:{id:{type:S},slug:{type:S},draft:{type:q}},resolve:async(z,Q,b)=>{if(!Q.id&&!Q.slug)throw new Error("Either id or slug is required");if(!(await dt(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)throw new Error("Access denied");b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"});let ie=Q.draft??!!b.user;return Q.id?n.findByID({collection:I.slug,id:Q.id,tenantId:b.tenantId,draft:ie}):(await n.find({collection:I.slug,where:{slug:{equals:Q.slug}},limit:1,page:1,tenantId:b.tenantId,draft:ie})).docs?.[0]||null}},w[`count${G(I.slug)}`]={type:new j({name:`${G(ge(I.slug))}Count`,fields:{totalDocs:{type:be}}}),args:{where:{type:S}},resolve:async(z,Q,b)=>{if(!(await dt(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)return {totalDocs:0};let ie={};if(Q.where)try{ie=JSON.parse(Q.where);}catch{}return {totalDocs:await n.count({collection:I.slug,where:ie,tenantId:b.tenantId})}}});}for(let I of f){let Y=g[I.slug];Y&&(w[Yr(ge(I.slug))]={type:Y,resolve:async(z,Q,b)=>{if(!(await Ci(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)throw new Error("Access denied: cannot read global");return b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"}),n.findOne({collection:`_globals_${I.slug}`,where:{},tenantId:b.tenantId})}});}let L=new j({name:"Query",fields:w}),P={};for(let I of c){let Y=d[I.slug],z=h[I.slug];!Y||!z||(P[`create${G(ge(I.slug))}`]={type:new j({name:`${G(ge(I.slug))}CreateResult`,fields:{doc:{type:Y},message:{type:S}}}),args:{data:{type:new D(z)}},resolve:async(Q,b,k)=>{if(!(await dt(I,"create",{user:k.user,req:k.req,tenantId:k.tenantId,apiKey:k.apiKey})).allowed)throw new Error("Access denied: cannot create");k.tenantId&&n.setTenantContext({tenantId:k.tenantId,userId:k.user?.id??"",role:k.user?.role,isSuperAdmin:k.user?.role==="super_admin"});let xn=t.getCreateZodSchema(I.slug).parse(b.data);return {doc:await n.create({collection:I.slug,data:xn,tenantId:k.tenantId}),message:"Created successfully"}}},P[`update${G(ge(I.slug))}`]={type:new j({name:`${G(ge(I.slug))}UpdateResult`,fields:{doc:{type:Y},message:{type:S}}}),args:{id:{type:new D(S)},data:{type:new D(z)},baseUpdatedAt:{type:S}},resolve:async(Q,b,k)=>{if(!(await dt(I,"update",{user:k.user,req:k.req,tenantId:k.tenantId,apiKey:k.apiKey})).allowed)throw new Error("Access denied: cannot update");if(k.tenantId&&n.setTenantContext({tenantId:k.tenantId,userId:k.user?.id??"",role:k.user?.role,isSuperAdmin:k.user?.role==="super_admin"}),b.baseUpdatedAt){let qt=await n.findByID({collection:I.slug,id:b.id,tenantId:k.tenantId,draft:true});if(qt&&qt.updatedAt&&b.baseUpdatedAt!==qt.updatedAt)throw new Error(`Revision conflict: document has changed since ${b.baseUpdatedAt}. Current updatedAt: ${qt.updatedAt}`)}let xn=t.getUpdateZodSchema(I.slug).parse(b.data);return {doc:await n.update({collection:I.slug,id:b.id,data:xn,tenantId:k.tenantId}),message:"Updated successfully"}}},P[`delete${G(ge(I.slug))}`]={type:new j({name:`${G(ge(I.slug))}DeleteResult`,fields:{doc:{type:Y},message:{type:S}}}),args:{id:{type:new D(S)}},resolve:async(Q,b,k)=>{if(!(await dt(I,"delete",{user:k.user,req:k.req,tenantId:k.tenantId,apiKey:k.apiKey})).allowed)throw new Error("Access denied: cannot delete");return k.tenantId&&n.setTenantContext({tenantId:k.tenantId,userId:k.user?.id??"",role:k.user?.role,isSuperAdmin:k.user?.role==="super_admin"}),{doc:await n.delete({collection:I.slug,id:b.id,tenantId:k.tenantId}),message:"Deleted successfully"}}});}for(let I of f){let Y=A[I.slug];Y&&(P[`update${G(I.slug)}`]={type:new j({name:`${G(I.slug)}UpdateResult`,fields:{doc:{type:g[I.slug]||S},message:{type:S}}}),args:{data:{type:new D(Y)}},resolve:async(z,Q,b)=>{if(!(await Ci(I,"update",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)throw new Error("Access denied: cannot update global");b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"});let ie=await n.findOne({collection:`_globals_${I.slug}`,where:{},tenantId:b.tenantId}),De;return ie?De=await n.update({collection:`_globals_${I.slug}`,id:ie.id,data:Q.data,tenantId:b.tenantId}):De=await n.create({collection:`_globals_${I.slug}`,data:Q.data,tenantId:b.tenantId}),{doc:De,message:"Updated successfully"}}});}let K=new j({name:"Mutation",fields:P});return new Pe({query:L,mutation:K})}function Uo(e,t,n){return Ui({registry:e,db:t,user:n?.user,req:n?.req,tenantId:n?.tenantId,apiKey:n?.apiKey})}
|
|
75
|
-
export{Ue as A,Qt as B,Dn as C,Ai as D,xi as E,Ri as F,
|
|
74
|
+
`}g();var Ln=class{db;tenantId;user;caches=new Map;pending=new Map;waiting=new Map;flushScheduled=false;constructor(t){this.db=t.db,this.tenantId=t.tenantId,this.user=t.user;}getCacheKey(t){return t}async load(t,n){let r=this.getCacheKey(t),i=this.caches.get(r);if(i||(i=new Map,this.caches.set(r,i)),i.has(n))return i.get(n);let s=this.pending.get(r);return s||(s=new Set,this.pending.set(r,s)),s.add(n),i.set(n,void 0),this.flushScheduled||(this.flushScheduled=true,queueMicrotask(()=>{this.flushScheduled=false,this.flushAll();})),new Promise(o=>{let a=this.waiting.get(`${r}:${n}`);a||(a=[],this.waiting.set(`${r}:${n}`,a)),a.push(o);})}async flushAll(){for(let[t,n]of this.pending){if(n.size===0)continue;let r=t,i=Array.from(n);this.pending.delete(t);try{let s=await this.db.find({collection:r,where:{id:{in:i}},limit:i.length,tenantId:this.tenantId}),o=this.caches.get(t)||new Map,a=new Map;for(let u of s.docs)a.set(u.id,u),o.set(u.id,u);for(let u of i){let c=this.waiting.get(`${t}:${u}`);if(c){let f=a.get(u);for(let d of c)d(f);this.waiting.delete(`${t}:${u}`);}}}catch(s){console.error(`[RelationLoader] Failed to batch load ${r}:`,s);for(let o of i){let a=this.waiting.get(`${t}:${o}`);if(a){for(let u of a)u(void 0);this.waiting.delete(`${t}:${o}`);}}}}}async loadMany(t,n){return Promise.all(n.map(r=>this.load(t,r)))}resolveOne(t,n){return this.caches.get(this.getCacheKey(t))?.get(n)}};var fe=new me({name:"JSON",description:"Arbitrary JSON value",serialize(e){return e},parseValue(e){return e},parseLiteral(e){switch(e.kind){case p.STRING:return e.value;case p.INT:case p.FLOAT:return parseFloat(e.value);case p.BOOLEAN:return e.value;case p.OBJECT:{let t={};for(let n of e.fields)t[n.name.value]=fe.parseLiteral(n.value);return t}case p.LIST:return e.values.map(t=>fe.parseLiteral(t));case p.NULL:return null;default:return null}}});function Co(e){return t=>{let n=0;return {Field(){n++,n>e&&t.reportError(new Error(`Query exceeds max depth of ${e}`));},leaveField(){n--;}}}}function G(e){return e.split(/[-_]/).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function Kr(e){let t=G(e);return t.charAt(0).toLowerCase()+t.slice(1)}function ge(e){return e.endsWith("s")&&e.length>1?e.slice(0,-1):e}async function dt(e$1,t,n){let r=e$1.access?.[t];if(n.apiKey){if(n.apiKey.permissions?.length>0){let s=e$1.slug,a=`${s}:${t==="read"?"read":t==="create"?"create":"update"}`;return !e(n.apiKey.permissions,a)&&!e(n.apiKey.permissions,`${s}:admin`)?{allowed:false}:{allowed:true}}if(r){let s=await h(r,{req:n.req,user:n.user,tenantId:n.tenantId});return typeof s=="boolean"?{allowed:s}:{allowed:true,extraWhere:s}}return {allowed:true}}if(n.user){let s=e$1.slug,a$1=`${s}:${t==="read"?"read":t==="create"?"create":t==="update"?"update":"delete"}`;if(!a({id:n.user.id,email:n.user.email,role:n.user.role},a$1)&&!a({id:n.user.id,email:n.user.email,role:n.user.role},`${s}:admin`)&&!r)return {allowed:false}}if(!r)return n.user?{allowed:true}:{allowed:false};let i=await h(r,{req:n.req,user:n.user,tenantId:n.tenantId});return typeof i=="boolean"?{allowed:i}:{allowed:true,extraWhere:i}}async function Ci(e$1,t,n){let r=e$1.access?.[t];if(n.apiKey){if(n.apiKey.permissions?.length>0){let s=e$1.slug,o=`${s}:${t}`;return !e(n.apiKey.permissions,o)&&!e(n.apiKey.permissions,`${s}:admin`)&&!e(n.apiKey.permissions,`${s}:*`)?{allowed:false}:{allowed:true}}if(r){let s=await h(r,{req:n.req,user:n.user,tenantId:n.tenantId});return {allowed:typeof s=="boolean"?s:true}}return {allowed:true}}if(!r){if(!n.user)return {allowed:false};let s=n.user.role;return s==="super_admin"||s==="admin"?{allowed:true}:{allowed:false}}let i=await h(r,{req:n.req,user:n.user,tenantId:n.tenantId});return typeof i=="boolean"?{allowed:i}:{allowed:true}}function $i(e,t){return e?e.startsWith("http://")||e.startsWith("https://")||e.startsWith("blob:")||e.startsWith("data:")?e:`${(process.env.KYRO_BASE_URL||t||"http://localhost:4321").replace(/\/+$/,"")}${e.startsWith("/")?"":"/"}${e}`:null}function Ve(e,t){return e&&(e.url&&(e.url=$i(e.url,t)),e.thumbnailUrl&&(e.thumbnailUrl=$i(e.thumbnailUrl,t)),e)}function Ye(e,t,n,r=false,i="Root",s=new Map){switch(e.type){case "text":case "email":case "password":case "textarea":case "color":case "code":case "markdown":case "date":case "select":case "radio":return e.hasMany?new M(S):S;case "list":return new M(S);case "upload":{let o=e;if(r)return o.hasMany?new M(S):S;if(o.relationTo&&n?.[o.relationTo]){let a=n[o.relationTo];return o.hasMany?new M(a):a}return fe}case "image":{if(r)return S;let o=e;return o.relationTo&&n?.[o.relationTo]?n[o.relationTo]:fe}case "number":{let o=e.integer?be:At;return e.hasMany?new M(o):o}case "checkbox":return q;case "json":case "richtext":return fe;case "blocks":{if(r)return fe;let o=e,a=(o.blocks||[]).map(f=>{let d=`Block_${G(f.slug)}`,h=s.get(d);return h||(h=new j({name:d,fields:()=>{let v=Ke(f.fields||[],t,n,d,s);return v.blockType={type:S},v.name={type:S},v}}),s.set(d,h)),h});if(a.length===0)return fe;let u=`${i}_${G(o.name)}_Blocks`,c=s.get(u);return c||(c=new ke({name:u,types:a,resolveType:f=>`Block_${G(f.blockType||f.type)}`}),s.set(u,c)),new M(c)}case "tabs":{if(r)return fe;let o=e,a=`${i}_${G(o.name)}_Tabs`,u=s.get(a);return u||(u=new j({name:a,fields:()=>Ke(o.tabs?.flatMap(c=>c.fields||[])||[],t,n,a,s)}),s.set(a,u)),u}case "relationship":{let o=e.relationTo;if((o==="*"||Array.isArray(o)&&o.includes("*"))&&(o=t.getCollections().map(a=>a.slug)),typeof o=="string"){if(r)return e.hasMany?new M(S):S;if(n?.[o])return e.hasMany?new M(n[o]):n[o];let a=t.getCollection(o);if(a)return new j({name:`${G(o)}Ref`,fields:()=>({id:{type:S},...xn(a,t,n,s)})})}else if(Array.isArray(o)){if(r)return e.hasMany?new M(fe):fe;let a=o.map(h=>{if(n?.[h])return n[h];let v=t.getCollection(h);if(v){let g=s.get(`${G(h)}Ref`);return g||(g=new j({name:`${G(h)}Ref`,fields:()=>({id:{type:S},...xn(v,t,n,s)})}),s.set(`${G(h)}Ref`,g)),g}return null}).filter(Boolean);if(a.length===0)return fe;let u=`${i}_${G(e.name||"Ref")}_PolyUnion`,c=s.get(u);c||(c=new ke({name:u,types:a,resolveType:h=>{if(h.__collection&&h.__collection!=="*")return n?.[h.__collection]?n[h.__collection].name:`${G(h.__collection)}Ref`}}),s.set(u,c));let f=`${i}_${G(e.name||"Ref")}_PolyWrapper`,d=s.get(f);return d||(d=new j({name:f,fields:{relationTo:{type:S},value:{type:c}}}),s.set(f,d)),e.hasMany?new M(d):d}return fe}case "array":{if(r)return new M(fe);let o=e,a=`${i}_${G(o.name)}_ArrayItem`,u=s.get(a);return u||(u=new j({name:a,fields:()=>{let c=Ke(o.fields||[],t,n,a,s);return c.id={type:S},c}}),s.set(a,u)),new M(u)}case "group":{if(r)return fe;let o=e,a=`${i}_${G(o.name)}_Group`,u=s.get(a);return u||(u=new j({name:a,fields:()=>Ke(o.fields||[],t,n,a,s)}),s.set(a,u)),u}default:return S}}function Ke(e,t,n,r,i=new Map){let s={};for(let o of e){if(o.type==="tabs"&&!o.name){for(let a of o.tabs||[]){let u=Ke(a.fields||[],t,n,r,i);Object.assign(s,u);}continue}if(o.type==="row"||o.type==="collapsible"){let a=Ke(o.fields||[],t,n,r,i);Object.assign(s,a);continue}if(o.name&&o.admin?.hidden!==true){let a=$o(o,t,n,r,i);a&&(s[o.name]=a);}}return s}function xn(e,t,n,r=new Map){return Ke(e.fields,t,n,G(ge(e.slug)),r)}function $o(e,t,n,r,i=new Map){if(!e.name)return null;let s=e.deprecated||void 0;if(e.type==="upload"){let a=Ye(e,t,n,false,r,i),u=e;return {type:e.required?new D(a):a,description:e.admin?.description||e.label,deprecationReason:s,resolve:async(c,f,d)=>{let h=d?.relationLoader,v=c?.[u.name],g=d?.req?.url?new URL(d.req.url).origin:void 0;if(!v)return null;if(u.hasMany){let w=Array.isArray(v)?v:[];return Promise.all(w.map(async L=>{let P=typeof L=="string"?L:L?.id;if(!P||typeof L=="object"&&L?.url)return Ve(L,g);if(h){let K=h.resolveOne(u.relationTo,P);if(K)return Ve(K,g);let I=await h.load(u.relationTo,P);return I?Ve(I,g):null}return {id:P}}))}let A=typeof v=="string"?v:v?.id;if(!A||typeof v=="object"&&v?.url)return Ve(v,g);if(h){let w=h.resolveOne(u.relationTo,A);if(w)return Ve(w,g);let L=await h.load(u.relationTo,A);return L?Ve(L,g):null}return {id:A}}}}if(e.type==="relationship"&&!e.hasMany){let a=Ye(e,t,n,false,r,i);return {type:e.required?new D(a):a,description:e.admin?.description||e.label,deprecationReason:s,resolve:async(u,c,f)=>{let d=f?.relationLoader,h=e,v=u?.[h.name];if(!v)return null;let g=Array.isArray(h.relationTo)||h.relationTo==="*",A=g?v?.relationTo:h.relationTo,w=g?v?.value:v;if(g&&typeof v=="string"&&(A=h.relationTo[0],w=v),g&&A==="*")return null;if(d&&typeof w=="string"&&typeof A=="string"&&A!=="*"){let L=d.resolveOne(A,w);if(L)return g?{relationTo:A,value:{...L,__collection:A}}:L;let P=await d.load(A,w);return P?g?{relationTo:A,value:{...P,__collection:A}}:P:null}return g?{relationTo:A,value:{id:w,__collection:A}}:{id:w}}}}if(e.type==="relationship"&&e.hasMany)return {type:Ye(e,t,n,false,r,i),description:e.admin?.description||e.label,deprecationReason:s,resolve:async(u,c,f)=>{let d=f?.relationLoader,h=e,v=u?.[h.name]||[];if(typeof v=="string")try{v=JSON.parse(v);}catch{}if(Array.isArray(v)||(v=[]),!v.length)return [];let g=Array.isArray(h.relationTo)||h.relationTo==="*";if(d){let A=[];for(let w of v){let L=g?w?.relationTo:h.relationTo,P=g?w?.value:w;if(g&&typeof w=="string"&&(L=h.relationTo[0],P=w),!(g&&L==="*")){if(typeof P=="string"&&typeof L=="string"&&L!=="*"){let K=d.resolveOne(L,P);if(K){A.push(g?{relationTo:L,value:{...K,__collection:L}}:K);continue}let I=await d.load(L,P);if(I){A.push(g?{relationTo:L,value:{...I,__collection:L}}:I);continue}continue}A.push(g?{relationTo:L,value:{id:P,__collection:L}}:{id:P});}}return A}return v.map(A=>{let w=g?A?.relationTo:h.relationTo,L=g?A?.value:A;return g&&typeof A=="string"&&(w=h.relationTo[0],L=A),g?{relationTo:w,value:{id:L}}:{id:L}})}};if(e.type==="blocks"){let a=Ye(e,t,n,false,r,i);return {type:e.required?new D(a):a,description:e.admin?.description||e.label,deprecationReason:s,resolve:u=>{let c=u?.[e.name];if(typeof c=="string")try{c=JSON.parse(c);}catch{}return Array.isArray(c)?c.map(f=>f&&f.data&&f.type?{...f.data,id:f.id,type:f.type,blockType:f.type,name:f.name}:f):c}}}let o=Ye(e,t,n,false,r,i);return {type:e.required?new D(o):o,description:e.admin?.description||e.label,deprecationReason:s,resolve:a=>{let u=a?.[e.name];if(typeof u=="string"&&["array","group","tabs","blocks","json","richtext","list"].includes(e.type))try{u=JSON.parse(u);}catch{}return u}}}function Ui(e){let{registry:t,db:n,user:r,req:i,tenantId:s,apiKey:o,settings:a}=e;if(a?.access?.apiAccess?.graphqlEnabled===false)throw new Error("GraphQL API is disabled");let c=t.getCollections(),f=t.getGlobals(),d={},h={},v=new Map;for(let I of c){d[I.slug]=new j({name:G(ge(I.slug)),fields:()=>({id:{type:S},...xn(I,t,d,v),...I.timestamps?{createdAt:{type:S},updatedAt:{type:S}}:{},...I.tenantScoped?{tenantId:{type:S}}:{}})});let Y={};for(let z of I.fields)z.name&&z.name!=="id"&&(Y[z.name]={type:Ye(z,t,d,true)});h[I.slug]=new Ce({name:`${G(ge(I.slug))}Input`,fields:()=>Y});}let g={},A={};for(let I of f)g[I.slug]=new j({name:`${G(I.slug)}Global`,fields:()=>({id:{type:S},...xn({slug:I.slug,fields:I.fields},t,d)})}),A[I.slug]=new Ce({name:`${G(I.slug)}GlobalInput`,fields:()=>{let Y={};for(let z of I.fields)z.name&&z.name!=="id"&&(Y[z.name]={type:Ye(z,t,d,true)});return Y}});let w={};for(let I of c){let Y=d[I.slug];Y&&(w[Kr(I.slug)]={type:new j({name:`${G(ge(I.slug))}FindResult`,fields:{docs:{type:new M(Y)},totalDocs:{type:be},page:{type:be},totalPages:{type:be},hasNextPage:{type:q},hasPrevPage:{type:q}}}),args:{where:{type:S},sort:{type:S},limit:{type:be},page:{type:be},draft:{type:q}},resolve:async(z,Q,b)=>{let k=await dt(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey});if(!k.allowed)throw new Error("Access denied");b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"});let ie={};if(Q.where)try{ie=JSON.parse(Q.where);}catch{}k.extraWhere&&(ie={...ie,...k.extraWhere});let De=Q.draft??!!b.user;return n.find({collection:I.slug,where:ie,sort:Q.sort,limit:Q.limit||10,page:Q.page||1,tenantId:b.tenantId,draft:De})}},w[Kr(ge(I.slug))]={type:Y,args:{id:{type:S},slug:{type:S},draft:{type:q}},resolve:async(z,Q,b)=>{if(!Q.id&&!Q.slug)throw new Error("Either id or slug is required");if(!(await dt(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)throw new Error("Access denied");b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"});let ie=Q.draft??!!b.user;return Q.id?n.findByID({collection:I.slug,id:Q.id,tenantId:b.tenantId,draft:ie}):(await n.find({collection:I.slug,where:{slug:{equals:Q.slug}},limit:1,page:1,tenantId:b.tenantId,draft:ie})).docs?.[0]||null}},w[`count${G(I.slug)}`]={type:new j({name:`${G(ge(I.slug))}Count`,fields:{totalDocs:{type:be}}}),args:{where:{type:S}},resolve:async(z,Q,b)=>{if(!(await dt(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)return {totalDocs:0};let ie={};if(Q.where)try{ie=JSON.parse(Q.where);}catch{}return {totalDocs:await n.count({collection:I.slug,where:ie,tenantId:b.tenantId})}}});}for(let I of f){let Y=g[I.slug];Y&&(w[Kr(ge(I.slug))]={type:Y,resolve:async(z,Q,b)=>{if(!(await Ci(I,"read",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)throw new Error("Access denied: cannot read global");return b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"}),n.findOne({collection:`_globals_${I.slug}`,where:{},tenantId:b.tenantId})}});}let L=new j({name:"Query",fields:w}),P={};for(let I of c){let Y=d[I.slug],z=h[I.slug];!Y||!z||(P[`create${G(ge(I.slug))}`]={type:new j({name:`${G(ge(I.slug))}CreateResult`,fields:{doc:{type:Y},message:{type:S}}}),args:{data:{type:new D(z)}},resolve:async(Q,b,k)=>{if(!(await dt(I,"create",{user:k.user,req:k.req,tenantId:k.tenantId,apiKey:k.apiKey})).allowed)throw new Error("Access denied: cannot create");k.tenantId&&n.setTenantContext({tenantId:k.tenantId,userId:k.user?.id??"",role:k.user?.role,isSuperAdmin:k.user?.role==="super_admin"});let Rn=t.getCreateZodSchema(I.slug).parse(b.data);return {doc:await n.create({collection:I.slug,data:Rn,tenantId:k.tenantId}),message:"Created successfully"}}},P[`update${G(ge(I.slug))}`]={type:new j({name:`${G(ge(I.slug))}UpdateResult`,fields:{doc:{type:Y},message:{type:S}}}),args:{id:{type:new D(S)},data:{type:new D(z)},baseUpdatedAt:{type:S}},resolve:async(Q,b,k)=>{if(!(await dt(I,"update",{user:k.user,req:k.req,tenantId:k.tenantId,apiKey:k.apiKey})).allowed)throw new Error("Access denied: cannot update");if(k.tenantId&&n.setTenantContext({tenantId:k.tenantId,userId:k.user?.id??"",role:k.user?.role,isSuperAdmin:k.user?.role==="super_admin"}),b.baseUpdatedAt){let qt=await n.findByID({collection:I.slug,id:b.id,tenantId:k.tenantId,draft:true});if(qt&&qt.updatedAt&&b.baseUpdatedAt!==qt.updatedAt)throw new Error(`Revision conflict: document has changed since ${b.baseUpdatedAt}. Current updatedAt: ${qt.updatedAt}`)}let Rn=t.getUpdateZodSchema(I.slug).parse(b.data);return {doc:await n.update({collection:I.slug,id:b.id,data:Rn,tenantId:k.tenantId}),message:"Updated successfully"}}},P[`delete${G(ge(I.slug))}`]={type:new j({name:`${G(ge(I.slug))}DeleteResult`,fields:{doc:{type:Y},message:{type:S}}}),args:{id:{type:new D(S)}},resolve:async(Q,b,k)=>{if(!(await dt(I,"delete",{user:k.user,req:k.req,tenantId:k.tenantId,apiKey:k.apiKey})).allowed)throw new Error("Access denied: cannot delete");return k.tenantId&&n.setTenantContext({tenantId:k.tenantId,userId:k.user?.id??"",role:k.user?.role,isSuperAdmin:k.user?.role==="super_admin"}),{doc:await n.delete({collection:I.slug,id:b.id,tenantId:k.tenantId}),message:"Deleted successfully"}}});}for(let I of f){let Y=A[I.slug];Y&&(P[`update${G(I.slug)}`]={type:new j({name:`${G(I.slug)}UpdateResult`,fields:{doc:{type:g[I.slug]||S},message:{type:S}}}),args:{data:{type:new D(Y)}},resolve:async(z,Q,b)=>{if(!(await Ci(I,"update",{user:b.user,req:b.req,tenantId:b.tenantId,apiKey:b.apiKey})).allowed)throw new Error("Access denied: cannot update global");b.tenantId&&n.setTenantContext({tenantId:b.tenantId,userId:b.user?.id??"",role:b.user?.role,isSuperAdmin:b.user?.role==="super_admin"});let ie=await n.findOne({collection:`_globals_${I.slug}`,where:{},tenantId:b.tenantId}),De;return ie?De=await n.update({collection:`_globals_${I.slug}`,id:ie.id,data:Q.data,tenantId:b.tenantId}):De=await n.create({collection:`_globals_${I.slug}`,data:Q.data,tenantId:b.tenantId}),{doc:De,message:"Updated successfully"}}});}let K=new j({name:"Mutation",fields:P});return new Pe({query:L,mutation:K})}function Uo(e,t,n){return Ui({registry:e,db:t,user:n?.user,req:n?.req,tenantId:n?.tenantId,apiKey:n?.apiKey})}
|
|
75
|
+
export{Ue as A,Qt as B,Dn as C,Ai as D,xi as E,Ri as F,Br as G,Ln as H,Co as I,Ui as J,Uo as K,Mi as a,m as b,_ as c,p as d,si as e,U as f,rt as g,C as h,B as i,R as j,oe as k,le as l,Te as m,D as n,be as o,S as p,q,Ae as r,wt as s,kt as t,$t as u,Ut as v,Vt as w,hn as x,H as y,Oi as z};
|