"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[815],{8815:function(e,n,t){var r=t(709),i=t.n(r),a=t(4344);let s,o,c,u,l,f,d;function p(){const e=c,n=[];if(h("{"),!g("}")){do{n.push(k())}while(g(","));h("}")}return{kind:"Object",start:e,end:l,members:n}}function k(){const e=c,n="String"===d?v():null;h("String"),h(":");const t=b();return{kind:"Member",start:e,end:l,key:n,value:t}}function b(){switch(d){case"[":return function(){const e=c,n=[];if(h("["),!g("]")){do{n.push(b())}while(g(","));h("]")}return{kind:"Array",start:e,end:l,values:n}}();case"{":return p();case"String":case"Number":case"Boolean":case"Null":const e=v();return N(),e}h("Value")}function v(){return{kind:d,start:c,end:u,value:JSON.parse(s.slice(c,u))}}function h(e){if(d===e)return void N();let n;if("EOF"===d)n="[end of file]";else if(u-c>1)n="`"+s.slice(c,u)+"`";else{const e=s.slice(c).match(/^.+?\b/);n="`"+(e?e[0]:s[c])+"`"}throw y(`Expected ${e} but found ${n}.`)}class m extends Error{constructor(e,n){super(e),this.position=n}}function y(e){return new m(e,{start:c,end:u})}function g(e){if(d===e)return N(),!0}function w(){return u<o&&(u++,f=u===o?0:s.charCodeAt(u)),f}function N(){for(l=u;9===f||10===f||13===f||32===f;)w();if(0!==f){switch(c=u,f){case 34:return d="String",function(){for(w();34!==f&&f>31;)if(92===f)switch(f=w(),f){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:w();break;case 117:w(),$(),$(),$(),$();break;default:throw y("Bad character escape sequence.")}else{if(u===o)throw y("Unterminated string.");w()}if(34!==f)throw y("Unterminated string.");w()}();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return d="Number",45===f&&w(),48===f?w():O(),46===f&&(w(),O()),void(69!==f&&101!==f||(f=w(),43!==f&&45!==f||w(),O()));case 102:if("false"!==s.slice(c,c+5))break;return u+=4,w(),void(d="Boolean");case 110:if("null"!==s.slice(c,c+4))break;return u+=3,w(),void(d="Null");case 116:if("true"!==s.slice(c,c+4))break;return u+=3,w(),void(d="Boolean")}d=s[c],w()}else d="EOF"}function $(){if(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102)return w();throw y("Expected hexadecimal digit.")}function O(){if(f<48||f>57)throw y("Expected decimal digit.");do{w()}while(f>=48&&f<=57)}function F(e,n){if(!e||!n)return[];if(e instanceof a.Gc)return"Null"===n.kind?[[n,`Type "${e}" is non-nullable and cannot be null.`]]:F(e.ofType,n);if("Null"===n.kind)return[];if(e instanceof a.KT){const t=e.ofType;return"Array"===n.kind?x(n.values||[],(e=>F(t,e))):F(t,n)}if(e instanceof a.zP){if("Object"!==n.kind)return[[n,`Type "${e}" must be an Object.`]];const t=Object.create(null),r=x(n.members,(n=>{var r;const i=null===(r=null==n?void 0:n.key)||void 0===r?void 0:r.value;t[i]=!0;const a=e.getFields()[i];return a?F(a?a.type:void 0,n.value):[[n.key,`Type "${e}" does not have a field "${i}".`]]}));for(const i of Object.keys(e.getFields())){const s=e.getFields()[i];!t[i]&&s.type instanceof a.Gc&&!s.defaultValue&&r.push([n,`Object of type "${e}" is missing required field "${i}".`])}return r}return"Boolean"===e.name&&"Boolean"!==n.kind||"String"===e.name&&"String"!==n.kind||"ID"===e.name&&"Number"!==n.kind&&"String"!==n.kind||"Float"===e.name&&"Number"!==n.kind||"Int"===e.name&&("Number"!==n.kind||(0|n.value)!==n.value)||(e instanceof a.Zb||e instanceof a.Ag)&&("String"!==n.kind&&"Number"!==n.kind&&"Boolean"!==n.kind&&"Null"!==n.kind||null==(t=e.parseValue(n.value))||t!=t)?[[n,`Expected value of type "${e}".`]]:[];var t}function S(e,n,t){return{message:t,severity:"error",type:"validation",from:e.posFromIndex(n.start),to:e.posFromIndex(n.end)}}function x(e,n){return Array.prototype.concat.apply([],e.map(n))}i().registerHelper("lint","graphql-variables",((e,n,t)=>{if(!e)return[];let r;try{r=function(e){s=e,o=e.length,c=u=l=-1,w(),N();const n=p();return h("EOF"),n}(e)}catch(e){if(e instanceof m)return[S(t,e.position,e.message)];throw e}const{variableToType:i}=n;return i?function(e,n,t){var r;const i=[];for(const a of t.members)if(a){const t=null===(r=a.key)||void 0===r?void 0:r.value,s=n[t];if(s)for(const[n,t]of F(s,a.value))i.push(S(e,n,t));else i.push(S(e,a.key,`Variable "$${t}" does not appear in any GraphQL query.`))}return i}(t,i,r):[]}))}}]);
//# sourceMappingURL=815.js.map