UNPKG

playermap_graph

Version:

A React library for intuition visualization using force-directed graphs

51 lines (44 loc) 1.56 MB
(function(Nt,ge){typeof exports=="object"&&typeof module<"u"?ge(exports,require("react"),require("3d-force-graph-vr")):typeof define=="function"&&define.amd?define(["exports","react","3d-force-graph-vr"],ge):(Nt=typeof globalThis<"u"?globalThis:Nt||self,ge(Nt.PlayermapGraph={},Nt.React,Nt.ForceGraphVR))})(this,function(Nt,ge,Vo){"use strict";var QQ=Object.defineProperty;var JQ=(Nt,ge,Vo)=>ge in Nt?QQ(Nt,ge,{enumerable:!0,configurable:!0,writable:!0,value:Vo}):Nt[ge]=Vo;var Lc=(Nt,ge,Vo)=>JQ(Nt,typeof ge!="symbol"?ge+"":ge,Vo);function _m(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var vm={exports:{}},Fc={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var tb;function bN(){if(tb)return Fc;tb=1;var r=ge,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(l,c,u){var h,d={},f=null,p=null;u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),c.ref!==void 0&&(p=c.ref);for(h in c)i.call(c,h)&&!o.hasOwnProperty(h)&&(d[h]=c[h]);if(l&&l.defaultProps)for(h in c=l.defaultProps,c)d[h]===void 0&&(d[h]=c[h]);return{$$typeof:e,type:l,key:f,ref:p,props:d,_owner:s.current}}return Fc.Fragment=n,Fc.jsx=a,Fc.jsxs=a,Fc}var Uc={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var nb;function SN(){return nb||(nb=1,process.env.NODE_ENV!=="production"&&function(){var r=ge,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator,_="@@iterator";function y(z){if(z===null||typeof z!="object")return null;var we=m&&z[m]||z[_];return typeof we=="function"?we:null}var g=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(z){{for(var we=arguments.length,Ue=new Array(we>1?we-1:0),lt=1;lt<we;lt++)Ue[lt-1]=arguments[lt];b("error",z,Ue)}}function b(z,we,Ue){{var lt=g.ReactDebugCurrentFrame,It=lt.getStackAddendum();It!==""&&(we+="%s",Ue=Ue.concat([It]));var Yt=Ue.map(function(Rt){return String(Rt)});Yt.unshift("Warning: "+we),Function.prototype.apply.call(console[z],console,Yt)}}var v=!1,T=!1,M=!1,E=!1,A=!1,w;w=Symbol.for("react.module.reference");function S(z){return!!(typeof z=="string"||typeof z=="function"||z===i||z===o||A||z===s||z===u||z===h||E||z===p||v||T||M||typeof z=="object"&&z!==null&&(z.$$typeof===f||z.$$typeof===d||z.$$typeof===a||z.$$typeof===l||z.$$typeof===c||z.$$typeof===w||z.getModuleId!==void 0))}function R(z,we,Ue){var lt=z.displayName;if(lt)return lt;var It=we.displayName||we.name||"";return It!==""?Ue+"("+It+")":Ue}function O(z){return z.displayName||"Context"}function P(z){if(z==null)return null;if(typeof z.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case i:return"Fragment";case n:return"Portal";case o:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case h:return"SuspenseList"}if(typeof z=="object")switch(z.$$typeof){case l:var we=z;return O(we)+".Consumer";case a:var Ue=z;return O(Ue._context)+".Provider";case c:return R(z,z.render,"ForwardRef");case d:var lt=z.displayName||null;return lt!==null?lt:P(z.type)||"Memo";case f:{var It=z,Yt=It._payload,Rt=It._init;try{return P(Rt(Yt))}catch{return null}}}return null}var C=Object.assign,I=0,L,W,$,ie,U,k,re;function he(){}he.__reactDisabledLog=!0;function F(){{if(I===0){L=console.log,W=console.info,$=console.warn,ie=console.error,U=console.group,k=console.groupCollapsed,re=console.groupEnd;var z={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}I++}}function G(){{if(I--,I===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},z,{value:L}),info:C({},z,{value:W}),warn:C({},z,{value:$}),error:C({},z,{value:ie}),group:C({},z,{value:U}),groupCollapsed:C({},z,{value:k}),groupEnd:C({},z,{value:re})})}I<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=g.ReactCurrentDispatcher,J;function ue(z,we,Ue){{if(J===void 0)try{throw Error()}catch(It){var lt=It.stack.trim().match(/\n( *(at )?)/);J=lt&&lt[1]||""}return` `+J+z}}var be=!1,Te;{var je=typeof WeakMap=="function"?WeakMap:Map;Te=new je}function pe(z,we){if(!z||be)return"";{var Ue=Te.get(z);if(Ue!==void 0)return Ue}var lt;be=!0;var It=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Yt;Yt=ee.current,ee.current=null,F();try{if(we){var Rt=function(){throw Error()};if(Object.defineProperty(Rt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Rt,[])}catch(Ne){lt=Ne}Reflect.construct(z,[],Rt)}else{try{Rt.call()}catch(Ne){lt=Ne}z.call(Rt.prototype)}}else{try{throw Error()}catch(Ne){lt=Ne}z()}}catch(Ne){if(Ne&&lt&&typeof Ne.stack=="string"){for(var wt=Ne.stack.split(` `),D=lt.stack.split(` `),H=wt.length-1,te=D.length-1;H>=1&&te>=0&&wt[H]!==D[te];)te--;for(;H>=1&&te>=0;H--,te--)if(wt[H]!==D[te]){if(H!==1||te!==1)do if(H--,te--,te<0||wt[H]!==D[te]){var oe=` `+wt[H].replace(" at new "," at ");return z.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",z.displayName)),typeof z=="function"&&Te.set(z,oe),oe}while(H>=1&&te>=0);break}}}finally{be=!1,ee.current=Yt,G(),Error.prepareStackTrace=It}var Z=z?z.displayName||z.name:"",Ee=Z?ue(Z):"";return typeof z=="function"&&Te.set(z,Ee),Ee}function ot(z,we,Ue){return pe(z,!1)}function q(z){var we=z.prototype;return!!(we&&we.isReactComponent)}function Ct(z,we,Ue){if(z==null)return"";if(typeof z=="function")return pe(z,q(z));if(typeof z=="string")return ue(z);switch(z){case u:return ue("Suspense");case h:return ue("SuspenseList")}if(typeof z=="object")switch(z.$$typeof){case c:return ot(z.render);case d:return Ct(z.type,we,Ue);case f:{var lt=z,It=lt._payload,Yt=lt._init;try{return Ct(Yt(It),we,Ue)}catch{}}}return""}var at=Object.prototype.hasOwnProperty,pt={},Je=g.ReactDebugCurrentFrame;function Ot(z){if(z){var we=z._owner,Ue=Ct(z.type,z._source,we?we.type:null);Je.setExtraStackFrame(Ue)}else Je.setExtraStackFrame(null)}function Ke(z,we,Ue,lt,It){{var Yt=Function.call.bind(at);for(var Rt in z)if(Yt(z,Rt)){var wt=void 0;try{if(typeof z[Rt]!="function"){var D=Error((lt||"React class")+": "+Ue+" type `"+Rt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[Rt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}wt=z[Rt](we,Rt,lt,Ue,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(H){wt=H}wt&&!(wt instanceof Error)&&(Ot(It),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",lt||"React class",Ue,Rt,typeof wt),Ot(null)),wt instanceof Error&&!(wt.message in pt)&&(pt[wt.message]=!0,Ot(It),x("Failed %s type: %s",Ue,wt.message),Ot(null))}}}var B=Array.isArray;function N(z){return B(z)}function se(z){{var we=typeof Symbol=="function"&&Symbol.toStringTag,Ue=we&&z[Symbol.toStringTag]||z.constructor.name||"Object";return Ue}}function ve(z){try{return Se(z),!1}catch{return!0}}function Se(z){return""+z}function me(z){if(ve(z))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",se(z)),Se(z)}var Ge=g.ReactCurrentOwner,Oe={key:!0,ref:!0,__self:!0,__source:!0},ze,tt;function Me(z){if(at.call(z,"ref")){var we=Object.getOwnPropertyDescriptor(z,"ref").get;if(we&&we.isReactWarning)return!1}return z.ref!==void 0}function Ve(z){if(at.call(z,"key")){var we=Object.getOwnPropertyDescriptor(z,"key").get;if(we&&we.isReactWarning)return!1}return z.key!==void 0}function et(z,we){typeof z.ref=="string"&&Ge.current}function st(z,we){{var Ue=function(){ze||(ze=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",we))};Ue.isReactWarning=!0,Object.defineProperty(z,"key",{get:Ue,configurable:!0})}}function $e(z,we){{var Ue=function(){tt||(tt=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",we))};Ue.isReactWarning=!0,Object.defineProperty(z,"ref",{get:Ue,configurable:!0})}}var St=function(z,we,Ue,lt,It,Yt,Rt){var wt={$$typeof:e,type:z,key:we,ref:Ue,props:Rt,_owner:Yt};return wt._store={},Object.defineProperty(wt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(wt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:lt}),Object.defineProperty(wt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:It}),Object.freeze&&(Object.freeze(wt.props),Object.freeze(wt)),wt};function yt(z,we,Ue,lt,It){{var Yt,Rt={},wt=null,D=null;Ue!==void 0&&(me(Ue),wt=""+Ue),Ve(we)&&(me(we.key),wt=""+we.key),Me(we)&&(D=we.ref,et(we,It));for(Yt in we)at.call(we,Yt)&&!Oe.hasOwnProperty(Yt)&&(Rt[Yt]=we[Yt]);if(z&&z.defaultProps){var H=z.defaultProps;for(Yt in H)Rt[Yt]===void 0&&(Rt[Yt]=H[Yt])}if(wt||D){var te=typeof z=="function"?z.displayName||z.name||"Unknown":z;wt&&st(Rt,te),D&&$e(Rt,te)}return St(z,wt,D,It,lt,Ge.current,Rt)}}var Ht=g.ReactCurrentOwner,Y=g.ReactDebugCurrentFrame;function De(z){if(z){var we=z._owner,Ue=Ct(z.type,z._source,we?we.type:null);Y.setExtraStackFrame(Ue)}else Y.setExtraStackFrame(null)}var le;le=!1;function xe(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function Be(){{if(Ht.current){var z=P(Ht.current.type);if(z)return` Check the render method of \``+z+"`."}return""}}function ke(z){return""}var ht={};function fn(z){{var we=Be();if(!we){var Ue=typeof z=="string"?z:z.displayName||z.name;Ue&&(we=` Check the top-level render call using <`+Ue+">.")}return we}}function On(z,we){{if(!z._store||z._store.validated||z.key!=null)return;z._store.validated=!0;var Ue=fn(we);if(ht[Ue])return;ht[Ue]=!0;var lt="";z&&z._owner&&z._owner!==Ht.current&&(lt=" It was passed a child from "+P(z._owner.type)+"."),De(z),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Ue,lt),De(null)}}function Ft(z,we){{if(typeof z!="object")return;if(N(z))for(var Ue=0;Ue<z.length;Ue++){var lt=z[Ue];xe(lt)&&On(lt,we)}else if(xe(z))z._store&&(z._store.validated=!0);else if(z){var It=y(z);if(typeof It=="function"&&It!==z.entries)for(var Yt=It.call(z),Rt;!(Rt=Yt.next()).done;)xe(Rt.value)&&On(Rt.value,we)}}}function ji(z){{var we=z.type;if(we==null||typeof we=="string")return;var Ue;if(typeof we=="function")Ue=we.propTypes;else if(typeof we=="object"&&(we.$$typeof===c||we.$$typeof===d))Ue=we.propTypes;else return;if(Ue){var lt=P(we);Ke(Ue,z.props,"prop",lt,z)}else if(we.PropTypes!==void 0&&!le){le=!0;var It=P(we);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",It||"Unknown")}typeof we.getDefaultProps=="function"&&!we.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Rr(z){{for(var we=Object.keys(z.props),Ue=0;Ue<we.length;Ue++){var lt=we[Ue];if(lt!=="children"&&lt!=="key"){De(z),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",lt),De(null);break}}z.ref!==null&&(De(z),x("Invalid attribute `ref` supplied to `React.Fragment`."),De(null))}}var Ih={};function Lh(z,we,Ue,lt,It,Yt){{var Rt=S(z);if(!Rt){var wt="";(z===void 0||typeof z=="object"&&z!==null&&Object.keys(z).length===0)&&(wt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var D=ke();D?wt+=D:wt+=Be();var H;z===null?H="null":N(z)?H="array":z!==void 0&&z.$$typeof===e?(H="<"+(P(z.type)||"Unknown")+" />",wt=" Did you accidentally export a JSX literal instead of a component?"):H=typeof z,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",H,wt)}var te=yt(z,we,Ue,It,Yt);if(te==null)return te;if(Rt){var oe=we.children;if(oe!==void 0)if(lt)if(N(oe)){for(var Z=0;Z<oe.length;Z++)Ft(oe[Z],z);Object.freeze&&Object.freeze(oe)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ft(oe,z)}if(at.call(we,"key")){var Ee=P(z),Ne=Object.keys(we).filter(function(ct){return ct!=="key"}),We=Ne.length>0?"{key: someKey, "+Ne.join(": ..., ")+": ...}":"{key: someKey}";if(!Ih[Ee+We]){var Xe=Ne.length>0?"{"+Ne.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,We,Ee,Xe,Ee),Ih[Ee+We]=!0}}return z===i?Rr(te):ji(te),te}}function Xs(z,we,Ue){return Lh(z,we,Ue,!0)}function Oh(z,we,Ue){return Lh(z,we,Ue,!1)}var pm=Oh,mm=Xs;Uc.Fragment=i,Uc.jsx=pm,Uc.jsxs=mm}()),Uc}process.env.NODE_ENV==="production"?vm.exports=bN():vm.exports=SN();var X=vm.exports;const pn={SUBJECT:"#FFB300",PREDICATE:"#1976D2",OBJECT:"#43A047"},$o=r=>{switch(r){case"subject":return pn.SUBJECT;case"predicate":return pn.PREDICATE;case"object":return pn.OBJECT;default:return"#444"}},xm=()=>X.jsxs("div",{style:{position:"absolute",bottom:10,right:5,zIndex:1e3},children:[X.jsx("h4",{style:{margin:"0 0 4px 0",fontSize:"18px",color:"#ffd32a",fontWeight:"bold",letterSpacing:"0.5px",textTransform:"uppercase"},children:"LEGEND"}),X.jsxs("ul",{style:{listStyle:"none",margin:0,display:"flex",flexDirection:"column",gap:"12px",borderRadius:"10px",padding:"16px 16px"},children:[X.jsxs("li",{style:{display:"flex",alignItems:"center",gap:"12px",color:"#fff"},children:[X.jsx("span",{style:{width:"20px",height:"20px",backgroundColor:pn.SUBJECT,borderRadius:"50%",display:"inline-block",boxShadow:"0 2px 8px rgba(0,0,0,0.18)"}}),X.jsx("span",{style:{fontSize:"15px"},children:"Subject"})]}),X.jsxs("li",{style:{display:"flex",alignItems:"center",gap:"12px",color:"#fff"},children:[X.jsx("span",{style:{width:"20px",height:"20px",backgroundColor:pn.OBJECT,borderRadius:"4px",display:"inline-block",boxShadow:"0 2px 8px rgba(0,0,0,0.18)"}}),X.jsx("span",{style:{fontSize:"15px"},children:"Object"})]}),X.jsxs("li",{style:{display:"flex",alignItems:"center",gap:"12px",color:"#fff"},children:[X.jsx("span",{style:{width:"20px",height:"8px",backgroundColor:pn.PREDICATE,borderRadius:"4px",display:"inline-block",boxShadow:"0 2px 8px rgba(0,0,0,0.18)"}}),X.jsx("span",{style:{fontSize:"15px"},children:"Predicate"})]})]})]});class $a extends Error{constructor(n,i){const s=`${$a.extractMessage(n)}: ${JSON.stringify({response:n,request:i})}`;super(s);Lc(this,"response");Lc(this,"request");Object.setPrototypeOf(this,$a.prototype),this.response=n,this.request=i,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$a)}static extractMessage(n){var i,s;return((s=(i=n.errors)==null?void 0:i[0])==null?void 0:s.message)??`GraphQL Error (Code: ${String(n.status)})`}}const ib=r=>r.toUpperCase(),bm=r=>typeof r=="function"?r():r,rb=(r,e)=>r.map((n,i)=>[n,e[i]]),ja=r=>{let e={};return r instanceof Headers?e=TN(r):Array.isArray(r)?r.forEach(([n,i])=>{n&&i!==void 0&&(e[n]=i)}):r&&(e=r),e},TN=r=>{const e={};return r.forEach((n,i)=>{e[i]=n}),e},wN=r=>{try{const e=r();return MN(e)?e.catch(n=>sb(n)):e}catch(e){return sb(e)}},sb=r=>r instanceof Error?r:new Error(String(r)),MN=r=>typeof r=="object"&&r!==null&&"then"in r&&typeof r.then=="function"&&"catch"in r&&typeof r.catch=="function"&&"finally"in r&&typeof r.finally=="function",Sm=r=>{throw new Error(`Unhandled case: ${String(r)}`)},Bh=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),EN=(r,e)=>r.documents?r:{documents:r,requestHeaders:e,signal:void 0},AN=(r,e,n)=>r.query?r:{query:r,variables:e,requestHeaders:n,signal:void 0};function kh(r,e){if(!!!r)throw new Error(e)}function CN(r){return typeof r=="object"&&r!==null}function RN(r,e){if(!!!r)throw new Error("Unexpected invariant triggered.")}const NN=/\r\n|[\n\r]/g;function Tm(r,e){let n=0,i=1;for(const s of r.body.matchAll(NN)){if(typeof s.index=="number"||RN(!1),s.index>=e)break;n=s.index+s[0].length,i+=1}return{line:i,column:e+1-n}}function PN(r){return ob(r.source,Tm(r.source,r.start))}function ob(r,e){const n=r.locationOffset.column-1,i="".padStart(n)+r.body,s=e.line-1,o=r.locationOffset.line-1,a=e.line+o,l=e.line===1?n:0,c=e.column+l,u=`${r.name}:${a}:${c} `,h=i.split(/\r\n|[\n\r]/g),d=h[s];if(d.length>120){const f=Math.floor(c/80),p=c%80,m=[];for(let _=0;_<d.length;_+=80)m.push(d.slice(_,_+80));return u+ab([[`${a} |`,m[0]],...m.slice(1,f+1).map(_=>["|",_]),["|","^".padStart(p)],["|",m[f+1]]])}return u+ab([[`${a-1} |`,h[s-1]],[`${a} |`,d],["|","^".padStart(c)],[`${a+1} |`,h[s+1]]])}function ab(r){const e=r.filter(([i,s])=>s!==void 0),n=Math.max(...e.map(([i])=>i.length));return e.map(([i,s])=>i.padStart(n)+(s?" "+s:"")).join(` `)}function DN(r){const e=r[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:r[1],positions:r[2],path:r[3],originalError:r[4],extensions:r[5]}:e}class wm extends Error{constructor(e,...n){var i,s,o;const{nodes:a,source:l,positions:c,path:u,originalError:h,extensions:d}=DN(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=h??void 0,this.nodes=lb(Array.isArray(a)?a:a?[a]:void 0);const f=lb((i=this.nodes)===null||i===void 0?void 0:i.map(m=>m.loc).filter(m=>m!=null));this.source=l??(f==null||(s=f[0])===null||s===void 0?void 0:s.source),this.positions=c??(f==null?void 0:f.map(m=>m.start)),this.locations=c&&l?c.map(m=>Tm(l,m)):f==null?void 0:f.map(m=>Tm(m.source,m.start));const p=CN(h==null?void 0:h.extensions)?h==null?void 0:h.extensions:void 0;this.extensions=(o=d??p)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),h!=null&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,wm):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(const n of this.nodes)n.loc&&(e+=` `+PN(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=` `+ob(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function lb(r){return r===void 0||r.length===0?void 0:r}function Fn(r,e,n){return new wm(`Syntax Error: ${n}`,{source:r,positions:[e]})}class IN{constructor(e,n,i){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class cb{constructor(e,n,i,s,o,a){this.kind=e,this.start=n,this.end=i,this.line=s,this.column=o,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const ub={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"]},LN=new Set(Object.keys(ub));function hb(r){const e=r==null?void 0:r.kind;return typeof e=="string"&&LN.has(e)}var jo;(function(r){r.QUERY="query",r.MUTATION="mutation",r.SUBSCRIPTION="subscription"})(jo||(jo={}));var Mm;(function(r){r.QUERY="QUERY",r.MUTATION="MUTATION",r.SUBSCRIPTION="SUBSCRIPTION",r.FIELD="FIELD",r.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",r.FRAGMENT_SPREAD="FRAGMENT_SPREAD",r.INLINE_FRAGMENT="INLINE_FRAGMENT",r.VARIABLE_DEFINITION="VARIABLE_DEFINITION",r.SCHEMA="SCHEMA",r.SCALAR="SCALAR",r.OBJECT="OBJECT",r.FIELD_DEFINITION="FIELD_DEFINITION",r.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",r.INTERFACE="INTERFACE",r.UNION="UNION",r.ENUM="ENUM",r.ENUM_VALUE="ENUM_VALUE",r.INPUT_OBJECT="INPUT_OBJECT",r.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Mm||(Mm={}));var it;(function(r){r.NAME="Name",r.DOCUMENT="Document",r.OPERATION_DEFINITION="OperationDefinition",r.VARIABLE_DEFINITION="VariableDefinition",r.SELECTION_SET="SelectionSet",r.FIELD="Field",r.ARGUMENT="Argument",r.FRAGMENT_SPREAD="FragmentSpread",r.INLINE_FRAGMENT="InlineFragment",r.FRAGMENT_DEFINITION="FragmentDefinition",r.VARIABLE="Variable",r.INT="IntValue",r.FLOAT="FloatValue",r.STRING="StringValue",r.BOOLEAN="BooleanValue",r.NULL="NullValue",r.ENUM="EnumValue",r.LIST="ListValue",r.OBJECT="ObjectValue",r.OBJECT_FIELD="ObjectField",r.DIRECTIVE="Directive",r.NAMED_TYPE="NamedType",r.LIST_TYPE="ListType",r.NON_NULL_TYPE="NonNullType",r.SCHEMA_DEFINITION="SchemaDefinition",r.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",r.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",r.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",r.FIELD_DEFINITION="FieldDefinition",r.INPUT_VALUE_DEFINITION="InputValueDefinition",r.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",r.UNION_TYPE_DEFINITION="UnionTypeDefinition",r.ENUM_TYPE_DEFINITION="EnumTypeDefinition",r.ENUM_VALUE_DEFINITION="EnumValueDefinition",r.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",r.DIRECTIVE_DEFINITION="DirectiveDefinition",r.SCHEMA_EXTENSION="SchemaExtension",r.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",r.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",r.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",r.UNION_TYPE_EXTENSION="UnionTypeExtension",r.ENUM_TYPE_EXTENSION="EnumTypeExtension",r.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(it||(it={}));function Em(r){return r===9||r===32}function Bc(r){return r>=48&&r<=57}function db(r){return r>=97&&r<=122||r>=65&&r<=90}function fb(r){return db(r)||r===95}function ON(r){return db(r)||Bc(r)||r===95}function FN(r){var e;let n=Number.MAX_SAFE_INTEGER,i=null,s=-1;for(let a=0;a<r.length;++a){var o;const l=r[a],c=UN(l);c!==l.length&&(i=(o=i)!==null&&o!==void 0?o:a,s=a,a!==0&&c<n&&(n=c))}return r.map((a,l)=>l===0?a:a.slice(n)).slice((e=i)!==null&&e!==void 0?e:0,s+1)}function UN(r){let e=0;for(;e<r.length&&Em(r.charCodeAt(e));)++e;return e}function BN(r,e){const n=r.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),s=i.length===1,o=i.length>1&&i.slice(1).every(p=>p.length===0||Em(p.charCodeAt(0))),a=n.endsWith('\\"""'),l=r.endsWith('"')&&!a,c=r.endsWith("\\"),u=l||c,h=!s||r.length>70||u||o||a;let d="";const f=s&&Em(r.charCodeAt(0));return(h&&!f||o)&&(d+=` `),d+=n,(h||u)&&(d+=` `),'"""'+d+'"""'}var _e;(function(r){r.SOF="<SOF>",r.EOF="<EOF>",r.BANG="!",r.DOLLAR="$",r.AMP="&",r.PAREN_L="(",r.PAREN_R=")",r.SPREAD="...",r.COLON=":",r.EQUALS="=",r.AT="@",r.BRACKET_L="[",r.BRACKET_R="]",r.BRACE_L="{",r.PIPE="|",r.BRACE_R="}",r.NAME="Name",r.INT="Int",r.FLOAT="Float",r.STRING="String",r.BLOCK_STRING="BlockString",r.COMMENT="Comment"})(_e||(_e={}));class kN{constructor(e){const n=new cb(_e.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==_e.EOF)do if(e.next)e=e.next;else{const n=GN(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===_e.COMMENT);return e}}function zN(r){return r===_e.BANG||r===_e.DOLLAR||r===_e.AMP||r===_e.PAREN_L||r===_e.PAREN_R||r===_e.SPREAD||r===_e.COLON||r===_e.EQUALS||r===_e.AT||r===_e.BRACKET_L||r===_e.BRACKET_R||r===_e.BRACE_L||r===_e.PIPE||r===_e.BRACE_R}function Ha(r){return r>=0&&r<=55295||r>=57344&&r<=1114111}function zh(r,e){return pb(r.charCodeAt(e))&&mb(r.charCodeAt(e+1))}function pb(r){return r>=55296&&r<=56319}function mb(r){return r>=56320&&r<=57343}function Ho(r,e){const n=r.source.body.codePointAt(e);if(n===void 0)return _e.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function bn(r,e,n,i,s){const o=r.line,a=1+n-r.lineStart;return new cb(e,n,i,o,a,s)}function GN(r,e){const n=r.source.body,i=n.length;let s=e;for(;s<i;){const o=n.charCodeAt(s);switch(o){case 65279:case 9:case 32:case 44:++s;continue;case 10:++s,++r.line,r.lineStart=s;continue;case 13:n.charCodeAt(s+1)===10?s+=2:++s,++r.line,r.lineStart=s;continue;case 35:return VN(r,s);case 33:return bn(r,_e.BANG,s,s+1);case 36:return bn(r,_e.DOLLAR,s,s+1);case 38:return bn(r,_e.AMP,s,s+1);case 40:return bn(r,_e.PAREN_L,s,s+1);case 41:return bn(r,_e.PAREN_R,s,s+1);case 46:if(n.charCodeAt(s+1)===46&&n.charCodeAt(s+2)===46)return bn(r,_e.SPREAD,s,s+3);break;case 58:return bn(r,_e.COLON,s,s+1);case 61:return bn(r,_e.EQUALS,s,s+1);case 64:return bn(r,_e.AT,s,s+1);case 91:return bn(r,_e.BRACKET_L,s,s+1);case 93:return bn(r,_e.BRACKET_R,s,s+1);case 123:return bn(r,_e.BRACE_L,s,s+1);case 124:return bn(r,_e.PIPE,s,s+1);case 125:return bn(r,_e.BRACE_R,s,s+1);case 34:return n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34?XN(r,s):jN(r,s)}if(Bc(o)||o===45)return $N(r,s,o);if(fb(o))return YN(r,s);throw Fn(r.source,s,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ha(o)||zh(n,s)?`Unexpected character: ${Ho(r,s)}.`:`Invalid character: ${Ho(r,s)}.`)}return bn(r,_e.EOF,i,i)}function VN(r,e){const n=r.source.body,i=n.length;let s=e+1;for(;s<i;){const o=n.charCodeAt(s);if(o===10||o===13)break;if(Ha(o))++s;else if(zh(n,s))s+=2;else break}return bn(r,_e.COMMENT,e,s,n.slice(e+1,s))}function $N(r,e,n){const i=r.source.body;let s=e,o=n,a=!1;if(o===45&&(o=i.charCodeAt(++s)),o===48){if(o=i.charCodeAt(++s),Bc(o))throw Fn(r.source,s,`Invalid number, unexpected digit after 0: ${Ho(r,s)}.`)}else s=Am(r,s,o),o=i.charCodeAt(s);if(o===46&&(a=!0,o=i.charCodeAt(++s),s=Am(r,s,o),o=i.charCodeAt(s)),(o===69||o===101)&&(a=!0,o=i.charCodeAt(++s),(o===43||o===45)&&(o=i.charCodeAt(++s)),s=Am(r,s,o),o=i.charCodeAt(s)),o===46||fb(o))throw Fn(r.source,s,`Invalid number, expected digit but got: ${Ho(r,s)}.`);return bn(r,a?_e.FLOAT:_e.INT,e,s,i.slice(e,s))}function Am(r,e,n){if(!Bc(n))throw Fn(r.source,e,`Invalid number, expected digit but got: ${Ho(r,e)}.`);const i=r.source.body;let s=e+1;for(;Bc(i.charCodeAt(s));)++s;return s}function jN(r,e){const n=r.source.body,i=n.length;let s=e+1,o=s,a="";for(;s<i;){const l=n.charCodeAt(s);if(l===34)return a+=n.slice(o,s),bn(r,_e.STRING,e,s+1,a);if(l===92){a+=n.slice(o,s);const c=n.charCodeAt(s+1)===117?n.charCodeAt(s+2)===123?HN(r,s):WN(r,s):qN(r,s);a+=c.value,s+=c.size,o=s;continue}if(l===10||l===13)break;if(Ha(l))++s;else if(zh(n,s))s+=2;else throw Fn(r.source,s,`Invalid character within String: ${Ho(r,s)}.`)}throw Fn(r.source,s,"Unterminated string.")}function HN(r,e){const n=r.source.body;let i=0,s=3;for(;s<12;){const o=n.charCodeAt(e+s++);if(o===125){if(s<5||!Ha(i))break;return{value:String.fromCodePoint(i),size:s}}if(i=i<<4|kc(o),i<0)break}throw Fn(r.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+s)}".`)}function WN(r,e){const n=r.source.body,i=gb(n,e+2);if(Ha(i))return{value:String.fromCodePoint(i),size:6};if(pb(i)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const s=gb(n,e+8);if(mb(s))return{value:String.fromCodePoint(i,s),size:12}}throw Fn(r.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function gb(r,e){return kc(r.charCodeAt(e))<<12|kc(r.charCodeAt(e+1))<<8|kc(r.charCodeAt(e+2))<<4|kc(r.charCodeAt(e+3))}function kc(r){return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1}function qN(r,e){const n=r.source.body;switch(n.charCodeAt(e+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:` `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Fn(r.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function XN(r,e){const n=r.source.body,i=n.length;let s=r.lineStart,o=e+3,a=o,l="";const c=[];for(;o<i;){const u=n.charCodeAt(o);if(u===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){l+=n.slice(a,o),c.push(l);const h=bn(r,_e.BLOCK_STRING,e,o+3,FN(c).join(` `));return r.line+=c.length-1,r.lineStart=s,h}if(u===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){l+=n.slice(a,o),a=o+1,o+=4;continue}if(u===10||u===13){l+=n.slice(a,o),c.push(l),u===13&&n.charCodeAt(o+1)===10?o+=2:++o,l="",a=o,s=o;continue}if(Ha(u))++o;else if(zh(n,o))o+=2;else throw Fn(r.source,o,`Invalid character within String: ${Ho(r,o)}.`)}throw Fn(r.source,o,"Unterminated string.")}function YN(r,e){const n=r.source.body,i=n.length;let s=e+1;for(;s<i;){const o=n.charCodeAt(s);if(ON(o))++s;else break}return bn(r,_e.NAME,e,s,n.slice(e,s))}const ZN=10,yb=2;function Cm(r){return Gh(r,[])}function Gh(r,e){switch(typeof r){case"string":return JSON.stringify(r);case"function":return r.name?`[function ${r.name}]`:"[function]";case"object":return KN(r,e);default:return String(r)}}function KN(r,e){if(r===null)return"null";if(e.includes(r))return"[Circular]";const n=[...e,r];if(QN(r)){const i=r.toJSON();if(i!==r)return typeof i=="string"?i:Gh(i,n)}else if(Array.isArray(r))return eP(r,n);return JN(r,n)}function QN(r){return typeof r.toJSON=="function"}function JN(r,e){const n=Object.entries(r);return n.length===0?"{}":e.length>yb?"["+tP(r)+"]":"{ "+n.map(([s,o])=>s+": "+Gh(o,e)).join(", ")+" }"}function eP(r,e){if(r.length===0)return"[]";if(e.length>yb)return"[Array]";const n=Math.min(ZN,r.length),i=r.length-n,s=[];for(let o=0;o<n;++o)s.push(Gh(r[o],e));return i===1?s.push("... 1 more item"):i>1&&s.push(`... ${i} more items`),"["+s.join(", ")+"]"}function tP(r){const e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){const n=r.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const nP=globalThis.process&&process.env.NODE_ENV==="production"?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var i;const s=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in e?e[Symbol.toStringTag]:(i=e.constructor)===null||i===void 0?void 0:i.name;if(s===o){const a=Cm(e);throw new Error(`Cannot use ${s} "${a}" from another module or realm. Ensure that there is only one instance of "graphql" in the node_modules directory. If different versions of "graphql" are the dependencies of other relied on modules, use "resolutions" to ensure only one version is installed. https://yarnpkg.com/en/docs/selective-version-resolutions Duplicate "graphql" modules cannot be used at the same time since different versions may have different capabilities and behavior. The data from one version used in the function from another could produce confusing and spurious results.`)}}return!1};let _b=class{constructor(e,n="GraphQL request",i={line:1,column:1}){typeof e=="string"||kh(!1,`Body must be a string. Received: ${Cm(e)}.`),this.body=e,this.name=n,this.locationOffset=i,this.locationOffset.line>0||kh(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||kh(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function iP(r){return nP(r,_b)}function rP(r,e){const n=new sP(r,e),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}class sP{constructor(e,n={}){const i=iP(e)?e:new _b(e);this._lexer=new kN(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(_e.NAME);return this.node(e,{kind:it.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:it.DOCUMENT,definitions:this.many(_e.SOF,this.parseDefinition,_e.EOF)})}parseDefinition(){if(this.peek(_e.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===_e.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Fn(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(_e.BRACE_L))return this.node(e,{kind:it.OPERATION_DEFINITION,operation:jo.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(_e.NAME)&&(i=this.parseName()),this.node(e,{kind:it.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(_e.NAME);switch(e.value){case"query":return jo.QUERY;case"mutation":return jo.MUTATION;case"subscription":return jo.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(_e.PAREN_L,this.parseVariableDefinition,_e.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:it.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(_e.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(_e.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(_e.DOLLAR),this.node(e,{kind:it.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:it.SELECTION_SET,selections:this.many(_e.BRACE_L,this.parseSelection,_e.BRACE_R)})}parseSelection(){return this.peek(_e.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let i,s;return this.expectOptionalToken(_e.COLON)?(i=n,s=this.parseName()):s=n,this.node(e,{kind:it.FIELD,alias:i,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(_e.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(_e.PAREN_L,n,_e.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(_e.COLON),this.node(n,{kind:it.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(_e.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(_e.NAME)?this.node(e,{kind:it.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:it.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:it.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:it.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case _e.BRACKET_L:return this.parseList(e);case _e.BRACE_L:return this.parseObject(e);case _e.INT:return this.advanceLexer(),this.node(n,{kind:it.INT,value:n.value});case _e.FLOAT:return this.advanceLexer(),this.node(n,{kind:it.FLOAT,value:n.value});case _e.STRING:case _e.BLOCK_STRING:return this.parseStringLiteral();case _e.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:it.BOOLEAN,value:!0});case"false":return this.node(n,{kind:it.BOOLEAN,value:!1});case"null":return this.node(n,{kind:it.NULL});default:return this.node(n,{kind:it.ENUM,value:n.value})}case _e.DOLLAR:if(e)if(this.expectToken(_e.DOLLAR),this._lexer.token.kind===_e.NAME){const i=this._lexer.token.value;throw Fn(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:it.STRING,value:e.value,block:e.kind===_e.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:it.LIST,values:this.any(_e.BRACKET_L,n,_e.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:it.OBJECT,fields:this.any(_e.BRACE_L,n,_e.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,i=this.parseName();return this.expectToken(_e.COLON),this.node(n,{kind:it.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(_e.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(_e.AT),this.node(n,{kind:it.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(_e.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(_e.BRACKET_R),n=this.node(e,{kind:it.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(_e.BANG)?this.node(e,{kind:it.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:it.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(_e.STRING)||this.peek(_e.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),s=this.many(_e.BRACE_L,this.parseOperationTypeDefinition,_e.BRACE_R);return this.node(e,{kind:it.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:s})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(_e.COLON);const i=this.parseNamedType();return this.node(e,{kind:it.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),s=this.parseConstDirectives();return this.node(e,{kind:it.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:s})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:it.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(_e.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(_e.BRACE_L,this.parseFieldDefinition,_e.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName(),s=this.parseArgumentDefs();this.expectToken(_e.COLON);const o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:it.FIELD_DEFINITION,description:n,name:i,arguments:s,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(_e.PAREN_L,this.parseInputValueDef,_e.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(_e.COLON);const s=this.parseTypeReference();let o;this.expectOptionalToken(_e.EQUALS)&&(o=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:it.INPUT_VALUE_DEFINITION,description:n,name:i,type:s,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:it.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:o,fields:a})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),s=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(e,{kind:it.UNION_TYPE_DEFINITION,description:n,name:i,directives:s,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(_e.EQUALS)?this.delimitedMany(_e.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),s=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(e,{kind:it.ENUM_TYPE_DEFINITION,description:n,name:i,directives:s,values:o})}parseEnumValuesDefinition(){return this.optionalMany(_e.BRACE_L,this.parseEnumValueDefinition,_e.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),s=this.parseConstDirectives();return this.node(e,{kind:it.ENUM_VALUE_DEFINITION,description:n,name:i,directives:s})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Fn(this._lexer.source,this._lexer.token.start,`${Vh(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),s=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(e,{kind:it.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:s,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(_e.BRACE_L,this.parseInputValueDef,_e.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===_e.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(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(_e.BRACE_L,this.parseOperationTypeDefinition,_e.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:it.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(e,{kind:it.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&o.length===0)throw this.unexpected();return this.node(e,{kind:it.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:o})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&o.length===0)throw this.unexpected();return this.node(e,{kind:it.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:o})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:it.UNION_TYPE_EXTENSION,name:n,directives:i,types:s})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:it.ENUM_TYPE_EXTENSION,name:n,directives:i,values:s})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:it.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:s})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(_e.AT);const i=this.parseName(),s=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const a=this.parseDirectiveLocations();return this.node(e,{kind:it.DIRECTIVE_DEFINITION,description:n,name:i,arguments:s,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(_e.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Mm,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new IN(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw Fn(this._lexer.source,n.start,`Expected ${vb(e)}, found ${Vh(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeywor