@zuplo/graphql 5.1917.0 → 5.1922.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.min.cjs ADDED
@@ -0,0 +1,181 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ "use strict";var tt=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var Bn=Object.getOwnPropertyNames;var qn=Object.prototype.hasOwnProperty;var o=(e,t)=>tt(e,"name",{value:t,configurable:!0});var Jn=(e,t)=>{for(var n in t)tt(e,n,{get:t[n],enumerable:!0})},Yn=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bn(t))!qn.call(e,r)&&r!==n&&tt(e,r,{get:()=>t[r],enumerable:!(i=Qn(t,r))||i.enumerable});return e};var zn=e=>Yn(tt({},"__esModule",{value:!0}),e);var tr={};Jn(tr,{GraphQLComplexityLimitInboundPolicy:()=>Mn,GraphQLDisableIntrospectionInboundPolicy:()=>jn});module.exports=zn(tr);var Ue=require("@zuplo/runtime");function I(e,t){if(!!!e)throw new Error(t)}o(I,"devAssert");function k(e){return typeof e=="object"&&e!==null}o(k,"isObjectLike");function oe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}o(oe,"invariant");var Kn=/\r\n|[\n\r]/g;function Se(e,t){let n=0,i=1;for(let r of e.body.matchAll(Kn)){if(typeof r.index=="number"||oe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}o(Se,"getLocation");function Ut(e){return nt(e.source,Se(e.source,e.start))}o(Ut,"printLocation");function nt(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,c=t.line===1?n:0,d=t.column+c,f=`${e.name}:${a}:${d}
26
+ `,T=i.split(/\r\n|[\n\r]/g),x=T[r];if(x.length>120){let N=Math.floor(d/80),S=d%80,g=[];for(let U=0;U<x.length;U+=80)g.push(x.slice(U,U+80));return f+an([[`${a} |`,g[0]],...g.slice(1,N+1).map(U=>["|",U]),["|","^".padStart(S)],["|",g[N+1]]])}return f+an([[`${a-1} |`,T[r-1]],[`${a} |`,x],["|","^".padStart(d)],[`${a+1} |`,T[r+1]]])}o(nt,"printSourceLocation");function an(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
+ `)}o(an,"printPrefixedLines");function Hn(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}o(Hn,"toNormalizedOptions");var y=class e extends Error{static{o(this,"GraphQLError")}constructor(t,...n){var i,r,s;let{nodes:a,source:c,positions:d,path:f,originalError:T,extensions:x}=Hn(n);super(t),this.name="GraphQLError",this.path=f??void 0,this.originalError=T??void 0,this.nodes=pn(Array.isArray(a)?a:a?[a]:void 0);let N=pn((i=this.nodes)===null||i===void 0?void 0:i.map(g=>g.loc).filter(g=>g!=null));this.source=c??(N==null||(r=N[0])===null||r===void 0?void 0:r.source),this.positions=d??N?.map(g=>g.start),this.locations=d&&c?d.map(g=>Se(c,g)):N?.map(g=>Se(g.source,g.start));let S=k(T?.extensions)?T?.extensions:void 0;this.extensions=(s=x??S)!==null&&s!==void 0?s: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}}),T!=null&&T.stack?Object.defineProperty(this,"stack",{value:T.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
+
29
+ `+Ut(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
30
+
31
+ `+nt(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 pn(e){return e===void 0||e.length===0?void 0:e}o(pn,"undefinedIfEmpty");function D(e,t,n){return new y(`Syntax Error: ${n}`,{source:e,positions:[t]})}o(D,"syntaxError");var Ge=class{static{o(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}}},Le=class{static{o(this,"Token")}constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,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}}},Mt={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"]},Xn=new Set(Object.keys(Mt));function je(e){let t=e?.kind;return typeof t=="string"&&Xn.has(t)}o(je,"isNode");var H;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(H||(H={}));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 p;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.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"})(p||(p={}));function it(e){return e===9||e===32}o(it,"isWhiteSpace");function Oe(e){return e>=48&&e<=57}o(Oe,"isDigit");function cn(e){return e>=97&&e<=122||e>=65&&e<=90}o(cn,"isLetter");function $e(e){return cn(e)||e===95}o($e,"isNameStart");function rt(e){return cn(e)||Oe(e)||e===95}o(rt,"isNameContinue");function un(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var s;let c=e[a],d=Wn(c);d!==c.length&&(i=(s=i)!==null&&s!==void 0?s:a,r=a,a!==0&&d<n&&(n=d))}return e.map((a,c)=>c===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}o(un,"dedentBlockStringLines");function Wn(e){let t=0;for(;t<e.length&&it(e.charCodeAt(t));)++t;return t}o(Wn,"leadingWhitespace");function ln(e,t){let n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,s=i.length>1&&i.slice(1).every(S=>S.length===0||it(S.charCodeAt(0))),a=n.endsWith('\\"""'),c=e.endsWith('"')&&!a,d=e.endsWith("\\"),f=c||d,T=!(t!=null&&t.minimize)&&(!r||e.length>70||f||s||a),x="",N=r&&it(e.charCodeAt(0));return(T&&!N||s)&&(x+=`
32
+ `),x+=n,(T||f)&&(x+=`
33
+ `),'"""'+x+'"""'}o(ln,"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 Qe=class{static{o(this,"Lexer")}constructor(t){let n=new Le(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=Zn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===u.COMMENT);return t}};function fn(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}o(fn,"isPunctuatorTokenKind");function Ae(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}o(Ae,"isUnicodeScalarValue");function st(e,t){return mn(e.charCodeAt(t))&&hn(e.charCodeAt(t+1))}o(st,"isSupplementaryCodePoint");function mn(e){return e>=55296&&e<=56319}o(mn,"isLeadingSurrogate");function hn(e){return e>=56320&&e<=57343}o(hn,"isTrailingSurrogate");function ge(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")}o(ge,"printCodePointAt");function R(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new Le(t,n,i,s,a,r)}o(R,"createToken");function Zn(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let s=n.charCodeAt(r);switch(s){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 ei(e,r);case 33:return R(e,u.BANG,r,r+1);case 36:return R(e,u.DOLLAR,r,r+1);case 38:return R(e,u.AMP,r,r+1);case 40:return R(e,u.PAREN_L,r,r+1);case 41:return R(e,u.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return R(e,u.SPREAD,r,r+3);break;case 58:return R(e,u.COLON,r,r+1);case 61:return R(e,u.EQUALS,r,r+1);case 64:return R(e,u.AT,r,r+1);case 91:return R(e,u.BRACKET_L,r,r+1);case 93:return R(e,u.BRACKET_R,r,r+1);case 123:return R(e,u.BRACE_L,r,r+1);case 124:return R(e,u.PIPE,r,r+1);case 125:return R(e,u.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?oi(e,r):ni(e,r)}if(Oe(s)||s===45)return ti(e,r,s);if($e(s))return ai(e,r);throw D(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ae(s)||st(n,r)?`Unexpected character: ${ge(e,r)}.`:`Invalid character: ${ge(e,r)}.`)}return R(e,u.EOF,i,i)}o(Zn,"readNextToken");function ei(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(s===10||s===13)break;if(Ae(s))++r;else if(st(n,r))r+=2;else break}return R(e,u.COMMENT,t,r,n.slice(t+1,r))}o(ei,"readComment");function ti(e,t,n){let i=e.source.body,r=t,s=n,a=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),Oe(s))throw D(e.source,r,`Invalid number, unexpected digit after 0: ${ge(e,r)}.`)}else r=Gt(e,r,s),s=i.charCodeAt(r);if(s===46&&(a=!0,s=i.charCodeAt(++r),r=Gt(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(a=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=Gt(e,r,s),s=i.charCodeAt(r)),s===46||$e(s))throw D(e.source,r,`Invalid number, expected digit but got: ${ge(e,r)}.`);return R(e,a?u.FLOAT:u.INT,t,r,i.slice(t,r))}o(ti,"readNumber");function Gt(e,t,n){if(!Oe(n))throw D(e.source,t,`Invalid number, expected digit but got: ${ge(e,t)}.`);let i=e.source.body,r=t+1;for(;Oe(i.charCodeAt(r));)++r;return r}o(Gt,"readDigits");function ni(e,t){let n=e.source.body,i=n.length,r=t+1,s=r,a="";for(;r<i;){let c=n.charCodeAt(r);if(c===34)return a+=n.slice(s,r),R(e,u.STRING,t,r+1,a);if(c===92){a+=n.slice(s,r);let d=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?ii(e,r):ri(e,r):si(e,r);a+=d.value,r+=d.size,s=r;continue}if(c===10||c===13)break;if(Ae(c))++r;else if(st(n,r))r+=2;else throw D(e.source,r,`Invalid character within String: ${ge(e,r)}.`)}throw D(e.source,r,"Unterminated string.")}o(ni,"readString");function ii(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let s=n.charCodeAt(t+r++);if(s===125){if(r<5||!Ae(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Pe(s),i<0)break}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}o(ii,"readEscapedUnicodeVariableWidth");function ri(e,t){let n=e.source.body,i=dn(n,t+2);if(Ae(i))return{value:String.fromCodePoint(i),size:6};if(mn(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=dn(n,t+8);if(hn(r))return{value:String.fromCodePoint(i,r),size:12}}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}o(ri,"readEscapedUnicodeFixedWidth");function dn(e,t){return Pe(e.charCodeAt(t))<<12|Pe(e.charCodeAt(t+1))<<8|Pe(e.charCodeAt(t+2))<<4|Pe(e.charCodeAt(t+3))}o(dn,"read16BitHexCode");function Pe(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}o(Pe,"readHexDigit");function si(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 D(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}o(si,"readEscapedCharacter");function oi(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,c="",d=[];for(;s<i;){let f=n.charCodeAt(s);if(f===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){c+=n.slice(a,s),d.push(c);let T=R(e,u.BLOCK_STRING,t,s+3,un(d).join(`
35
+ `));return e.line+=d.length-1,e.lineStart=r,T}if(f===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){c+=n.slice(a,s),a=s+1,s+=4;continue}if(f===10||f===13){c+=n.slice(a,s),d.push(c),f===13&&n.charCodeAt(s+1)===10?s+=2:++s,c="",a=s,r=s;continue}if(Ae(f))++s;else if(st(n,s))s+=2;else throw D(e.source,s,`Invalid character within String: ${ge(e,s)}.`)}throw D(e.source,s,"Unterminated string.")}o(oi,"readBlockString");function ai(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let s=n.charCodeAt(r);if(rt(s))++r;else break}return R(e,u.NAME,t,r,n.slice(t,r))}o(ai,"readName");function m(e){return ot(e,[])}o(m,"inspect");function ot(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)}}o(ot,"formatValue");function pi(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(ci(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:ot(i,n)}else if(Array.isArray(e))return li(e,n);return ui(e,n)}o(pi,"formatObjectValue");function ci(e){return typeof e.toJSON=="function"}o(ci,"isJSONable");function ui(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+di(e)+"]":"{ "+n.map(([r,s])=>r+": "+ot(s,t)).join(", ")+" }"}o(ui,"formatObject");function li(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 s=0;s<n;++s)r.push(ot(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}o(li,"formatArray");function di(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}o(di,"getObjectTag");var q=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?o(function(t,n){return t instanceof n},"instanceOf"):o(function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){let a=m(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm.
36
+
37
+ Ensure that there is only one instance of "graphql" in the node_modules
38
+ directory. If different versions of "graphql" are the dependencies of other
39
+ relied on modules, use "resolutions" to ensure only one version is installed.
40
+
41
+ https://yarnpkg.com/en/docs/selective-version-resolutions
42
+
43
+ Duplicate "graphql" modules cannot be used at the same time since different
44
+ versions may have different capabilities and behavior. The data from one
45
+ version used in the function from another could produce confusing and
46
+ spurious results.`)}}return!1},"instanceOf");var De=class{static{o(this,"Source")}constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||I(!1,`Body must be a string. Received: ${m(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||I(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function yn(e){return q(e,De)}o(yn,"isSource");function ct(e,t){return new pt(e,t).parseDocument()}o(ct,"parse");function ut(e,t){let n=new pt(e,t);n.expectToken(u.SOF);let i=n.parseValueLiteral(!1);return n.expectToken(u.EOF),i}o(ut,"parseValue");var pt=class{static{o(this,"Parser")}constructor(t,n={}){let i=yn(t)?t:new De(t);this._lexer=new Qe(i),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(u.NAME);return this.node(t,{kind:p.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:p.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 D(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:p.OPERATION_DEFINITION,operation:H.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:p.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 H.QUERY;case"mutation":return H.MUTATION;case"subscription":return H.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:p.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:p.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:p.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:p.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:p.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:p.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:p.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:p.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:p.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:p.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:p.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:p.BOOLEAN,value:!0});case"false":return this.node(n,{kind:p.BOOLEAN,value:!1});case"null":return this.node(n,{kind:p.NULL});default:return this.node(n,{kind:p.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 D(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:p.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){let n=o(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:p.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){let n=o(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:p.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:p.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:p.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:p.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:p.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:p.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(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:p.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:p.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:p.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(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,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 s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:p.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,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(),s;this.expectOptionalToken(u.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:p.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:p.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}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(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:p.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}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:p.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 D(this._lexer.source,this._lexer.token.start,`${at(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(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}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:p.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:p.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(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:p.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:p.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}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:p.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:p.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:p.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(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:p.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,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 Ge(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 D(this._lexer.source,n.start,`Expected ${Tn(t)}, found ${at(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 D(this._lexer.source,n.start,`Expected "${t}", found ${at(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 D(this._lexer.source,n.start,`Unexpected ${at(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(t!==void 0&&n.kind!==u.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw D(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function at(e){let t=e.value;return Tn(e.kind)+(t!=null?` "${t}"`:"")}o(at,"getTokenDesc");function Tn(e){return fn(e)?`"${e}"`:e}o(Tn,"getTokenKindDesc");function lt(e,t){let[n,i]=t?[e,t]:[void 0,e],r=" Did you mean ";n&&(r+=n+" ");let s=i.map(d=>`"${d}"`);switch(s.length){case 0:return"";case 1:return r+s[0]+"?";case 2:return r+s[0]+" or "+s[1]+"?"}let a=s.slice(0,5),c=a.pop();return r+a.join(", ")+", or "+c+"?"}o(lt,"didYouMean");function jt(e){return e}o(jt,"identityFunc");function we(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}o(we,"keyMap");function ae(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}o(ae,"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}o(Be,"mapValue");function xn(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let r=e.charCodeAt(n),s=t.charCodeAt(i);if(dt(r)&&dt(s)){let a=0;do++n,a=a*10+r-$t,r=e.charCodeAt(n);while(dt(r)&&a>0);let c=0;do++i,c=c*10+s-$t,s=t.charCodeAt(i);while(dt(s)&&c>0);if(a<c)return-1;if(a>c)return 1}else{if(r<s)return-1;if(r>s)return 1;++n,++i}}return e.length-t.length}o(xn,"naturalCompare");var $t=48,fi=57;function dt(e){return!isNaN(e)&&$t<=e&&e<=fi}o(dt,"isDigit");function ft(e,t){let n=Object.create(null),i=new Pt(e),r=Math.floor(e.length*.4)+1;for(let s of t){let a=i.measure(s,r);a!==void 0&&(n[s]=a)}return Object.keys(n).sort((s,a)=>{let c=n[s]-n[a];return c!==0?c:xn(s,a)})}o(ft,"suggestionList");var Pt=class{static{o(this,"LexicalDistance")}constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=Nn(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=Nn(i),s=this._inputArray;if(r.length<s.length){let T=r;r=s,s=T}let a=r.length,c=s.length;if(a-c>n)return;let d=this._rows;for(let T=0;T<=c;T++)d[0][T]=T;for(let T=1;T<=a;T++){let x=d[(T-1)%3],N=d[T%3],S=N[0]=T;for(let g=1;g<=c;g++){let U=r[T-1]===s[g-1]?0:1,K=Math.min(x[g]+1,N[g-1]+1,x[g-1]+U);if(T>1&&g>1&&r[T-1]===s[g-2]&&r[T-2]===s[g-1]){let F=d[(T-2)%3][g-2];K=Math.min(K,F+1)}K<S&&(S=K),N[g]=K}if(S>n)return}let f=d[a%3][c];return f<=n?f:void 0}};function Nn(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}o(Nn,"stringToArray");function j(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}o(j,"toObjMap");function En(e){return`"${e.replace(mi,hi)}"`}o(En,"printString");var mi=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function hi(e){return yi[e.charCodeAt(0)]}o(hi,"escapedReplacer");var yi=["\\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 he(e,t,n=Mt){let i=new Map;for(let F of Object.values(p))i.set(F,Re(t,F));let r,s=Array.isArray(e),a=[e],c=-1,d=[],f=e,T,x,N=[],S=[];do{c++;let F=c===a.length,me=F&&d.length!==0;if(F){if(T=S.length===0?void 0:N[N.length-1],f=x,x=S.pop(),me)if(s){f=f.slice();let Z=0;for(let[Me,_e]of d){let et=Me-Z;_e===null?(f.splice(et,1),Z++):f[et]=_e}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(let[Z,Me]of d)f[Z]=Me}c=r.index,a=r.keys,d=r.edits,s=r.inArray,r=r.prev}else if(x){if(T=s?c:a[c],f=x[T],f==null)continue;N.push(T)}let re;if(!Array.isArray(f)){var g,U;je(f)||I(!1,`Invalid AST Node: ${m(f)}.`);let Z=F?(g=i.get(f.kind))===null||g===void 0?void 0:g.leave:(U=i.get(f.kind))===null||U===void 0?void 0:U.enter;if(re=Z?.call(t,f,T,x,N,S),re===Qt)break;if(re===!1){if(!F){N.pop();continue}}else if(re!==void 0&&(d.push([T,re]),!F))if(je(re))f=re;else{N.pop();continue}}if(re===void 0&&me&&d.push([T,f]),F)N.pop();else{var K;r={inArray:s,index:c,keys:a,edits:d,prev:r},s=Array.isArray(f),a=s?f:(K=n[f.kind])!==null&&K!==void 0?K:[],c=-1,d=[],x&&S.push(x),x=f}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:e}o(he,"visit");function Re(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}}o(Re,"getEnterLeaveForKind");function $(e){return he(e,xi)}o($,"print");var Ti=80,xi={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>h(e.definitions,`
47
+
48
+ `)},OperationDefinition:{leave(e){let t=_("(",h(e.variableDefinitions,", "),")"),n=h([e.operation,h([e.name,t]),h(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+_(" = ",n)+_(" ",h(i," "))},SelectionSet:{leave:({selections:e})=>ee(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let s=_("",e,": ")+t,a=s+_("(",h(n,", "),")");return a.length>Ti&&(a=s+_(`(
49
+ `,mt(h(n,`
50
+ `)),`
51
+ )`)),h([a,h(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+_(" ",h(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>h(["...",_("on ",e),h(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${_("(",h(n,", "),")")} on ${t} ${_("",h(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?ln(e):En(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+h(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+h(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+_("(",h(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>_("",e,`
52
+ `)+h(["schema",h(t," "),ee(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>_("",e,`
53
+ `)+h(["scalar",t,h(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>_("",e,`
54
+ `)+h(["type",t,_("implements ",h(n," & ")),h(i," "),ee(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>_("",e,`
55
+ `)+t+(gn(n)?_(`(
56
+ `,mt(h(n,`
57
+ `)),`
58
+ )`):_("(",h(n,", "),")"))+": "+i+_(" ",h(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>_("",e,`
59
+ `)+h([t+": "+n,_("= ",i),h(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>_("",e,`
60
+ `)+h(["interface",t,_("implements ",h(n," & ")),h(i," "),ee(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>_("",e,`
61
+ `)+h(["union",t,h(n," "),_("= ",h(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>_("",e,`
62
+ `)+h(["enum",t,h(n," "),ee(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>_("",e,`
63
+ `)+h([t,h(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>_("",e,`
64
+ `)+h(["input",t,h(n," "),ee(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:r})=>_("",e,`
65
+ `)+"directive @"+t+(gn(n)?_(`(
66
+ `,mt(h(n,`
67
+ `)),`
68
+ )`):_("(",h(n,", "),")"))+(i?" repeatable":"")+" on "+h(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>h(["extend schema",h(e," "),ee(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>h(["extend scalar",e,h(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>h(["extend type",e,_("implements ",h(t," & ")),h(n," "),ee(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>h(["extend interface",e,_("implements ",h(t," & ")),h(n," "),ee(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>h(["extend union",e,h(t," "),_("= ",h(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>h(["extend enum",e,h(t," "),ee(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>h(["extend input",e,h(t," "),ee(n)]," ")}};function h(e,t=""){var n;return(n=e?.filter(i=>i).join(t))!==null&&n!==void 0?n:""}o(h,"join");function ee(e){return _(`{
69
+ `,mt(h(e,`
70
+ `)),`
71
+ }`)}o(ee,"block");function _(e,t,n=""){return t!=null&&t!==""?e+t+n:""}o(_,"wrap");function mt(e){return _(" ",e.replace(/\n/g,`
72
+ `))}o(mt,"indent");function gn(e){var t;return(t=e?.some(n=>n.includes(`
73
+ `)))!==null&&t!==void 0?t:!1}o(gn,"hasMultilineItems");function qe(e,t){switch(e.kind){case p.NULL:return null;case p.INT:return parseInt(e.value,10);case p.FLOAT:return parseFloat(e.value);case p.STRING:case p.ENUM:case p.BOOLEAN:return e.value;case p.LIST:return e.values.map(n=>qe(n,t));case p.OBJECT:return ae(e.fields,n=>n.name.value,n=>qe(n.value,t));case p.VARIABLE:return t?.[e.name.value]}}o(qe,"valueFromASTUntyped");function Q(e){if(e!=null||I(!1,"Must provide name."),typeof e=="string"||I(!1,"Expected name to be a string."),e.length===0)throw new y("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!rt(e.charCodeAt(t)))throw new y(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!$e(e.charCodeAt(0)))throw new y(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}o(Q,"assertName");function Bt(e){if(e==="true"||e==="false"||e==="null")throw new y(`Enum values cannot be named: ${e}`);return Q(e)}o(Bt,"assertEnumValueName");function yt(e){return ye(e)||G(e)||C(e)||X(e)||Y(e)||V(e)||B(e)||A(e)}o(yt,"isType");function ye(e){return q(e,J)}o(ye,"isScalarType");function G(e){return q(e,M)}o(G,"isObjectType");function Tt(e){if(!G(e))throw new Error(`Expected ${m(e)} to be a GraphQL Object type.`);return e}o(Tt,"assertObjectType");function C(e){return q(e,le)}o(C,"isInterfaceType");function xt(e){if(!C(e))throw new Error(`Expected ${m(e)} to be a GraphQL Interface type.`);return e}o(xt,"assertInterfaceType");function X(e){return q(e,ve)}o(X,"isUnionType");function Y(e){return q(e,pe)}o(Y,"isEnumType");function V(e){return q(e,Ie)}o(V,"isInputObjectType");function B(e){return q(e,w)}o(B,"isListType");function A(e){return q(e,E)}o(A,"isNonNullType");function z(e){return ye(e)||Y(e)||V(e)||Je(e)&&z(e.ofType)}o(z,"isInputType");function de(e){return ye(e)||G(e)||C(e)||X(e)||Y(e)||Je(e)&&de(e.ofType)}o(de,"isOutputType");function Te(e){return ye(e)||Y(e)}o(Te,"isLeafType");function ce(e){return G(e)||C(e)||X(e)}o(ce,"isCompositeType");function xe(e){return C(e)||X(e)}o(xe,"isAbstractType");var w=class{static{o(this,"GraphQLList")}constructor(t){yt(t)||I(!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{o(this,"GraphQLNonNull")}constructor(t){Nt(t)||I(!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 B(e)||A(e)}o(Je,"isWrappingType");function Nt(e){return yt(e)&&!A(e)}o(Nt,"isNullableType");function Et(e){if(!Nt(e))throw new Error(`Expected ${m(e)} to be a GraphQL nullable type.`);return e}o(Et,"assertNullableType");function gt(e){if(e)return A(e)?e.ofType:e}o(gt,"getNullableType");function te(e){if(e){let t=e;for(;Je(t);)t=t.ofType;return t}}o(te,"getNamedType");function vt(e){return typeof e=="function"?e():e}o(vt,"resolveReadonlyArrayThunk");function It(e){return typeof e=="function"?e():e}o(It,"resolveObjMapThunk");var J=class{static{o(this,"GraphQLScalarType")}constructor(t){var n,i,r,s;let a=(n=t.parseValue)!==null&&n!==void 0?n:jt;this.name=Q(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:jt,this.parseValue=a,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:(c,d)=>a(qe(c,d)),this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||I(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${m(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||I(!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"||I(!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()}},M=class{static{o(this,"GraphQLObjectType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>In(t),this._interfaces=()=>vn(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||I(!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:bn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function vn(e){var t;let n=vt((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||I(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}o(vn,"defineInterfaces");function In(e){let t=It(e.fields);return ke(t)||I(!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;ke(n)||I(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||I(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${m(n.resolve)}.`);let s=(r=n.args)!==null&&r!==void 0?r:{};return ke(s)||I(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:Q(i),description:n.description,type:n.type,args:qt(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}})}o(In,"defineFieldMap");function qt(e){return Object.entries(e).map(([t,n])=>({name:Q(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}))}o(qt,"defineArguments");function ke(e){return k(e)&&!Array.isArray(e)}o(ke,"isPlainObj");function bn(e){return Be(e,t=>({description:t.description,type:t.type,args:Jt(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}o(bn,"fieldsToFieldsConfig");function Jt(e){return ae(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}o(Jt,"argsToArgsConfig");var le=class{static{o(this,"GraphQLInterfaceType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=In.bind(void 0,t),this._interfaces=vn.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||I(!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:bn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},ve=class{static{o(this,"GraphQLUnionType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=Ni.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||I(!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 Ni(e){let t=vt(e.types);return Array.isArray(t)||I(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}o(Ni,"defineTypes");var pe=class{static{o(this,"GraphQLEnumType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=Ei(this.name,t.values),this._valueLookup=new Map(this._values.map(i=>[i.value,i])),this._nameLookup=we(this._values,i=>i.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let n=this._valueLookup.get(t);if(n===void 0)throw new y(`Enum "${this.name}" cannot represent value: ${m(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let i=m(t);throw new y(`Enum "${this.name}" cannot represent non-string value: ${i}.`+ht(this,i))}let n=this.getValue(t);if(n==null)throw new y(`Value "${t}" does not exist in "${this.name}" enum.`+ht(this,t));return n.value}parseLiteral(t,n){if(t.kind!==p.ENUM){let r=$(t);throw new y(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+ht(this,r),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=$(t);throw new y(`Value "${r}" does not exist in "${this.name}" enum.`+ht(this,r),{nodes:t})}return i.value}toConfig(){let t=ae(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 ht(e,t){let n=e.getValues().map(r=>r.name),i=ft(t,n);return lt("the enum value",i)}o(ht,"didYouMeanEnumValue");function Ei(e,t){return ke(t)||I(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(ke(i)||I(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${m(i)}.`),{name:Bt(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:j(i.extensions),astNode:i.astNode}))}o(Ei,"defineEnumValues");var Ie=class{static{o(this,"GraphQLInputObjectType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=gi.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}}toString(){return this.name}toJSON(){return this.toString()}};function gi(e){let t=It(e.fields);return ke(t)||I(!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)||I(!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:j(n.extensions),astNode:n.astNode}))}o(gi,"defineInputFieldMap");var bt=2147483647,_t=-2147483648,Yt=new J({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=Ye(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 y(`Int cannot represent non-integer value: ${m(t)}`);if(n>bt||n<_t)throw new y("Int cannot represent non 32-bit signed integer value: "+m(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new y(`Int cannot represent non-integer value: ${m(e)}`);if(e>bt||e<_t)throw new y(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==p.INT)throw new y(`Int cannot represent non-integer value: ${$(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>bt||t<_t)throw new y(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),_n=new J({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=Ye(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 y(`Float cannot represent non numeric value: ${m(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new y(`Float cannot represent non numeric value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.FLOAT&&e.kind!==p.INT)throw new y(`Float cannot represent non numeric value: ${$(e)}`,e);return parseFloat(e.value)}}),O=new J({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=Ye(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 y(`String cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e!="string")throw new y(`String cannot represent a non string value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.STRING)throw new y(`String cannot represent a non string value: ${$(e)}`,{nodes:e});return e.value}}),P=new J({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Ye(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new y(`Boolean cannot represent a non boolean value: ${m(t)}`)},parseValue(e){if(typeof e!="boolean")throw new y(`Boolean cannot represent a non boolean value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.BOOLEAN)throw new y(`Boolean cannot represent a non boolean value: ${$(e)}`,{nodes:e});return e.value}}),St=new J({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=Ye(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new y(`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 y(`ID cannot represent value: ${m(e)}`)},parseLiteral(e){if(e.kind!==p.STRING&&e.kind!==p.INT)throw new y("ID cannot represent a non-string and non-integer value: "+$(e),{nodes:e});return e.value}}),zt=Object.freeze([O,Yt,_n,P,St]);function Ye(e){if(k(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!k(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}o(Ye,"serializeObject");function Kt(e){return q(e,ne)}o(Kt,"isDirective");var ne=class{static{o(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=j(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||I(!1,`@${t.name} locations must be an Array.`);let r=(i=t.args)!==null&&i!==void 0?i:{};k(r)&&!Array.isArray(r)||I(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=qt(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Jt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},Sn=new ne({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(P),description:"Included when true."}}}),Ln=new ne({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(P),description:"Skipped when true."}}}),On="No longer supported",An=new ne({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:O,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:On}}}),Dn=new ne({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[b.SCALAR],args:{url:{type:new E(O),description:"The URL that specifies the behavior of this scalar."}}}),Ht=Object.freeze([Sn,Ln,An,Dn]);function Lt(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}o(Lt,"isIterableObject");function be(e,t){if(A(t)){let n=be(e,t.ofType);return n?.kind===p.NULL?null:n}if(e===null)return{kind:p.NULL};if(e===void 0)return null;if(B(t)){let n=t.ofType;if(Lt(e)){let i=[];for(let r of e){let s=be(r,n);s!=null&&i.push(s)}return{kind:p.LIST,values:i}}return be(e,n)}if(V(t)){if(!k(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=be(e[i.name],i.type);r&&n.push({kind:p.OBJECT_FIELD,name:{kind:p.NAME,value:i.name},value:r})}return{kind:p.OBJECT,fields:n}}if(Te(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:p.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return wn.test(i)?{kind:p.INT,value:i}:{kind:p.FLOAT,value:i}}if(typeof n=="string")return Y(t)?{kind:p.ENUM,value:n}:t===St&&wn.test(n)?{kind:p.INT,value:n}:{kind:p.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${m(n)}.`)}oe(!1,"Unexpected input type: "+m(t))}o(be,"astFromValue");var wn=/^-?(?:0|[1-9][0-9]*)$/;var ze=new M({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:O,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new E(new w(new E(W))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new E(W),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:W,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:W,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new E(new w(new E(Xt))),resolve:e=>e.getDirectives()}})}),Xt=new M({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
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:()=>({name:{type:new E(O),resolve:e=>e.name},description:{type:O,resolve:e=>e.description},isRepeatable:{type:new E(P),resolve:e=>e.isRepeatable},locations:{type:new E(new w(new E(Wt))),resolve:e=>e.locations},args:{type:new E(new w(new E(Ke))),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})}),Wt=new pe({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."}}}),W=new M({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new E(tn),resolve(e){if(ye(e))return L.SCALAR;if(G(e))return L.OBJECT;if(C(e))return L.INTERFACE;if(X(e))return L.UNION;if(Y(e))return L.ENUM;if(V(e))return L.INPUT_OBJECT;if(B(e))return L.LIST;if(A(e))return L.NON_NULL;oe(!1,`Unexpected type: "${m(e)}".`)}},name:{type:O,resolve:e=>"name"in e?e.name:void 0},description:{type:O,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:O,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new w(new E(Zt)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(G(e)||C(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new w(new E(W)),resolve(e){if(G(e)||C(e))return e.getInterfaces()}},possibleTypes:{type:new w(new E(W)),resolve(e,t,n,{schema:i}){if(xe(e))return i.getPossibleTypes(e)}},enumValues:{type:new w(new E(en)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Y(e)){let n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new w(new E(Ke)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(V(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:W,resolve:e=>"ofType"in e?e.ofType:void 0}})}),Zt=new M({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new E(O),resolve:e=>e.name},description:{type:O,resolve:e=>e.description},args:{type:new E(new w(new E(Ke))),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new E(W),resolve:e=>e.type},isDeprecated:{type:new E(P),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:O,resolve:e=>e.deprecationReason}})}),Ke=new M({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new E(O),resolve:e=>e.name},description:{type:O,resolve:e=>e.description},type:{type:new E(W),resolve:e=>e.type},defaultValue:{type:O,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,i=be(n,t);return i?$(i):null}},isDeprecated:{type:new E(P),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:O,resolve:e=>e.deprecationReason}})}),en=new M({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new E(O),resolve:e=>e.name},description:{type:O,resolve:e=>e.description},isDeprecated:{type:new E(P),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:O,resolve:e=>e.deprecationReason}})}),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 tn=new pe({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."}}}),Ot={name:"__schema",type:new E(ze),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:i})=>i,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},At={name:"__type",type:W,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new E(O),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:i})=>i.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Dt={name:"__typename",type:new E(O),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:i})=>i.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},nn=Object.freeze([ze,Xt,Wt,W,Zt,Ke,en,tn]);var He=class{static{o(this,"GraphQLSchema")}constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,k(t)||I(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||I(!1,`"types" must be Array if provided but got: ${m(t.types)}.`),!t.directives||Array.isArray(t.directives)||I(!1,`"directives" must be Array if provided but got: ${m(t.directives)}.`),this.description=t.description,this.extensions=j(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 s of t.types)r.delete(s),ie(s,r);this._queryType!=null&&ie(this._queryType,r),this._mutationType!=null&&ie(this._mutationType,r),this._subscriptionType!=null&&ie(this._subscriptionType,r);for(let s of this._directives)if(Kt(s))for(let a of s.args)ie(a.type,r);ie(ze,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of r){if(s==null)continue;let a=s.name;if(a||I(!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]=s,C(s)){for(let c of s.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.interfaces.push(s)}}else if(G(s)){for(let c of s.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case H.QUERY:return this.getQueryType();case H.MUTATION:return this.getMutationType();case H.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return X(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),X(t))for(let r of t.getTypes())i[r.name]=!0;else{let r=this.getImplementations(t);for(let s of r.objects)i[s.name]=!0;for(let s of r.interfaces)i[s.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 ie(e,t){let n=te(e);if(!t.has(n)){if(t.add(n),X(n))for(let i of n.getTypes())ie(i,t);else if(G(n)||C(n)){for(let i of n.getInterfaces())ie(i,t);for(let i of Object.values(n.getFields())){ie(i.type,t);for(let r of i.args)ie(r.type,t)}}else if(V(n))for(let i of Object.values(n.getFields()))ie(i.type,t)}return t}o(ie,"collectReferencedTypes");function Ne(e,t){switch(t.kind){case p.LIST_TYPE:{let n=Ne(e,t.type);return n&&new w(n)}case p.NON_NULL_TYPE:{let n=Ne(e,t.type);return n&&new E(n)}case p.NAMED_TYPE:return e.getType(t.name.value)}}o(Ne,"typeFromAST");var Ee=class{static{o(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??vi,n&&(z(n)&&this._inputTypeStack.push(n),ce(n)&&this._parentTypeStack.push(n),de(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case p.SELECTION_SET:{let r=te(this.getType());this._parentTypeStack.push(ce(r)?r:void 0);break}case p.FIELD:{let r=this.getParentType(),s,a;r&&(s=this._getFieldDef(n,r,t),s&&(a=s.type)),this._fieldDefStack.push(s),this._typeStack.push(de(a)?a:void 0);break}case p.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case p.OPERATION_DEFINITION:{let r=n.getRootType(t.operation);this._typeStack.push(G(r)?r:void 0);break}case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:{let r=t.typeCondition,s=r?Ne(n,r):te(this.getType());this._typeStack.push(de(s)?s:void 0);break}case p.VARIABLE_DEFINITION:{let r=Ne(n,t.type);this._inputTypeStack.push(z(r)?r:void 0);break}case p.ARGUMENT:{var i;let r,s,a=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();a&&(r=a.args.find(c=>c.name===t.name.value),r&&(s=r.type)),this._argument=r,this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(z(s)?s:void 0);break}case p.LIST:{let r=gt(this.getInputType()),s=B(r)?r.ofType:r;this._defaultValueStack.push(void 0),this._inputTypeStack.push(z(s)?s:void 0);break}case p.OBJECT_FIELD:{let r=te(this.getInputType()),s,a;V(r)&&(a=r.getFields()[t.name.value],a&&(s=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(z(s)?s:void 0);break}case p.ENUM:{let r=te(this.getInputType()),s;Y(r)&&(s=r.getValue(t.value)),this._enumValue=s;break}default:}}leave(t){switch(t.kind){case p.SELECTION_SET:this._parentTypeStack.pop();break;case p.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case p.DIRECTIVE:this._directive=null;break;case p.OPERATION_DEFINITION:case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:this._typeStack.pop();break;case p.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case p.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.LIST:case p.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.ENUM:this._enumValue=null;break;default:}}};function vi(e,t,n){let i=n.name.value;if(i===Ot.name&&e.getQueryType()===t)return Ot;if(i===At.name&&e.getQueryType()===t)return At;if(i===Dt.name&&ce(t))return Dt;if(G(t)||C(t))return t.getFields()[i]}o(vi,"getFieldDef");function Ce(e,t){return{enter(...n){let i=n[0];e.enter(i);let r=Re(t,i.kind).enter;if(r){let s=r.apply(t,n);return s!==void 0&&(e.leave(i),je(s)&&e.enter(s)),s}},leave(...n){let i=n[0],r=Re(t,i.kind).leave,s;return r&&(s=r.apply(t,n)),e.leave(i),s}}}o(Ce,"visitWithTypeInfo");function wt(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}o(wt,"printPathArray");function rn(e,t,n){return{prev:e,key:t,typename:n}}o(rn,"addPath");function fe(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}o(fe,"pathToArray");function sn(e,t,n=Ii){return Xe(e,t,n,void 0)}o(sn,"coerceInputValue");function Ii(e,t,n){let i="Invalid value "+m(t);throw e.length>0&&(i+=` at "value${wt(e)}"`),n.message=i+": "+n.message,n}o(Ii,"defaultOnError");function Xe(e,t,n,i){if(A(t)){if(e!=null)return Xe(e,t.ofType,n,i);n(fe(i),e,new y(`Expected non-nullable type "${m(t)}" not to be null.`));return}if(e==null)return null;if(B(t)){let r=t.ofType;return Lt(e)?Array.from(e,(s,a)=>{let c=rn(i,a,void 0);return Xe(s,r,n,c)}):[Xe(e,r,n,i)]}if(V(t)){if(!k(e)){n(fe(i),e,new y(`Expected type "${t.name}" to be an object.`));return}let r={},s=t.getFields();for(let a of Object.values(s)){let c=e[a.name];if(c===void 0){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(A(a.type)){let d=m(a.type);n(fe(i),e,new y(`Field "${a.name}" of required type "${d}" was not provided.`))}continue}r[a.name]=Xe(c,a.type,n,rn(i,a.name,t.name))}for(let a of Object.keys(e))if(!s[a]){let c=ft(a,Object.keys(t.getFields()));n(fe(i),e,new y(`Field "${a}" is not defined by type "${t.name}".`+lt(c)))}return r}if(Te(t)){let r;try{r=t.parseValue(e)}catch(s){s instanceof y?n(fe(i),e,s):n(fe(i),e,new y(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return r===void 0&&n(fe(i),e,new y(`Expected type "${t.name}".`)),r}oe(!1,"Unexpected input type: "+m(t))}o(Xe,"coerceInputValueImpl");function ue(e,t,n){if(e){if(e.kind===p.VARIABLE){let i=e.name.value;if(n==null||n[i]===void 0)return;let r=n[i];return r===null&&A(t)?void 0:r}if(A(t))return e.kind===p.NULL?void 0:ue(e,t.ofType,n);if(e.kind===p.NULL)return null;if(B(t)){let i=t.ofType;if(e.kind===p.LIST){let s=[];for(let a of e.values)if(Rn(a,n)){if(A(i))return;s.push(null)}else{let c=ue(a,i,n);if(c===void 0)return;s.push(c)}return s}let r=ue(e,i,n);return r===void 0?void 0:[r]}if(V(t)){if(e.kind!==p.OBJECT)return;let i=Object.create(null),r=we(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let a=r[s.name];if(!a||Rn(a.value,n)){if(s.defaultValue!==void 0)i[s.name]=s.defaultValue;else if(A(s.type))return;continue}let c=ue(a.value,s.type,n);if(c===void 0)return;i[s.name]=c}return i}if(Te(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}oe(!1,"Unexpected input type: "+m(t))}}o(ue,"valueFromAST");function Rn(e,t){return e.kind===p.VARIABLE&&(t==null||t[e.name.value]===void 0)}o(Rn,"isMissingVariable");function Rt(e,t,n,i){let r=[],s=i?.maxErrors;try{let a=bi(e,t,n,c=>{if(s!=null&&r.length>=s)throw new y("Too many errors processing variables, error limit reached. Execution aborted.");r.push(c)});if(r.length===0)return{coerced:a}}catch(a){r.push(a)}return{errors:r}}o(Rt,"getVariableValues");function bi(e,t,n,i){let r={};for(let s of t){let a=s.variable.name.value,c=Ne(e,s.type);if(!z(c)){let f=$(s.type);i(new y(`Variable "$${a}" expected value of type "${f}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!kn(n,a)){if(s.defaultValue)r[a]=ue(s.defaultValue,c);else if(A(c)){let f=m(c);i(new y(`Variable "$${a}" of required type "${f}" was not provided.`,{nodes:s}))}continue}let d=n[a];if(d===null&&A(c)){let f=m(c);i(new y(`Variable "$${a}" of non-null type "${f}" must not be null.`,{nodes:s}));continue}r[a]=sn(d,c,(f,T,x)=>{let N=`Variable "$${a}" got invalid value `+m(T);f.length>0&&(N+=` at "${a}${wt(f)}"`),i(new y(N+"; "+x.message,{nodes:s,originalError:x}))})}return r}o(bi,"coerceVariableValues");function We(e,t,n){var i;let r={},s=(i=t.arguments)!==null&&i!==void 0?i:[],a=we(s,c=>c.name.value);for(let c of e.args){let d=c.name,f=c.type,T=a[d];if(!T){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new y(`Argument "${d}" of required type "${m(f)}" was not provided.`,{nodes:t});continue}let x=T.value,N=x.kind===p.NULL;if(x.kind===p.VARIABLE){let g=x.name.value;if(n==null||!kn(n,g)){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new y(`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&&A(f))throw new y(`Argument "${d}" of non-null type "${m(f)}" must not be null.`,{nodes:x});let S=ue(x,f,n);if(S===void 0)throw new y(`Argument "${d}" has invalid value ${$(x)}.`,{nodes:x});r[d]=S}return r}o(We,"getArgumentValues");function Ze(e,t,n){var i;let r=(i=t.directives)===null||i===void 0?void 0:i.find(s=>s.name.value===e.name);if(r)return We(e,r,n)}o(Ze,"getDirectiveValues");function kn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}o(kn,"hasOwnProperty");var kt=class{static{o(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===p.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 s of r.selections)s.kind===p.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&i.push(s.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],s;for(;s=r.pop();)for(let a of this.getFragmentSpreads(s)){let c=a.name.value;if(i[c]!==!0){i[c]=!0;let d=this.getFragment(c);d&&(n.push(d),r.push(d.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},Cn=class extends kt{static{o(this,"SDLValidationContext")}constructor(t,n,i){super(t,i),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}},Fe=class extends kt{static{o(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 Ee(this._schema);he(t,Ce(r,{VariableDefinition:()=>!1,Variable(s){i.push({node:s,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 Ct(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},n=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",r=t.directiveIsRepeatable?"isRepeatable":"",s=t.schemaDescription?n:"";function a(c){return t.inputValueDeprecation?c:""}return o(a,"inputDeprecation"),`
76
+ query IntrospectionQuery {
77
+ __schema {
78
+ ${s}
79
+ queryType { name }
80
+ mutationType { name }
81
+ subscriptionType { name }
82
+ types {
83
+ ...FullType
84
+ }
85
+ directives {
86
+ name
87
+ ${n}
88
+ ${r}
89
+ locations
90
+ args${a("(includeDeprecated: true)")} {
91
+ ...InputValue
92
+ }
93
+ }
94
+ }
95
+ }
96
+
97
+ fragment FullType on __Type {
98
+ kind
99
+ name
100
+ ${n}
101
+ ${i}
102
+ fields(includeDeprecated: true) {
103
+ name
104
+ ${n}
105
+ args${a("(includeDeprecated: true)")} {
106
+ ...InputValue
107
+ }
108
+ type {
109
+ ...TypeRef
110
+ }
111
+ isDeprecated
112
+ deprecationReason
113
+ }
114
+ inputFields${a("(includeDeprecated: true)")} {
115
+ ...InputValue
116
+ }
117
+ interfaces {
118
+ ...TypeRef
119
+ }
120
+ enumValues(includeDeprecated: true) {
121
+ name
122
+ ${n}
123
+ isDeprecated
124
+ deprecationReason
125
+ }
126
+ possibleTypes {
127
+ ...TypeRef
128
+ }
129
+ }
130
+
131
+ fragment InputValue on __InputValue {
132
+ name
133
+ ${n}
134
+ type { ...TypeRef }
135
+ defaultValue
136
+ ${a("isDeprecated")}
137
+ ${a("deprecationReason")}
138
+ }
139
+
140
+ fragment TypeRef on __Type {
141
+ kind
142
+ name
143
+ ofType {
144
+ kind
145
+ name
146
+ ofType {
147
+ kind
148
+ name
149
+ ofType {
150
+ kind
151
+ name
152
+ ofType {
153
+ kind
154
+ name
155
+ ofType {
156
+ kind
157
+ name
158
+ ofType {
159
+ kind
160
+ name
161
+ ofType {
162
+ kind
163
+ name
164
+ ofType {
165
+ kind
166
+ name
167
+ ofType {
168
+ kind
169
+ name
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ `}o(Ct,"getIntrospectionQuery");function Ft(e,t){k(e)&&k(e.__schema)||I(!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=ae(n.types,l=>l.name,l=>N(l));for(let l of[...zt,...nn])i[l.name]&&(i[l.name]=l);let r=n.queryType?T(n.queryType):null,s=n.mutationType?T(n.mutationType):null,a=n.subscriptionType?T(n.subscriptionType):null,c=n.directives?n.directives.map($n):[];return new He({description:n.description,query:r,mutation:s,subscription:a,types:Object.values(i),directives:c,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 w(d(v))}if(l.kind===L.NON_NULL){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");let se=d(v);return new E(Et(se))}return f(l)}function f(l){let v=l.name;if(!v)throw new Error(`Unknown type reference: ${m(l)}.`);let se=i[v];if(!se)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 se}function T(l){return Tt(f(l))}function x(l){return xt(f(l))}function N(l){if(l!=null&&l.name!=null&&l.kind!=null)switch(l.kind){case L.SCALAR:return S(l);case L.OBJECT:return U(l);case L.INTERFACE:return K(l);case L.UNION:return F(l);case L.ENUM:return me(l);case L.INPUT_OBJECT:return re(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 S(l){return new J({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 U(l){return new M({name:l.name,description:l.description,interfaces:()=>g(l),fields:()=>Z(l)})}function K(l){return new le({name:l.name,description:l.description,interfaces:()=>g(l),fields:()=>Z(l)})}function F(l){if(!l.possibleTypes){let v=m(l);throw new Error(`Introspection result missing possibleTypes: ${v}.`)}return new ve({name:l.name,description:l.description,types:()=>l.possibleTypes.map(T)})}function me(l){if(!l.enumValues){let v=m(l);throw new Error(`Introspection result missing enumValues: ${v}.`)}return new pe({name:l.name,description:l.description,values:ae(l.enumValues,v=>v.name,v=>({description:v.description,deprecationReason:v.deprecationReason}))})}function re(l){if(!l.inputFields){let v=m(l);throw new Error(`Introspection result missing inputFields: ${v}.`)}return new Ie({name:l.name,description:l.description,fields:()=>_e(l.inputFields)})}function Z(l){if(!l.fields)throw new Error(`Introspection result missing fields: ${m(l)}.`);return ae(l.fields,v=>v.name,Me)}function Me(l){let v=d(l.type);if(!de(v)){let se=m(v);throw new Error(`Introspection must provide output type for fields, but received: ${se}.`)}if(!l.args){let se=m(l);throw new Error(`Introspection result missing field args: ${se}.`)}return{description:l.description,deprecationReason:l.deprecationReason,type:v,args:_e(l.args)}}function _e(l){return ae(l,v=>v.name,et)}function et(l){let v=d(l.type);if(!z(v)){let Pn=m(v);throw new Error(`Introspection must provide input type for arguments, but received: ${Pn}.`)}let se=l.defaultValue!=null?ue(ut(l.defaultValue),v):void 0;return{description:l.description,type:v,defaultValue:se,deprecationReason:l.deprecationReason}}function $n(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 ne({name:l.name,description:l.description,isRepeatable:l.isRepeatable,locations:l.locations.slice(),args:_e(l.args)})}}o(Ft,"buildClientSchema");function zi(e,t){return`The query exceeds the maximum complexity of ${e}. Actual complexity is ${t}`}o(zi,"queryComplexityMessage");function Fn(e){let t=new Ee(e.schema),n=[],i=new Fe(e.schema,e.query,t,s=>n.push(s)),r=new on(i,{maximumComplexity:e.maximumComplexity??1/0,estimators:e.estimators,variables:e.variables,operationName:e.operationName,context:e.context});if(he(e.query,Ce(t,r)),n.length)throw n.pop();return r.complexity}o(Fn,"getComplexity");var on=class{static{o(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}=Rt(this.context.getSchema(),t.variableDefinitions?[...t.variableDefinitions]:[],this.options.variables??{});if(i&&i.length){i.forEach(s=>this.context.reportError(s));return}this.variableValues=n||{};let r=this.context.getSchema();switch(t.operation){case"query":{let s=r.getQueryType();if(!s)throw new Error("Schema does not define the required query root type");this.complexity+=this.nodeComplexity(t,s);break}case"mutation":{let s=r.getMutationType();if(!s)throw new Error("Schema does not define the required mutation root type");this.complexity+=this.nodeComplexity(t,s);break}case"subscription":{let s=r.getSubscriptionType();if(!s)throw new Error("Schema does not define the required mutation subscription type");this.complexity+=this.nodeComplexity(t,s);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 M||n instanceof le)&&(i=n.getFields());let r;xe(n)?r=this.context.getSchema().getPossibleTypes(n).map(a=>a.name):r=[n.name];let s=t.selectionSet.selections.reduce((a,c)=>{let d=a,f=!0,T=!1;for(let x of c.directives??[])switch(x.name.value){case"include":{let S=this.includeDirectiveDef&&Ze(this.includeDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(f=S.if);break}case"skip":{let S=this.skipDirectiveDef&&Ze(this.skipDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(T=S.if);break}}if(!f||T)return a;switch(c.kind){case p.FIELD:{let x=i[c.name.value];if(!x)break;let N=te(x.type),S;try{S=We(x,c,this.variableValues||{})}catch(F){return this.context.reportError(F),a}let g=0;ce(N)&&(g=this.nodeComplexity(c,N));let U={childComplexity:g,args:S,field:x,node:c,type:n,context:this.requestContext};if(!this.estimators.find(F=>{let me=F(U);return typeof me=="number"&&!isNaN(me)?(d=Ve(me,a,r),!0):!1}))return this.context.reportError(new y(`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 p.FRAGMENT_SPREAD:{let x=this.context.getFragment(c.name.value);if(!x)break;let N=this.context.getSchema().getType(x.typeCondition.name.value);if(!ce(N))break;let S=this.nodeComplexity(x,N);xe(N)?d=Ve(S,a,this.context.getSchema().getPossibleTypes(N).map(g=>g.name)):d=Ve(S,a,[N.name]);break}case p.INLINE_FRAGMENT:{let x=n;if(c.typeCondition&&c.typeCondition.name&&(x=this.context.getSchema().getType(c.typeCondition.name.value)||x,!ce(x)))break;let N=this.nodeComplexity(c,x);xe(x)?d=Ve(N,a,this.context.getSchema().getPossibleTypes(x).map(S=>S.name)):d=Ve(N,a,[x.name]);break}default:{d=Ve(this.nodeComplexity(c,n),a,r);break}}return d},{});return s?Math.max(...Object.values(s),0):NaN}return 0}createError(){return typeof this.options.createError=="function"?this.options.createError(this.options.maximumComplexity,this.complexity):new y(zi(this.options.maximumComplexity,this.complexity))}};function Ve(e,t,n){for(let i of n)Object.prototype.hasOwnProperty.call(t,i)?t[i]+=e:t[i]=e;return t}o(Ve,"addComplexities");function Vn(e){let t=e?.defaultComplexity??1;return n=>t+n.childComplexity}o(Vn,"simpleEstimator");var Un=o((e,t,n={})=>{let{definitions:i}=e,r=Ki(i),s=Hi(i);return Object.entries(s).map(([a,c])=>Vt(c,r,0,t,a,n))},"depthLimit");function Ki(e){return e.reduce((t,n)=>(n.kind===p.FRAGMENT_DEFINITION&&(t[n?.name?.value??""]=n),t),{})}o(Ki,"getFragments");function Hi(e){return e.reduce((t,n)=>{if(n.kind===p.OPERATION_DEFINITION){let i=n?.name?.value??"";t[i]=n}return t},{})}o(Hi,"getQueriesAndMutations");function Vt(e,t,n,i,r,s){if(n>i)throw s?.onLimitReached?.(n,r),new y(`${r||"Your query"} exceeds maximum operation depth of ${i}`,{nodes:[e]});let a=s?.ignore??[/^__/];switch(e.kind){case p.FIELD:return Xi(e,a)||!e.selectionSet?0:1+Math.max(...e.selectionSet.selections.map(c=>Vt(c,t,n+1,i,r,s)));case p.FRAGMENT_SPREAD:return Vt(t[e.name.value],t,n,i,r,s);case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:case p.OPERATION_DEFINITION:return Math.max(...e.selectionSet.selections.map(c=>Vt(c,t,n,i,r,s)));default:throw new Error("uh oh! depth crawler cannot handle: "+e.kind)}}o(Vt,"determineDepth");var Xi=o((e,t)=>t.find(n=>e.name.value.match(n)!==null)||!1,"isIgnored");var Wi=o(async(e,t)=>{if(!t.complexityLimit)throw new Ue.ConfigurationError("No complexity maximum defined, you need to pass a maxComplexity to the policy");let i=t.endpointUrl;if(!i)throw new Ue.ConfigurationError("No GraphQL endpoint, you need to pass a endpointUrl to the policy");let r=Ct(),c=(await(await fetch(i,{method:"POST",body:JSON.stringify({query:r}),headers:{"Content-Type":"application/json"}})).json()).data;if(!c||!c?.__schema)throw new y("GraphQL introspection query failed, enable introspection or pass a schema url in configuration.");let d=Ft(c,{assumeValid:!0}),f=Fn({estimators:[Vn({defaultComplexity:1})],schema:d,query:e,variables:{count:10}});if(t.complexityLimit&&f>t.complexityLimit)throw new y(`Query is too complex (${f}/${t.complexityLimit}), remove some fields and try again`)},"applyComplexityLimitPolicy"),Zi=o(async(e,t)=>{let n=t.depthLimit;if(!n)throw new Ue.ConfigurationError("No maximum depth defined, you need to pass a maxDepth to the policy");return Math.max(...Un(e,n))},"applyDepthLimitPolicy"),Mn=o(async(e,t,n)=>{let i=Ue.SystemLogMap.getLogger(t);try{let s=await e.clone().json(),a=ct(s.query);n.useDepthLimit&&await Zi(a,n.useDepthLimit),n.useComplexityLimit&&await Wi(a,n.useComplexityLimit)}catch(r){if(r instanceof y)return i.info(r),new Response(JSON.stringify(r.toJSON()),{status:400,headers:{"Content-Type":"application/json"}});throw r}return e},"GraphQLComplexityLimitInboundPolicy");var Gn=require("@zuplo/runtime");function er(e){if(!e)return!1;let t=e.replace(/\s/g,"");return t.includes("__schema")||t.includes("__type")}o(er,"isIntrospectionQuery");var jn=o(async(e,t)=>{let i=await e.clone().json();return er(i.query)?Gn.HttpProblems.forbidden(e,t,{detail:"Introspection queries are not allowed"}):e},"GraphQLDisableIntrospectionInboundPolicy");
181
+ /*! For license information please see index.min.cjs.LEGAL.txt */
File without changes