gant-core 0.2.36 → 2.0.1
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/CHANGELOG.md +14 -0
- package/eslint.config.mjs +26 -0
- package/lib/cli/acorn.js +2 -1
- package/lib/cli/angular.js +2 -1
- package/lib/cli/babel.js +2 -1
- package/lib/cli/config/defineConfig.js +103 -1
- package/lib/cli/config/index.js +2 -1
- package/lib/cli/copyfiles/index.js +2 -1
- package/lib/cli/create/config/index.js +3 -2
- package/lib/cli/create/index.js +1 -0
- package/lib/cli/create/module/index.js +2 -9
- package/lib/cli/estree.js +2 -1
- package/lib/cli/flow.js +2 -1
- package/lib/cli/glimmer.js +2 -1
- package/lib/cli/graphql.js +2 -1
- package/lib/cli/html.js +2 -1
- package/lib/cli/i18n/index.js +3 -2
- package/lib/cli/i18n/utils.js +2 -1
- package/lib/cli/index.d.ts +1836 -0
- package/lib/cli/index.js +2 -1
- package/lib/cli/markdown.js +2 -1
- package/lib/cli/meriyah.js +2 -1
- package/lib/cli/postcss.js +2 -1
- package/lib/cli/routes/index.js +2 -1
- package/lib/cli/template/template.vue.config.txt +1 -1
- package/lib/cli/template/types.d.txt +134 -132
- package/lib/cli/tsconfig/index.js +2 -1
- package/lib/cli/typescript.js +2 -1
- package/lib/cli/utils/detectPort.js +3 -0
- package/lib/cli/utils/getJavascriptfile.js +2 -1
- package/lib/cli/utils/index.js +2 -1
- package/lib/cli/webpack/Webpack.js +2 -1
- package/lib/cli/webpack/config/analyzer.config.js +2 -1
- package/lib/cli/webpack/config/browsers.js +1 -0
- package/lib/cli/webpack/config/cssRules.js +2 -1
- package/lib/cli/webpack/config/default.config.js +2 -1
- package/lib/cli/webpack/config/development.config.js +2 -1
- package/lib/cli/webpack/config/framework/index.js +3 -0
- package/lib/cli/webpack/config/framework/react.js +3 -0
- package/lib/cli/webpack/config/framework/vue.js +3 -0
- package/lib/cli/webpack/config/index.js +1 -0
- package/lib/cli/webpack/config/production.config.js +2 -1
- package/lib/cli/webpack/plugins/copy.js +2 -1
- package/lib/cli/webpack/plugins/index.js +2 -1
- package/lib/cli/yaml.js +2 -1
- package/lib/core/i18n/index.js +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/microservices/index.js +10 -1
- package/lib/core/request/index.js +1 -1
- package/lib/core/store/index.js +1 -1
- package/lib/core/theme/index.js +1 -1
- package/lib/core/utils/index.js +83 -1
- package/lib/types/index.d.ts +115 -104
- package/package.json +62 -44
- package/rollup.config.js +27 -10
- package/tsconfig.json +1 -0
- package/lib/core/cache/index.js.map +0 -1
- package/lib/core/event/index.js.map +0 -1
- package/lib/core/i18n/index.js.map +0 -1
- package/lib/core/index.js.map +0 -1
- package/lib/core/microservices/index.js.map +0 -1
- package/lib/core/request/index.js.map +0 -1
- package/lib/core/store/index.js.map +0 -1
- package/lib/core/theme/index.js.map +0 -1
- package/lib/core/utils/index.js.map +0 -1
package/lib/cli/graphql.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var e=Object.defineProperty,t=(t,n)=>{for(var i in n)e(t,i,{get:n[i],enumerable:!0})},n={};t(n,{languages:()=>Y,options:()=>J,parsers:()=>q,printers:()=>$e});var i=(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)},r="indent",s="group",a="if-break",o="line",l=()=>{};function c(e){return{type:r,contents:e}}function u(e,t={}){return l(t.expandedStates),{type:s,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function p(e,t="",n={}){return{type:a,breakContents:e,flatContents:t,groupId:n.groupId}}var h={type:o},d={type:o,soft:!0},f=[{type:o,hard:!0},{type:"break-parent"}];function E(e,t){let n=[];for(let i=0;i<t.length;i++)0!==i&&n.push(e),n.push(t[i]);return n}function m(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}}var T=m(" \t"),N=m(",; \t"),I=m(/[^\n\r]/);var y=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};var v=function(e,t,n={}){let i=T(e,n.backwards?t-1:t,n);return i!==y(e,i,n)};var 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};var O=function(e,t){return!1!==t&&("/"===e.charAt(t)&&"/"===e.charAt(t+1)?I(e,t):t)};var A=function(e,t){let n=null,i=t;for(;i!==n;)n=i,i=N(e,i),i=x(e,i),i=T(e,i);return i=O(e,i),i=y(e,i),!1!==i&&v(e,i)};var D=function(e){return Array.isArray(e)&&e.length>0},_=class extends Error{name="UnexpectedNodeError";constructor(e,t,n="type"){super(`Unexpected ${t} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},g=null;function k(e){if(null!==g&&(g.property,1)){let e=g;return g=k.prototype=null,e}return g=k.prototype=e??Object.create(null),new k}for(let e=0;e<=10;e++)k();var S,C,b=function(e,t="type"){return function(e){k(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}},L=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}}},R=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}}},F={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(F)),(C=S||(S={})).QUERY="query",C.MUTATION="mutation",C.SUBSCRIPTION="subscription";var w=b(F,"kind");function P(e){return e.loc.start}function V(e){return e.loc.end}var U=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(f):r.push(h),r};function M(e,t,n){if(0===n.directives.length)return"";let i=E(h,e.map(t,"directives"));return"FragmentDefinition"===n.kind||"OperationDefinition"===n.kind?u([h,i]):[" ",u(c([d,i]))]}function B(e,t,n,i){return e.map((({isLast:e,node:i})=>{let r=n();return!e&&A(t.originalText,V(i))?[r,f]:r}),i)}function j(e,t){let{node:n}=e;return D(n.variableDefinitions)?u(["(",c([d,E([p("",", "),d],e.map(t,"variableDefinitions"))]),d,")"]):""}function K(e,t){"StringValue"===e.kind&&e.block&&!e.value.includes("\n")&&(t.value=t.value.trim())}K.ignoredProperties=new Set(["loc","comments"]);var $={print:function(e,t,n){let{node:r}=e;switch(r.kind){case"Document":return[...E(f,B(e,t,n,"definitions")),f];case"OperationDefinition":{let i="{"!==t.originalText[P(r)],s=!!r.name;return[i?r.operation:"",i&&s?[" ",n("name")]:"",i&&!s&&D(r.variableDefinitions)?" ":"",j(e,n),M(e,n,r),i||s?" ":"",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),j(e,n)," on ",n("typeCondition"),M(e,n,r)," ",n("selectionSet")];case"SelectionSet":return["{",c([f,E(f,B(e,t,n,"selections"))]),f,"}"];case"Field":return u([r.alias?[n("alias"),": "]:"",n("name"),r.arguments.length>0?u(["(",c([d,E([p("",", "),d],B(e,t,n,"arguments"))]),d,")"]):"",M(e,n,r),r.selectionSet?" ":"",n("selectionSet")]);case"Name":case"IntValue":case"FloatValue":case"EnumValue":return r.value;case"StringValue":if(r.block){let e=i(!1,r.value,'"""','\\"""').split("\n");return 1===e.length&&(e[0]=e[0].trim()),e.every((e=>""===e))&&(e.length=0),E(f,['"""',...e,'"""'])}return['"',i(!1,i(!1,r.value,/["\\]/g,"\\$&"),"\n","\\n"),'"'];case"BooleanValue":return r.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return u(["[",c([d,E([p("",", "),d],e.map(n,"values"))]),d,"]"]);case"ObjectValue":{let i=t.bracketSpacing&&r.fields.length>0?" ":"";return u(["{",i,c([d,E([p("",", "),d],e.map(n,"fields"))]),d,p("",i),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),r.arguments.length>0?u(["(",c([d,E([p("",", "),d],B(e,t,n,"arguments"))]),d,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),r.defaultValue?[" = ",n("defaultValue")]:"",M(e,n,r)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:i}=r,s=[];return i.endsWith("TypeDefinition")?s.push(U(e,t,n)):s.push("extend "),i.startsWith("ObjectType")?s.push("type"):i.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!i.startsWith("InputObjectType")&&r.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?h:" ")}}return r}(e,t,n)),s.push(M(e,n,r)),r.fields.length>0&&s.push([" {",c([f,E(f,B(e,t,n,"fields"))]),f,"}"]),s}case"FieldDefinition":return[U(e,t,n),n("name"),r.arguments.length>0?u(["(",c([d,E([p("",", "),d],B(e,t,n,"arguments"))]),d,")"]):"",": ",n("type"),M(e,n,r)];case"DirectiveDefinition":return[U(e,t,n),"directive ","@",n("name"),r.arguments.length>0?u(["(",c([d,E([p("",", "),d],B(e,t,n,"arguments"))]),d,")"]):"",r.repeatable?" repeatable":""," on ",...E(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[U(e,t,n),"EnumTypeExtension"===r.kind?"extend ":"","enum ",n("name"),M(e,n,r),r.values.length>0?[" {",c([f,E(f,B(e,t,n,"values"))]),f,"}"]:""];case"EnumValueDefinition":return[U(e,t,n),n("name"),M(e,n,r)];case"InputValueDefinition":return[U(e,t,n),n("name"),": ",n("type"),r.defaultValue?[" = ",n("defaultValue")]:"",M(e,n,r)];case"SchemaExtension":return["extend schema",M(e,n,r),...r.operationTypes.length>0?[" {",c([f,E(f,B(e,t,n,"operationTypes"))]),f,"}"]:[]];case"SchemaDefinition":return[U(e,t,n),"schema",M(e,n,r)," {",r.operationTypes.length>0?c([f,E(f,B(e,t,n,"operationTypes"))]):"",f,"}"];case"OperationTypeDefinition":return[r.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),M(e,n,r)];case"InlineFragment":return["...",r.typeCondition?[" on ",n("typeCondition")]:"",M(e,n,r)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return u([U(e,t,n),u(["UnionTypeExtension"===r.kind?"extend ":"","union ",n("name"),M(e,n,r),r.types.length>0?[" =",p(""," "),c([p([h,"| "]),E([h,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[U(e,t,n),"ScalarTypeExtension"===r.kind?"extend ":"","scalar ",n("name"),M(e,n,r)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new _(r,"Graphql","kind")}},massageAstNode:K,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:w},G=$,Y=[{linguistLanguageId:139,name:"GraphQL",type:"data",color:"#e10098",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"]}],J={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."}},q={};function Q(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}t(q,{graphql:()=>Ke});var X=/\r\n|[\n\r]/g;function z(e,t){let n=0,i=1;for(let r of e.body.matchAll(X)){if("number"==typeof r.index||Q(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function H(e){return W(e.source,z(e.source,e.start))}function W(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+Z([[`${a} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return c+Z([[a-1+" |",u[r-1]],[`${a} |`,p],["|","^".padStart(l)],[`${a+1} |`,u[r+1]]])}function Z(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 ee,te,ne,ie=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=re(Array.isArray(a)?a:a?[a]:void 0);let h=re(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=>z(o,e))):null==h?void 0:h.map((e=>z(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"+H(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+W(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 re(e){return void 0===e||0===e.length?void 0:e}function se(e,t,n){return new ie(`Syntax Error: ${n}`,{source:e,positions:[t]})}function ae(e){return 9===e||32===e}function oe(e){return e>=48&&e<=57}function le(e){return e>=97&&e<=122||e>=65&&e<=90}function ce(e){return le(e)||95===e}function ue(e){return le(e)||oe(e)||95===e}function pe(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=he(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 he(e){let t=0;for(;t<e.length&&ae(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"}(ee||(ee={})),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"}(te||(te={})),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"}(ne||(ne={}));var de=class{constructor(e){let t=new R(ne.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!==ne.EOF)do{if(e.next)e=e.next;else{let t=ye(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===ne.COMMENT);return e}};function fe(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Ee(e,t){return me(e.charCodeAt(t))&&Te(e.charCodeAt(t+1))}function me(e){return e>=55296&&e<=56319}function Te(e){return e>=56320&&e<=57343}function Ne(e,t){let n=e.source.body.codePointAt(t);if(void 0===n)return ne.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Ie(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new R(t,n,i,s,a,r)}function ye(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 Ie(e,ne.BANG,r,r+1);case 36:return Ie(e,ne.DOLLAR,r,r+1);case 38:return Ie(e,ne.AMP,r,r+1);case 40:return Ie(e,ne.PAREN_L,r,r+1);case 41:return Ie(e,ne.PAREN_R,r,r+1);case 46:if(46===n.charCodeAt(r+1)&&46===n.charCodeAt(r+2))return Ie(e,ne.SPREAD,r,r+3);break;case 58:return Ie(e,ne.COLON,r,r+1);case 61:return Ie(e,ne.EQUALS,r,r+1);case 64:return Ie(e,ne.AT,r,r+1);case 91:return Ie(e,ne.BRACKET_L,r,r+1);case 93:return Ie(e,ne.BRACKET_R,r,r+1);case 123:return Ie(e,ne.BRACE_L,r,r+1);case 124:return Ie(e,ne.PIPE,r,r+1);case 125:return Ie(e,ne.BRACE_R,r,r+1);case 34:return 34===n.charCodeAt(r+1)&&34===n.charCodeAt(r+2)?Ce(e,r):Ae(e,r)}if(oe(t)||45===t)return xe(e,r,t);if(ce(t))return be(e,r);throw se(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":fe(t)||Ee(n,r)?`Unexpected character: ${Ne(e,r)}.`:`Invalid character: ${Ne(e,r)}.`)}return Ie(e,ne.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(fe(e))++r;else{if(!Ee(n,r))break;r+=2}}return Ie(e,ne.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),oe(s))throw se(e.source,r,`Invalid number, unexpected digit after 0: ${Ne(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||ce(s))throw se(e.source,r,`Invalid number, expected digit but got: ${Ne(e,r)}.`);return Ie(e,a?ne.FLOAT:ne.INT,t,r,i.slice(t,r))}function Oe(e,t,n){if(!oe(n))throw se(e.source,t,`Invalid number, expected digit but got: ${Ne(e,t)}.`);let i=e.source.body,r=t+1;for(;oe(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),Ie(e,ne.STRING,t,r+1,a);if(92!==i){if(10===i||13===i)break;if(fe(i))++r;else{if(!Ee(n,r))throw se(e.source,r,`Invalid character within String: ${Ne(e,r)}.`);r+=2}}else{a+=n.slice(s,r);let t=117===n.charCodeAt(r+1)?123===n.charCodeAt(r+2)?De(e,r):_e(e,r):Se(e,r);a+=t.value,r+=t.size,s=r}}throw se(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||!fe(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|ke(e),i<0)break}throw se(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function _e(e,t){let n=e.source.body,i=ge(n,t+2);if(fe(i))return{value:String.fromCodePoint(i),size:6};if(me(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){let e=ge(n,t+8);if(Te(e))return{value:String.fromCodePoint(i,e),size:12}}throw se(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function ge(e,t){return ke(e.charCodeAt(t))<<12|ke(e.charCodeAt(t+1))<<8|ke(e.charCodeAt(t+2))<<4|ke(e.charCodeAt(t+3))}function ke(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Se(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 se(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ce(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=Ie(e,ne.BLOCK_STRING,t,s+3,pe(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(fe(i))++s;else{if(!Ee(n,s))throw se(e.source,s,`Invalid character within String: ${Ne(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 se(e.source,s,"Unterminated string.")}function be(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){if(!ue(n.charCodeAt(r)))break;++r}return Ie(e,ne.NAME,t,r,n.slice(t,r))}function Le(e,t){if(!e)throw new Error(t)}function Re(e){return Fe(e,[])}function Fe(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:Fe(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(Fe(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+": "+Fe(n,t))).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}var we=globalThis.process&&"production"===globalThis.process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){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=Re(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},Pe=class{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||Le(!1,`Body must be a string. Received: ${Re(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Le(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Le(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};var Ve=class{constructor(e,t={}){let n=function(e){return we(e,Pe)}(e)?e:new Pe(e);this._lexer=new de(n),this._options=t,this._tokenCounter=0}parseName(){let e=this.expectToken(ne.NAME);return this.node(e,{kind:te.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:te.DOCUMENT,definitions:this.many(ne.SOF,this.parseDefinition,ne.EOF)})}parseDefinition(){if(this.peek(ne.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===ne.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 se(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(ne.BRACE_L))return this.node(e,{kind:te.OPERATION_DEFINITION,operation:S.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t,n=this.parseOperationType();return this.peek(ne.NAME)&&(t=this.parseName()),this.node(e,{kind:te.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(ne.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(ne.PAREN_L,this.parseVariableDefinition,ne.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:te.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(ne.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(ne.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(ne.DOLLAR),this.node(e,{kind:te.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:te.SELECTION_SET,selections:this.many(ne.BRACE_L,this.parseSelection,ne.BRACE_R)})}parseSelection(){return this.peek(ne.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e,t,n=this._lexer.token,i=this.parseName();return this.expectOptionalToken(ne.COLON)?(e=i,t=this.parseName()):t=i,this.node(n,{kind:te.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ne.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(ne.PAREN_L,t,ne.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(ne.COLON),this.node(t,{kind:te.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(ne.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(ne.NAME)?this.node(e,{kind:te.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:te.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:te.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:te.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 ne.BRACKET_L:return this.parseList(e);case ne.BRACE_L:return this.parseObject(e);case ne.INT:return this.advanceLexer(),this.node(t,{kind:te.INT,value:t.value});case ne.FLOAT:return this.advanceLexer(),this.node(t,{kind:te.FLOAT,value:t.value});case ne.STRING:case ne.BLOCK_STRING:return this.parseStringLiteral();case ne.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:te.BOOLEAN,value:!0});case"false":return this.node(t,{kind:te.BOOLEAN,value:!1});case"null":return this.node(t,{kind:te.NULL});default:return this.node(t,{kind:te.ENUM,value:t.value})}case ne.DOLLAR:if(e){if(this.expectToken(ne.DOLLAR),this._lexer.token.kind===ne.NAME){let e=this._lexer.token.value;throw se(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:te.STRING,value:e.value,block:e.kind===ne.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:te.LIST,values:this.any(ne.BRACKET_L,(()=>this.parseValueLiteral(e)),ne.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:te.OBJECT,fields:this.any(ne.BRACE_L,(()=>this.parseObjectField(e)),ne.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(ne.COLON),this.node(t,{kind:te.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(ne.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(ne.AT),this.node(t,{kind:te.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e,t=this._lexer.token;if(this.expectOptionalToken(ne.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(ne.BRACKET_R),e=this.node(t,{kind:te.LIST_TYPE,type:n})}else e=this.parseNamedType();return this.expectOptionalToken(ne.BANG)?this.node(t,{kind:te.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:te.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(ne.STRING)||this.peek(ne.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(ne.BRACE_L,this.parseOperationTypeDefinition,ne.BRACE_R);return this.node(e,{kind:te.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(ne.COLON);let n=this.parseNamedType();return this.node(e,{kind:te.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:te.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:te.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ne.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(ne.BRACE_L,this.parseFieldDefinition,ne.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(ne.COLON);let r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:te.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(ne.PAREN_L,this.parseInputValueDef,ne.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(ne.COLON);let i,r=this.parseTypeReference();this.expectOptionalToken(ne.EQUALS)&&(i=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(e,{kind:te.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:te.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:te.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(ne.EQUALS)?this.delimitedMany(ne.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:te.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(ne.BRACE_L,this.parseEnumValueDefinition,ne.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:te.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 se(this._lexer.source,this._lexer.token.start,`${Ue(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:te.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(ne.BRACE_L,this.parseInputValueDef,ne.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===ne.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(ne.BRACE_L,this.parseOperationTypeDefinition,ne.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:te.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:te.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:te.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:te.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:te.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:te.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:te.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(ne.AT);let n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:te.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(ne.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(ee,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new L(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 se(this._lexer.source,t.start,`Expected ${Me(e)}, found ${Ue(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind!==ne.NAME||t.value!==e)throw se(this._lexer.source,t.start,`Expected "${e}", found ${Ue(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===ne.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=e??this._lexer.token;return se(this._lexer.source,t.start,`Unexpected ${Ue(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(void 0!==e&&t.kind!==ne.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw se(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function Ue(e){let t=e.value;return Me(e.kind)+(null!=t?` "${t}"`:"")}function Me(e){return function(e){return e===ne.BANG||e===ne.DOLLAR||e===ne.AMP||e===ne.PAREN_L||e===ne.PAREN_R||e===ne.SPREAD||e===ne.COLON||e===ne.EQUALS||e===ne.AT||e===ne.BRACKET_L||e===ne.BRACKET_R||e===ne.BRACE_L||e===ne.PIPE||e===ne.BRACE_R}(e)?`"${e}"`:e}var Be=function(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)};var je={allowLegacyFragmentVariables:!0};var Ke={parse:function(e){let t;try{t=function(e,t){return new Ve(e,t).parseDocument()}(e,je)}catch(e){throw function(e){if("GraphQLError"===(null==e?void 0:e.name)){let{message:t,locations:[n]}=e;return Be(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/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(e)},locStart:P,locEnd:V},$e={graphql:G},Ge=n;exports.default=Ge,exports.languages=Y,exports.options=J,exports.parsers=q,exports.printers=$e;
|
|
2
|
+
"use strict";var e=Object.defineProperty,t=(t,n)=>{for(var i in n)e(t,i,{get:n[i],enumerable:!0})},n={};t(n,{languages:()=>X,options:()=>z,parsers:()=>H,printers:()=>Je});var i,r,s=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},a=(i="replaceAll",r=function(){if("string"==typeof this)return s},(e,t,...n)=>1|e&&null==t?void 0:(r.call(t)??t[i]).apply(t,n)),o="line",l=()=>{};function c(e){return{type:"indent",contents:e}}function u(e,t={}){return l(t.expandedStates),{type:"group",id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function p(e,t="",n={}){return{type:"if-break",breakContents:e,flatContents:t,groupId:n.groupId}}function h(e,t){let n=[];for(let i=0;i<t.length;i++)0!==i&&n.push(e),n.push(t[i]);return n}var d={type:o},f={type:o,soft:!0},E=[{type:o,hard:!0},{type:"break-parent"}];function m(e){return(t,n,i)=>{let r=!!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}}var T=m(" \t"),N=m(",; \t"),I=m(/[^\n\r]/u),y=e=>"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e;var O=function(e,t,n){let i=!!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(y(r))return t-1}else{if("\r"===r&&"\n"===e.charAt(t+1))return t+2;if(y(r))return t+1}return t};var A=function(e,t,n={}){let i=T(e,n.backwards?t-1:t,n);return i!==O(e,i,n)};var D=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};var v=function(e,t){return!1!==t&&("/"===e.charAt(t)&&"/"===e.charAt(t+1)?I(e,t):t)};var x=function(e,t){let n=null,i=t;for(;i!==n;)n=i,i=N(e,i),i=D(e,i),i=T(e,i);return i=v(e,i),i=O(e,i),!1!==i&&A(e,i)};var _=function(e){return Array.isArray(e)&&e.length>0},k=class extends Error{name="UnexpectedNodeError";constructor(e,t,n="type"){super(`Unexpected ${t} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},g=k,C=null;function S(e){if(null!==C&&(C.property,1)){let e=C;return C=S.prototype=null,e}return C=S.prototype=e??Object.create(null),new S}for(let e=0;e<=10;e++)S();var R,b=function(e,t="type"){return function(e){S(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}},L=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}}},F=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}}},w={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","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"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]};new Set(Object.keys(w)),function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(R||(R={}));var P={...w};for(let e of["ArgumentCoordinate","DirectiveArgumentCoordinate","DirectiveCoordinate","MemberCoordinate","TypeCoordinate"])delete P[e];var M=b(P,"kind"),U=e=>e.loc.start,V=e=>e.loc.end,B=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u,j=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;var K=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(E):r.push(d),r};function $(e,t,n){if(0===n.directives.length)return"";let i=h(d,e.map(t,"directives"));return"FragmentDefinition"===n.kind||"OperationDefinition"===n.kind?u([d,i]):[" ",u(c([f,i]))]}function G(e,t,n,i){return e.map(({isLast:e,node:i})=>{let r=n();return!e&&x(t.originalText,V(i))?[r,E]:r},i)}function Y(e,t){let{node:n}=e;return _(n.variableDefinitions)?u(["(",c([f,h([p("",", "),f],e.map(t,"variableDefinitions"))]),f,")"]):""}function q(e,t){"StringValue"===e.kind&&e.block&&!e.value.includes("\n")&&(t.value=e.value.trim())}q.ignoredProperties=new Set(["loc","comments"]);var J={print:function(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...h(E,G(e,t,n,"definitions")),E];case"OperationDefinition":{let r="{"!==t.originalText[U(i)],s=!!i.name;return[K(e,t,n),r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&_(i.variableDefinitions)?" ":"",Y(e,n),$(e,n,i),r||s?" ":"",n("selectionSet")]}case"FragmentDefinition":return[K(e,t,n),"fragment ",n("name"),Y(e,n)," on ",n("typeCondition"),$(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",c([E,h(E,G(e,t,n,"selections"))]),E,"}"];case"Field":return u([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?u(["(",c([f,h([p("",", "),f],G(e,t,n,"arguments"))]),f,")"]):"",$(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(0,i.value,'"""','\\"""').split("\n");return 1===e.length&&(e[0]=e[0].trim()),e.every(e=>""===e)&&(e.length=0),h(E,['"""',...e,'"""'])}return['"',a(0,a(0,i.value,/["\\]/gu,"\\$&"),"\n","\\n"),'"'];case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return u(["[",c([f,h([p("",", "),f],e.map(n,"values"))]),f,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return u(["{",r,c([f,h([p("",", "),f],e.map(n,"fields"))]),f,p("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?u(["(",c([f,h([p("",", "),f],G(e,t,n,"arguments"))]),f,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[K(e,t,n),n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",$(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(K(e,t,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?d:" ")}}return r}(e,t,n)),s.push($(e,n,i)),i.fields.length>0&&s.push([" {",c([E,h(E,G(e,t,n,"fields"))]),E,"}"]),s}case"FieldDefinition":return[K(e,t,n),n("name"),i.arguments.length>0?u(["(",c([f,h([p("",", "),f],G(e,t,n,"arguments"))]),f,")"]):"",": ",n("type"),$(e,n,i)];case"DirectiveDefinition":return[K(e,t,n),"directive ","@",n("name"),i.arguments.length>0?u(["(",c([f,h([p("",", "),f],G(e,t,n,"arguments"))]),f,")"]):"",i.repeatable?" repeatable":""," on ",...h(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[K(e,t,n),"EnumTypeExtension"===i.kind?"extend ":"","enum ",n("name"),$(e,n,i),i.values.length>0?[" {",c([E,h(E,G(e,t,n,"values"))]),E,"}"]:""];case"EnumValueDefinition":return[K(e,t,n),n("name"),$(e,n,i)];case"InputValueDefinition":return[K(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",$(e,n,i)];case"SchemaExtension":return["extend schema",$(e,n,i),...i.operationTypes.length>0?[" {",c([E,h(E,G(e,t,n,"operationTypes"))]),E,"}"]:[]];case"SchemaDefinition":return[K(e,t,n),"schema",$(e,n,i)," {",i.operationTypes.length>0?c([E,h(E,G(e,t,n,"operationTypes"))]):"",E,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),$(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",$(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return u([K(e,t,n),u(["UnionTypeExtension"===i.kind?"extend ":"","union ",n("name"),$(e,n,i),i.types.length>0?[" =",p(""," "),c([p([d,"| "]),h([d,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[K(e,t,n),"ScalarTypeExtension"===i.kind?"extend ":"","scalar ",n("name"),$(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new g(i,"Graphql","kind")}},massageAstNode:q,hasPrettierIgnore:function(e){let{node:t}=e;return t?.comments?.some(e=>"prettier-ignore"===e.value.trim())},insertPragma:e=>`# @format\n\n${e}`,printComment:function({node:e}){if("Comment"===e.kind)return"#"+e.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(e))},canAttachComment:function(e){return"Comment"!==e.kind},getVisitorKeys:M},Q=J,X=[{name:"GraphQL",type:"data",aceMode:"graphqlschema",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",parsers:["graphql"],vscodeLanguageIds:["graphql"],linguistLanguageId:139}],z={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."}},H={};function W(e,t){throw new Error("Unexpected invariant triggered.")}t(H,{graphql:()=>qe});var Z=/\r\n|[\n\r]/g;function ee(e,t){let n=0,i=1;for(let r of e.body.matchAll(Z)){if("number"==typeof r.index||W(),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function te(e){return ne(e.source,ee(e.source,e.start))}function ne(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+ie([[`${a} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+ie([[a-1+" |",u[r-1]],[`${a} |`,p],["|","^".padStart(l)],[`${a+1} |`,u[r+1]]])}function ie(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 re,se,ae,oe=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=le(Array.isArray(a)?a:a?[a]:void 0);let h=le(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??h?.map(e=>e.start),this.locations=l&&o?l.map(e=>ee(o,e)):h?.map(e=>ee(e.source,e.start));let d=function(e){return"object"==typeof e&&null!==e}(u?.extensions)?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"+te(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+ne(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 le(e){return void 0===e||0===e.length?void 0:e}function ce(e,t,n){return new oe(`Syntax Error: ${n}`,{source:e,positions:[t]})}function ue(e){return 9===e||32===e}function pe(e){return e>=48&&e<=57}function he(e){return e>=97&&e<=122||e>=65&&e<=90}function de(e){return he(e)||95===e}function fe(e){return he(e)||pe(e)||95===e}function Ee(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=me(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 me(e){let t=0;for(;t<e.length&&ue(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"}(re||(re={})),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",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"}(se||(se={})),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(ae||(ae={}));var Te=class{constructor(e){let t=new F(ae.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!==ae.EOF)do{if(e.next)e=e.next;else{let t=ve(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===ae.COMMENT);return e}};function Ne(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Ie(e,t){return ye(e.charCodeAt(t))&&Oe(e.charCodeAt(t+1))}function ye(e){return e>=55296&&e<=56319}function Oe(e){return e>=56320&&e<=57343}function Ae(e,t){let n=e.source.body.codePointAt(t);if(void 0===n)return ae.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function De(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new F(t,n,i,s,a,r)}function ve(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 xe(e,r);case 33:return De(e,ae.BANG,r,r+1);case 36:return De(e,ae.DOLLAR,r,r+1);case 38:return De(e,ae.AMP,r,r+1);case 40:return De(e,ae.PAREN_L,r,r+1);case 41:return De(e,ae.PAREN_R,r,r+1);case 46:if(46===n.charCodeAt(r+1)&&46===n.charCodeAt(r+2))return De(e,ae.SPREAD,r,r+3);break;case 58:return De(e,ae.COLON,r,r+1);case 61:return De(e,ae.EQUALS,r,r+1);case 64:return De(e,ae.AT,r,r+1);case 91:return De(e,ae.BRACKET_L,r,r+1);case 93:return De(e,ae.BRACKET_R,r,r+1);case 123:return De(e,ae.BRACE_L,r,r+1);case 124:return De(e,ae.PIPE,r,r+1);case 125:return De(e,ae.BRACE_R,r,r+1);case 34:return 34===n.charCodeAt(r+1)&&34===n.charCodeAt(r+2)?Fe(e,r):ge(e,r)}if(pe(t)||45===t)return _e(e,r,t);if(de(t))return we(e,r);throw ce(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ne(t)||Ie(n,r)?`Unexpected character: ${Ae(e,r)}.`:`Invalid character: ${Ae(e,r)}.`)}return De(e,ae.EOF,i,i)}function xe(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(Ne(e))++r;else{if(!Ie(n,r))break;r+=2}}return De(e,ae.COMMENT,t,r,n.slice(t+1,r))}function _e(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),pe(s))throw ce(e.source,r,`Invalid number, unexpected digit after 0: ${Ae(e,r)}.`)}else r=ke(e,r,s),s=i.charCodeAt(r);if(46===s&&(a=!0,s=i.charCodeAt(++r),r=ke(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=ke(e,r,s),s=i.charCodeAt(r)),46===s||de(s))throw ce(e.source,r,`Invalid number, expected digit but got: ${Ae(e,r)}.`);return De(e,a?ae.FLOAT:ae.INT,t,r,i.slice(t,r))}function ke(e,t,n){if(!pe(n))throw ce(e.source,t,`Invalid number, expected digit but got: ${Ae(e,t)}.`);let i=e.source.body,r=t+1;for(;pe(i.charCodeAt(r));)++r;return r}function ge(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),De(e,ae.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)?Ce(e,r):Se(e,r):Le(e,r);a+=t.value,r+=t.size,s=r;continue}if(10===i||13===i)break;if(Ne(i))++r;else{if(!Ie(n,r))throw ce(e.source,r,`Invalid character within String: ${Ae(e,r)}.`);r+=2}}throw ce(e.source,r,"Unterminated string.")}function Ce(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||!Ne(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|be(e),i<0)break}throw ce(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function Se(e,t){let n=e.source.body,i=Re(n,t+2);if(Ne(i))return{value:String.fromCodePoint(i),size:6};if(ye(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){let e=Re(n,t+8);if(Oe(e))return{value:String.fromCodePoint(i,e),size:12}}throw ce(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Re(e,t){return be(e.charCodeAt(t))<<12|be(e.charCodeAt(t+1))<<8|be(e.charCodeAt(t+2))<<4|be(e.charCodeAt(t+3))}function be(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Le(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 ce(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Fe(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=De(e,ae.BLOCK_STRING,t,s+3,Ee(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(Ne(i))++s;else{if(!Ie(n,s))throw ce(e.source,s,`Invalid character within String: ${Ae(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 ce(e.source,s,"Unterminated string.")}function we(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){if(!fe(n.charCodeAt(r)))break;++r}return De(e,ae.NAME,t,r,n.slice(t,r))}function Pe(e,t){throw new Error(t)}function Me(e){return Ue(e,[])}function Ue(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:Ue(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(Ue(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+": "+Ue(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}var Ve=globalThis.process&&!0?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=Me(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},Be=class{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||Pe(0,`Body must be a string. Received: ${Me(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Pe(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Pe(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};var je=class{constructor(e,t={}){let{lexer:n,...i}=t;if(n)this._lexer=n;else{let t=function(e){return Ve(e,Be)}(e)?e:new Be(e);this._lexer=new Te(t)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(ae.NAME);return this.node(e,{kind:se.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:se.DOCUMENT,definitions:this.many(ae.SOF,this.parseDefinition,ae.EOF)})}parseDefinition(){if(this.peek(ae.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===ae.BRACE_L)throw ce(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===ae.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()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw ce(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(ae.BRACE_L))return this.node(e,{kind:se.OPERATION_DEFINITION,operation:R.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t,n=this.parseDescription(),i=this.parseOperationType();return this.peek(ae.NAME)&&(t=this.parseName()),this.node(e,{kind:se.OPERATION_DEFINITION,operation:i,description:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(ae.NAME);switch(e.value){case"query":return R.QUERY;case"mutation":return R.MUTATION;case"subscription":return R.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(ae.PAREN_L,this.parseVariableDefinition,ae.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:se.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(ae.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(ae.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(ae.DOLLAR),this.node(e,{kind:se.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:se.SELECTION_SET,selections:this.many(ae.BRACE_L,this.parseSelection,ae.BRACE_R)})}parseSelection(){return this.peek(ae.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e,t,n=this._lexer.token,i=this.parseName();return this.expectOptionalToken(ae.COLON)?(e=i,t=this.parseName()):t=i,this.node(n,{kind:se.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ae.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(ae.PAREN_L,t,ae.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(ae.COLON),this.node(t,{kind:se.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(ae.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(ae.NAME)?this.node(e,{kind:se.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:se.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:se.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:se.FRAGMENT_DEFINITION,description:t,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 ae.BRACKET_L:return this.parseList(e);case ae.BRACE_L:return this.parseObject(e);case ae.INT:return this.advanceLexer(),this.node(t,{kind:se.INT,value:t.value});case ae.FLOAT:return this.advanceLexer(),this.node(t,{kind:se.FLOAT,value:t.value});case ae.STRING:case ae.BLOCK_STRING:return this.parseStringLiteral();case ae.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:se.BOOLEAN,value:!0});case"false":return this.node(t,{kind:se.BOOLEAN,value:!1});case"null":return this.node(t,{kind:se.NULL});default:return this.node(t,{kind:se.ENUM,value:t.value})}case ae.DOLLAR:if(e){if(this.expectToken(ae.DOLLAR),this._lexer.token.kind===ae.NAME){let e=this._lexer.token.value;throw ce(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:se.STRING,value:e.value,block:e.kind===ae.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:se.LIST,values:this.any(ae.BRACKET_L,()=>this.parseValueLiteral(e),ae.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:se.OBJECT,fields:this.any(ae.BRACE_L,()=>this.parseObjectField(e),ae.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(ae.COLON),this.node(t,{kind:se.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(ae.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(ae.AT),this.node(t,{kind:se.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e,t=this._lexer.token;if(this.expectOptionalToken(ae.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(ae.BRACKET_R),e=this.node(t,{kind:se.LIST_TYPE,type:n})}else e=this.parseNamedType();return this.expectOptionalToken(ae.BANG)?this.node(t,{kind:se.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:se.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(ae.STRING)||this.peek(ae.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(ae.BRACE_L,this.parseOperationTypeDefinition,ae.BRACE_R);return this.node(e,{kind:se.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(ae.COLON);let n=this.parseNamedType();return this.node(e,{kind:se.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:se.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:se.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ae.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(ae.BRACE_L,this.parseFieldDefinition,ae.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(ae.COLON);let r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:se.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(ae.PAREN_L,this.parseInputValueDef,ae.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(ae.COLON);let i,r=this.parseTypeReference();this.expectOptionalToken(ae.EQUALS)&&(i=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(e,{kind:se.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:se.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:se.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(ae.EQUALS)?this.delimitedMany(ae.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:se.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(ae.BRACE_L,this.parseEnumValueDefinition,ae.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:se.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 ce(this._lexer.source,this._lexer.token.start,`${Ke(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:se.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(ae.BRACE_L,this.parseInputValueDef,ae.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===ae.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(ae.BRACE_L,this.parseOperationTypeDefinition,ae.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:se.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:se.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:se.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:se.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:se.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:se.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:se.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(ae.AT);let n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:se.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(ae.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(re,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e,t,n=this._lexer.token,i=this.expectOptionalToken(ae.AT),r=this.parseName();return!i&&this.expectOptionalToken(ae.DOT)&&(e=this.parseName()),(i||e)&&this.expectOptionalToken(ae.PAREN_L)&&(t=this.parseName(),this.expectToken(ae.COLON),this.expectToken(ae.PAREN_R)),i?t?this.node(n,{kind:se.DIRECTIVE_ARGUMENT_COORDINATE,name:r,argumentName:t}):this.node(n,{kind:se.DIRECTIVE_COORDINATE,name:r}):e?t?this.node(n,{kind:se.ARGUMENT_COORDINATE,name:r,fieldName:e,argumentName:t}):this.node(n,{kind:se.MEMBER_COORDINATE,name:r,memberName:e}):this.node(n,{kind:se.TYPE_COORDINATE,name:r})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new L(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 ce(this._lexer.source,t.start,`Expected ${$e(e)}, found ${Ke(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind!==ae.NAME||t.value!==e)throw ce(this._lexer.source,t.start,`Expected "${e}", found ${Ke(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===ae.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=e??this._lexer.token;return ce(this._lexer.source,t.start,`Unexpected ${Ke(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!==ae.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw ce(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function Ke(e){let t=e.value;return $e(e.kind)+(null!=t?` "${t}"`:"")}function $e(e){return function(e){return e===ae.BANG||e===ae.DOLLAR||e===ae.AMP||e===ae.PAREN_L||e===ae.PAREN_R||e===ae.DOT||e===ae.SPREAD||e===ae.COLON||e===ae.EQUALS||e===ae.AT||e===ae.BRACKET_L||e===ae.BRACKET_R||e===ae.BRACE_L||e===ae.PIPE||e===ae.BRACE_R}(e)?`"${e}"`:e}var Ge=function(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)};var Ye={allowLegacyFragmentVariables:!0};var qe={parse:function(e){let t;try{t=function(e,t){let n=new je(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}(e,Ye)}catch(e){throw function(e){if("GraphQLError"===e?.name){let{message:t,locations:[n]}=e;return Ge(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:e=>j.test(e),hasIgnorePragma:e=>B.test(e),locStart:U,locEnd:V},Je={graphql:Q};exports.default=n,exports.languages=X,exports.options=z,exports.parsers=H,exports.printers=Je;
|
|
3
|
+
//# sourceMappingURL=graphql.js.map
|