UNPKG

ruru

Version:

Grafast-flavoured GraphiQL distribution

2 lines 42.4 kB
export const __webpack_esm_id__=2541;export const __webpack_esm_ids__=[2541];export const __webpack_esm_modules__={82541(e,t,n){n.r(t),n.d(t,{default:()=>Ge,languages:()=>J,options:()=>q,parsers:()=>Q,printers:()=>$e});var i=Object.defineProperty,r=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},s={};r(s,{languages:()=>J,options:()=>q,parsers:()=>Q,printers:()=>$e});var a=(e,t,n,i)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,i):n.global?t.replace(n,i):t.split(n).join(i)},o="line",l=()=>{},c=l,u=l;function p(e){return c(e),{type:"indent",contents:e}}function h(e,t={}){return c(e),u(t.expandedStates,!0),{type:"group",id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function d(e,t="",n={}){return c(e),""!==t&&c(t),{type:"if-break",breakContents:e,flatContents:t,groupId:n.groupId}}var f={type:o},E={type:o,soft:!0},m=[{type:o,hard:!0},{type:"break-parent"}];function T(e,t){c(e),u(t);let n=[];for(let i=0;i<t.length;i++)0!==i&&n.push(e),n.push(t[i]);return n}function N(e){return(t,n,i)=>{let r=!(null==i||!i.backwards);if(!1===n)return!1;let{length:s}=t,a=n;for(;a>=0&&a<s;){let n=t.charAt(a);if(e instanceof RegExp){if(!e.test(n))return a}else if(!e.includes(n))return a;r?a--:a++}return(-1===a||a===s)&&a}}N(/\s/u);var I=N(" \t"),y=N(",; \t"),_=N(/[^\n\r]/u),v=function(e,t,n){let i=!(null==n||!n.backwards);if(!1===t)return!1;let r=e.charAt(t);if(i){if("\r"===e.charAt(t-1)&&"\n"===r)return t-2;if("\n"===r||"\r"===r||"\u2028"===r||"\u2029"===r)return t-1}else{if("\r"===r&&"\n"===e.charAt(t+1))return t+2;if("\n"===r||"\r"===r||"\u2028"===r||"\u2029"===r)return t+1}return t},x=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;n<e.length;++n)if("*"===e.charAt(n)&&"/"===e.charAt(n+1))return n+2;return t},O=function(e,t){let n=null,i=t;for(;i!==n;)n=i,i=y(e,i),i=x(e,i),i=I(e,i);return i=function(e,t){return!1!==t&&("/"===e.charAt(t)&&"/"===e.charAt(t+1)?_(e,t):t)}(e,i),i=v(e,i),!1!==i&&function(e,t,n={}){let i=I(e,n.backwards?t-1:t,n);return i!==v(e,i,n)}(e,i)},A=function(e){return Array.isArray(e)&&e.length>0},D=class extends Error{name="UnexpectedNodeError";constructor(e,t,n="type"){super(`Unexpected ${t} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},k=null;function g(e){if(null!==k&&(k.property,1)){let e=k;return k=g.prototype=null,e}return k=g.prototype=e??Object.create(null),new g}for(let e=0;e<=10;e++)g();var S,C,b=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},L=class{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,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}}},R={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"]};new Set(Object.keys(R)),(C=S||(S={})).QUERY="query",C.MUTATION="mutation",C.SUBSCRIPTION="subscription";var F=function(e,t="type"){return function(e){g(e)}(e),function(n){let i=n[t],r=e[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:n});return r}}(R,"kind");function w(e){return e.loc.start}function P(e){return e.loc.end}var U=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u,V=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u,M=function(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return"InputValueDefinition"!==i.kind||i.description.block?r.push(m):r.push(f),r};function B(e,t,n){if(0===n.directives.length)return"";let i=T(f,e.map(t,"directives"));return"FragmentDefinition"===n.kind||"OperationDefinition"===n.kind?h([f,i]):[" ",h(p([E,i]))]}function j(e,t,n,i){return e.map(({isLast:e,node:i})=>{let r=n();return!e&&O(t.originalText,P(i))?[r,m]:r},i)}function K(e,t){let{node:n}=e;return A(n.variableDefinitions)?h(["(",p([E,T([d("",", "),E],e.map(t,"variableDefinitions"))]),E,")"]):""}function $(e,t){"StringValue"===e.kind&&e.block&&!e.value.includes("\n")&&(t.value=e.value.trim())}$.ignoredProperties=new Set(["loc","comments"]);var G={print:function(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...T(m,j(e,t,n,"definitions")),m];case"OperationDefinition":{let r="{"!==t.originalText[w(i)],s=!!i.name;return[r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&A(i.variableDefinitions)?" ":"",K(e,n),B(e,n,i),r||s?" ":"",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),K(e,n)," on ",n("typeCondition"),B(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",p([m,T(m,j(e,t,n,"selections"))]),m,"}"];case"Field":return h([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],j(e,t,n,"arguments"))]),E,")"]):"",B(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"StringValue":if(i.block){let e=a(!1,i.value,'"""',String.raw`\"""`).split("\n");return 1===e.length&&(e[0]=e[0].trim()),e.every(e=>""===e)&&(e.length=0),T(m,['"""',...e,'"""'])}return['"',a(!1,a(!1,i.value,/["\\]/gu,String.raw`\$&`),"\n",String.raw`\n`),'"'];case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return h(["[",p([E,T([d("",", "),E],e.map(n,"values"))]),E,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return h(["{",r,p([E,T([d("",", "),E],e.map(n,"fields"))]),E,d("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],j(e,t,n,"arguments"))]),E,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",B(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push(M(e,0,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...function(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,a=e.map(n,"interfaces");for(let e=0;e<s.length;e++){let n=s[e];r.push(a[e]);let i=s[e+1];if(i){let e=t.originalText.slice(n.loc.end,i.loc.start).includes("#");r.push(" &",e?f:" ")}}return r}(e,t,n)),s.push(B(e,n,i)),i.fields.length>0&&s.push([" {",p([m,T(m,j(e,t,n,"fields"))]),m,"}"]),s}case"FieldDefinition":return[M(e,0,n),n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],j(e,t,n,"arguments"))]),E,")"]):"",": ",n("type"),B(e,n,i)];case"DirectiveDefinition":return[M(e,0,n),"directive ","@",n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],j(e,t,n,"arguments"))]),E,")"]):"",i.repeatable?" repeatable":""," on ",...T(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[M(e,0,n),"EnumTypeExtension"===i.kind?"extend ":"","enum ",n("name"),B(e,n,i),i.values.length>0?[" {",p([m,T(m,j(e,t,n,"values"))]),m,"}"]:""];case"EnumValueDefinition":return[M(e,0,n),n("name"),B(e,n,i)];case"InputValueDefinition":return[M(e,0,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",B(e,n,i)];case"SchemaExtension":return["extend schema",B(e,n,i),...i.operationTypes.length>0?[" {",p([m,T(m,j(e,t,n,"operationTypes"))]),m,"}"]:[]];case"SchemaDefinition":return[M(e,0,n),"schema",B(e,n,i)," {",i.operationTypes.length>0?p([m,T(m,j(e,t,n,"operationTypes"))]):"",m,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),B(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",B(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return h([M(e,0,n),h(["UnionTypeExtension"===i.kind?"extend ":"","union ",n("name"),B(e,n,i),i.types.length>0?[" =",d(""," "),p([d([f,"| "]),T([f,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[M(e,0,n),"ScalarTypeExtension"===i.kind?"extend ":"","scalar ",n("name"),B(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new D(i,"Graphql","kind")}},massageAstNode:$,hasPrettierIgnore:function(e){var t;let{node:n}=e;return null==(t=null==n?void 0:n.comments)?void 0:t.some(e=>"prettier-ignore"===e.value.trim())},insertPragma:function(e){return`# @format\n\n${e}`},printComment:function(e){let t=e.node;if("Comment"===t.kind)return"#"+t.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(t))},canAttachComment:function(e){return"Comment"!==e.kind},getVisitorKeys:F},Y=G,J=[{name:"GraphQL",type:"data",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"],linguistLanguageId:139}],q={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."}},Q={};function X(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}r(Q,{graphql:()=>Ke});var z=/\r\n|[\n\r]/g;function H(e,t){let n=0,i=1;for(let r of e.body.matchAll(z)){if("number"==typeof r.index||X(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function W(e){return Z(e.source,H(e.source,e.start))}function Z(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,o=1===t.line?n:0,l=t.column+o,c=`${e.name}:${a}:${l}\n`,u=i.split(/\r\n|[\n\r]/g),p=u[r];if(p.length>120){let e=Math.floor(l/80),t=l%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return c+ee([[`${a} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+ee([[a-1+" |",u[r-1]],[`${a} |`,p],["|","^".padStart(l)],[`${a+1} |`,u[r+1]]])}function ee(e){let t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}var te,ne,ie,re=class e extends Error{constructor(t,...n){var i,r,s;let{nodes:a,source:o,positions:l,path:c,originalError:u,extensions:p}=function(e){let t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=se(Array.isArray(a)?a:a?[a]:void 0);let h=se(null===(i=this.nodes)||void 0===i?void 0:i.map(e=>e.loc).filter(e=>null!=e));this.source=o??(null==h||null===(r=h[0])||void 0===r?void 0:r.source),this.positions=l??(null==h?void 0:h.map(e=>e.start)),this.locations=l&&o?l.map(e=>H(o,e)):null==h?void 0:h.map(e=>H(e.source,e.start));let d=function(e){return"object"==typeof e&&null!==e}(null==u?void 0:u.extensions)?null==u?void 0:u.extensions:void 0;this.extensions=null!==(s=p??d)&&void 0!==s?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}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.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 e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+="\n\n"+W(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+Z(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function se(e){return void 0===e||0===e.length?void 0:e}function ae(e,t,n){return new re(`Syntax Error: ${n}`,{source:e,positions:[t]})}function oe(e){return 9===e||32===e}function le(e){return e>=48&&e<=57}function ce(e){return e>=97&&e<=122||e>=65&&e<=90}function ue(e){return ce(e)||95===e}function pe(e){return ce(e)||le(e)||95===e}function he(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let t=0;t<e.length;++t){var s;let a=e[t],o=de(a);o!==a.length&&(i=null!==(s=i)&&void 0!==s?s:t,r=t,0!==t&&o<n&&(n=o))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=i)&&void 0!==t?t:0,r+1)}function de(e){let t=0;for(;t<e.length&&oe(e.charCodeAt(t));)++t;return t}!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"}(te||(te={})),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"}(ne||(ne={})),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"}(ie||(ie={}));var fe=class{constructor(e){let t=new L(ie.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==ie.EOF)do{if(e.next)e=e.next;else{let t=_e(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===ie.COMMENT);return e}};function Ee(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function me(e,t){return Te(e.charCodeAt(t))&&Ne(e.charCodeAt(t+1))}function Te(e){return e>=55296&&e<=56319}function Ne(e){return e>=56320&&e<=57343}function Ie(e,t){let n=e.source.body.codePointAt(t);if(void 0===n)return ie.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ye(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new L(t,n,i,s,a,r)}function _e(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let t=n.charCodeAt(r);switch(t){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:10===n.charCodeAt(r+1)?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return ve(e,r);case 33:return ye(e,ie.BANG,r,r+1);case 36:return ye(e,ie.DOLLAR,r,r+1);case 38:return ye(e,ie.AMP,r,r+1);case 40:return ye(e,ie.PAREN_L,r,r+1);case 41:return ye(e,ie.PAREN_R,r,r+1);case 46:if(46===n.charCodeAt(r+1)&&46===n.charCodeAt(r+2))return ye(e,ie.SPREAD,r,r+3);break;case 58:return ye(e,ie.COLON,r,r+1);case 61:return ye(e,ie.EQUALS,r,r+1);case 64:return ye(e,ie.AT,r,r+1);case 91:return ye(e,ie.BRACKET_L,r,r+1);case 93:return ye(e,ie.BRACKET_R,r,r+1);case 123:return ye(e,ie.BRACE_L,r,r+1);case 124:return ye(e,ie.PIPE,r,r+1);case 125:return ye(e,ie.BRACE_R,r,r+1);case 34:return 34===n.charCodeAt(r+1)&&34===n.charCodeAt(r+2)?be(e,r):Ae(e,r)}if(le(t)||45===t)return xe(e,r,t);if(ue(t))return Le(e,r);throw ae(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ee(t)||me(n,r)?`Unexpected character: ${Ie(e,r)}.`:`Invalid character: ${Ie(e,r)}.`)}return ye(e,ie.EOF,i,i)}function ve(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let e=n.charCodeAt(r);if(10===e||13===e)break;if(Ee(e))++r;else{if(!me(n,r))break;r+=2}}return ye(e,ie.COMMENT,t,r,n.slice(t+1,r))}function xe(e,t,n){let i=e.source.body,r=t,s=n,a=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),le(s))throw ae(e.source,r,`Invalid number, unexpected digit after 0: ${Ie(e,r)}.`)}else r=Oe(e,r,s),s=i.charCodeAt(r);if(46===s&&(a=!0,s=i.charCodeAt(++r),r=Oe(e,r,s),s=i.charCodeAt(r)),(69===s||101===s)&&(a=!0,s=i.charCodeAt(++r),(43===s||45===s)&&(s=i.charCodeAt(++r)),r=Oe(e,r,s),s=i.charCodeAt(r)),46===s||ue(s))throw ae(e.source,r,`Invalid number, expected digit but got: ${Ie(e,r)}.`);return ye(e,a?ie.FLOAT:ie.INT,t,r,i.slice(t,r))}function Oe(e,t,n){if(!le(n))throw ae(e.source,t,`Invalid number, expected digit but got: ${Ie(e,t)}.`);let i=e.source.body,r=t+1;for(;le(i.charCodeAt(r));)++r;return r}function Ae(e,t){let n=e.source.body,i=n.length,r=t+1,s=r,a="";for(;r<i;){let i=n.charCodeAt(r);if(34===i)return a+=n.slice(s,r),ye(e,ie.STRING,t,r+1,a);if(92===i){a+=n.slice(s,r);let t=117===n.charCodeAt(r+1)?123===n.charCodeAt(r+2)?De(e,r):ke(e,r):Ce(e,r);a+=t.value,r+=t.size,s=r;continue}if(10===i||13===i)break;if(Ee(i))++r;else{if(!me(n,r))throw ae(e.source,r,`Invalid character within String: ${Ie(e,r)}.`);r+=2}}throw ae(e.source,r,"Unterminated string.")}function De(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let e=n.charCodeAt(t+r++);if(125===e){if(r<5||!Ee(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Se(e),i<0)break}throw ae(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function ke(e,t){let n=e.source.body,i=ge(n,t+2);if(Ee(i))return{value:String.fromCodePoint(i),size:6};if(Te(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){let e=ge(n,t+8);if(Ne(e))return{value:String.fromCodePoint(i,e),size:12}}throw ae(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function ge(e,t){return Se(e.charCodeAt(t))<<12|Se(e.charCodeAt(t+1))<<8|Se(e.charCodeAt(t+2))<<4|Se(e.charCodeAt(t+3))}function Se(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Ce(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:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw ae(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function be(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,o="",l=[];for(;s<i;){let i=n.charCodeAt(s);if(34===i&&34===n.charCodeAt(s+1)&&34===n.charCodeAt(s+2)){o+=n.slice(a,s),l.push(o);let i=ye(e,ie.BLOCK_STRING,t,s+3,he(l).join("\n"));return e.line+=l.length-1,e.lineStart=r,i}if(92!==i||34!==n.charCodeAt(s+1)||34!==n.charCodeAt(s+2)||34!==n.charCodeAt(s+3))if(10!==i&&13!==i)if(Ee(i))++s;else{if(!me(n,s))throw ae(e.source,s,`Invalid character within String: ${Ie(e,s)}.`);s+=2}else o+=n.slice(a,s),l.push(o),13===i&&10===n.charCodeAt(s+1)?s+=2:++s,o="",a=s,r=s;else o+=n.slice(a,s),a=s+1,s+=4}throw ae(e.source,s,"Unterminated string.")}function Le(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i&&pe(n.charCodeAt(r));)++r;return ye(e,ie.NAME,t,r,n.slice(t,r))}function Re(e,t){if(!e)throw new Error(t)}function Fe(e){return we(e,[])}function we(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){let t=e.toJSON();if(t!==e)return"string"==typeof t?t:we(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let i=0;i<n;++i)r.push(we(e[i],t));return 1===i?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}(e,n);return function(e,t){let n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+n.map(([e,n])=>e+": "+we(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}var Pe=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;let i=t.prototype[Symbol.toStringTag];if(i===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){let t=Fe(e);throw new Error(`Cannot use ${i} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1},Ue=class{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||Re(!1,`Body must be a string. Received: ${Fe(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Re(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Re(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}},Ve=class{constructor(e,t={}){let n=function(e){return Pe(e,Ue)}(e)?e:new Ue(e);this._lexer=new fe(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(ie.NAME);return this.node(e,{kind:ne.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:ne.DOCUMENT,definitions:this.many(ie.SOF,this.parseDefinition,ie.EOF)})}parseDefinition(){if(this.peek(ie.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===ie.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw ae(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(ie.BRACE_L))return this.node(e,{kind:ne.OPERATION_DEFINITION,operation:S.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t,n=this.parseOperationType();return this.peek(ie.NAME)&&(t=this.parseName()),this.node(e,{kind:ne.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(ie.NAME);switch(e.value){case"query":return S.QUERY;case"mutation":return S.MUTATION;case"subscription":return S.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(ie.PAREN_L,this.parseVariableDefinition,ie.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ne.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(ie.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(ie.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(ie.DOLLAR),this.node(e,{kind:ne.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ne.SELECTION_SET,selections:this.many(ie.BRACE_L,this.parseSelection,ie.BRACE_R)})}parseSelection(){return this.peek(ie.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e,t,n=this._lexer.token,i=this.parseName();return this.expectOptionalToken(ie.COLON)?(e=i,t=this.parseName()):t=i,this.node(n,{kind:ne.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ie.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(ie.PAREN_L,t,ie.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(ie.COLON),this.node(t,{kind:ne.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(ie.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(ie.NAME)?this.node(e,{kind:ne.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:ne.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case ie.BRACKET_L:return this.parseList(e);case ie.BRACE_L:return this.parseObject(e);case ie.INT:return this.advanceLexer(),this.node(t,{kind:ne.INT,value:t.value});case ie.FLOAT:return this.advanceLexer(),this.node(t,{kind:ne.FLOAT,value:t.value});case ie.STRING:case ie.BLOCK_STRING:return this.parseStringLiteral();case ie.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:ne.BOOLEAN,value:!0});case"false":return this.node(t,{kind:ne.BOOLEAN,value:!1});case"null":return this.node(t,{kind:ne.NULL});default:return this.node(t,{kind:ne.ENUM,value:t.value})}case ie.DOLLAR:if(e){if(this.expectToken(ie.DOLLAR),this._lexer.token.kind===ie.NAME){let e=this._lexer.token.value;throw ae(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:ne.STRING,value:e.value,block:e.kind===ie.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:ne.LIST,values:this.any(ie.BRACKET_L,()=>this.parseValueLiteral(e),ie.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:ne.OBJECT,fields:this.any(ie.BRACE_L,()=>this.parseObjectField(e),ie.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(ie.COLON),this.node(t,{kind:ne.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(ie.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(ie.AT),this.node(t,{kind:ne.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e,t=this._lexer.token;if(this.expectOptionalToken(ie.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(ie.BRACKET_R),e=this.node(t,{kind:ne.LIST_TYPE,type:n})}else e=this.parseNamedType();return this.expectOptionalToken(ie.BANG)?this.node(t,{kind:ne.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:ne.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(ie.STRING)||this.peek(ie.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.many(ie.BRACE_L,this.parseOperationTypeDefinition,ie.BRACE_R);return this.node(e,{kind:ne.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(ie.COLON);let n=this.parseNamedType();return this.node(e,{kind:ne.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:ne.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ie.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(ie.BRACE_L,this.parseFieldDefinition,ie.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(ie.COLON);let r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:ne.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(ie.PAREN_L,this.parseInputValueDef,ie.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(ie.COLON);let i,r=this.parseTypeReference();this.expectOptionalToken(ie.EQUALS)&&(i=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(e,{kind:ne.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:s})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:ne.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:ne.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(ie.EQUALS)?this.delimitedMany(ie.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:ne.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(ie.BRACE_L,this.parseEnumValueDefinition,ie.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw ae(this._lexer.source,this._lexer.token.start,`${Me(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(ie.BRACE_L,this.parseInputValueDef,ie.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===ie.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),n=this.optionalMany(ie.BRACE_L,this.parseOperationTypeDefinition,ie.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:ne.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:ne.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:ne.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:ne.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:ne.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:ne.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(ie.AT);let n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:ne.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(ie.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(te,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new b(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw ae(this._lexer.source,t.start,`Expected ${Be(e)}, found ${Me(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind!==ie.NAME||t.value!==e)throw ae(this._lexer.source,t.start,`Expected "${e}", found ${Me(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===ie.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=e??this._lexer.token;return ae(this._lexer.source,t.start,`Unexpected ${Me(t)}.`)}any(e,t,n){this.expectToken(e);let i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);let i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==ie.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw ae(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function Me(e){let t=e.value;return Be(e.kind)+(null!=t?` "${t}"`:"")}function Be(e){return function(e){return e===ie.BANG||e===ie.DOLLAR||e===ie.AMP||e===ie.PAREN_L||e===ie.PAREN_R||e===ie.SPREAD||e===ie.COLON||e===ie.EQUALS||e===ie.AT||e===ie.BRACKET_L||e===ie.BRACKET_R||e===ie.BRACE_L||e===ie.PIPE||e===ie.BRACE_R}(e)?`"${e}"`:e}var je={allowLegacyFragmentVariables:!0},Ke={parse:function(e){let t;try{t=function(e,t){let n=new Ve(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}(e,je)}catch(e){throw function(e){if("GraphQLError"===(null==e?void 0:e.name)){let{message:t,locations:[n]}=e;return function(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)}(t,{loc:{start:n},cause:e})}return e}(e)}return t.comments=function(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let e=n;e!==i;e=e.next)"Comment"===e.kind&&t.push({...e,loc:{start:e.start,end:e.end}});return t}(t),t},astFormat:"graphql",hasPragma:function(e){return V.test(e)},hasIgnorePragma:function(e){return U.test(e)},locStart:w,locEnd:P},$e={graphql:Y},Ge=s}}; //# sourceMappingURL=2541.js.map