@zuplo/cli 6.71.21 → 6.71.23

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.
Files changed (109) hide show
  1. package/node_modules/@posthog/core/dist/error-tracking/exception-steps.d.ts.map +1 -1
  2. package/node_modules/@posthog/core/dist/error-tracking/exception-steps.js +6 -24
  3. package/node_modules/@posthog/core/dist/error-tracking/exception-steps.mjs +7 -25
  4. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +6 -0
  5. package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
  6. package/node_modules/@posthog/core/dist/posthog-core-stateless.js +75 -17
  7. package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +73 -18
  8. package/node_modules/@posthog/core/dist/posthog-core.d.ts +2 -2
  9. package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
  10. package/node_modules/@posthog/core/dist/posthog-core.js +10 -6
  11. package/node_modules/@posthog/core/dist/posthog-core.mjs +11 -7
  12. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.d.ts +1 -0
  13. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.d.ts.map +1 -1
  14. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.js +3 -0
  15. package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.mjs +3 -0
  16. package/node_modules/@posthog/core/dist/utils/promise-queue.d.ts +3 -0
  17. package/node_modules/@posthog/core/dist/utils/promise-queue.d.ts.map +1 -1
  18. package/node_modules/@posthog/core/dist/utils/promise-queue.js +15 -3
  19. package/node_modules/@posthog/core/dist/utils/promise-queue.mjs +15 -3
  20. package/node_modules/@posthog/core/dist/utils/string-utils.d.ts +1 -0
  21. package/node_modules/@posthog/core/dist/utils/string-utils.d.ts.map +1 -1
  22. package/node_modules/@posthog/core/dist/utils/string-utils.js +21 -0
  23. package/node_modules/@posthog/core/dist/utils/string-utils.mjs +19 -1
  24. package/node_modules/@posthog/core/package.json +1 -1
  25. package/node_modules/@posthog/core/src/error-tracking/exception-steps.ts +5 -42
  26. package/node_modules/@posthog/core/src/posthog-core-stateless.ts +118 -23
  27. package/node_modules/@posthog/core/src/posthog-core.ts +18 -7
  28. package/node_modules/@posthog/core/src/testing/PostHogCoreTestClient.ts +4 -0
  29. package/node_modules/@posthog/core/src/utils/promise-queue.ts +17 -4
  30. package/node_modules/@posthog/core/src/utils/string-utils.spec.ts +38 -1
  31. package/node_modules/@posthog/core/src/utils/string-utils.ts +42 -0
  32. package/node_modules/@posthog/types/dist/posthog.d.ts +12 -0
  33. package/node_modules/@posthog/types/dist/posthog.d.ts.map +1 -1
  34. package/node_modules/@posthog/types/package.json +1 -1
  35. package/node_modules/@posthog/types/src/posthog.ts +13 -0
  36. package/node_modules/@types/node/README.md +1 -1
  37. package/node_modules/@types/node/buffer.d.ts +64 -25
  38. package/node_modules/@types/node/crypto.d.ts +18 -5
  39. package/node_modules/@types/node/diagnostics_channel.d.ts +237 -3
  40. package/node_modules/@types/node/dns.d.ts +1 -1
  41. package/node_modules/@types/node/ffi.d.ts +486 -0
  42. package/node_modules/@types/node/fs/promises.d.ts +3 -0
  43. package/node_modules/@types/node/fs.d.ts +21 -6
  44. package/node_modules/@types/node/http.d.ts +25 -0
  45. package/node_modules/@types/node/index.d.ts +1 -0
  46. package/node_modules/@types/node/package.json +2 -2
  47. package/node_modules/@types/node/process.d.ts +14 -1
  48. package/node_modules/@types/node/quic.d.ts +92 -11
  49. package/node_modules/@types/node/sqlite.d.ts +55 -0
  50. package/node_modules/@types/node/stream/iter.d.ts +150 -0
  51. package/node_modules/@types/node/stream.d.ts +32 -0
  52. package/node_modules/@types/node/test.d.ts +112 -2
  53. package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
  54. package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
  55. package/node_modules/@types/node/util.d.ts +19 -2
  56. package/node_modules/@types/node/v8.d.ts +84 -2
  57. package/node_modules/@types/node/worker_threads.d.ts +8 -7
  58. package/node_modules/@zuplo/core/customer.cli.minified.js +2 -2
  59. package/node_modules/@zuplo/core/index.minified.js +2 -2
  60. package/node_modules/@zuplo/core/package.json +1 -1
  61. package/node_modules/@zuplo/graphql/out/esm/index.js +11 -11
  62. package/node_modules/@zuplo/graphql/out/esm/index.js.map +1 -1
  63. package/node_modules/@zuplo/graphql/package.json +1 -1
  64. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  65. package/node_modules/@zuplo/otel/package.json +1 -1
  66. package/node_modules/@zuplo/runtime/out/esm/{chunk-DQ4ANJLR.js → chunk-4MNJC7E2.js} +2 -2
  67. package/node_modules/@zuplo/runtime/out/esm/chunk-4MNJC7E2.js.map +1 -0
  68. package/node_modules/@zuplo/runtime/out/esm/{chunk-2Y72LML3.js → chunk-4QJJMELB.js} +2 -2
  69. package/node_modules/@zuplo/runtime/out/esm/{chunk-2Y72LML3.js.map → chunk-4QJJMELB.js.map} +1 -1
  70. package/node_modules/@zuplo/runtime/out/esm/chunk-5CYWMN74.js +402 -0
  71. package/node_modules/@zuplo/runtime/out/esm/chunk-5CYWMN74.js.map +1 -0
  72. package/node_modules/@zuplo/runtime/out/esm/{chunk-L3MZGNQA.js → chunk-DSZS6PZJ.js} +10 -10
  73. package/node_modules/@zuplo/runtime/out/esm/chunk-DSZS6PZJ.js.map +1 -0
  74. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  75. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  76. package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
  77. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +7 -7
  78. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
  79. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  80. package/node_modules/@zuplo/runtime/out/types/index.d.ts +1050 -18
  81. package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +33 -7
  82. package/node_modules/@zuplo/runtime/package.json +1 -1
  83. package/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
  84. package/node_modules/iconv-lite/encodings/utf32.js +10 -3
  85. package/node_modules/iconv-lite/package.json +2 -2
  86. package/node_modules/iconv-lite/types/encodings.d.ts +2 -0
  87. package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
  88. package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
  89. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  90. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  91. package/node_modules/protobufjs/dist/protobuf.js +5 -2
  92. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  93. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  94. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  95. package/node_modules/protobufjs/package.json +1 -1
  96. package/node_modules/protobufjs/src/parse.js +3 -0
  97. package/node_modules/toad-cache/README.md +10 -9
  98. package/node_modules/toad-cache/dist/toad-cache.cjs +139 -139
  99. package/node_modules/toad-cache/dist/toad-cache.mjs +136 -140
  100. package/node_modules/toad-cache/package.json +8 -8
  101. package/node_modules/toad-cache/toad-cache.d.cts +20 -14
  102. package/node_modules/toad-cache/toad-cache.d.ts +18 -14
  103. package/package.json +6 -6
  104. package/node_modules/@zuplo/runtime/out/esm/chunk-DQ4ANJLR.js.map +0 -1
  105. package/node_modules/@zuplo/runtime/out/esm/chunk-I5HLAHUY.js +0 -357
  106. package/node_modules/@zuplo/runtime/out/esm/chunk-I5HLAHUY.js.map +0 -1
  107. package/node_modules/@zuplo/runtime/out/esm/chunk-L3MZGNQA.js.map +0 -1
  108. /package/node_modules/@zuplo/runtime/out/esm/{chunk-I5HLAHUY.js.LEGAL.txt → chunk-5CYWMN74.js.LEGAL.txt} +0 -0
  109. /package/node_modules/@zuplo/runtime/out/esm/{chunk-L3MZGNQA.js.LEGAL.txt → chunk-DSZS6PZJ.js.LEGAL.txt} +0 -0
@@ -22,17 +22,17 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- var zn=Object.defineProperty;var s=(e,t)=>zn(e,"name",{value:t,configurable:!0});import{extractGraphqlErrors as Xi,ZoneCache as Wi}from"@zuplo/runtime";function _(e,t){if(!!!e)throw new Error(t)}s(_,"devAssert");function F(e){return typeof e=="object"&&e!==null}s(F,"isObjectLike");function pe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}s(pe,"invariant");var Kn=/\r\n|[\n\r]/g;function Le(e,t){let n=0,i=1;for(let r of e.body.matchAll(Kn)){if(typeof r.index=="number"||pe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}s(Le,"getLocation");function Ct(e){return tt(e.source,Le(e.source,e.start))}s(Ct,"printLocation");function tt(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,p=t.line===1?n:0,d=t.column+p,f=`${e.name}:${a}:${d}
25
+ var Kn=Object.defineProperty;var s=(e,t)=>Kn(e,"name",{value:t,configurable:!0});import{extractGraphqlErrors as Wi,recordGraphqlCacheState as $n,ZoneCache as Zi}from"@zuplo/runtime";function _(e,t){if(!!!e)throw new Error(t)}s(_,"devAssert");function F(e){return typeof e=="object"&&e!==null}s(F,"isObjectLike");function pe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}s(pe,"invariant");var Xn=/\r\n|[\n\r]/g;function Le(e,t){let n=0,i=1;for(let r of e.body.matchAll(Xn)){if(typeof r.index=="number"||pe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}s(Le,"getLocation");function Ct(e){return tt(e.source,Le(e.source,e.start))}s(Ct,"printLocation");function tt(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,p=t.line===1?n:0,d=t.column+p,f=`${e.name}:${a}:${d}
26
26
  `,y=i.split(/\r\n|[\n\r]/g),x=y[r];if(x.length>120){let N=Math.floor(d/80),I=d%80,g=[];for(let C=0;C<x.length;C+=80)g.push(x.slice(C,C+80));return f+pn([[`${a} |`,g[0]],...g.slice(1,N+1).map(C=>["|",C]),["|","^".padStart(I)],["|",g[N+1]]])}return f+pn([[`${a-1} |`,y[r-1]],[`${a} |`,x],["|","^".padStart(d)],[`${a+1} |`,y[r+1]]])}s(tt,"printSourceLocation");function pn(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
27
- `)}s(pn,"printPrefixedLines");function Xn(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}s(Xn,"toNormalizedOptions");var h=class e extends Error{static{s(this,"GraphQLError")}constructor(t,...n){var i,r,o;let{nodes:a,source:p,positions:d,path:f,originalError:y,extensions:x}=Xn(n);super(t),this.name="GraphQLError",this.path=f??void 0,this.originalError=y??void 0,this.nodes=un(Array.isArray(a)?a:a?[a]:void 0);let N=un((i=this.nodes)===null||i===void 0?void 0:i.map(g=>g.loc).filter(g=>g!=null));this.source=p??(N==null||(r=N[0])===null||r===void 0?void 0:r.source),this.positions=d??N?.map(g=>g.start),this.locations=d&&p?d.map(g=>Le(p,g)):N?.map(g=>Le(g.source,g.start));let I=F(y?.extensions)?y?.extensions:void 0;this.extensions=(o=x??I)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),y!=null&&y.stack?Object.defineProperty(this,"stack",{value:y.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
27
+ `)}s(pn,"printPrefixedLines");function Wn(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}s(Wn,"toNormalizedOptions");var h=class e extends Error{static{s(this,"GraphQLError")}constructor(t,...n){var i,r,o;let{nodes:a,source:p,positions:d,path:f,originalError:y,extensions:x}=Wn(n);super(t),this.name="GraphQLError",this.path=f??void 0,this.originalError=y??void 0,this.nodes=un(Array.isArray(a)?a:a?[a]:void 0);let N=un((i=this.nodes)===null||i===void 0?void 0:i.map(g=>g.loc).filter(g=>g!=null));this.source=p??(N==null||(r=N[0])===null||r===void 0?void 0:r.source),this.positions=d??N?.map(g=>g.start),this.locations=d&&p?d.map(g=>Le(p,g)):N?.map(g=>Le(g.source,g.start));let I=F(y?.extensions)?y?.extensions:void 0;this.extensions=(o=x??I)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),y!=null&&y.stack?Object.defineProperty(this,"stack",{value:y.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
28
28
 
29
29
  `+Ct(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
30
30
 
31
- `+tt(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 un(e){return e===void 0||e.length===0?void 0:e}s(un,"undefinedIfEmpty");function w(e,t,n){return new h(`Syntax Error: ${n}`,{source:e,positions:[t]})}s(w,"syntaxError");var Ae=class{static{s(this,"Location")}constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Ie=class{static{s(this,"Token")}constructor(t,n,i,r,o,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=a,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}}},Ft={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Wn=new Set(Object.keys(Ft));function Qe(e){let t=e?.kind;return typeof t=="string"&&Wn.has(t)}s(Qe,"isNode");var $;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})($||($={}));var b;(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"})(b||(b={}));var c;(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.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"})(c||(c={}));function nt(e){return e===9||e===32}s(nt,"isWhiteSpace");function De(e){return e>=48&&e<=57}s(De,"isDigit");function ln(e){return e>=97&&e<=122||e>=65&&e<=90}s(ln,"isLetter");function Pe(e){return ln(e)||e===95}s(Pe,"isNameStart");function it(e){return ln(e)||De(e)||e===95}s(it,"isNameContinue");function dn(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var o;let p=e[a],d=Zn(p);d!==p.length&&(i=(o=i)!==null&&o!==void 0?o:a,r=a,a!==0&&d<n&&(n=d))}return e.map((a,p)=>p===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}s(dn,"dedentBlockStringLines");function Zn(e){let t=0;for(;t<e.length&&nt(e.charCodeAt(t));)++t;return t}s(Zn,"leadingWhitespace");function fn(e,t){let n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,o=i.length>1&&i.slice(1).every(I=>I.length===0||nt(I.charCodeAt(0))),a=n.endsWith('\\"""'),p=e.endsWith('"')&&!a,d=e.endsWith("\\"),f=p||d,y=!(t!=null&&t.minimize)&&(!r||e.length>70||f||o||a),x="",N=r&&nt(e.charCodeAt(0));return(y&&!N||o)&&(x+=`
31
+ `+tt(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 un(e){return e===void 0||e.length===0?void 0:e}s(un,"undefinedIfEmpty");function w(e,t,n){return new h(`Syntax Error: ${n}`,{source:e,positions:[t]})}s(w,"syntaxError");var Ae=class{static{s(this,"Location")}constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Ie=class{static{s(this,"Token")}constructor(t,n,i,r,o,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=a,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}}},Ft={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Zn=new Set(Object.keys(Ft));function Qe(e){let t=e?.kind;return typeof t=="string"&&Zn.has(t)}s(Qe,"isNode");var $;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})($||($={}));var b;(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"})(b||(b={}));var c;(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.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"})(c||(c={}));function nt(e){return e===9||e===32}s(nt,"isWhiteSpace");function De(e){return e>=48&&e<=57}s(De,"isDigit");function ln(e){return e>=97&&e<=122||e>=65&&e<=90}s(ln,"isLetter");function Pe(e){return ln(e)||e===95}s(Pe,"isNameStart");function it(e){return ln(e)||De(e)||e===95}s(it,"isNameContinue");function dn(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var o;let p=e[a],d=ei(p);d!==p.length&&(i=(o=i)!==null&&o!==void 0?o:a,r=a,a!==0&&d<n&&(n=d))}return e.map((a,p)=>p===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}s(dn,"dedentBlockStringLines");function ei(e){let t=0;for(;t<e.length&&nt(e.charCodeAt(t));)++t;return t}s(ei,"leadingWhitespace");function fn(e,t){let n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,o=i.length>1&&i.slice(1).every(I=>I.length===0||nt(I.charCodeAt(0))),a=n.endsWith('\\"""'),p=e.endsWith('"')&&!a,d=e.endsWith("\\"),f=p||d,y=!(t!=null&&t.minimize)&&(!r||e.length>70||f||o||a),x="",N=r&&nt(e.charCodeAt(0));return(y&&!N||o)&&(x+=`
32
32
  `),x+=n,(y||f)&&(x+=`
33
- `),'"""'+x+'"""'}s(fn,"printBlockString");var u;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(u||(u={}));var $e=class{static{s(this,"Lexer")}constructor(t){let n=new Ie(u.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!==u.EOF)do if(t.next)t=t.next;else{let n=ei(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===u.COMMENT);return t}};function hn(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R}s(hn,"isPunctuatorTokenKind");function we(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}s(we,"isUnicodeScalarValue");function rt(e,t){return yn(e.charCodeAt(t))&&Tn(e.charCodeAt(t+1))}s(rt,"isSupplementaryCodePoint");function yn(e){return e>=55296&&e<=56319}s(yn,"isLeadingSurrogate");function Tn(e){return e>=56320&&e<=57343}s(Tn,"isTrailingSurrogate");function be(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return u.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}s(be,"printCodePointAt");function k(e,t,n,i,r){let o=e.line,a=1+n-e.lineStart;return new Ie(t,n,i,o,a,r)}s(k,"createToken");function ei(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let o=n.charCodeAt(r);switch(o){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return ti(e,r);case 33:return k(e,u.BANG,r,r+1);case 36:return k(e,u.DOLLAR,r,r+1);case 38:return k(e,u.AMP,r,r+1);case 40:return k(e,u.PAREN_L,r,r+1);case 41:return k(e,u.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return k(e,u.SPREAD,r,r+3);break;case 58:return k(e,u.COLON,r,r+1);case 61:return k(e,u.EQUALS,r,r+1);case 64:return k(e,u.AT,r,r+1);case 91:return k(e,u.BRACKET_L,r,r+1);case 93:return k(e,u.BRACKET_R,r,r+1);case 123:return k(e,u.BRACE_L,r,r+1);case 124:return k(e,u.PIPE,r,r+1);case 125:return k(e,u.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?ai(e,r):ii(e,r)}if(De(o)||o===45)return ni(e,r,o);if(Pe(o))return ci(e,r);throw w(e.source,r,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:we(o)||rt(n,r)?`Unexpected character: ${be(e,r)}.`:`Invalid character: ${be(e,r)}.`)}return k(e,u.EOF,i,i)}s(ei,"readNextToken");function ti(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(o===10||o===13)break;if(we(o))++r;else if(rt(n,r))r+=2;else break}return k(e,u.COMMENT,t,r,n.slice(t+1,r))}s(ti,"readComment");function ni(e,t,n){let i=e.source.body,r=t,o=n,a=!1;if(o===45&&(o=i.charCodeAt(++r)),o===48){if(o=i.charCodeAt(++r),De(o))throw w(e.source,r,`Invalid number, unexpected digit after 0: ${be(e,r)}.`)}else r=Vt(e,r,o),o=i.charCodeAt(r);if(o===46&&(a=!0,o=i.charCodeAt(++r),r=Vt(e,r,o),o=i.charCodeAt(r)),(o===69||o===101)&&(a=!0,o=i.charCodeAt(++r),(o===43||o===45)&&(o=i.charCodeAt(++r)),r=Vt(e,r,o),o=i.charCodeAt(r)),o===46||Pe(o))throw w(e.source,r,`Invalid number, expected digit but got: ${be(e,r)}.`);return k(e,a?u.FLOAT:u.INT,t,r,i.slice(t,r))}s(ni,"readNumber");function Vt(e,t,n){if(!De(n))throw w(e.source,t,`Invalid number, expected digit but got: ${be(e,t)}.`);let i=e.source.body,r=t+1;for(;De(i.charCodeAt(r));)++r;return r}s(Vt,"readDigits");function ii(e,t){let n=e.source.body,i=n.length,r=t+1,o=r,a="";for(;r<i;){let p=n.charCodeAt(r);if(p===34)return a+=n.slice(o,r),k(e,u.STRING,t,r+1,a);if(p===92){a+=n.slice(o,r);let d=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?ri(e,r):si(e,r):oi(e,r);a+=d.value,r+=d.size,o=r;continue}if(p===10||p===13)break;if(we(p))++r;else if(rt(n,r))r+=2;else throw w(e.source,r,`Invalid character within String: ${be(e,r)}.`)}throw w(e.source,r,"Unterminated string.")}s(ii,"readString");function ri(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let o=n.charCodeAt(t+r++);if(o===125){if(r<5||!we(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|je(o),i<0)break}throw w(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}s(ri,"readEscapedUnicodeVariableWidth");function si(e,t){let n=e.source.body,i=mn(n,t+2);if(we(i))return{value:String.fromCodePoint(i),size:6};if(yn(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=mn(n,t+8);if(Tn(r))return{value:String.fromCodePoint(i,r),size:12}}throw w(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}s(si,"readEscapedUnicodeFixedWidth");function mn(e,t){return je(e.charCodeAt(t))<<12|je(e.charCodeAt(t+1))<<8|je(e.charCodeAt(t+2))<<4|je(e.charCodeAt(t+3))}s(mn,"read16BitHexCode");function je(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}s(je,"readHexDigit");function oi(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:`
34
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw w(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}s(oi,"readEscapedCharacter");function ai(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,a=o,p="",d=[];for(;o<i;){let f=n.charCodeAt(o);if(f===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){p+=n.slice(a,o),d.push(p);let y=k(e,u.BLOCK_STRING,t,o+3,dn(d).join(`
35
- `));return e.line+=d.length-1,e.lineStart=r,y}if(f===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){p+=n.slice(a,o),a=o+1,o+=4;continue}if(f===10||f===13){p+=n.slice(a,o),d.push(p),f===13&&n.charCodeAt(o+1)===10?o+=2:++o,p="",a=o,r=o;continue}if(we(f))++o;else if(rt(n,o))o+=2;else throw w(e.source,o,`Invalid character within String: ${be(e,o)}.`)}throw w(e.source,o,"Unterminated string.")}s(ai,"readBlockString");function ci(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(it(o))++r;else break}return k(e,u.NAME,t,r,n.slice(t,r))}s(ci,"readName");function m(e){return st(e,[])}s(m,"inspect");function st(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return pi(e,t);default:return String(e)}}s(st,"formatValue");function pi(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(ui(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:st(i,n)}else if(Array.isArray(e))return di(e,n);return li(e,n)}s(pi,"formatObjectValue");function ui(e){return typeof e.toJSON=="function"}s(ui,"isJSONable");function li(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+fi(e)+"]":"{ "+n.map(([r,o])=>r+": "+st(o,t)).join(", ")+" }"}s(li,"formatObject");function di(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o<n;++o)r.push(st(e[o],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}s(di,"formatArray");function fi(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}s(fi,"getObjectTag");var mi=globalThis.process&&!0,K=s(mi?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===o){let a=m(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm.
33
+ `),'"""'+x+'"""'}s(fn,"printBlockString");var u;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(u||(u={}));var $e=class{static{s(this,"Lexer")}constructor(t){let n=new Ie(u.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!==u.EOF)do if(t.next)t=t.next;else{let n=ti(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===u.COMMENT);return t}};function hn(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R}s(hn,"isPunctuatorTokenKind");function we(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}s(we,"isUnicodeScalarValue");function rt(e,t){return yn(e.charCodeAt(t))&&Tn(e.charCodeAt(t+1))}s(rt,"isSupplementaryCodePoint");function yn(e){return e>=55296&&e<=56319}s(yn,"isLeadingSurrogate");function Tn(e){return e>=56320&&e<=57343}s(Tn,"isTrailingSurrogate");function be(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return u.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}s(be,"printCodePointAt");function k(e,t,n,i,r){let o=e.line,a=1+n-e.lineStart;return new Ie(t,n,i,o,a,r)}s(k,"createToken");function ti(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let o=n.charCodeAt(r);switch(o){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return ni(e,r);case 33:return k(e,u.BANG,r,r+1);case 36:return k(e,u.DOLLAR,r,r+1);case 38:return k(e,u.AMP,r,r+1);case 40:return k(e,u.PAREN_L,r,r+1);case 41:return k(e,u.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return k(e,u.SPREAD,r,r+3);break;case 58:return k(e,u.COLON,r,r+1);case 61:return k(e,u.EQUALS,r,r+1);case 64:return k(e,u.AT,r,r+1);case 91:return k(e,u.BRACKET_L,r,r+1);case 93:return k(e,u.BRACKET_R,r,r+1);case 123:return k(e,u.BRACE_L,r,r+1);case 124:return k(e,u.PIPE,r,r+1);case 125:return k(e,u.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?ci(e,r):ri(e,r)}if(De(o)||o===45)return ii(e,r,o);if(Pe(o))return pi(e,r);throw w(e.source,r,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:we(o)||rt(n,r)?`Unexpected character: ${be(e,r)}.`:`Invalid character: ${be(e,r)}.`)}return k(e,u.EOF,i,i)}s(ti,"readNextToken");function ni(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(o===10||o===13)break;if(we(o))++r;else if(rt(n,r))r+=2;else break}return k(e,u.COMMENT,t,r,n.slice(t+1,r))}s(ni,"readComment");function ii(e,t,n){let i=e.source.body,r=t,o=n,a=!1;if(o===45&&(o=i.charCodeAt(++r)),o===48){if(o=i.charCodeAt(++r),De(o))throw w(e.source,r,`Invalid number, unexpected digit after 0: ${be(e,r)}.`)}else r=Vt(e,r,o),o=i.charCodeAt(r);if(o===46&&(a=!0,o=i.charCodeAt(++r),r=Vt(e,r,o),o=i.charCodeAt(r)),(o===69||o===101)&&(a=!0,o=i.charCodeAt(++r),(o===43||o===45)&&(o=i.charCodeAt(++r)),r=Vt(e,r,o),o=i.charCodeAt(r)),o===46||Pe(o))throw w(e.source,r,`Invalid number, expected digit but got: ${be(e,r)}.`);return k(e,a?u.FLOAT:u.INT,t,r,i.slice(t,r))}s(ii,"readNumber");function Vt(e,t,n){if(!De(n))throw w(e.source,t,`Invalid number, expected digit but got: ${be(e,t)}.`);let i=e.source.body,r=t+1;for(;De(i.charCodeAt(r));)++r;return r}s(Vt,"readDigits");function ri(e,t){let n=e.source.body,i=n.length,r=t+1,o=r,a="";for(;r<i;){let p=n.charCodeAt(r);if(p===34)return a+=n.slice(o,r),k(e,u.STRING,t,r+1,a);if(p===92){a+=n.slice(o,r);let d=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?si(e,r):oi(e,r):ai(e,r);a+=d.value,r+=d.size,o=r;continue}if(p===10||p===13)break;if(we(p))++r;else if(rt(n,r))r+=2;else throw w(e.source,r,`Invalid character within String: ${be(e,r)}.`)}throw w(e.source,r,"Unterminated string.")}s(ri,"readString");function si(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let o=n.charCodeAt(t+r++);if(o===125){if(r<5||!we(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|je(o),i<0)break}throw w(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}s(si,"readEscapedUnicodeVariableWidth");function oi(e,t){let n=e.source.body,i=mn(n,t+2);if(we(i))return{value:String.fromCodePoint(i),size:6};if(yn(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=mn(n,t+8);if(Tn(r))return{value:String.fromCodePoint(i,r),size:12}}throw w(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}s(oi,"readEscapedUnicodeFixedWidth");function mn(e,t){return je(e.charCodeAt(t))<<12|je(e.charCodeAt(t+1))<<8|je(e.charCodeAt(t+2))<<4|je(e.charCodeAt(t+3))}s(mn,"read16BitHexCode");function je(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}s(je,"readHexDigit");function ai(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:`
34
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw w(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}s(ai,"readEscapedCharacter");function ci(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,a=o,p="",d=[];for(;o<i;){let f=n.charCodeAt(o);if(f===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){p+=n.slice(a,o),d.push(p);let y=k(e,u.BLOCK_STRING,t,o+3,dn(d).join(`
35
+ `));return e.line+=d.length-1,e.lineStart=r,y}if(f===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){p+=n.slice(a,o),a=o+1,o+=4;continue}if(f===10||f===13){p+=n.slice(a,o),d.push(p),f===13&&n.charCodeAt(o+1)===10?o+=2:++o,p="",a=o,r=o;continue}if(we(f))++o;else if(rt(n,o))o+=2;else throw w(e.source,o,`Invalid character within String: ${be(e,o)}.`)}throw w(e.source,o,"Unterminated string.")}s(ci,"readBlockString");function pi(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(it(o))++r;else break}return k(e,u.NAME,t,r,n.slice(t,r))}s(pi,"readName");function m(e){return st(e,[])}s(m,"inspect");function st(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ui(e,t);default:return String(e)}}s(st,"formatValue");function ui(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(li(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:st(i,n)}else if(Array.isArray(e))return fi(e,n);return di(e,n)}s(ui,"formatObjectValue");function li(e){return typeof e.toJSON=="function"}s(li,"isJSONable");function di(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+mi(e)+"]":"{ "+n.map(([r,o])=>r+": "+st(o,t)).join(", ")+" }"}s(di,"formatObject");function fi(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o<n;++o)r.push(st(e[o],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}s(fi,"formatArray");function mi(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}s(mi,"getObjectTag");var hi=globalThis.process&&!0,K=s(hi?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===o){let a=m(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm.
36
36
 
37
37
  Ensure that there is only one instance of "graphql" in the node_modules
38
38
  directory. If different versions of "graphql" are the dependencies of other
@@ -43,9 +43,9 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
43
43
  Duplicate "graphql" modules cannot be used at the same time since different
44
44
  versions may have different capabilities and behavior. The data from one
45
45
  version used in the function from another could produce confusing and
46
- spurious results.`)}}return!1},"instanceOf");var Re=class{static{s(this,"Source")}constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||_(!1,`Body must be a string. Received: ${m(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||_(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||_(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function xn(e){return K(e,Re)}s(xn,"isSource");function ke(e,t){let n=new at(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}s(ke,"parse");function ct(e,t){let n=new at(e,t);n.expectToken(u.SOF);let i=n.parseValueLiteral(!1);return n.expectToken(u.EOF),i}s(ct,"parseValue");var at=class{static{s(this,"Parser")}constructor(t,n={}){let i=xn(t)?t:new Re(t);this._lexer=new $e(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(u.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===u.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()}if(t)throw w(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:$.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(u.NAME)&&(i=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(u.NAME);switch(t.value){case"query":return $.QUERY;case"mutation":return $.MUTATION;case"subscription":return $.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(u.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:c.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,n,u.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(u.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(u.NAME)?this.node(t,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),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 u.BRACKET_L:return this.parseList(t);case u.BRACE_L:return this.parseObject(t);case u.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case u.DOLLAR:if(t)if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){let i=this._lexer.token.value;throw w(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){let n=s(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:c.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){let n=s(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(u.BRACE_L,n,u.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(u.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(u.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(u.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(u.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(u.COLON);let i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(u.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw w(this._lexer.source,this._lexer.token.start,`${ot(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 i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===u.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()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(b,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Ae(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 w(this._lexer.source,n.start,`Expected ${Nn(t)}, found ${ot(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===u.NAME&&n.value===t)this.advanceLexer();else throw w(this._lexer.source,n.start,`Expected "${t}", found ${ot(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===u.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return w(this._lexer.source,n.start,`Unexpected ${ot(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==u.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw w(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function ot(e){let t=e.value;return Nn(e.kind)+(t!=null?` "${t}"`:"")}s(ot,"getTokenDesc");function Nn(e){return hn(e)?`"${e}"`:e}s(Nn,"getTokenKindDesc");function pt(e,t){let[n,i]=t?[e,t]:[void 0,e],r=" Did you mean ";n&&(r+=n+" ");let o=i.map(d=>`"${d}"`);switch(o.length){case 0:return"";case 1:return r+o[0]+"?";case 2:return r+o[0]+" or "+o[1]+"?"}let a=o.slice(0,5),p=a.pop();return r+a.join(", ")+", or "+p+"?"}s(pt,"didYouMean");function Ut(e){return e}s(Ut,"identityFunc");function Ce(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}s(Ce,"keyMap");function ue(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}s(ue,"keyValMap");function Be(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}s(Be,"mapValue");function gn(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let r=e.charCodeAt(n),o=t.charCodeAt(i);if(ut(r)&&ut(o)){let a=0;do++n,a=a*10+r-Gt,r=e.charCodeAt(n);while(ut(r)&&a>0);let p=0;do++i,p=p*10+o-Gt,o=t.charCodeAt(i);while(ut(o)&&p>0);if(a<p)return-1;if(a>p)return 1}else{if(r<o)return-1;if(r>o)return 1;++n,++i}}return e.length-t.length}s(gn,"naturalCompare");var Gt=48,hi=57;function ut(e){return!isNaN(e)&&Gt<=e&&e<=hi}s(ut,"isDigit");function lt(e,t){let n=Object.create(null),i=new Mt(e),r=Math.floor(e.length*.4)+1;for(let o of t){let a=i.measure(o,r);a!==void 0&&(n[o]=a)}return Object.keys(n).sort((o,a)=>{let p=n[o]-n[a];return p!==0?p:gn(o,a)})}s(lt,"suggestionList");var Mt=class{static{s(this,"LexicalDistance")}constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=En(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 i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=En(i),o=this._inputArray;if(r.length<o.length){let y=r;r=o,o=y}let a=r.length,p=o.length;if(a-p>n)return;let d=this._rows;for(let y=0;y<=p;y++)d[0][y]=y;for(let y=1;y<=a;y++){let x=d[(y-1)%3],N=d[y%3],I=N[0]=y;for(let g=1;g<=p;g++){let C=r[y-1]===o[g-1]?0:1,M=Math.min(x[g]+1,N[g-1]+1,x[g-1]+C);if(y>1&&g>1&&r[y-1]===o[g-2]&&r[y-2]===o[g-1]){let O=d[(y-2)%3][g-2];M=Math.min(M,O+1)}M<I&&(I=M),N[g]=M}if(I>n)return}let f=d[a%3][p];return f<=n?f:void 0}};function En(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}s(En,"stringToArray");function B(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,i]of Object.entries(e))t[n]=i;return t}s(B,"toObjMap");function vn(e){return`"${e.replace(yi,Ti)}"`}s(vn,"printString");var yi=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Ti(e){return xi[e.charCodeAt(0)]}s(Ti,"escapedReplacer");var xi=["\\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"];var Qt=Object.freeze({});function Te(e,t,n=Ft){let i=new Map;for(let O of Object.values(c))i.set(O,Fe(t,O));let r,o=Array.isArray(e),a=[e],p=-1,d=[],f=e,y,x,N=[],I=[];do{p++;let O=p===a.length,H=O&&d.length!==0;if(O){if(y=I.length===0?void 0:N[N.length-1],f=x,x=I.pop(),H)if(o){f=f.slice();let z=0;for(let[me,ie]of d){let et=me-z;ie===null?(f.splice(et,1),z++):f[et]=ie}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(let[z,me]of d)f[z]=me}p=r.index,a=r.keys,d=r.edits,o=r.inArray,r=r.prev}else if(x){if(y=o?p:a[p],f=x[y],f==null)continue;N.push(y)}let Y;if(!Array.isArray(f)){var g,C;Qe(f)||_(!1,`Invalid AST Node: ${m(f)}.`);let z=O?(g=i.get(f.kind))===null||g===void 0?void 0:g.leave:(C=i.get(f.kind))===null||C===void 0?void 0:C.enter;if(Y=z?.call(t,f,y,x,N,I),Y===Qt)break;if(Y===!1){if(!O){N.pop();continue}}else if(Y!==void 0&&(d.push([y,Y]),!O))if(Qe(Y))f=Y;else{N.pop();continue}}if(Y===void 0&&H&&d.push([y,f]),O)N.pop();else{var M;r={inArray:o,index:p,keys:a,edits:d,prev:r},o=Array.isArray(f),a=o?f:(M=n[f.kind])!==null&&M!==void 0?M:[],p=-1,d=[],x&&I.push(x),x=f}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:e}s(Te,"visit");function Fe(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}}s(Fe,"getEnterLeaveForKind");function V(e){return Te(e,gi)}s(V,"print");var Ni=80,gi={Name:{leave:s(e=>e.value,"leave")},Variable:{leave:s(e=>"$"+e.name,"leave")},Document:{leave:s(e=>T(e.definitions,`
46
+ spurious results.`)}}return!1},"instanceOf");var Re=class{static{s(this,"Source")}constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||_(!1,`Body must be a string. Received: ${m(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||_(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||_(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function xn(e){return K(e,Re)}s(xn,"isSource");function ke(e,t){let n=new at(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}s(ke,"parse");function ct(e,t){let n=new at(e,t);n.expectToken(u.SOF);let i=n.parseValueLiteral(!1);return n.expectToken(u.EOF),i}s(ct,"parseValue");var at=class{static{s(this,"Parser")}constructor(t,n={}){let i=xn(t)?t:new Re(t);this._lexer=new $e(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(u.NAME);return this.node(t,{kind:c.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===u.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()}if(t)throw w(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:c.OPERATION_DEFINITION,operation:$.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(u.NAME)&&(i=this.parseName()),this.node(t,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(u.NAME);switch(t.value){case"query":return $.QUERY;case"mutation":return $.MUTATION;case"subscription":return $.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(t,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(u.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:c.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,n,u.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(u.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(u.NAME)?this.node(t,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),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 u.BRACKET_L:return this.parseList(t);case u.BRACE_L:return this.parseObject(t);case u.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case u.DOLLAR:if(t)if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){let i=this._lexer.token.value;throw w(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:c.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){let n=s(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:c.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){let n=s(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(u.BRACE_L,n,u.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(u.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(u.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(u.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(u.BRACKET_R),n=this.node(t,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(t,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(u.COLON);let i=this.parseNamedType();return this.node(t,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(u.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw w(this._lexer.source,this._lexer.token.start,`${ot(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 i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===u.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()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(b,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Ae(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 w(this._lexer.source,n.start,`Expected ${Nn(t)}, found ${ot(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===u.NAME&&n.value===t)this.advanceLexer();else throw w(this._lexer.source,n.start,`Expected "${t}", found ${ot(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===u.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return w(this._lexer.source,n.start,`Unexpected ${ot(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==u.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw w(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function ot(e){let t=e.value;return Nn(e.kind)+(t!=null?` "${t}"`:"")}s(ot,"getTokenDesc");function Nn(e){return hn(e)?`"${e}"`:e}s(Nn,"getTokenKindDesc");function pt(e,t){let[n,i]=t?[e,t]:[void 0,e],r=" Did you mean ";n&&(r+=n+" ");let o=i.map(d=>`"${d}"`);switch(o.length){case 0:return"";case 1:return r+o[0]+"?";case 2:return r+o[0]+" or "+o[1]+"?"}let a=o.slice(0,5),p=a.pop();return r+a.join(", ")+", or "+p+"?"}s(pt,"didYouMean");function Ut(e){return e}s(Ut,"identityFunc");function Ce(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}s(Ce,"keyMap");function ue(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}s(ue,"keyValMap");function Be(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}s(Be,"mapValue");function gn(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let r=e.charCodeAt(n),o=t.charCodeAt(i);if(ut(r)&&ut(o)){let a=0;do++n,a=a*10+r-Gt,r=e.charCodeAt(n);while(ut(r)&&a>0);let p=0;do++i,p=p*10+o-Gt,o=t.charCodeAt(i);while(ut(o)&&p>0);if(a<p)return-1;if(a>p)return 1}else{if(r<o)return-1;if(r>o)return 1;++n,++i}}return e.length-t.length}s(gn,"naturalCompare");var Gt=48,yi=57;function ut(e){return!isNaN(e)&&Gt<=e&&e<=yi}s(ut,"isDigit");function lt(e,t){let n=Object.create(null),i=new Mt(e),r=Math.floor(e.length*.4)+1;for(let o of t){let a=i.measure(o,r);a!==void 0&&(n[o]=a)}return Object.keys(n).sort((o,a)=>{let p=n[o]-n[a];return p!==0?p:gn(o,a)})}s(lt,"suggestionList");var Mt=class{static{s(this,"LexicalDistance")}constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=En(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 i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=En(i),o=this._inputArray;if(r.length<o.length){let y=r;r=o,o=y}let a=r.length,p=o.length;if(a-p>n)return;let d=this._rows;for(let y=0;y<=p;y++)d[0][y]=y;for(let y=1;y<=a;y++){let x=d[(y-1)%3],N=d[y%3],I=N[0]=y;for(let g=1;g<=p;g++){let C=r[y-1]===o[g-1]?0:1,M=Math.min(x[g]+1,N[g-1]+1,x[g-1]+C);if(y>1&&g>1&&r[y-1]===o[g-2]&&r[y-2]===o[g-1]){let O=d[(y-2)%3][g-2];M=Math.min(M,O+1)}M<I&&(I=M),N[g]=M}if(I>n)return}let f=d[a%3][p];return f<=n?f:void 0}};function En(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}s(En,"stringToArray");function B(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,i]of Object.entries(e))t[n]=i;return t}s(B,"toObjMap");function vn(e){return`"${e.replace(Ti,xi)}"`}s(vn,"printString");var Ti=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function xi(e){return Ni[e.charCodeAt(0)]}s(xi,"escapedReplacer");var Ni=["\\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"];var Qt=Object.freeze({});function Te(e,t,n=Ft){let i=new Map;for(let O of Object.values(c))i.set(O,Fe(t,O));let r,o=Array.isArray(e),a=[e],p=-1,d=[],f=e,y,x,N=[],I=[];do{p++;let O=p===a.length,H=O&&d.length!==0;if(O){if(y=I.length===0?void 0:N[N.length-1],f=x,x=I.pop(),H)if(o){f=f.slice();let z=0;for(let[me,ie]of d){let et=me-z;ie===null?(f.splice(et,1),z++):f[et]=ie}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(let[z,me]of d)f[z]=me}p=r.index,a=r.keys,d=r.edits,o=r.inArray,r=r.prev}else if(x){if(y=o?p:a[p],f=x[y],f==null)continue;N.push(y)}let Y;if(!Array.isArray(f)){var g,C;Qe(f)||_(!1,`Invalid AST Node: ${m(f)}.`);let z=O?(g=i.get(f.kind))===null||g===void 0?void 0:g.leave:(C=i.get(f.kind))===null||C===void 0?void 0:C.enter;if(Y=z?.call(t,f,y,x,N,I),Y===Qt)break;if(Y===!1){if(!O){N.pop();continue}}else if(Y!==void 0&&(d.push([y,Y]),!O))if(Qe(Y))f=Y;else{N.pop();continue}}if(Y===void 0&&H&&d.push([y,f]),O)N.pop();else{var M;r={inArray:o,index:p,keys:a,edits:d,prev:r},o=Array.isArray(f),a=o?f:(M=n[f.kind])!==null&&M!==void 0?M:[],p=-1,d=[],x&&I.push(x),x=f}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:e}s(Te,"visit");function Fe(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}}s(Fe,"getEnterLeaveForKind");function V(e){return Te(e,Ei)}s(V,"print");var gi=80,Ei={Name:{leave:s(e=>e.value,"leave")},Variable:{leave:s(e=>"$"+e.name,"leave")},Document:{leave:s(e=>T(e.definitions,`
47
47
 
48
- `),"leave")},OperationDefinition:{leave(e){let t=S("(",T(e.variableDefinitions,", "),")"),n=T([e.operation,T([e.name,t]),T(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:s(({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+S(" = ",n)+S(" ",T(i," ")),"leave")},SelectionSet:{leave:s(({selections:e})=>re(e),"leave")},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=S("",e,": ")+t,a=o+S("(",T(n,", "),")");return a.length>Ni&&(a=o+S(`(
48
+ `),"leave")},OperationDefinition:{leave(e){let t=S("(",T(e.variableDefinitions,", "),")"),n=T([e.operation,T([e.name,t]),T(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:s(({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+S(" = ",n)+S(" ",T(i," ")),"leave")},SelectionSet:{leave:s(({selections:e})=>re(e),"leave")},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=S("",e,": ")+t,a=o+S("(",T(n,", "),")");return a.length>gi&&(a=o+S(`(
49
49
  `,dt(T(n,`
50
50
  `)),`
51
51
  )`)),T([a,T(i," "),r]," ")}},Argument:{leave:s(({name:e,value:t})=>e+": "+t,"leave")},FragmentSpread:{leave:s(({name:e,directives:t})=>"..."+e+S(" ",T(t," ")),"leave")},InlineFragment:{leave:s(({typeCondition:e,directives:t,selectionSet:n})=>T(["...",S("on ",e),T(t," "),n]," "),"leave")},FragmentDefinition:{leave:s(({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${S("(",T(n,", "),")")} on ${t} ${S("",T(i," ")," ")}`+r,"leave")},IntValue:{leave:s(({value:e})=>e,"leave")},FloatValue:{leave:s(({value:e})=>e,"leave")},StringValue:{leave:s(({value:e,block:t})=>t?fn(e):vn(e),"leave")},BooleanValue:{leave:s(({value:e})=>e?"true":"false","leave")},NullValue:{leave:s(()=>"null","leave")},EnumValue:{leave:s(({value:e})=>e,"leave")},ListValue:{leave:s(({values:e})=>"["+T(e,", ")+"]","leave")},ObjectValue:{leave:s(({fields:e})=>"{"+T(e,", ")+"}","leave")},ObjectField:{leave:s(({name:e,value:t})=>e+": "+t,"leave")},Directive:{leave:s(({name:e,arguments:t})=>"@"+e+S("(",T(t,", "),")"),"leave")},NamedType:{leave:s(({name:e})=>e,"leave")},ListType:{leave:s(({type:e})=>"["+e+"]","leave")},NonNullType:{leave:s(({type:e})=>e+"!","leave")},SchemaDefinition:{leave:s(({description:e,directives:t,operationTypes:n})=>S("",e,`
@@ -70,9 +70,9 @@ spurious results.`)}}return!1},"instanceOf");var Re=class{static{s(this,"Source"
70
70
  `)),`
71
71
  }`)}s(re,"block");function S(e,t,n=""){return t!=null&&t!==""?e+t+n:""}s(S,"wrap");function dt(e){return S(" ",e.replace(/\n/g,`
72
72
  `))}s(dt,"indent");function In(e){var t;return(t=e?.some(n=>n.includes(`
73
- `)))!==null&&t!==void 0?t:!1}s(In,"hasMultilineItems");function qe(e,t){switch(e.kind){case c.NULL:return null;case c.INT:return parseInt(e.value,10);case c.FLOAT:return parseFloat(e.value);case c.STRING:case c.ENUM:case c.BOOLEAN:return e.value;case c.LIST:return e.values.map(n=>qe(n,t));case c.OBJECT:return ue(e.fields,n=>n.name.value,n=>qe(n.value,t));case c.VARIABLE:return t?.[e.name.value]}}s(qe,"valueFromASTUntyped");function q(e){if(e!=null||_(!1,"Must provide name."),typeof e=="string"||_(!1,"Expected name to be a string."),e.length===0)throw new h("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!it(e.charCodeAt(t)))throw new h(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Pe(e.charCodeAt(0)))throw new h(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}s(q,"assertName");function Pt(e){if(e==="true"||e==="false"||e==="null")throw new h(`Enum values cannot be named: ${e}`);return q(e)}s(Pt,"assertEnumValueName");function mt(e){return xe(e)||P(e)||U(e)||ee(e)||W(e)||G(e)||J(e)||D(e)}s(mt,"isType");function xe(e){return K(e,X)}s(xe,"isScalarType");function P(e){return K(e,Q)}s(P,"isObjectType");function ht(e){if(!P(e))throw new Error(`Expected ${m(e)} to be a GraphQL Object type.`);return e}s(ht,"assertObjectType");function U(e){return K(e,he)}s(U,"isInterfaceType");function yt(e){if(!U(e))throw new Error(`Expected ${m(e)} to be a GraphQL Interface type.`);return e}s(yt,"assertInterfaceType");function ee(e){return K(e,_e)}s(ee,"isUnionType");function W(e){return K(e,le)}s(W,"isEnumType");function G(e){return K(e,Se)}s(G,"isInputObjectType");function J(e){return K(e,R)}s(J,"isListType");function D(e){return K(e,E)}s(D,"isNonNullType");function Z(e){return xe(e)||W(e)||G(e)||Je(e)&&Z(e.ofType)}s(Z,"isInputType");function ye(e){return xe(e)||P(e)||U(e)||ee(e)||W(e)||Je(e)&&ye(e.ofType)}s(ye,"isOutputType");function Ne(e){return xe(e)||W(e)}s(Ne,"isLeafType");function de(e){return P(e)||U(e)||ee(e)}s(de,"isCompositeType");function ge(e){return U(e)||ee(e)}s(ge,"isAbstractType");var R=class{static{s(this,"GraphQLList")}constructor(t){mt(t)||_(!1,`Expected ${m(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}},E=class{static{s(this,"GraphQLNonNull")}constructor(t){Tt(t)||_(!1,`Expected ${m(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 Je(e){return J(e)||D(e)}s(Je,"isWrappingType");function Tt(e){return mt(e)&&!D(e)}s(Tt,"isNullableType");function xt(e){if(!Tt(e))throw new Error(`Expected ${m(e)} to be a GraphQL nullable type.`);return e}s(xt,"assertNullableType");function Nt(e){if(e)return D(e)?e.ofType:e}s(Nt,"getNullableType");function se(e){if(e){let t=e;for(;Je(t);)t=t.ofType;return t}}s(se,"getNamedType");function gt(e){return typeof e=="function"?e():e}s(gt,"resolveReadonlyArrayThunk");function Et(e){return typeof e=="function"?e():e}s(Et,"resolveObjMapThunk");var X=class{static{s(this,"GraphQLScalarType")}constructor(t){var n,i,r,o;let a=(n=t.parseValue)!==null&&n!==void 0?n:Ut;this.name=q(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:Ut,this.parseValue=a,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:(p,d)=>a(qe(p,d)),this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(o=t.extensionASTNodes)!==null&&o!==void 0?o:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||_(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${m(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||_(!1,`${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"||_(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Q=class{static{s(this,"GraphQLObjectType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>Sn(t),this._interfaces=()=>_n(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||_(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${m(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:On(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function _n(e){var t;let n=gt((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||_(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}s(_n,"defineInterfaces");function Sn(e){let t=Et(e.fields);return Ve(t)||_(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Be(t,(n,i)=>{var r;Ve(n)||_(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||_(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${m(n.resolve)}.`);let o=(r=n.args)!==null&&r!==void 0?r:{};return Ve(o)||_(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:q(i),description:n.description,type:n.type,args:jt(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:B(n.extensions),astNode:n.astNode}})}s(Sn,"defineFieldMap");function jt(e){return Object.entries(e).map(([t,n])=>({name:q(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:B(n.extensions),astNode:n.astNode}))}s(jt,"defineArguments");function Ve(e){return F(e)&&!Array.isArray(e)}s(Ve,"isPlainObj");function On(e){return Be(e,t=>({description:t.description,type:t.type,args:$t(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(On,"fieldsToFieldsConfig");function $t(e){return ue(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s($t,"argsToArgsConfig");var he=class{static{s(this,"GraphQLInterfaceType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Sn.bind(void 0,t),this._interfaces=_n.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||_(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(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:On(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},_e=class{static{s(this,"GraphQLUnionType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=Ei.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||_(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(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 Ei(e){let t=gt(e.types);return Array.isArray(t)||_(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}s(Ei,"defineTypes");var le=class{static{s(this,"GraphQLEnumType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:bn(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=bn(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=Ce(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(i=>[i.value,i])));let n=this._valueLookup.get(t);if(n===void 0)throw new h(`Enum "${this.name}" cannot represent value: ${m(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let i=m(t);throw new h(`Enum "${this.name}" cannot represent non-string value: ${i}.`+ft(this,i))}let n=this.getValue(t);if(n==null)throw new h(`Value "${t}" does not exist in "${this.name}" enum.`+ft(this,t));return n.value}parseLiteral(t,n){if(t.kind!==c.ENUM){let r=V(t);throw new h(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+ft(this,r),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=V(t);throw new h(`Value "${r}" does not exist in "${this.name}" enum.`+ft(this,r),{nodes:t})}return i.value}toConfig(){let t=ue(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 ft(e,t){let n=e.getValues().map(r=>r.name),i=lt(t,n);return pt("the enum value",i)}s(ft,"didYouMeanEnumValue");function bn(e,t){return Ve(t)||_(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(Ve(i)||_(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${m(i)}.`),{name:Pt(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:B(i.extensions),astNode:i.astNode}))}s(bn,"defineEnumValues");var Se=class{static{s(this,"GraphQLInputObjectType")}constructor(t){var n,i;this.name=q(t.name),this.description=t.description,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(i=t.isOneOf)!==null&&i!==void 0?i:!1,this._fields=vi.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=Be(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 vi(e){let t=Et(e.fields);return Ve(t)||_(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Be(t,(n,i)=>(!("resolve"in n)||_(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:q(i),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:B(n.extensions),astNode:n.astNode}))}s(vi,"defineInputFieldMap");var vt=2147483647,It=-2147483648,Bt=new X({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=He(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 h(`Int cannot represent non-integer value: ${m(t)}`);if(n>vt||n<It)throw new h("Int cannot represent non 32-bit signed integer value: "+m(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new h(`Int cannot represent non-integer value: ${m(e)}`);if(e>vt||e<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==c.INT)throw new h(`Int cannot represent non-integer value: ${V(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>vt||t<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),Ln=new X({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=He(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 h(`Float cannot represent non numeric value: ${m(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new h(`Float cannot represent non numeric value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==c.FLOAT&&e.kind!==c.INT)throw new h(`Float cannot represent non numeric value: ${V(e)}`,e);return parseFloat(e.value)}}),A=new X({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=He(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 h(`String cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e!="string")throw new h(`String cannot represent a non string value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==c.STRING)throw new h(`String cannot represent a non string value: ${V(e)}`,{nodes:e});return e.value}}),j=new X({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=He(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new h(`Boolean cannot represent a non boolean value: ${m(t)}`)},parseValue(e){if(typeof e!="boolean")throw new h(`Boolean cannot represent a non boolean value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==c.BOOLEAN)throw new h(`Boolean cannot represent a non boolean value: ${V(e)}`,{nodes:e});return e.value}}),bt=new X({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=He(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new h(`ID cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new h(`ID cannot represent value: ${m(e)}`)},parseLiteral(e){if(e.kind!==c.STRING&&e.kind!==c.INT)throw new h("ID cannot represent a non-string and non-integer value: "+V(e),{nodes:e});return e.value}}),qt=Object.freeze([A,Bt,Ln,j,bt]);function He(e){if(F(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!F(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}s(He,"serializeObject");function Jt(e){return K(e,te)}s(Jt,"isDirective");var te=class{static{s(this,"GraphQLDirective")}constructor(t){var n,i;this.name=q(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=B(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||_(!1,`@${t.name} locations must be an Array.`);let r=(i=t.args)!==null&&i!==void 0?i:{};F(r)&&!Array.isArray(r)||_(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=jt(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:$t(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},An=new te({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[b.FIELD,b.FRAGMENT_SPREAD,b.INLINE_FRAGMENT],args:{if:{type:new E(j),description:"Included when true."}}}),Dn=new te({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[b.FIELD,b.FRAGMENT_SPREAD,b.INLINE_FRAGMENT],args:{if:{type:new E(j),description:"Skipped when true."}}}),wn="No longer supported",Rn=new te({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[b.FIELD_DEFINITION,b.ARGUMENT_DEFINITION,b.INPUT_FIELD_DEFINITION,b.ENUM_VALUE],args:{reason:{type:A,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:wn}}}),kn=new te({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[b.SCALAR],args:{url:{type:new E(A),description:"The URL that specifies the behavior of this scalar."}}}),Cn=new te({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[b.INPUT_OBJECT],args:{}}),Ht=Object.freeze([An,Dn,Rn,kn,Cn]);function _t(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}s(_t,"isIterableObject");function Oe(e,t){if(D(t)){let n=Oe(e,t.ofType);return n?.kind===c.NULL?null:n}if(e===null)return{kind:c.NULL};if(e===void 0)return null;if(J(t)){let n=t.ofType;if(_t(e)){let i=[];for(let r of e){let o=Oe(r,n);o!=null&&i.push(o)}return{kind:c.LIST,values:i}}return Oe(e,n)}if(G(t)){if(!F(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=Oe(e[i.name],i.type);r&&n.push({kind:c.OBJECT_FIELD,name:{kind:c.NAME,value:i.name},value:r})}return{kind:c.OBJECT,fields:n}}if(Ne(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:c.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return Fn.test(i)?{kind:c.INT,value:i}:{kind:c.FLOAT,value:i}}if(typeof n=="string")return W(t)?{kind:c.ENUM,value:n}:t===bt&&Fn.test(n)?{kind:c.INT,value:n}:{kind:c.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${m(n)}.`)}pe(!1,"Unexpected input type: "+m(t))}s(Oe,"astFromValue");var Fn=/^-?(?:0|[1-9][0-9]*)$/;var Ye=new Q({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:s(()=>({description:{type:A,resolve:s(e=>e.description,"resolve")},types:{description:"A list of all types supported by this server.",type:new E(new R(new E(ne))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new E(ne),resolve:s(e=>e.getQueryType(),"resolve")},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:ne,resolve:s(e=>e.getMutationType(),"resolve")},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:ne,resolve:s(e=>e.getSubscriptionType(),"resolve")},directives:{description:"A list of all directives supported by this server.",type:new E(new R(new E(Yt))),resolve:s(e=>e.getDirectives(),"resolve")}}),"fields")}),Yt=new Q({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
73
+ `)))!==null&&t!==void 0?t:!1}s(In,"hasMultilineItems");function qe(e,t){switch(e.kind){case c.NULL:return null;case c.INT:return parseInt(e.value,10);case c.FLOAT:return parseFloat(e.value);case c.STRING:case c.ENUM:case c.BOOLEAN:return e.value;case c.LIST:return e.values.map(n=>qe(n,t));case c.OBJECT:return ue(e.fields,n=>n.name.value,n=>qe(n.value,t));case c.VARIABLE:return t?.[e.name.value]}}s(qe,"valueFromASTUntyped");function q(e){if(e!=null||_(!1,"Must provide name."),typeof e=="string"||_(!1,"Expected name to be a string."),e.length===0)throw new h("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!it(e.charCodeAt(t)))throw new h(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Pe(e.charCodeAt(0)))throw new h(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}s(q,"assertName");function Pt(e){if(e==="true"||e==="false"||e==="null")throw new h(`Enum values cannot be named: ${e}`);return q(e)}s(Pt,"assertEnumValueName");function mt(e){return xe(e)||P(e)||U(e)||ee(e)||W(e)||G(e)||J(e)||D(e)}s(mt,"isType");function xe(e){return K(e,X)}s(xe,"isScalarType");function P(e){return K(e,Q)}s(P,"isObjectType");function ht(e){if(!P(e))throw new Error(`Expected ${m(e)} to be a GraphQL Object type.`);return e}s(ht,"assertObjectType");function U(e){return K(e,he)}s(U,"isInterfaceType");function yt(e){if(!U(e))throw new Error(`Expected ${m(e)} to be a GraphQL Interface type.`);return e}s(yt,"assertInterfaceType");function ee(e){return K(e,_e)}s(ee,"isUnionType");function W(e){return K(e,le)}s(W,"isEnumType");function G(e){return K(e,Se)}s(G,"isInputObjectType");function J(e){return K(e,R)}s(J,"isListType");function D(e){return K(e,E)}s(D,"isNonNullType");function Z(e){return xe(e)||W(e)||G(e)||Je(e)&&Z(e.ofType)}s(Z,"isInputType");function ye(e){return xe(e)||P(e)||U(e)||ee(e)||W(e)||Je(e)&&ye(e.ofType)}s(ye,"isOutputType");function Ne(e){return xe(e)||W(e)}s(Ne,"isLeafType");function de(e){return P(e)||U(e)||ee(e)}s(de,"isCompositeType");function ge(e){return U(e)||ee(e)}s(ge,"isAbstractType");var R=class{static{s(this,"GraphQLList")}constructor(t){mt(t)||_(!1,`Expected ${m(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}},E=class{static{s(this,"GraphQLNonNull")}constructor(t){Tt(t)||_(!1,`Expected ${m(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 Je(e){return J(e)||D(e)}s(Je,"isWrappingType");function Tt(e){return mt(e)&&!D(e)}s(Tt,"isNullableType");function xt(e){if(!Tt(e))throw new Error(`Expected ${m(e)} to be a GraphQL nullable type.`);return e}s(xt,"assertNullableType");function Nt(e){if(e)return D(e)?e.ofType:e}s(Nt,"getNullableType");function se(e){if(e){let t=e;for(;Je(t);)t=t.ofType;return t}}s(se,"getNamedType");function gt(e){return typeof e=="function"?e():e}s(gt,"resolveReadonlyArrayThunk");function Et(e){return typeof e=="function"?e():e}s(Et,"resolveObjMapThunk");var X=class{static{s(this,"GraphQLScalarType")}constructor(t){var n,i,r,o;let a=(n=t.parseValue)!==null&&n!==void 0?n:Ut;this.name=q(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:Ut,this.parseValue=a,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:(p,d)=>a(qe(p,d)),this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(o=t.extensionASTNodes)!==null&&o!==void 0?o:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||_(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${m(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||_(!1,`${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"||_(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Q=class{static{s(this,"GraphQLObjectType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>Sn(t),this._interfaces=()=>_n(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||_(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${m(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:On(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function _n(e){var t;let n=gt((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||_(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}s(_n,"defineInterfaces");function Sn(e){let t=Et(e.fields);return Ve(t)||_(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Be(t,(n,i)=>{var r;Ve(n)||_(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||_(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${m(n.resolve)}.`);let o=(r=n.args)!==null&&r!==void 0?r:{};return Ve(o)||_(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:q(i),description:n.description,type:n.type,args:jt(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:B(n.extensions),astNode:n.astNode}})}s(Sn,"defineFieldMap");function jt(e){return Object.entries(e).map(([t,n])=>({name:q(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:B(n.extensions),astNode:n.astNode}))}s(jt,"defineArguments");function Ve(e){return F(e)&&!Array.isArray(e)}s(Ve,"isPlainObj");function On(e){return Be(e,t=>({description:t.description,type:t.type,args:$t(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(On,"fieldsToFieldsConfig");function $t(e){return ue(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s($t,"argsToArgsConfig");var he=class{static{s(this,"GraphQLInterfaceType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Sn.bind(void 0,t),this._interfaces=_n.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||_(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(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:On(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},_e=class{static{s(this,"GraphQLUnionType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=vi.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||_(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(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 vi(e){let t=gt(e.types);return Array.isArray(t)||_(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}s(vi,"defineTypes");var le=class{static{s(this,"GraphQLEnumType")}constructor(t){var n;this.name=q(t.name),this.description=t.description,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:bn(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=bn(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=Ce(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(i=>[i.value,i])));let n=this._valueLookup.get(t);if(n===void 0)throw new h(`Enum "${this.name}" cannot represent value: ${m(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let i=m(t);throw new h(`Enum "${this.name}" cannot represent non-string value: ${i}.`+ft(this,i))}let n=this.getValue(t);if(n==null)throw new h(`Value "${t}" does not exist in "${this.name}" enum.`+ft(this,t));return n.value}parseLiteral(t,n){if(t.kind!==c.ENUM){let r=V(t);throw new h(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+ft(this,r),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=V(t);throw new h(`Value "${r}" does not exist in "${this.name}" enum.`+ft(this,r),{nodes:t})}return i.value}toConfig(){let t=ue(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 ft(e,t){let n=e.getValues().map(r=>r.name),i=lt(t,n);return pt("the enum value",i)}s(ft,"didYouMeanEnumValue");function bn(e,t){return Ve(t)||_(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(Ve(i)||_(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${m(i)}.`),{name:Pt(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:B(i.extensions),astNode:i.astNode}))}s(bn,"defineEnumValues");var Se=class{static{s(this,"GraphQLInputObjectType")}constructor(t){var n,i;this.name=q(t.name),this.description=t.description,this.extensions=B(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(i=t.isOneOf)!==null&&i!==void 0?i:!1,this._fields=Ii.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=Be(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 Ii(e){let t=Et(e.fields);return Ve(t)||_(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Be(t,(n,i)=>(!("resolve"in n)||_(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:q(i),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:B(n.extensions),astNode:n.astNode}))}s(Ii,"defineInputFieldMap");var vt=2147483647,It=-2147483648,Bt=new X({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=He(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 h(`Int cannot represent non-integer value: ${m(t)}`);if(n>vt||n<It)throw new h("Int cannot represent non 32-bit signed integer value: "+m(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new h(`Int cannot represent non-integer value: ${m(e)}`);if(e>vt||e<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==c.INT)throw new h(`Int cannot represent non-integer value: ${V(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>vt||t<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),Ln=new X({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=He(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 h(`Float cannot represent non numeric value: ${m(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new h(`Float cannot represent non numeric value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==c.FLOAT&&e.kind!==c.INT)throw new h(`Float cannot represent non numeric value: ${V(e)}`,e);return parseFloat(e.value)}}),A=new X({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=He(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 h(`String cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e!="string")throw new h(`String cannot represent a non string value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==c.STRING)throw new h(`String cannot represent a non string value: ${V(e)}`,{nodes:e});return e.value}}),j=new X({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=He(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new h(`Boolean cannot represent a non boolean value: ${m(t)}`)},parseValue(e){if(typeof e!="boolean")throw new h(`Boolean cannot represent a non boolean value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==c.BOOLEAN)throw new h(`Boolean cannot represent a non boolean value: ${V(e)}`,{nodes:e});return e.value}}),bt=new X({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=He(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new h(`ID cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new h(`ID cannot represent value: ${m(e)}`)},parseLiteral(e){if(e.kind!==c.STRING&&e.kind!==c.INT)throw new h("ID cannot represent a non-string and non-integer value: "+V(e),{nodes:e});return e.value}}),qt=Object.freeze([A,Bt,Ln,j,bt]);function He(e){if(F(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!F(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}s(He,"serializeObject");function Jt(e){return K(e,te)}s(Jt,"isDirective");var te=class{static{s(this,"GraphQLDirective")}constructor(t){var n,i;this.name=q(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=B(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||_(!1,`@${t.name} locations must be an Array.`);let r=(i=t.args)!==null&&i!==void 0?i:{};F(r)&&!Array.isArray(r)||_(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=jt(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:$t(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},An=new te({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[b.FIELD,b.FRAGMENT_SPREAD,b.INLINE_FRAGMENT],args:{if:{type:new E(j),description:"Included when true."}}}),Dn=new te({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[b.FIELD,b.FRAGMENT_SPREAD,b.INLINE_FRAGMENT],args:{if:{type:new E(j),description:"Skipped when true."}}}),wn="No longer supported",Rn=new te({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[b.FIELD_DEFINITION,b.ARGUMENT_DEFINITION,b.INPUT_FIELD_DEFINITION,b.ENUM_VALUE],args:{reason:{type:A,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:wn}}}),kn=new te({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[b.SCALAR],args:{url:{type:new E(A),description:"The URL that specifies the behavior of this scalar."}}}),Cn=new te({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[b.INPUT_OBJECT],args:{}}),Ht=Object.freeze([An,Dn,Rn,kn,Cn]);function _t(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}s(_t,"isIterableObject");function Oe(e,t){if(D(t)){let n=Oe(e,t.ofType);return n?.kind===c.NULL?null:n}if(e===null)return{kind:c.NULL};if(e===void 0)return null;if(J(t)){let n=t.ofType;if(_t(e)){let i=[];for(let r of e){let o=Oe(r,n);o!=null&&i.push(o)}return{kind:c.LIST,values:i}}return Oe(e,n)}if(G(t)){if(!F(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=Oe(e[i.name],i.type);r&&n.push({kind:c.OBJECT_FIELD,name:{kind:c.NAME,value:i.name},value:r})}return{kind:c.OBJECT,fields:n}}if(Ne(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:c.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return Fn.test(i)?{kind:c.INT,value:i}:{kind:c.FLOAT,value:i}}if(typeof n=="string")return W(t)?{kind:c.ENUM,value:n}:t===bt&&Fn.test(n)?{kind:c.INT,value:n}:{kind:c.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${m(n)}.`)}pe(!1,"Unexpected input type: "+m(t))}s(Oe,"astFromValue");var Fn=/^-?(?:0|[1-9][0-9]*)$/;var Ye=new Q({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:s(()=>({description:{type:A,resolve:s(e=>e.description,"resolve")},types:{description:"A list of all types supported by this server.",type:new E(new R(new E(ne))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new E(ne),resolve:s(e=>e.getQueryType(),"resolve")},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:ne,resolve:s(e=>e.getMutationType(),"resolve")},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:ne,resolve:s(e=>e.getSubscriptionType(),"resolve")},directives:{description:"A list of all directives supported by this server.",type:new E(new R(new E(Yt))),resolve:s(e=>e.getDirectives(),"resolve")}}),"fields")}),Yt=new Q({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
74
74
 
75
- 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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},isRepeatable:{type:new E(j),resolve:s(e=>e.isRepeatable,"resolve")},locations:{type:new E(new R(new E(zt))),resolve:s(e=>e.locations,"resolve")},args:{type:new E(new R(new E(ze))),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}}),"fields")}),zt=new le({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:b.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:b.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:b.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:b.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:b.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:b.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:b.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:b.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:b.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:b.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:b.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:b.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:b.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:b.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:b.UNION,description:"Location adjacent to a union definition."},ENUM:{value:b.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:b.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:b.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:b.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),ne=new Q({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:s(()=>({kind:{type:new E(Wt),resolve(e){if(xe(e))return L.SCALAR;if(P(e))return L.OBJECT;if(U(e))return L.INTERFACE;if(ee(e))return L.UNION;if(W(e))return L.ENUM;if(G(e))return L.INPUT_OBJECT;if(J(e))return L.LIST;if(D(e))return L.NON_NULL;pe(!1,`Unexpected type: "${m(e)}".`)}},name:{type:A,resolve:s(e=>"name"in e?e.name:void 0,"resolve")},description:{type:A,resolve:s(e=>"description"in e?e.description:void 0,"resolve")},specifiedByURL:{type:A,resolve:s(e=>"specifiedByURL"in e?e.specifiedByURL:void 0,"resolve")},fields:{type:new R(new E(Kt)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(P(e)||U(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new R(new E(ne)),resolve(e){if(P(e)||U(e))return e.getInterfaces()}},possibleTypes:{type:new R(new E(ne)),resolve(e,t,n,{schema:i}){if(ge(e))return i.getPossibleTypes(e)}},enumValues:{type:new R(new E(Xt)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(W(e)){let n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new R(new E(ze)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(G(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:ne,resolve:s(e=>"ofType"in e?e.ofType:void 0,"resolve")},isOneOf:{type:j,resolve:s(e=>{if(G(e))return e.isOneOf},"resolve")}}),"fields")}),Kt=new Q({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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},args:{type:new E(new R(new E(ze))),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new E(ne),resolve:s(e=>e.type,"resolve")},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:A,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),ze=new Q({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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},type:{type:new E(ne),resolve:s(e=>e.type,"resolve")},defaultValue:{type:A,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,i=Oe(n,t);return i?V(i):null}},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:A,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),Xt=new Q({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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:A,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),L;(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"})(L||(L={}));var Wt=new le({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:L.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:L.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:L.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:L.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:L.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:L.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:L.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:L.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),St={name:"__schema",type:new E(Ye),description:"Access the current type schema of this server.",args:[],resolve:s((e,t,n,{schema:i})=>i,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Ot={name:"__type",type:ne,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new E(A),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:s((e,{name:t},n,{schema:i})=>i.getType(t),"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Lt={name:"__typename",type:new E(A),description:"The name of the current Object type at runtime.",args:[],resolve:s((e,t,n,{parentType:i})=>i.name,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Zt=Object.freeze([Ye,Yt,zt,ne,Kt,ze,Xt,Wt]);var Ke=class{static{s(this,"GraphQLSchema")}constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,F(t)||_(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||_(!1,`"types" must be Array if provided but got: ${m(t.types)}.`),!t.directives||Array.isArray(t.directives)||_(!1,`"directives" must be Array if provided but got: ${m(t.directives)}.`),this.description=t.description,this.extensions=B(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=(i=t.directives)!==null&&i!==void 0?i:Ht;let r=new Set(t.types);if(t.types!=null)for(let o of t.types)r.delete(o),oe(o,r);this._queryType!=null&&oe(this._queryType,r),this._mutationType!=null&&oe(this._mutationType,r),this._subscriptionType!=null&&oe(this._subscriptionType,r);for(let o of this._directives)if(Jt(o))for(let a of o.args)oe(a.type,r);oe(Ye,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let o of r){if(o==null)continue;let a=o.name;if(a||_(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[a]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${a}".`);if(this._typeMap[a]=o,U(o)){for(let p of o.getInterfaces())if(U(p)){let d=this._implementationsMap[p.name];d===void 0&&(d=this._implementationsMap[p.name]={objects:[],interfaces:[]}),d.interfaces.push(o)}}else if(P(o)){for(let p of o.getInterfaces())if(U(p)){let d=this._implementationsMap[p.name];d===void 0&&(d=this._implementationsMap[p.name]={objects:[],interfaces:[]}),d.objects.push(o)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case $.QUERY:return this.getQueryType();case $.MUTATION:return this.getMutationType();case $.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return ee(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap[t.name];if(i===void 0){if(i=Object.create(null),ee(t))for(let r of t.getTypes())i[r.name]=!0;else{let r=this.getImplementations(t);for(let o of r.objects)i[o.name]=!0;for(let o of r.interfaces)i[o.name]=!0}this._subTypeMap[t.name]=i}return i[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 oe(e,t){let n=se(e);if(!t.has(n)){if(t.add(n),ee(n))for(let i of n.getTypes())oe(i,t);else if(P(n)||U(n)){for(let i of n.getInterfaces())oe(i,t);for(let i of Object.values(n.getFields())){oe(i.type,t);for(let r of i.args)oe(r.type,t)}}else if(G(n))for(let i of Object.values(n.getFields()))oe(i.type,t)}return t}s(oe,"collectReferencedTypes");function Ee(e,t){switch(t.kind){case c.LIST_TYPE:{let n=Ee(e,t.type);return n&&new R(n)}case c.NON_NULL_TYPE:{let n=Ee(e,t.type);return n&&new E(n)}case c.NAMED_TYPE:return e.getType(t.name.value)}}s(Ee,"typeFromAST");var ve=class{static{s(this,"TypeInfo")}constructor(t,n,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??Ii,n&&(Z(n)&&this._inputTypeStack.push(n),de(n)&&this._parentTypeStack.push(n),ye(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 c.SELECTION_SET:{let r=se(this.getType());this._parentTypeStack.push(de(r)?r:void 0);break}case c.FIELD:{let r=this.getParentType(),o,a;r&&(o=this._getFieldDef(n,r,t),o&&(a=o.type)),this._fieldDefStack.push(o),this._typeStack.push(ye(a)?a:void 0);break}case c.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case c.OPERATION_DEFINITION:{let r=n.getRootType(t.operation);this._typeStack.push(P(r)?r:void 0);break}case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:{let r=t.typeCondition,o=r?Ee(n,r):se(this.getType());this._typeStack.push(ye(o)?o:void 0);break}case c.VARIABLE_DEFINITION:{let r=Ee(n,t.type);this._inputTypeStack.push(Z(r)?r:void 0);break}case c.ARGUMENT:{var i;let r,o,a=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();a&&(r=a.args.find(p=>p.name===t.name.value),r&&(o=r.type)),this._argument=r,this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Z(o)?o:void 0);break}case c.LIST:{let r=Nt(this.getInputType()),o=J(r)?r.ofType:r;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Z(o)?o:void 0);break}case c.OBJECT_FIELD:{let r=se(this.getInputType()),o,a;G(r)&&(a=r.getFields()[t.name.value],a&&(o=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(Z(o)?o:void 0);break}case c.ENUM:{let r=se(this.getInputType()),o;W(r)&&(o=r.getValue(t.value)),this._enumValue=o;break}default:}}leave(t){switch(t.kind){case c.SELECTION_SET:this._parentTypeStack.pop();break;case c.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case c.DIRECTIVE:this._directive=null;break;case c.OPERATION_DEFINITION:case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:this._typeStack.pop();break;case c.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case c.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.LIST:case c.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.ENUM:this._enumValue=null;break;default:}}};function Ii(e,t,n){let i=n.name.value;if(i===St.name&&e.getQueryType()===t)return St;if(i===Ot.name&&e.getQueryType()===t)return Ot;if(i===Lt.name&&de(t))return Lt;if(P(t)||U(t))return t.getFields()[i]}s(Ii,"getFieldDef");function Ue(e,t){return{enter(...n){let i=n[0];e.enter(i);let r=Fe(t,i.kind).enter;if(r){let o=r.apply(t,n);return o!==void 0&&(e.leave(i),Qe(o)&&e.enter(o)),o}},leave(...n){let i=n[0],r=Fe(t,i.kind).leave,o;return r&&(o=r.apply(t,n)),e.leave(i),o}}}s(Ue,"visitWithTypeInfo");function At(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}s(At,"printPathArray");function en(e,t,n){return{prev:e,key:t,typename:n}}s(en,"addPath");function ae(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}s(ae,"pathToArray");function tn(e,t,n=bi){return Xe(e,t,n,void 0)}s(tn,"coerceInputValue");function bi(e,t,n){let i="Invalid value "+m(t);throw e.length>0&&(i+=` at "value${At(e)}"`),n.message=i+": "+n.message,n}s(bi,"defaultOnError");function Xe(e,t,n,i){if(D(t)){if(e!=null)return Xe(e,t.ofType,n,i);n(ae(i),e,new h(`Expected non-nullable type "${m(t)}" not to be null.`));return}if(e==null)return null;if(J(t)){let r=t.ofType;return _t(e)?Array.from(e,(o,a)=>{let p=en(i,a,void 0);return Xe(o,r,n,p)}):[Xe(e,r,n,i)]}if(G(t)){if(!F(e)){n(ae(i),e,new h(`Expected type "${t.name}" to be an object.`));return}let r={},o=t.getFields();for(let a of Object.values(o)){let p=e[a.name];if(p===void 0){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(D(a.type)){let d=m(a.type);n(ae(i),e,new h(`Field "${a.name}" of required type "${d}" was not provided.`))}continue}r[a.name]=Xe(p,a.type,n,en(i,a.name,t.name))}for(let a of Object.keys(e))if(!o[a]){let p=lt(a,Object.keys(t.getFields()));n(ae(i),e,new h(`Field "${a}" is not defined by type "${t.name}".`+pt(p)))}if(t.isOneOf){let a=Object.keys(r);a.length!==1&&n(ae(i),e,new h(`Exactly one key must be specified for OneOf type "${t.name}".`));let p=a[0],d=r[p];d===null&&n(ae(i).concat(p),d,new h(`Field "${p}" must be non-null.`))}return r}if(Ne(t)){let r;try{r=t.parseValue(e)}catch(o){o instanceof h?n(ae(i),e,o):n(ae(i),e,new h(`Expected type "${t.name}". `+o.message,{originalError:o}));return}return r===void 0&&n(ae(i),e,new h(`Expected type "${t.name}".`)),r}pe(!1,"Unexpected input type: "+m(t))}s(Xe,"coerceInputValueImpl");function fe(e,t,n){if(e){if(e.kind===c.VARIABLE){let i=e.name.value;if(n==null||n[i]===void 0)return;let r=n[i];return r===null&&D(t)?void 0:r}if(D(t))return e.kind===c.NULL?void 0:fe(e,t.ofType,n);if(e.kind===c.NULL)return null;if(J(t)){let i=t.ofType;if(e.kind===c.LIST){let o=[];for(let a of e.values)if(Vn(a,n)){if(D(i))return;o.push(null)}else{let p=fe(a,i,n);if(p===void 0)return;o.push(p)}return o}let r=fe(e,i,n);return r===void 0?void 0:[r]}if(G(t)){if(e.kind!==c.OBJECT)return;let i=Object.create(null),r=Ce(e.fields,o=>o.name.value);for(let o of Object.values(t.getFields())){let a=r[o.name];if(!a||Vn(a.value,n)){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(D(o.type))return;continue}let p=fe(a.value,o.type,n);if(p===void 0)return;i[o.name]=p}if(t.isOneOf){let o=Object.keys(i);if(o.length!==1||i[o[0]]===null)return}return i}if(Ne(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}pe(!1,"Unexpected input type: "+m(t))}}s(fe,"valueFromAST");function Vn(e,t){return e.kind===c.VARIABLE&&(t==null||t[e.name.value]===void 0)}s(Vn,"isMissingVariable");function Dt(e,t,n,i){let r=[],o=i?.maxErrors;try{let a=_i(e,t,n,p=>{if(o!=null&&r.length>=o)throw new h("Too many errors processing variables, error limit reached. Execution aborted.");r.push(p)});if(r.length===0)return{coerced:a}}catch(a){r.push(a)}return{errors:r}}s(Dt,"getVariableValues");function _i(e,t,n,i){let r={};for(let o of t){let a=o.variable.name.value,p=Ee(e,o.type);if(!Z(p)){let f=V(o.type);i(new h(`Variable "$${a}" expected value of type "${f}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!Un(n,a)){if(o.defaultValue)r[a]=fe(o.defaultValue,p);else if(D(p)){let f=m(p);i(new h(`Variable "$${a}" of required type "${f}" was not provided.`,{nodes:o}))}continue}let d=n[a];if(d===null&&D(p)){let f=m(p);i(new h(`Variable "$${a}" of non-null type "${f}" must not be null.`,{nodes:o}));continue}r[a]=tn(d,p,(f,y,x)=>{let N=`Variable "$${a}" got invalid value `+m(y);f.length>0&&(N+=` at "${a}${At(f)}"`),i(new h(N+"; "+x.message,{nodes:o,originalError:x}))})}return r}s(_i,"coerceVariableValues");function We(e,t,n){var i;let r={},o=(i=t.arguments)!==null&&i!==void 0?i:[],a=Ce(o,p=>p.name.value);for(let p of e.args){let d=p.name,f=p.type,y=a[d];if(!y){if(p.defaultValue!==void 0)r[d]=p.defaultValue;else if(D(f))throw new h(`Argument "${d}" of required type "${m(f)}" was not provided.`,{nodes:t});continue}let x=y.value,N=x.kind===c.NULL;if(x.kind===c.VARIABLE){let g=x.name.value;if(n==null||!Un(n,g)){if(p.defaultValue!==void 0)r[d]=p.defaultValue;else if(D(f))throw new h(`Argument "${d}" of required type "${m(f)}" was provided the variable "$${g}" which was not provided a runtime value.`,{nodes:x});continue}N=n[g]==null}if(N&&D(f))throw new h(`Argument "${d}" of non-null type "${m(f)}" must not be null.`,{nodes:x});let I=fe(x,f,n);if(I===void 0)throw new h(`Argument "${d}" has invalid value ${V(x)}.`,{nodes:x});r[d]=I}return r}s(We,"getArgumentValues");function Ze(e,t,n){var i;let r=(i=t.directives)===null||i===void 0?void 0:i.find(o=>o.name.value===e.name);if(r)return We(e,r,n)}s(Ze,"getDirectiveValues");function Un(e,t){return Object.prototype.hasOwnProperty.call(e,t)}s(Un,"hasOwnProperty");var nn=class{static{s(this,"ASTValidationContext")}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 i of this.getDocument().definitions)i.kind===c.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===c.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=Object.create(null),r=[t.selectionSet],o;for(;o=r.pop();)for(let a of this.getFragmentSpreads(o)){let p=a.name.value;if(i[p]!==!0){i[p]=!0;let d=this.getFragment(p);d&&(n.push(d),r.push(d.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};var Ge=class extends nn{static{s(this,"ValidationContext")}constructor(t,n,i,r){super(n,r),this._schema=t,this._typeInfo=i,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 i=[],r=new ve(this._schema);Te(t,Ue(r,{VariableDefinition:s(()=>!1,"VariableDefinition"),Variable(o){i.push({node:o,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),n=i,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let i of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(i));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()}};function wt(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",r=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(d){return t.inputValueDeprecation?d:""}s(a,"inputDeprecation");let p=t.oneOf?"isOneOf":"";return`
75
+ 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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},isRepeatable:{type:new E(j),resolve:s(e=>e.isRepeatable,"resolve")},locations:{type:new E(new R(new E(zt))),resolve:s(e=>e.locations,"resolve")},args:{type:new E(new R(new E(ze))),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}}),"fields")}),zt=new le({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:b.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:b.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:b.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:b.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:b.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:b.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:b.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:b.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:b.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:b.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:b.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:b.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:b.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:b.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:b.UNION,description:"Location adjacent to a union definition."},ENUM:{value:b.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:b.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:b.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:b.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),ne=new Q({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:s(()=>({kind:{type:new E(Wt),resolve(e){if(xe(e))return L.SCALAR;if(P(e))return L.OBJECT;if(U(e))return L.INTERFACE;if(ee(e))return L.UNION;if(W(e))return L.ENUM;if(G(e))return L.INPUT_OBJECT;if(J(e))return L.LIST;if(D(e))return L.NON_NULL;pe(!1,`Unexpected type: "${m(e)}".`)}},name:{type:A,resolve:s(e=>"name"in e?e.name:void 0,"resolve")},description:{type:A,resolve:s(e=>"description"in e?e.description:void 0,"resolve")},specifiedByURL:{type:A,resolve:s(e=>"specifiedByURL"in e?e.specifiedByURL:void 0,"resolve")},fields:{type:new R(new E(Kt)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(P(e)||U(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new R(new E(ne)),resolve(e){if(P(e)||U(e))return e.getInterfaces()}},possibleTypes:{type:new R(new E(ne)),resolve(e,t,n,{schema:i}){if(ge(e))return i.getPossibleTypes(e)}},enumValues:{type:new R(new E(Xt)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(W(e)){let n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new R(new E(ze)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(G(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:ne,resolve:s(e=>"ofType"in e?e.ofType:void 0,"resolve")},isOneOf:{type:j,resolve:s(e=>{if(G(e))return e.isOneOf},"resolve")}}),"fields")}),Kt=new Q({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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},args:{type:new E(new R(new E(ze))),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new E(ne),resolve:s(e=>e.type,"resolve")},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:A,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),ze=new Q({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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},type:{type:new E(ne),resolve:s(e=>e.type,"resolve")},defaultValue:{type:A,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,i=Oe(n,t);return i?V(i):null}},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:A,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),Xt=new Q({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:s(()=>({name:{type:new E(A),resolve:s(e=>e.name,"resolve")},description:{type:A,resolve:s(e=>e.description,"resolve")},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:A,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),L;(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"})(L||(L={}));var Wt=new le({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:L.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:L.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:L.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:L.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:L.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:L.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:L.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:L.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),St={name:"__schema",type:new E(Ye),description:"Access the current type schema of this server.",args:[],resolve:s((e,t,n,{schema:i})=>i,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Ot={name:"__type",type:ne,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new E(A),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:s((e,{name:t},n,{schema:i})=>i.getType(t),"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Lt={name:"__typename",type:new E(A),description:"The name of the current Object type at runtime.",args:[],resolve:s((e,t,n,{parentType:i})=>i.name,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Zt=Object.freeze([Ye,Yt,zt,ne,Kt,ze,Xt,Wt]);var Ke=class{static{s(this,"GraphQLSchema")}constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,F(t)||_(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||_(!1,`"types" must be Array if provided but got: ${m(t.types)}.`),!t.directives||Array.isArray(t.directives)||_(!1,`"directives" must be Array if provided but got: ${m(t.directives)}.`),this.description=t.description,this.extensions=B(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=(i=t.directives)!==null&&i!==void 0?i:Ht;let r=new Set(t.types);if(t.types!=null)for(let o of t.types)r.delete(o),oe(o,r);this._queryType!=null&&oe(this._queryType,r),this._mutationType!=null&&oe(this._mutationType,r),this._subscriptionType!=null&&oe(this._subscriptionType,r);for(let o of this._directives)if(Jt(o))for(let a of o.args)oe(a.type,r);oe(Ye,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let o of r){if(o==null)continue;let a=o.name;if(a||_(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[a]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${a}".`);if(this._typeMap[a]=o,U(o)){for(let p of o.getInterfaces())if(U(p)){let d=this._implementationsMap[p.name];d===void 0&&(d=this._implementationsMap[p.name]={objects:[],interfaces:[]}),d.interfaces.push(o)}}else if(P(o)){for(let p of o.getInterfaces())if(U(p)){let d=this._implementationsMap[p.name];d===void 0&&(d=this._implementationsMap[p.name]={objects:[],interfaces:[]}),d.objects.push(o)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case $.QUERY:return this.getQueryType();case $.MUTATION:return this.getMutationType();case $.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return ee(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap[t.name];if(i===void 0){if(i=Object.create(null),ee(t))for(let r of t.getTypes())i[r.name]=!0;else{let r=this.getImplementations(t);for(let o of r.objects)i[o.name]=!0;for(let o of r.interfaces)i[o.name]=!0}this._subTypeMap[t.name]=i}return i[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 oe(e,t){let n=se(e);if(!t.has(n)){if(t.add(n),ee(n))for(let i of n.getTypes())oe(i,t);else if(P(n)||U(n)){for(let i of n.getInterfaces())oe(i,t);for(let i of Object.values(n.getFields())){oe(i.type,t);for(let r of i.args)oe(r.type,t)}}else if(G(n))for(let i of Object.values(n.getFields()))oe(i.type,t)}return t}s(oe,"collectReferencedTypes");function Ee(e,t){switch(t.kind){case c.LIST_TYPE:{let n=Ee(e,t.type);return n&&new R(n)}case c.NON_NULL_TYPE:{let n=Ee(e,t.type);return n&&new E(n)}case c.NAMED_TYPE:return e.getType(t.name.value)}}s(Ee,"typeFromAST");var ve=class{static{s(this,"TypeInfo")}constructor(t,n,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??bi,n&&(Z(n)&&this._inputTypeStack.push(n),de(n)&&this._parentTypeStack.push(n),ye(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 c.SELECTION_SET:{let r=se(this.getType());this._parentTypeStack.push(de(r)?r:void 0);break}case c.FIELD:{let r=this.getParentType(),o,a;r&&(o=this._getFieldDef(n,r,t),o&&(a=o.type)),this._fieldDefStack.push(o),this._typeStack.push(ye(a)?a:void 0);break}case c.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case c.OPERATION_DEFINITION:{let r=n.getRootType(t.operation);this._typeStack.push(P(r)?r:void 0);break}case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:{let r=t.typeCondition,o=r?Ee(n,r):se(this.getType());this._typeStack.push(ye(o)?o:void 0);break}case c.VARIABLE_DEFINITION:{let r=Ee(n,t.type);this._inputTypeStack.push(Z(r)?r:void 0);break}case c.ARGUMENT:{var i;let r,o,a=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();a&&(r=a.args.find(p=>p.name===t.name.value),r&&(o=r.type)),this._argument=r,this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Z(o)?o:void 0);break}case c.LIST:{let r=Nt(this.getInputType()),o=J(r)?r.ofType:r;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Z(o)?o:void 0);break}case c.OBJECT_FIELD:{let r=se(this.getInputType()),o,a;G(r)&&(a=r.getFields()[t.name.value],a&&(o=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(Z(o)?o:void 0);break}case c.ENUM:{let r=se(this.getInputType()),o;W(r)&&(o=r.getValue(t.value)),this._enumValue=o;break}default:}}leave(t){switch(t.kind){case c.SELECTION_SET:this._parentTypeStack.pop();break;case c.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case c.DIRECTIVE:this._directive=null;break;case c.OPERATION_DEFINITION:case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:this._typeStack.pop();break;case c.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case c.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.LIST:case c.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.ENUM:this._enumValue=null;break;default:}}};function bi(e,t,n){let i=n.name.value;if(i===St.name&&e.getQueryType()===t)return St;if(i===Ot.name&&e.getQueryType()===t)return Ot;if(i===Lt.name&&de(t))return Lt;if(P(t)||U(t))return t.getFields()[i]}s(bi,"getFieldDef");function Ue(e,t){return{enter(...n){let i=n[0];e.enter(i);let r=Fe(t,i.kind).enter;if(r){let o=r.apply(t,n);return o!==void 0&&(e.leave(i),Qe(o)&&e.enter(o)),o}},leave(...n){let i=n[0],r=Fe(t,i.kind).leave,o;return r&&(o=r.apply(t,n)),e.leave(i),o}}}s(Ue,"visitWithTypeInfo");function At(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}s(At,"printPathArray");function en(e,t,n){return{prev:e,key:t,typename:n}}s(en,"addPath");function ae(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}s(ae,"pathToArray");function tn(e,t,n=_i){return Xe(e,t,n,void 0)}s(tn,"coerceInputValue");function _i(e,t,n){let i="Invalid value "+m(t);throw e.length>0&&(i+=` at "value${At(e)}"`),n.message=i+": "+n.message,n}s(_i,"defaultOnError");function Xe(e,t,n,i){if(D(t)){if(e!=null)return Xe(e,t.ofType,n,i);n(ae(i),e,new h(`Expected non-nullable type "${m(t)}" not to be null.`));return}if(e==null)return null;if(J(t)){let r=t.ofType;return _t(e)?Array.from(e,(o,a)=>{let p=en(i,a,void 0);return Xe(o,r,n,p)}):[Xe(e,r,n,i)]}if(G(t)){if(!F(e)){n(ae(i),e,new h(`Expected type "${t.name}" to be an object.`));return}let r={},o=t.getFields();for(let a of Object.values(o)){let p=e[a.name];if(p===void 0){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(D(a.type)){let d=m(a.type);n(ae(i),e,new h(`Field "${a.name}" of required type "${d}" was not provided.`))}continue}r[a.name]=Xe(p,a.type,n,en(i,a.name,t.name))}for(let a of Object.keys(e))if(!o[a]){let p=lt(a,Object.keys(t.getFields()));n(ae(i),e,new h(`Field "${a}" is not defined by type "${t.name}".`+pt(p)))}if(t.isOneOf){let a=Object.keys(r);a.length!==1&&n(ae(i),e,new h(`Exactly one key must be specified for OneOf type "${t.name}".`));let p=a[0],d=r[p];d===null&&n(ae(i).concat(p),d,new h(`Field "${p}" must be non-null.`))}return r}if(Ne(t)){let r;try{r=t.parseValue(e)}catch(o){o instanceof h?n(ae(i),e,o):n(ae(i),e,new h(`Expected type "${t.name}". `+o.message,{originalError:o}));return}return r===void 0&&n(ae(i),e,new h(`Expected type "${t.name}".`)),r}pe(!1,"Unexpected input type: "+m(t))}s(Xe,"coerceInputValueImpl");function fe(e,t,n){if(e){if(e.kind===c.VARIABLE){let i=e.name.value;if(n==null||n[i]===void 0)return;let r=n[i];return r===null&&D(t)?void 0:r}if(D(t))return e.kind===c.NULL?void 0:fe(e,t.ofType,n);if(e.kind===c.NULL)return null;if(J(t)){let i=t.ofType;if(e.kind===c.LIST){let o=[];for(let a of e.values)if(Vn(a,n)){if(D(i))return;o.push(null)}else{let p=fe(a,i,n);if(p===void 0)return;o.push(p)}return o}let r=fe(e,i,n);return r===void 0?void 0:[r]}if(G(t)){if(e.kind!==c.OBJECT)return;let i=Object.create(null),r=Ce(e.fields,o=>o.name.value);for(let o of Object.values(t.getFields())){let a=r[o.name];if(!a||Vn(a.value,n)){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(D(o.type))return;continue}let p=fe(a.value,o.type,n);if(p===void 0)return;i[o.name]=p}if(t.isOneOf){let o=Object.keys(i);if(o.length!==1||i[o[0]]===null)return}return i}if(Ne(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}pe(!1,"Unexpected input type: "+m(t))}}s(fe,"valueFromAST");function Vn(e,t){return e.kind===c.VARIABLE&&(t==null||t[e.name.value]===void 0)}s(Vn,"isMissingVariable");function Dt(e,t,n,i){let r=[],o=i?.maxErrors;try{let a=Si(e,t,n,p=>{if(o!=null&&r.length>=o)throw new h("Too many errors processing variables, error limit reached. Execution aborted.");r.push(p)});if(r.length===0)return{coerced:a}}catch(a){r.push(a)}return{errors:r}}s(Dt,"getVariableValues");function Si(e,t,n,i){let r={};for(let o of t){let a=o.variable.name.value,p=Ee(e,o.type);if(!Z(p)){let f=V(o.type);i(new h(`Variable "$${a}" expected value of type "${f}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!Un(n,a)){if(o.defaultValue)r[a]=fe(o.defaultValue,p);else if(D(p)){let f=m(p);i(new h(`Variable "$${a}" of required type "${f}" was not provided.`,{nodes:o}))}continue}let d=n[a];if(d===null&&D(p)){let f=m(p);i(new h(`Variable "$${a}" of non-null type "${f}" must not be null.`,{nodes:o}));continue}r[a]=tn(d,p,(f,y,x)=>{let N=`Variable "$${a}" got invalid value `+m(y);f.length>0&&(N+=` at "${a}${At(f)}"`),i(new h(N+"; "+x.message,{nodes:o,originalError:x}))})}return r}s(Si,"coerceVariableValues");function We(e,t,n){var i;let r={},o=(i=t.arguments)!==null&&i!==void 0?i:[],a=Ce(o,p=>p.name.value);for(let p of e.args){let d=p.name,f=p.type,y=a[d];if(!y){if(p.defaultValue!==void 0)r[d]=p.defaultValue;else if(D(f))throw new h(`Argument "${d}" of required type "${m(f)}" was not provided.`,{nodes:t});continue}let x=y.value,N=x.kind===c.NULL;if(x.kind===c.VARIABLE){let g=x.name.value;if(n==null||!Un(n,g)){if(p.defaultValue!==void 0)r[d]=p.defaultValue;else if(D(f))throw new h(`Argument "${d}" of required type "${m(f)}" was provided the variable "$${g}" which was not provided a runtime value.`,{nodes:x});continue}N=n[g]==null}if(N&&D(f))throw new h(`Argument "${d}" of non-null type "${m(f)}" must not be null.`,{nodes:x});let I=fe(x,f,n);if(I===void 0)throw new h(`Argument "${d}" has invalid value ${V(x)}.`,{nodes:x});r[d]=I}return r}s(We,"getArgumentValues");function Ze(e,t,n){var i;let r=(i=t.directives)===null||i===void 0?void 0:i.find(o=>o.name.value===e.name);if(r)return We(e,r,n)}s(Ze,"getDirectiveValues");function Un(e,t){return Object.prototype.hasOwnProperty.call(e,t)}s(Un,"hasOwnProperty");var nn=class{static{s(this,"ASTValidationContext")}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 i of this.getDocument().definitions)i.kind===c.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===c.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=Object.create(null),r=[t.selectionSet],o;for(;o=r.pop();)for(let a of this.getFragmentSpreads(o)){let p=a.name.value;if(i[p]!==!0){i[p]=!0;let d=this.getFragment(p);d&&(n.push(d),r.push(d.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};var Ge=class extends nn{static{s(this,"ValidationContext")}constructor(t,n,i,r){super(n,r),this._schema=t,this._typeInfo=i,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 i=[],r=new ve(this._schema);Te(t,Ue(r,{VariableDefinition:s(()=>!1,"VariableDefinition"),Variable(o){i.push({node:o,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),n=i,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let i of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(i));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()}};function wt(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",r=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(d){return t.inputValueDeprecation?d:""}s(a,"inputDeprecation");let p=t.oneOf?"isOneOf":"";return`
76
76
  query IntrospectionQuery {
77
77
  __schema {
78
78
  ${o}
@@ -178,5 +178,5 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
178
178
  }
179
179
  }
180
180
  }
181
- `}s(wt,"getIntrospectionQuery");function Rt(e,t){F(e)&&F(e.__schema)||_(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${m(e)}.`);let n=e.__schema,i=ue(n.types,l=>l.name,l=>N(l));for(let l of[...qt,...Zt])i[l.name]&&(i[l.name]=l);let r=n.queryType?y(n.queryType):null,o=n.mutationType?y(n.mutationType):null,a=n.subscriptionType?y(n.subscriptionType):null,p=n.directives?n.directives.map(Hn):[];return new Ke({description:n.description,query:r,mutation:o,subscription:a,types:Object.values(i),directives:p,assumeValid:t?.assumeValid});function d(l){if(l.kind===L.LIST){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");return new R(d(v))}if(l.kind===L.NON_NULL){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");let ce=d(v);return new E(xt(ce))}return f(l)}function f(l){let v=l.name;if(!v)throw new Error(`Unknown type reference: ${m(l)}.`);let ce=i[v];if(!ce)throw new Error(`Invalid or incomplete schema, unknown type: ${v}. Ensure that a full introspection query is used in order to build a client schema.`);return ce}function y(l){return ht(f(l))}function x(l){return yt(f(l))}function N(l){if(l!=null&&l.name!=null&&l.kind!=null)switch(l.kind){case L.SCALAR:return I(l);case L.OBJECT:return C(l);case L.INTERFACE:return M(l);case L.UNION:return O(l);case L.ENUM:return H(l);case L.INPUT_OBJECT:return Y(l)}let v=m(l);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${v}.`)}function I(l){return new X({name:l.name,description:l.description,specifiedByURL:l.specifiedByURL})}function g(l){if(l.interfaces===null&&l.kind===L.INTERFACE)return[];if(!l.interfaces){let v=m(l);throw new Error(`Introspection result missing interfaces: ${v}.`)}return l.interfaces.map(x)}function C(l){return new Q({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>z(l),"fields")})}function M(l){return new he({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>z(l),"fields")})}function O(l){if(!l.possibleTypes){let v=m(l);throw new Error(`Introspection result missing possibleTypes: ${v}.`)}return new _e({name:l.name,description:l.description,types:s(()=>l.possibleTypes.map(y),"types")})}function H(l){if(!l.enumValues){let v=m(l);throw new Error(`Introspection result missing enumValues: ${v}.`)}return new le({name:l.name,description:l.description,values:ue(l.enumValues,v=>v.name,v=>({description:v.description,deprecationReason:v.deprecationReason}))})}function Y(l){if(!l.inputFields){let v=m(l);throw new Error(`Introspection result missing inputFields: ${v}.`)}return new Se({name:l.name,description:l.description,fields:s(()=>ie(l.inputFields),"fields"),isOneOf:l.isOneOf})}function z(l){if(!l.fields)throw new Error(`Introspection result missing fields: ${m(l)}.`);return ue(l.fields,v=>v.name,me)}function me(l){let v=d(l.type);if(!ye(v)){let ce=m(v);throw new Error(`Introspection must provide output type for fields, but received: ${ce}.`)}if(!l.args){let ce=m(l);throw new Error(`Introspection result missing field args: ${ce}.`)}return{description:l.description,deprecationReason:l.deprecationReason,type:v,args:ie(l.args)}}function ie(l){return ue(l,v=>v.name,et)}function et(l){let v=d(l.type);if(!Z(v)){let Yn=m(v);throw new Error(`Introspection must provide input type for arguments, but received: ${Yn}.`)}let ce=l.defaultValue!=null?fe(ct(l.defaultValue),v):void 0;return{description:l.description,type:v,defaultValue:ce,deprecationReason:l.deprecationReason}}function Hn(l){if(!l.args){let v=m(l);throw new Error(`Introspection result missing directive args: ${v}.`)}if(!l.locations){let v=m(l);throw new Error(`Introspection result missing directive locations: ${v}.`)}return new te({name:l.name,description:l.description,isRepeatable:l.isRepeatable,locations:l.locations.slice(),args:ie(l.args)})}}s(Rt,"buildClientSchema");function Gn(e){let t;try{t=JSON.parse(e)}catch{return}if(t===null||typeof t!="object"||Array.isArray(t))return;let{query:n,variables:i,operationName:r}=t;if(!(typeof n!="string"||n.length===0))return{query:n,variables:i,operationName:typeof r=="string"?r:void 0}}s(Gn,"parseGraphQLRequestBody");function rn(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(rn):Object.fromEntries(Object.keys(e).sort().map(t=>[t,rn(e[t])]))}s(rn,"canonicalize");function Mn(e,t){let n;try{n=ke(e)}catch{return}let i=n.definitions.filter(o=>o.kind===c.OPERATION_DEFINITION),r;if(t){if(r=i.find(o=>o.name?.value===t),!r)return}else if(i.length===1)r=i[0];else return;return{query:V(n),isQueryOperation:r.operation===$.QUERY}}s(Mn,"normalizeGraphQLQuery");async function Qn(e,t,n,i){let r=[e,JSON.stringify(rn(t)??null),n??"",JSON.stringify(i??[])].join("\0"),o=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(r));return Array.from(new Uint8Array(o)).map(a=>a.toString(16).padStart(2,"0")).join("")}s(Qn,"buildCacheKey");var zi=["authorization","cookie"];function Pn(e,t){if(t!==void 0&&t.length===0)return{skip:!1,varyValues:[]};let n=new Set((t??[]).map(r=>r.toLowerCase()));for(let r of zi)if(e.has(r)&&!n.has(r))return{skip:!0,varyValues:[]};let i=[];for(let r of[...n].sort()){let o=e.get(r);o!==null&&i.push([r,o])}return{skip:!1,varyValues:i}}s(Pn,"resolveVary");var Ki=new Set(["set-cookie","set-cookie2","clear-site-data"]);function jn(e){let t={};return e.forEach((n,i)=>{Ki.has(i.toLowerCase())||(t[i]=n)}),t}s(jn,"toCacheableHeaders");var Zi="graphql-responses",er=60,sn="x-cache",on="x-cache-key";function $n(e,t,n){e.set(sn,t),e.set(on,n);let i=e.get("access-control-expose-headers");if(!i||i.trim()==="*"){i||e.set("access-control-expose-headers",`${sn}, ${on}`);return}let r=new Set(i.split(",").map(a=>a.trim().toLowerCase())),o=[sn,on].filter(a=>!r.has(a));o.length>0&&e.set("access-control-expose-headers",[i,...o].join(", "))}s($n,"tagCacheHeaders");var tr=s(async(e,t,n,i)=>{let r=n?.cacheName??Zi,o=n?.ttlSeconds??er,a=Pn(e.headers,n?.cacheKeyHeaders);if(a.skip)return e;let p=await e.clone().text(),d=Gn(p);if(!d)return e;let{query:f,variables:y,operationName:x}=d,N=Mn(f,x);if(!N||!N.isQueryOperation)return e;let I=await Qn(N.query,y,x,a.varyValues),g=I.slice(0,8),C=new Wi(r,t),M=await C.get(I);if(M){let O=new Headers(M.headers);return O.delete("content-length"),$n(O,"HIT",g),t.log.info({cacheKey:g},`GraphQLCacheInboundPolicy '${i}' - cache HIT`),new Response(M.body,{status:M.status,headers:O})}return t.addResponseSendingHook(async O=>{if(O.status!==200)return O;let H=await O.text(),Y=Xi(H);if(Y===null||Y.length>0){let ie=new Headers(O.headers);return ie.delete("content-length"),new Response(H,{status:O.status,statusText:O.statusText,headers:ie})}let z=jn(O.headers);t.waitUntil(C.put(I,{status:O.status,headers:z,body:H},o).catch(ie=>t.log.error(ie,`GraphQLCacheInboundPolicy '${i}' - failed to write cache entry`)));let me=new Headers(O.headers);return me.delete("content-length"),$n(me,"MISS",g),t.log.info({cacheKey:g},`GraphQLCacheInboundPolicy '${i}' - cache MISS`),new Response(H,{status:O.status,statusText:O.statusText,headers:me})}),e},"GraphQLCacheInboundPolicy");import{ConfigurationError as cn}from"@zuplo/runtime";function nr(e,t){return`The query exceeds the maximum complexity of ${e}. Actual complexity is ${t}`}s(nr,"queryComplexityMessage");function Bn(e){let t=new ve(e.schema),n=[],i=new Ge(e.schema,e.query,t,o=>n.push(o)),r=new an(i,{maximumComplexity:e.maximumComplexity??1/0,estimators:e.estimators,variables:e.variables,operationName:e.operationName,context:e.context});if(Te(e.query,Ue(t,r)),n.length)throw n.pop();return r.complexity}s(Bn,"getComplexity");var an=class{static{s(this,"QueryComplexity")}context;complexity;options;OperationDefinition;estimators;includeDirectiveDef;skipDirectiveDef;variableValues;requestContext;constructor(t,n){if(Number(n.maximumComplexity)<=0)throw new Error("Maximum query complexity must be a positive number");this.context=t,this.complexity=0,this.options=n,this.includeDirectiveDef=this.context.getSchema().getDirective("include")||void 0,this.skipDirectiveDef=this.context.getSchema().getDirective("skip")||void 0,this.estimators=n.estimators,this.variableValues={},this.requestContext=n.context,this.OperationDefinition={enter:this.onOperationDefinitionEnter,leave:this.onOperationDefinitionLeave}}onOperationDefinitionEnter(t){if(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)return;let{coerced:n,errors:i}=Dt(this.context.getSchema(),t.variableDefinitions?[...t.variableDefinitions]:[],this.options.variables??{});if(i?.length){i.forEach(o=>this.context.reportError(o));return}this.variableValues=n||{};let r=this.context.getSchema();switch(t.operation){case"query":{let o=r.getQueryType();if(!o)throw new Error("Schema does not define the required query root type");this.complexity+=this.nodeComplexity(t,o);break}case"mutation":{let o=r.getMutationType();if(!o)throw new Error("Schema does not define the required mutation root type");this.complexity+=this.nodeComplexity(t,o);break}case"subscription":{let o=r.getSubscriptionType();if(!o)throw new Error("Schema does not define the required mutation subscription type");this.complexity+=this.nodeComplexity(t,o);break}default:throw new Error(`Query complexity could not be calculated for operation of type ${t.operation}`)}}onOperationDefinitionLeave(t){if(!(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)&&(this.options.onComplete&&this.options.onComplete(this.complexity),this.complexity>this.options.maximumComplexity))return this.context.reportError(this.createError())}nodeComplexity(t,n){if(t.selectionSet){let i={};(n instanceof Q||n instanceof he)&&(i=n.getFields());let r;ge(n)?r=this.context.getSchema().getPossibleTypes(n).map(a=>a.name):r=[n.name];let o=t.selectionSet.selections.reduce((a,p)=>{let d=a,f=!0,y=!1;for(let x of p.directives??[])switch(x.name.value){case"include":{let I=this.includeDirectiveDef&&Ze(this.includeDirectiveDef,p,this.variableValues||{});typeof I?.if=="boolean"&&(f=I.if);break}case"skip":{let I=this.skipDirectiveDef&&Ze(this.skipDirectiveDef,p,this.variableValues||{});typeof I?.if=="boolean"&&(y=I.if);break}}if(!f||y)return a;switch(p.kind){case c.FIELD:{let x=i[p.name.value];if(!x)break;let N=se(x.type),I;try{I=We(x,p,this.variableValues||{})}catch(O){return this.context.reportError(O),a}let g=0;de(N)&&(g=this.nodeComplexity(p,N));let C={childComplexity:g,args:I,field:x,node:p,type:n,context:this.requestContext};if(!this.estimators.find(O=>{let H=O(C);return typeof H=="number"&&!Number.isNaN(H)?(d=Me(H,a,r),!0):!1}))return this.context.reportError(new h(`No complexity could be calculated for field ${n.name}.${x.name}. At least one complexity estimator has to return a complexity score.`)),a;break}case c.FRAGMENT_SPREAD:{let x=this.context.getFragment(p.name.value);if(!x)break;let N=this.context.getSchema().getType(x.typeCondition.name.value);if(!de(N))break;let I=this.nodeComplexity(x,N);ge(N)?d=Me(I,a,this.context.getSchema().getPossibleTypes(N).map(g=>g.name)):d=Me(I,a,[N.name]);break}case c.INLINE_FRAGMENT:{let x=n;if(p.typeCondition?.name&&(x=this.context.getSchema().getType(p.typeCondition.name.value)||x,!de(x)))break;let N=this.nodeComplexity(p,x);ge(x)?d=Me(N,a,this.context.getSchema().getPossibleTypes(x).map(I=>I.name)):d=Me(N,a,[x.name]);break}default:{d=Me(this.nodeComplexity(p,n),a,r);break}}return d},{});return o?Math.max(...Object.values(o),0):NaN}return 0}createError(){return typeof this.options.createError=="function"?this.options.createError(this.options.maximumComplexity,this.complexity):new h(nr(this.options.maximumComplexity,this.complexity))}};function Me(e,t,n){for(let i of n)Object.hasOwn(t,i)?t[i]+=e:t[i]=e;return t}s(Me,"addComplexities");function qn(e){let t=e?.defaultComplexity??1;return n=>t+n.childComplexity}s(qn,"simpleEstimator");var Jn=s((e,t,n={})=>{let{definitions:i}=e,r=ir(i),o=rr(i);return Object.entries(o).map(([a,p])=>kt(p,r,0,t,a,n))},"depthLimit");function ir(e){return e.reduce((t,n)=>(n.kind===c.FRAGMENT_DEFINITION&&(t[n?.name?.value??""]=n),t),{})}s(ir,"getFragments");function rr(e){return e.reduce((t,n)=>{if(n.kind===c.OPERATION_DEFINITION){let i=n?.name?.value??"";t[i]=n}return t},{})}s(rr,"getQueriesAndMutations");function kt(e,t,n,i,r,o){if(n>i)throw o?.onLimitReached?.(n,r),new h(`${r||"Your query"} exceeds maximum operation depth of ${i}`,{nodes:[e]});let a=o?.ignore??[/^__/];switch(e.kind){case c.FIELD:return sr(e,a)||!e.selectionSet?0:1+Math.max(...e.selectionSet.selections.map(p=>kt(p,t,n+1,i,r,o)));case c.FRAGMENT_SPREAD:return kt(t[e.name.value],t,n,i,r,o);case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:case c.OPERATION_DEFINITION:return Math.max(...e.selectionSet.selections.map(p=>kt(p,t,n,i,r,o)));default:throw new Error(`uh oh! depth crawler cannot handle: ${e.kind}`)}}s(kt,"determineDepth");var sr=s((e,t)=>t.find(n=>e.name.value.match(n)!==null)||!1,"isIgnored");var or=s(async(e,t)=>{if(!t.complexityLimit)throw new cn("No complexity maximum defined, you need to pass a maxComplexity to the policy");let i=t.endpointUrl;if(!i)throw new cn("No GraphQL endpoint, you need to pass a endpointUrl to the policy");let r=wt(),p=(await(await fetch(i,{method:"POST",body:JSON.stringify({query:r}),headers:{"Content-Type":"application/json"}})).json()).data;if(!p||!p?.__schema)throw new h("GraphQL introspection query failed, enable introspection or pass a schema url in configuration.");let d=Rt(p,{assumeValid:!0}),f=Bn({estimators:[qn({defaultComplexity:1})],schema:d,query:e,variables:{count:10}});if(t.complexityLimit&&f>t.complexityLimit)throw new h(`Query is too complex (${f}/${t.complexityLimit}), remove some fields and try again`)},"applyComplexityLimitPolicy"),ar=s(async(e,t)=>{let n=t.depthLimit;if(!n)throw new cn("No maximum depth defined, you need to pass a maxDepth to the policy");return Math.max(...Jn(e,n))},"applyDepthLimitPolicy"),cr=s(async(e,t,n)=>{try{let r=await e.clone().json(),o=ke(r.query);n.useDepthLimit&&await ar(o,n.useDepthLimit),n.useComplexityLimit&&await or(o,n.useComplexityLimit)}catch(i){if(t.log.error(i),i instanceof h)return new Response(JSON.stringify(i.toJSON()),{status:400,headers:{"Content-Type":"application/json"}});throw i}return e},"GraphQLComplexityLimitInboundPolicy");import{HttpProblems as pr}from"@zuplo/runtime";function ur(e){if(!e)return!1;let t=e.replace(/\s/g,"");return t.includes("__schema")||t.includes("__type")}s(ur,"isIntrospectionQuery");var lr=s(async(e,t)=>{let i=await e.clone().json();return ur(i.query)?pr.forbidden(e,t,{detail:"Introspection queries are not allowed"}):e},"GraphQLDisableIntrospectionInboundPolicy");function dr(e,t,n){if(!e?.data?.__schema?.types)return e;let i=e.data.__schema,r=new Set(t);return i.types=i.types.filter(o=>!r.has(o.name)),i.types.forEach(o=>{if(o.fields&&n){let a=new Set(n[o.name]);o.fields=o.fields.filter(p=>!a.has(p.name))}}),e}s(dr,"filterIntrospectionResult");var fr=s(async(e,t,n,i)=>{let{excludeTypes:r,excludeTypeFields:o}=i;if(e.status!==200)return e;try{let a=await e.json();if(!a?.data?.__schema)return new Response(JSON.stringify(a),{headers:e.headers,status:e.status,statusText:e.statusText});let p=dr(a,r,o),d=JSON.stringify(p);return new Response(d,{headers:e.headers,status:e.status,statusText:e.statusText})}catch(a){return n.log.error(a,"Error parsing GraphQL response in GraphQLIntrospectionOutboundPolicy"),new Response(JSON.stringify({error:"Failed to process response"}),{headers:e.headers,status:500})}},"GraphQLIntrospectionFilterOutboundPolicy");export{tr as GraphQLCacheInboundPolicy,cr as GraphQLComplexityLimitInboundPolicy,lr as GraphQLDisableIntrospectionInboundPolicy,fr as GraphQLIntrospectionFilterOutboundPolicy};
181
+ `}s(wt,"getIntrospectionQuery");function Rt(e,t){F(e)&&F(e.__schema)||_(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${m(e)}.`);let n=e.__schema,i=ue(n.types,l=>l.name,l=>N(l));for(let l of[...qt,...Zt])i[l.name]&&(i[l.name]=l);let r=n.queryType?y(n.queryType):null,o=n.mutationType?y(n.mutationType):null,a=n.subscriptionType?y(n.subscriptionType):null,p=n.directives?n.directives.map(Yn):[];return new Ke({description:n.description,query:r,mutation:o,subscription:a,types:Object.values(i),directives:p,assumeValid:t?.assumeValid});function d(l){if(l.kind===L.LIST){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");return new R(d(v))}if(l.kind===L.NON_NULL){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");let ce=d(v);return new E(xt(ce))}return f(l)}function f(l){let v=l.name;if(!v)throw new Error(`Unknown type reference: ${m(l)}.`);let ce=i[v];if(!ce)throw new Error(`Invalid or incomplete schema, unknown type: ${v}. Ensure that a full introspection query is used in order to build a client schema.`);return ce}function y(l){return ht(f(l))}function x(l){return yt(f(l))}function N(l){if(l!=null&&l.name!=null&&l.kind!=null)switch(l.kind){case L.SCALAR:return I(l);case L.OBJECT:return C(l);case L.INTERFACE:return M(l);case L.UNION:return O(l);case L.ENUM:return H(l);case L.INPUT_OBJECT:return Y(l)}let v=m(l);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${v}.`)}function I(l){return new X({name:l.name,description:l.description,specifiedByURL:l.specifiedByURL})}function g(l){if(l.interfaces===null&&l.kind===L.INTERFACE)return[];if(!l.interfaces){let v=m(l);throw new Error(`Introspection result missing interfaces: ${v}.`)}return l.interfaces.map(x)}function C(l){return new Q({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>z(l),"fields")})}function M(l){return new he({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>z(l),"fields")})}function O(l){if(!l.possibleTypes){let v=m(l);throw new Error(`Introspection result missing possibleTypes: ${v}.`)}return new _e({name:l.name,description:l.description,types:s(()=>l.possibleTypes.map(y),"types")})}function H(l){if(!l.enumValues){let v=m(l);throw new Error(`Introspection result missing enumValues: ${v}.`)}return new le({name:l.name,description:l.description,values:ue(l.enumValues,v=>v.name,v=>({description:v.description,deprecationReason:v.deprecationReason}))})}function Y(l){if(!l.inputFields){let v=m(l);throw new Error(`Introspection result missing inputFields: ${v}.`)}return new Se({name:l.name,description:l.description,fields:s(()=>ie(l.inputFields),"fields"),isOneOf:l.isOneOf})}function z(l){if(!l.fields)throw new Error(`Introspection result missing fields: ${m(l)}.`);return ue(l.fields,v=>v.name,me)}function me(l){let v=d(l.type);if(!ye(v)){let ce=m(v);throw new Error(`Introspection must provide output type for fields, but received: ${ce}.`)}if(!l.args){let ce=m(l);throw new Error(`Introspection result missing field args: ${ce}.`)}return{description:l.description,deprecationReason:l.deprecationReason,type:v,args:ie(l.args)}}function ie(l){return ue(l,v=>v.name,et)}function et(l){let v=d(l.type);if(!Z(v)){let zn=m(v);throw new Error(`Introspection must provide input type for arguments, but received: ${zn}.`)}let ce=l.defaultValue!=null?fe(ct(l.defaultValue),v):void 0;return{description:l.description,type:v,defaultValue:ce,deprecationReason:l.deprecationReason}}function Yn(l){if(!l.args){let v=m(l);throw new Error(`Introspection result missing directive args: ${v}.`)}if(!l.locations){let v=m(l);throw new Error(`Introspection result missing directive locations: ${v}.`)}return new te({name:l.name,description:l.description,isRepeatable:l.isRepeatable,locations:l.locations.slice(),args:ie(l.args)})}}s(Rt,"buildClientSchema");function Gn(e){let t;try{t=JSON.parse(e)}catch{return}if(t===null||typeof t!="object"||Array.isArray(t))return;let{query:n,variables:i,operationName:r}=t;if(!(typeof n!="string"||n.length===0))return{query:n,variables:i,operationName:typeof r=="string"?r:void 0}}s(Gn,"parseGraphQLRequestBody");function rn(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(rn):Object.fromEntries(Object.keys(e).sort().map(t=>[t,rn(e[t])]))}s(rn,"canonicalize");function Mn(e,t){let n;try{n=ke(e)}catch{return}let i=n.definitions.filter(o=>o.kind===c.OPERATION_DEFINITION),r;if(t){if(r=i.find(o=>o.name?.value===t),!r)return}else if(i.length===1)r=i[0];else return;return{query:V(n),isQueryOperation:r.operation===$.QUERY}}s(Mn,"normalizeGraphQLQuery");async function Qn(e,t,n,i){let r=[e,JSON.stringify(rn(t)??null),n??"",JSON.stringify(i??[])].join("\0"),o=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(r));return Array.from(new Uint8Array(o)).map(a=>a.toString(16).padStart(2,"0")).join("")}s(Qn,"buildCacheKey");var Ki=["authorization","cookie"];function Pn(e,t){if(t!==void 0&&t.length===0)return{skip:!1,varyValues:[]};let n=new Set((t??[]).map(r=>r.toLowerCase()));for(let r of Ki)if(e.has(r)&&!n.has(r))return{skip:!0,varyValues:[]};let i=[];for(let r of[...n].sort()){let o=e.get(r);o!==null&&i.push([r,o])}return{skip:!1,varyValues:i}}s(Pn,"resolveVary");var Xi=new Set(["set-cookie","set-cookie2","clear-site-data"]);function jn(e){let t={};return e.forEach((n,i)=>{Xi.has(i.toLowerCase())||(t[i]=n)}),t}s(jn,"toCacheableHeaders");var er="graphql-responses",tr=60,sn="x-cache",on="x-cache-key";function Bn(e,t,n){e.set(sn,t),e.set(on,n);let i=e.get("access-control-expose-headers");if(!i||i.trim()==="*"){i||e.set("access-control-expose-headers",`${sn}, ${on}`);return}let r=new Set(i.split(",").map(a=>a.trim().toLowerCase())),o=[sn,on].filter(a=>!r.has(a));o.length>0&&e.set("access-control-expose-headers",[i,...o].join(", "))}s(Bn,"tagCacheHeaders");var nr=s(async(e,t,n,i)=>{let r=n?.cacheName??er,o=n?.ttlSeconds??tr,a=Pn(e.headers,n?.cacheKeyHeaders);if(a.skip)return e;let p=await e.clone().text(),d=Gn(p);if(!d)return e;let{query:f,variables:y,operationName:x}=d,N=Mn(f,x);if(!N||!N.isQueryOperation)return e;let I=await Qn(N.query,y,x,a.varyValues),g=I.slice(0,8),C=new Zi(r,t),M=await C.get(I);if(M){$n(t,"hit");let O=new Headers(M.headers);return O.delete("content-length"),Bn(O,"HIT",g),t.log.info({cacheKey:g},`GraphQLCacheInboundPolicy '${i}' - cache HIT`),new Response(M.body,{status:M.status,headers:O})}return $n(t,"miss"),t.addResponseSendingHook(async O=>{if(O.status!==200)return O;let H=await O.text(),Y=Wi(H);if(Y===null||Y.length>0){let ie=new Headers(O.headers);return ie.delete("content-length"),new Response(H,{status:O.status,statusText:O.statusText,headers:ie})}let z=jn(O.headers);t.waitUntil(C.put(I,{status:O.status,headers:z,body:H},o).catch(ie=>t.log.error(ie,`GraphQLCacheInboundPolicy '${i}' - failed to write cache entry`)));let me=new Headers(O.headers);return me.delete("content-length"),Bn(me,"MISS",g),t.log.info({cacheKey:g},`GraphQLCacheInboundPolicy '${i}' - cache MISS`),new Response(H,{status:O.status,statusText:O.statusText,headers:me})}),e},"GraphQLCacheInboundPolicy");import{ConfigurationError as cn}from"@zuplo/runtime";function ir(e,t){return`The query exceeds the maximum complexity of ${e}. Actual complexity is ${t}`}s(ir,"queryComplexityMessage");function qn(e){let t=new ve(e.schema),n=[],i=new Ge(e.schema,e.query,t,o=>n.push(o)),r=new an(i,{maximumComplexity:e.maximumComplexity??1/0,estimators:e.estimators,variables:e.variables,operationName:e.operationName,context:e.context});if(Te(e.query,Ue(t,r)),n.length)throw n.pop();return r.complexity}s(qn,"getComplexity");var an=class{static{s(this,"QueryComplexity")}context;complexity;options;OperationDefinition;estimators;includeDirectiveDef;skipDirectiveDef;variableValues;requestContext;constructor(t,n){if(Number(n.maximumComplexity)<=0)throw new Error("Maximum query complexity must be a positive number");this.context=t,this.complexity=0,this.options=n,this.includeDirectiveDef=this.context.getSchema().getDirective("include")||void 0,this.skipDirectiveDef=this.context.getSchema().getDirective("skip")||void 0,this.estimators=n.estimators,this.variableValues={},this.requestContext=n.context,this.OperationDefinition={enter:this.onOperationDefinitionEnter,leave:this.onOperationDefinitionLeave}}onOperationDefinitionEnter(t){if(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)return;let{coerced:n,errors:i}=Dt(this.context.getSchema(),t.variableDefinitions?[...t.variableDefinitions]:[],this.options.variables??{});if(i?.length){i.forEach(o=>this.context.reportError(o));return}this.variableValues=n||{};let r=this.context.getSchema();switch(t.operation){case"query":{let o=r.getQueryType();if(!o)throw new Error("Schema does not define the required query root type");this.complexity+=this.nodeComplexity(t,o);break}case"mutation":{let o=r.getMutationType();if(!o)throw new Error("Schema does not define the required mutation root type");this.complexity+=this.nodeComplexity(t,o);break}case"subscription":{let o=r.getSubscriptionType();if(!o)throw new Error("Schema does not define the required mutation subscription type");this.complexity+=this.nodeComplexity(t,o);break}default:throw new Error(`Query complexity could not be calculated for operation of type ${t.operation}`)}}onOperationDefinitionLeave(t){if(!(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)&&(this.options.onComplete&&this.options.onComplete(this.complexity),this.complexity>this.options.maximumComplexity))return this.context.reportError(this.createError())}nodeComplexity(t,n){if(t.selectionSet){let i={};(n instanceof Q||n instanceof he)&&(i=n.getFields());let r;ge(n)?r=this.context.getSchema().getPossibleTypes(n).map(a=>a.name):r=[n.name];let o=t.selectionSet.selections.reduce((a,p)=>{let d=a,f=!0,y=!1;for(let x of p.directives??[])switch(x.name.value){case"include":{let I=this.includeDirectiveDef&&Ze(this.includeDirectiveDef,p,this.variableValues||{});typeof I?.if=="boolean"&&(f=I.if);break}case"skip":{let I=this.skipDirectiveDef&&Ze(this.skipDirectiveDef,p,this.variableValues||{});typeof I?.if=="boolean"&&(y=I.if);break}}if(!f||y)return a;switch(p.kind){case c.FIELD:{let x=i[p.name.value];if(!x)break;let N=se(x.type),I;try{I=We(x,p,this.variableValues||{})}catch(O){return this.context.reportError(O),a}let g=0;de(N)&&(g=this.nodeComplexity(p,N));let C={childComplexity:g,args:I,field:x,node:p,type:n,context:this.requestContext};if(!this.estimators.find(O=>{let H=O(C);return typeof H=="number"&&!Number.isNaN(H)?(d=Me(H,a,r),!0):!1}))return this.context.reportError(new h(`No complexity could be calculated for field ${n.name}.${x.name}. At least one complexity estimator has to return a complexity score.`)),a;break}case c.FRAGMENT_SPREAD:{let x=this.context.getFragment(p.name.value);if(!x)break;let N=this.context.getSchema().getType(x.typeCondition.name.value);if(!de(N))break;let I=this.nodeComplexity(x,N);ge(N)?d=Me(I,a,this.context.getSchema().getPossibleTypes(N).map(g=>g.name)):d=Me(I,a,[N.name]);break}case c.INLINE_FRAGMENT:{let x=n;if(p.typeCondition?.name&&(x=this.context.getSchema().getType(p.typeCondition.name.value)||x,!de(x)))break;let N=this.nodeComplexity(p,x);ge(x)?d=Me(N,a,this.context.getSchema().getPossibleTypes(x).map(I=>I.name)):d=Me(N,a,[x.name]);break}default:{d=Me(this.nodeComplexity(p,n),a,r);break}}return d},{});return o?Math.max(...Object.values(o),0):NaN}return 0}createError(){return typeof this.options.createError=="function"?this.options.createError(this.options.maximumComplexity,this.complexity):new h(ir(this.options.maximumComplexity,this.complexity))}};function Me(e,t,n){for(let i of n)Object.hasOwn(t,i)?t[i]+=e:t[i]=e;return t}s(Me,"addComplexities");function Jn(e){let t=e?.defaultComplexity??1;return n=>t+n.childComplexity}s(Jn,"simpleEstimator");var Hn=s((e,t,n={})=>{let{definitions:i}=e,r=rr(i),o=sr(i);return Object.entries(o).map(([a,p])=>kt(p,r,0,t,a,n))},"depthLimit");function rr(e){return e.reduce((t,n)=>(n.kind===c.FRAGMENT_DEFINITION&&(t[n?.name?.value??""]=n),t),{})}s(rr,"getFragments");function sr(e){return e.reduce((t,n)=>{if(n.kind===c.OPERATION_DEFINITION){let i=n?.name?.value??"";t[i]=n}return t},{})}s(sr,"getQueriesAndMutations");function kt(e,t,n,i,r,o){if(n>i)throw o?.onLimitReached?.(n,r),new h(`${r||"Your query"} exceeds maximum operation depth of ${i}`,{nodes:[e]});let a=o?.ignore??[/^__/];switch(e.kind){case c.FIELD:return or(e,a)||!e.selectionSet?0:1+Math.max(...e.selectionSet.selections.map(p=>kt(p,t,n+1,i,r,o)));case c.FRAGMENT_SPREAD:return kt(t[e.name.value],t,n,i,r,o);case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:case c.OPERATION_DEFINITION:return Math.max(...e.selectionSet.selections.map(p=>kt(p,t,n,i,r,o)));default:throw new Error(`uh oh! depth crawler cannot handle: ${e.kind}`)}}s(kt,"determineDepth");var or=s((e,t)=>t.find(n=>e.name.value.match(n)!==null)||!1,"isIgnored");var ar=s(async(e,t)=>{if(!t.complexityLimit)throw new cn("No complexity maximum defined, you need to pass a maxComplexity to the policy");let i=t.endpointUrl;if(!i)throw new cn("No GraphQL endpoint, you need to pass a endpointUrl to the policy");let r=wt(),p=(await(await fetch(i,{method:"POST",body:JSON.stringify({query:r}),headers:{"Content-Type":"application/json"}})).json()).data;if(!p||!p?.__schema)throw new h("GraphQL introspection query failed, enable introspection or pass a schema url in configuration.");let d=Rt(p,{assumeValid:!0}),f=qn({estimators:[Jn({defaultComplexity:1})],schema:d,query:e,variables:{count:10}});if(t.complexityLimit&&f>t.complexityLimit)throw new h(`Query is too complex (${f}/${t.complexityLimit}), remove some fields and try again`)},"applyComplexityLimitPolicy"),cr=s(async(e,t)=>{let n=t.depthLimit;if(!n)throw new cn("No maximum depth defined, you need to pass a maxDepth to the policy");return Math.max(...Hn(e,n))},"applyDepthLimitPolicy"),pr=s(async(e,t,n)=>{try{let r=await e.clone().json(),o=ke(r.query);n.useDepthLimit&&await cr(o,n.useDepthLimit),n.useComplexityLimit&&await ar(o,n.useComplexityLimit)}catch(i){if(t.log.error(i),i instanceof h)return new Response(JSON.stringify(i.toJSON()),{status:400,headers:{"Content-Type":"application/json"}});throw i}return e},"GraphQLComplexityLimitInboundPolicy");import{HttpProblems as ur}from"@zuplo/runtime";function lr(e){if(!e)return!1;let t=e.replace(/\s/g,"");return t.includes("__schema")||t.includes("__type")}s(lr,"isIntrospectionQuery");var dr=s(async(e,t)=>{let i=await e.clone().json();return lr(i.query)?ur.forbidden(e,t,{detail:"Introspection queries are not allowed"}):e},"GraphQLDisableIntrospectionInboundPolicy");function fr(e,t,n){if(!e?.data?.__schema?.types)return e;let i=e.data.__schema,r=new Set(t);return i.types=i.types.filter(o=>!r.has(o.name)),i.types.forEach(o=>{if(o.fields&&n){let a=new Set(n[o.name]);o.fields=o.fields.filter(p=>!a.has(p.name))}}),e}s(fr,"filterIntrospectionResult");var mr=s(async(e,t,n,i)=>{let{excludeTypes:r,excludeTypeFields:o}=i;if(e.status!==200)return e;try{let a=await e.json();if(!a?.data?.__schema)return new Response(JSON.stringify(a),{headers:e.headers,status:e.status,statusText:e.statusText});let p=fr(a,r,o),d=JSON.stringify(p);return new Response(d,{headers:e.headers,status:e.status,statusText:e.statusText})}catch(a){return n.log.error(a,"Error parsing GraphQL response in GraphQLIntrospectionOutboundPolicy"),new Response(JSON.stringify({error:"Failed to process response"}),{headers:e.headers,status:500})}},"GraphQLIntrospectionFilterOutboundPolicy");export{nr as GraphQLCacheInboundPolicy,pr as GraphQLComplexityLimitInboundPolicy,dr as GraphQLDisableIntrospectionInboundPolicy,mr as GraphQLIntrospectionFilterOutboundPolicy};
182
182
  //# sourceMappingURL=index.js.map