{"version":3,"file":"vendor.codemirror-graphql.3db969dc7da8851e.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,gBAAgB,mBAAO,CAAC,KAAS;AACjC,qCAAqC,mBAAO,CAAC,KAAuB;AACpE,iCAAiC,mBAAO,CAAC,KAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,iDAAiD,QAAQ,GAAG;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA,sFAAsF,oCAAoC;AAC1H,qFAAqF;AACrF;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,QAAQ,GAAG;AAChE;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA,kBAAkB,yEAAyE;AAC3F,kBAAkB,yEAAyE;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;AC1Ga;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,qCAAqC,mBAAO,CAAC,KAAsB;AACnE;AACA;;;;;;;ACRa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA,kBAAe;AACf;;;;;;;ACda;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,mBAAO,CAAC,IAAiC;AACzC,iCAAiC,mBAAO,CAAC,KAA0B;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb,gBAAgB,gCAAgC;AAChD,cAAc,+BAA+B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;ACtCa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB,mBAAO,CAAC,KAAS;AACjC,sBAAsB,mBAAO,CAAC,IAA4B;AAC1D,qCAAqC,mBAAO,CAAC,KAAgB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yBAAyB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,kCAAkC;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrIa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB,mBAAO,CAAC,KAAS;AACjC,mCAAmC,mBAAO,CAAC,KAAY;AACvD,oCAAoC,mBAAO,CAAC,KAAqB;AACjE,wBAAwB,mBAAO,CAAC,KAAyB;AACzD,mBAAO,CAAC,KAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,8BAA8B,YAAY;AAC1C,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzKa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iCAAiC,mBAAO,CAAC,KAA0B;AACnE,oCAAoC,mBAAO,CAAC,KAAe;AAC3D;AACA;AACA,2CAA2C,+DAA+D;AAC1G;AACA;AACA,wBAAwB,yBAAyB;AACjD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,0BAA0B;AAC1B,4BAA4B;AAC5B,SAAS;AACT;AACA;AACA,kBAAe;AACf;;;;;;;AC7Ba;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;;;;;;;ACZa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,iCAAiC,IAAI,+BAA+B,IAAI,oCAAoC;AACnJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvHa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,iCAAiC,mBAAO,CAAC,KAA0B;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA,CAAC;AACD;;;;;;;ACzBa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,wBAAwB,GAAG,6BAA6B,GAAG,4BAA4B,GAAG,6BAA6B,GAAG,yBAAyB;AACnJ,gBAAgB,mBAAO,CAAC,KAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;;;;;;;AC3Da;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,iCAAiC,mBAAO,CAAC,KAA0B;AACnE;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA;AACA,wBAAwB,yBAAyB;AACjD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,wBAAwB;AACxB,0BAA0B;AAC1B,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,GAAG;AAC7B;AACA,6DAA6D,EAAE;AAC/D;AACA;AACA;AACA,8CAA8C,mJAAmJ;AACjM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iDAAiD,sJAAsJ;AACvM;AACA;AACA;AACA;AACA;AACA,kCAAkC,iCAAiC;AACnE;AACA;AACA,SAAS;AACT;AACA;AACA;;;;;;;ACvFa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB;AAChB;AACA;AACA,UAAU;AACV,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;;;;;;AC9Pa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,iCAAiC,mBAAO,CAAC,KAA0B;AACnE;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA;AACA,wBAAwB,yBAAyB;AACjD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,wBAAwB;AACxB,0BAA0B;AAC1B,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,GAAG;AAC7B;AACA,6DAA6D,EAAE;AAC/D;AACA;AACA;AACA,8CAA8C,gHAAgH;AAC9J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iDAAiD,sHAAsH;AACvK;AACA;AACA;;;;;;;AC9Ea;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mCAAmC;AACnD,cAAc,kCAAkC;AAChD;AACA;AACA,kBAAe;AACf;AACA;AACA,uDAAuD,6BAA6B;AACpF;AACA,kDAAkD;AAClD;AACA;AACA,KAAK,IAAI;AACT,sFAAsF,6BAA6B,qBAAqB,kCAAkC;AAC1K;AACA;AACA;AACA;AACA,KAAK;AACL,+CAA+C,oBAAoB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA,gBAAgB,cAAc;AAC9B,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvEa;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC3Ia;AACb;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,oCAAoC,mBAAO,CAAC,KAAqB;AACjE,wBAAwB,mBAAO,CAAC,KAAyB;AACzD,mBAAO,CAAC,KAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;AClCa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mCAAmC,mBAAO,CAAC,KAAY;AACvD,gBAAgB,mBAAO,CAAC,KAAS;AACjC,kCAAkC,mBAAO,CAAC,KAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yCAAyC;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://admin/./node_modules/codemirror-graphql/variables/hint.js","webpack://admin/./node_modules/codemirror-graphql/mode.js","webpack://admin/./node_modules/codemirror-graphql/utils/forEachState.js","webpack://admin/./node_modules/codemirror-graphql/hint.js","webpack://admin/./node_modules/codemirror-graphql/utils/getTypeInfo.js","webpack://admin/./node_modules/codemirror-graphql/info.js","webpack://admin/./node_modules/codemirror-graphql/utils/mode-factory.js","webpack://admin/./node_modules/codemirror-graphql/utils/mode-indent.js","webpack://admin/./node_modules/codemirror-graphql/utils/jump-addon.js","webpack://admin/./node_modules/codemirror-graphql/lint.js","webpack://admin/./node_modules/codemirror-graphql/utils/SchemaReference.js","webpack://admin/./node_modules/codemirror-graphql/variables/mode.js","webpack://admin/./node_modules/codemirror-graphql/utils/jsonParse.js","webpack://admin/./node_modules/codemirror-graphql/results/mode.js","webpack://admin/./node_modules/codemirror-graphql/utils/hintList.js","webpack://admin/./node_modules/codemirror-graphql/utils/info-addon.js","webpack://admin/./node_modules/codemirror-graphql/jump.js","webpack://admin/./node_modules/codemirror-graphql/variables/lint.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar graphql_1 = require(\"graphql\");\nvar forEachState_1 = __importDefault(require(\"../utils/forEachState\"));\nvar hintList_1 = __importDefault(require(\"../utils/hintList\"));\ncodemirror_1.default.registerHelper('hint', 'graphql-variables', function (editor, options) {\n var cur = editor.getCursor();\n var token = editor.getTokenAt(cur);\n var results = getVariablesHint(cur, token, options);\n if (results && results.list && results.list.length > 0) {\n results.from = codemirror_1.default.Pos(results.from.line, results.from.ch);\n results.to = codemirror_1.default.Pos(results.to.line, results.to.ch);\n codemirror_1.default.signal(editor, 'hasCompletion', editor, results, token);\n }\n return results;\n});\nfunction getVariablesHint(cur, token, options) {\n var state = token.state.kind === 'Invalid' ? token.state.prevState : token.state;\n var kind = state.kind;\n var step = state.step;\n if (kind === 'Document' && step === 0) {\n return hintList_1.default(cur, token, [{ text: '{' }]);\n }\n var variableToType = options.variableToType;\n if (!variableToType) {\n return;\n }\n var typeInfo = getTypeInfo(variableToType, token.state);\n if (kind === 'Document' || (kind === 'Variable' && step === 0)) {\n var variableNames = Object.keys(variableToType);\n return hintList_1.default(cur, token, variableNames.map(function (name) { return ({\n text: \"\\\"\" + name + \"\\\": \",\n type: variableToType[name],\n }); }));\n }\n if (kind === 'ObjectValue' || (kind === 'ObjectField' && step === 0)) {\n if (typeInfo.fields) {\n var inputFields = Object.keys(typeInfo.fields).map(function (fieldName) { return typeInfo.fields[fieldName]; });\n return hintList_1.default(cur, token, inputFields.map(function (field) { return ({\n text: \"\\\"\" + field.name + \"\\\": \",\n type: field.type,\n description: field.description,\n }); }));\n }\n }\n if (kind === 'StringValue' ||\n kind === 'NumberValue' ||\n kind === 'BooleanValue' ||\n kind === 'NullValue' ||\n (kind === 'ListValue' && step === 1) ||\n (kind === 'ObjectField' && step === 2) ||\n (kind === 'Variable' && step === 2)) {\n var namedInputType_1 = typeInfo.type\n ? graphql_1.getNamedType(typeInfo.type)\n : undefined;\n if (namedInputType_1 instanceof graphql_1.GraphQLInputObjectType) {\n return hintList_1.default(cur, token, [{ text: '{' }]);\n }\n else if (namedInputType_1 instanceof graphql_1.GraphQLEnumType) {\n var values = namedInputType_1.getValues();\n return hintList_1.default(cur, token, values.map(function (value) { return ({\n text: \"\\\"\" + value.name + \"\\\"\",\n type: namedInputType_1,\n description: value.description,\n }); }));\n }\n else if (namedInputType_1 === graphql_1.GraphQLBoolean) {\n return hintList_1.default(cur, token, [\n { text: 'true', type: graphql_1.GraphQLBoolean, description: 'Not false.' },\n { text: 'false', type: graphql_1.GraphQLBoolean, description: 'Not true.' },\n ]);\n }\n }\n}\nfunction getTypeInfo(variableToType, tokenState) {\n var info = {\n type: null,\n fields: null,\n };\n forEachState_1.default(tokenState, function (state) {\n if (state.kind === 'Variable') {\n info.type = variableToType[state.name];\n }\n else if (state.kind === 'ListValue') {\n var nullableType = info.type ? graphql_1.getNullableType(info.type) : undefined;\n info.type =\n nullableType instanceof graphql_1.GraphQLList ? nullableType.ofType : null;\n }\n else if (state.kind === 'ObjectValue') {\n var objectType = info.type ? graphql_1.getNamedType(info.type) : undefined;\n info.fields =\n objectType instanceof graphql_1.GraphQLInputObjectType\n ? objectType.getFields()\n : null;\n }\n else if (state.kind === 'ObjectField') {\n var objectField = state.name && info.fields ? info.fields[state.name] : null;\n info.type = objectField && objectField.type;\n }\n });\n return info;\n}\n//# sourceMappingURL=hint.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar mode_factory_1 = __importDefault(require(\"./utils/mode-factory\"));\ncodemirror_1.default.defineMode('graphql', mode_factory_1.default);\n//# sourceMappingURL=mode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction forEachState(stack, fn) {\n var reverseStateStack = [];\n var state = stack;\n while (state && state.kind) {\n reverseStateStack.push(state);\n state = state.prevState;\n }\n for (var i = reverseStateStack.length - 1; i >= 0; i--) {\n fn(reverseStateStack[i]);\n }\n}\nexports.default = forEachState;\n//# sourceMappingURL=forEachState.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nrequire(\"codemirror/addon/hint/show-hint\");\nvar graphql_language_service_1 = require(\"graphql-language-service\");\ncodemirror_1.default.registerHelper('hint', 'graphql', function (editor, options) {\n var schema = options.schema;\n if (!schema) {\n return;\n }\n var cur = editor.getCursor();\n var token = editor.getTokenAt(cur);\n var tokenStart = token.type !== null && /\"|\\w/.test(token.string[0])\n ? token.start\n : token.end;\n var position = new graphql_language_service_1.Position(cur.line, tokenStart);\n var rawResults = graphql_language_service_1.getAutocompleteSuggestions(schema, editor.getValue(), position, token, options.externalFragments);\n var results = {\n list: rawResults.map(function (item) { return ({\n text: item.label,\n type: item.type,\n description: item.documentation,\n isDeprecated: item.isDeprecated,\n deprecationReason: item.deprecationReason,\n }); }),\n from: { line: cur.line, ch: tokenStart },\n to: { line: cur.line, ch: token.end },\n };\n if (results && results.list && results.list.length > 0) {\n results.from = codemirror_1.default.Pos(results.from.line, results.from.ch);\n results.to = codemirror_1.default.Pos(results.to.line, results.to.ch);\n codemirror_1.default.signal(editor, 'hasCompletion', editor, results, token);\n }\n return results;\n});\n//# sourceMappingURL=hint.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar graphql_1 = require(\"graphql\");\nvar introspection_1 = require(\"graphql/type/introspection\");\nvar forEachState_1 = __importDefault(require(\"./forEachState\"));\nfunction getTypeInfo(schema, tokenState) {\n var info = {\n schema: schema,\n type: null,\n parentType: null,\n inputType: null,\n directiveDef: null,\n fieldDef: null,\n argDef: null,\n argDefs: null,\n objectFieldDefs: null,\n };\n forEachState_1.default(tokenState, function (state) {\n switch (state.kind) {\n case 'Query':\n case 'ShortQuery':\n info.type = schema.getQueryType();\n break;\n case 'Mutation':\n info.type = schema.getMutationType();\n break;\n case 'Subscription':\n info.type = schema.getSubscriptionType();\n break;\n case 'InlineFragment':\n case 'FragmentDefinition':\n if (state.type) {\n info.type = schema.getType(state.type);\n }\n break;\n case 'Field':\n case 'AliasedField':\n info.fieldDef =\n info.type && state.name\n ? getFieldDef(schema, info.parentType, state.name)\n : null;\n info.type = info.fieldDef && info.fieldDef.type;\n break;\n case 'SelectionSet':\n info.parentType = info.type ? graphql_1.getNamedType(info.type) : null;\n break;\n case 'Directive':\n info.directiveDef = state.name ? schema.getDirective(state.name) : null;\n break;\n case 'Arguments':\n var parentDef = state.prevState\n ? state.prevState.kind === 'Field'\n ? info.fieldDef\n : state.prevState.kind === 'Directive'\n ? info.directiveDef\n : state.prevState.kind === 'AliasedField'\n ? state.prevState.name &&\n getFieldDef(schema, info.parentType, state.prevState.name)\n : null\n : null;\n info.argDefs = parentDef ? parentDef.args : null;\n break;\n case 'Argument':\n info.argDef = null;\n if (info.argDefs) {\n for (var i = 0; i < info.argDefs.length; i++) {\n if (info.argDefs[i].name === state.name) {\n info.argDef = info.argDefs[i];\n break;\n }\n }\n }\n info.inputType = info.argDef && info.argDef.type;\n break;\n case 'EnumValue':\n var enumType = info.inputType ? graphql_1.getNamedType(info.inputType) : null;\n info.enumValue =\n enumType instanceof graphql_1.GraphQLEnumType\n ? find(enumType.getValues(), function (val) { return val.value === state.name; })\n : null;\n break;\n case 'ListValue':\n var nullableType = info.inputType\n ? graphql_1.getNullableType(info.inputType)\n : null;\n info.inputType =\n nullableType instanceof graphql_1.GraphQLList ? nullableType.ofType : null;\n break;\n case 'ObjectValue':\n var objectType = info.inputType ? graphql_1.getNamedType(info.inputType) : null;\n info.objectFieldDefs =\n objectType instanceof graphql_1.GraphQLInputObjectType\n ? objectType.getFields()\n : null;\n break;\n case 'ObjectField':\n var objectField = state.name && info.objectFieldDefs\n ? info.objectFieldDefs[state.name]\n : null;\n info.inputType = objectField && objectField.type;\n break;\n case 'NamedType':\n info.type = state.name ? schema.getType(state.name) : null;\n break;\n }\n });\n return info;\n}\nexports.default = getTypeInfo;\nfunction getFieldDef(schema, type, fieldName) {\n if (fieldName === introspection_1.SchemaMetaFieldDef.name && schema.getQueryType() === type) {\n return introspection_1.SchemaMetaFieldDef;\n }\n if (fieldName === introspection_1.TypeMetaFieldDef.name && schema.getQueryType() === type) {\n return introspection_1.TypeMetaFieldDef;\n }\n if (fieldName === introspection_1.TypeNameMetaFieldDef.name && graphql_1.isCompositeType(type)) {\n return introspection_1.TypeNameMetaFieldDef;\n }\n if (type && type.getFields) {\n return type.getFields()[fieldName];\n }\n}\nfunction find(array, predicate) {\n for (var i = 0; i < array.length; i++) {\n if (predicate(array[i])) {\n return array[i];\n }\n }\n}\n//# sourceMappingURL=getTypeInfo.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar graphql_1 = require(\"graphql\");\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar getTypeInfo_1 = __importDefault(require(\"./utils/getTypeInfo\"));\nvar SchemaReference_1 = require(\"./utils/SchemaReference\");\nrequire(\"./utils/info-addon\");\ncodemirror_1.default.registerHelper('info', 'graphql', function (token, options) {\n if (!options.schema || !token.state) {\n return;\n }\n var state = token.state;\n var kind = state.kind;\n var step = state.step;\n var typeInfo = getTypeInfo_1.default(options.schema, token.state);\n if ((kind === 'Field' && step === 0 && typeInfo.fieldDef) ||\n (kind === 'AliasedField' && step === 2 && typeInfo.fieldDef)) {\n var into = document.createElement('div');\n renderField(into, typeInfo, options);\n renderDescription(into, options, typeInfo.fieldDef);\n return into;\n }\n else if (kind === 'Directive' && step === 1 && typeInfo.directiveDef) {\n var into = document.createElement('div');\n renderDirective(into, typeInfo, options);\n renderDescription(into, options, typeInfo.directiveDef);\n return into;\n }\n else if (kind === 'Argument' && step === 0 && typeInfo.argDef) {\n var into = document.createElement('div');\n renderArg(into, typeInfo, options);\n renderDescription(into, options, typeInfo.argDef);\n return into;\n }\n else if (kind === 'EnumValue' &&\n typeInfo.enumValue &&\n typeInfo.enumValue.description) {\n var into = document.createElement('div');\n renderEnumValue(into, typeInfo, options);\n renderDescription(into, options, typeInfo.enumValue);\n return into;\n }\n else if (kind === 'NamedType' &&\n typeInfo.type &&\n typeInfo.type.description) {\n var into = document.createElement('div');\n renderType(into, typeInfo, options, typeInfo.type);\n renderDescription(into, options, typeInfo.type);\n return into;\n }\n});\nfunction renderField(into, typeInfo, options) {\n renderQualifiedField(into, typeInfo, options);\n renderTypeAnnotation(into, typeInfo, options, typeInfo.type);\n}\nfunction renderQualifiedField(into, typeInfo, options) {\n var _a;\n var fieldName = ((_a = typeInfo.fieldDef) === null || _a === void 0 ? void 0 : _a.name) || '';\n if (fieldName.slice(0, 2) !== '__') {\n renderType(into, typeInfo, options, typeInfo.parentType);\n text(into, '.');\n }\n text(into, fieldName, 'field-name', options, SchemaReference_1.getFieldReference(typeInfo));\n}\nfunction renderDirective(into, typeInfo, options) {\n var _a;\n var name = '@' + (((_a = typeInfo.directiveDef) === null || _a === void 0 ? void 0 : _a.name) || '');\n text(into, name, 'directive-name', options, SchemaReference_1.getDirectiveReference(typeInfo));\n}\nfunction renderArg(into, typeInfo, options) {\n var _a;\n if (typeInfo.directiveDef) {\n renderDirective(into, typeInfo, options);\n }\n else if (typeInfo.fieldDef) {\n renderQualifiedField(into, typeInfo, options);\n }\n var name = ((_a = typeInfo.argDef) === null || _a === void 0 ? void 0 : _a.name) || '';\n text(into, '(');\n text(into, name, 'arg-name', options, SchemaReference_1.getArgumentReference(typeInfo));\n renderTypeAnnotation(into, typeInfo, options, typeInfo.inputType);\n text(into, ')');\n}\nfunction renderTypeAnnotation(into, typeInfo, options, t) {\n text(into, ': ');\n renderType(into, typeInfo, options, t);\n}\nfunction renderEnumValue(into, typeInfo, options) {\n var _a;\n var name = ((_a = typeInfo.enumValue) === null || _a === void 0 ? void 0 : _a.name) || '';\n renderType(into, typeInfo, options, typeInfo.inputType);\n text(into, '.');\n text(into, name, 'enum-value', options, SchemaReference_1.getEnumValueReference(typeInfo));\n}\nfunction renderType(into, typeInfo, options, t) {\n if (t instanceof graphql_1.GraphQLNonNull) {\n renderType(into, typeInfo, options, t.ofType);\n text(into, '!');\n }\n else if (t instanceof graphql_1.GraphQLList) {\n text(into, '[');\n renderType(into, typeInfo, options, t.ofType);\n text(into, ']');\n }\n else {\n text(into, (t === null || t === void 0 ? void 0 : t.name) || '', 'type-name', options, SchemaReference_1.getTypeReference(typeInfo, t));\n }\n}\nfunction renderDescription(into, options, def) {\n var description = def.description;\n if (description) {\n var descriptionDiv = document.createElement('div');\n descriptionDiv.className = 'info-description';\n if (options.renderDescription) {\n descriptionDiv.innerHTML = options.renderDescription(description);\n }\n else {\n descriptionDiv.appendChild(document.createTextNode(description));\n }\n into.appendChild(descriptionDiv);\n }\n renderDeprecation(into, options, def);\n}\nfunction renderDeprecation(into, options, def) {\n var reason = def.deprecationReason;\n if (reason) {\n var deprecationDiv = document.createElement('div');\n deprecationDiv.className = 'info-deprecation';\n if (options.renderDescription) {\n deprecationDiv.innerHTML = options.renderDescription(reason);\n }\n else {\n deprecationDiv.appendChild(document.createTextNode(reason));\n }\n var label = document.createElement('span');\n label.className = 'info-deprecation-label';\n label.appendChild(document.createTextNode('Deprecated: '));\n deprecationDiv.insertBefore(label, deprecationDiv.firstChild);\n into.appendChild(deprecationDiv);\n }\n}\nfunction text(into, content, className, options, ref) {\n if (className === void 0) { className = ''; }\n if (options === void 0) { options = { onClick: null }; }\n if (ref === void 0) { ref = null; }\n if (className) {\n var onClick_1 = options.onClick;\n var node = void 0;\n if (onClick_1) {\n node = document.createElement('a');\n node.href = 'javascript:void 0';\n node.addEventListener('click', function (e) {\n onClick_1(ref, e);\n });\n }\n else {\n node = document.createElement('span');\n }\n node.className = className;\n node.appendChild(document.createTextNode(content));\n into.appendChild(node);\n }\n else {\n into.appendChild(document.createTextNode(content));\n }\n}\n//# sourceMappingURL=info.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar graphql_language_service_1 = require(\"graphql-language-service\");\nvar mode_indent_1 = __importDefault(require(\"./mode-indent\"));\nvar graphqlModeFactory = function (config) {\n var parser = graphql_language_service_1.onlineParser({\n eatWhitespace: function (stream) { return stream.eatWhile(graphql_language_service_1.isIgnored); },\n lexRules: graphql_language_service_1.LexRules,\n parseRules: graphql_language_service_1.ParseRules,\n editorConfig: { tabSize: config.tabSize },\n });\n return {\n config: config,\n startState: parser.startState,\n token: parser.token,\n indent: mode_indent_1.default,\n electricInput: /^\\s*[})\\]]/,\n fold: 'brace',\n lineComment: '#',\n closeBrackets: {\n pairs: '()[]{}\"\"',\n explode: '()[]{}',\n },\n };\n};\nexports.default = graphqlModeFactory;\n//# sourceMappingURL=mode-factory.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction indent(state, textAfter) {\n var _a, _b;\n var levels = state.levels;\n var level = !levels || levels.length === 0\n ? state.indentLevel\n : levels[levels.length - 1] -\n (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0);\n return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0);\n}\nexports.default = indent;\n//# sourceMappingURL=mode-indent.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\ncodemirror_1.default.defineOption('jump', false, function (cm, options, old) {\n if (old && old !== codemirror_1.default.Init) {\n var oldOnMouseOver = cm.state.jump.onMouseOver;\n codemirror_1.default.off(cm.getWrapperElement(), 'mouseover', oldOnMouseOver);\n var oldOnMouseOut = cm.state.jump.onMouseOut;\n codemirror_1.default.off(cm.getWrapperElement(), 'mouseout', oldOnMouseOut);\n codemirror_1.default.off(document, 'keydown', cm.state.jump.onKeyDown);\n delete cm.state.jump;\n }\n if (options) {\n var state = (cm.state.jump = {\n options: options,\n onMouseOver: onMouseOver.bind(null, cm),\n onMouseOut: onMouseOut.bind(null, cm),\n onKeyDown: onKeyDown.bind(null, cm),\n });\n codemirror_1.default.on(cm.getWrapperElement(), 'mouseover', state.onMouseOver);\n codemirror_1.default.on(cm.getWrapperElement(), 'mouseout', state.onMouseOut);\n codemirror_1.default.on(document, 'keydown', state.onKeyDown);\n }\n});\nfunction onMouseOver(cm, event) {\n var target = event.target || event.srcElement;\n if (!(target instanceof HTMLElement)) {\n return;\n }\n if ((target === null || target === void 0 ? void 0 : target.nodeName) !== 'SPAN') {\n return;\n }\n var box = target.getBoundingClientRect();\n var cursor = {\n left: (box.left + box.right) / 2,\n top: (box.top + box.bottom) / 2,\n };\n cm.state.jump.cursor = cursor;\n if (cm.state.jump.isHoldingModifier) {\n enableJumpMode(cm);\n }\n}\nfunction onMouseOut(cm) {\n if (!cm.state.jump.isHoldingModifier && cm.state.jump.cursor) {\n cm.state.jump.cursor = null;\n return;\n }\n if (cm.state.jump.isHoldingModifier && cm.state.jump.marker) {\n disableJumpMode(cm);\n }\n}\nfunction onKeyDown(cm, event) {\n if (cm.state.jump.isHoldingModifier || !isJumpModifier(event.key)) {\n return;\n }\n cm.state.jump.isHoldingModifier = true;\n if (cm.state.jump.cursor) {\n enableJumpMode(cm);\n }\n var onKeyUp = function (upEvent) {\n if (upEvent.code !== event.code) {\n return;\n }\n cm.state.jump.isHoldingModifier = false;\n if (cm.state.jump.marker) {\n disableJumpMode(cm);\n }\n codemirror_1.default.off(document, 'keyup', onKeyUp);\n codemirror_1.default.off(document, 'click', onClick);\n cm.off('mousedown', onMouseDown);\n };\n var onClick = function (clickEvent) {\n var destination = cm.state.jump.destination;\n if (destination) {\n cm.state.jump.options.onClick(destination, clickEvent);\n }\n };\n var onMouseDown = function (_, downEvent) {\n if (cm.state.jump.destination) {\n downEvent.codemirrorIgnore = true;\n }\n };\n codemirror_1.default.on(document, 'keyup', onKeyUp);\n codemirror_1.default.on(document, 'click', onClick);\n cm.on('mousedown', onMouseDown);\n}\nvar isMac = typeof navigator !== 'undefined' &&\n navigator &&\n navigator.appVersion.indexOf('Mac') !== -1;\nfunction isJumpModifier(key) {\n return key === (isMac ? 'Meta' : 'Control');\n}\nfunction enableJumpMode(cm) {\n if (cm.state.jump.marker) {\n return;\n }\n var cursor = cm.state.jump.cursor;\n var pos = cm.coordsChar(cursor);\n var token = cm.getTokenAt(pos, true);\n var options = cm.state.jump.options;\n var getDestination = options.getDestination || cm.getHelper(pos, 'jump');\n if (getDestination) {\n var destination = getDestination(token, options, cm);\n if (destination) {\n var marker = cm.markText({ line: pos.line, ch: token.start }, { line: pos.line, ch: token.end }, { className: 'CodeMirror-jump-token' });\n cm.state.jump.marker = marker;\n cm.state.jump.destination = destination;\n }\n }\n}\nfunction disableJumpMode(cm) {\n var marker = cm.state.jump.marker;\n cm.state.jump.marker = null;\n cm.state.jump.destination = null;\n marker.clear();\n}\n//# sourceMappingURL=jump-addon.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar graphql_language_service_1 = require(\"graphql-language-service\");\nvar SEVERITY = ['error', 'warning', 'information', 'hint'];\nvar TYPE = {\n 'GraphQL: Validation': 'validation',\n 'GraphQL: Deprecation': 'deprecation',\n 'GraphQL: Syntax': 'syntax',\n};\ncodemirror_1.default.registerHelper('lint', 'graphql', function (text, options) {\n var schema = options.schema;\n var rawResults = graphql_language_service_1.getDiagnostics(text, schema, options.validationRules, undefined, options.externalFragments);\n var results = rawResults.map(function (error) { return ({\n message: error.message,\n severity: error.severity ? SEVERITY[error.severity - 1] : SEVERITY[0],\n type: error.source ? TYPE[error.source] : undefined,\n from: codemirror_1.default.Pos(error.range.start.line, error.range.start.character),\n to: codemirror_1.default.Pos(error.range.end.line, error.range.end.character),\n }); });\n return results;\n});\n//# sourceMappingURL=lint.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getTypeReference = exports.getEnumValueReference = exports.getArgumentReference = exports.getDirectiveReference = exports.getFieldReference = void 0;\nvar graphql_1 = require(\"graphql\");\nfunction getFieldReference(typeInfo) {\n return {\n kind: 'Field',\n schema: typeInfo.schema,\n field: typeInfo.fieldDef,\n type: isMetaField(typeInfo.fieldDef) ? null : typeInfo.parentType,\n };\n}\nexports.getFieldReference = getFieldReference;\nfunction getDirectiveReference(typeInfo) {\n return {\n kind: 'Directive',\n schema: typeInfo.schema,\n directive: typeInfo.directiveDef,\n };\n}\nexports.getDirectiveReference = getDirectiveReference;\nfunction getArgumentReference(typeInfo) {\n return typeInfo.directiveDef\n ? {\n kind: 'Argument',\n schema: typeInfo.schema,\n argument: typeInfo.argDef,\n directive: typeInfo.directiveDef,\n }\n : {\n kind: 'Argument',\n schema: typeInfo.schema,\n argument: typeInfo.argDef,\n field: typeInfo.fieldDef,\n type: isMetaField(typeInfo.fieldDef) ? null : typeInfo.parentType,\n };\n}\nexports.getArgumentReference = getArgumentReference;\nfunction getEnumValueReference(typeInfo) {\n return {\n kind: 'EnumValue',\n value: typeInfo.enumValue || undefined,\n type: typeInfo.inputType\n ? graphql_1.getNamedType(typeInfo.inputType)\n : undefined,\n };\n}\nexports.getEnumValueReference = getEnumValueReference;\nfunction getTypeReference(typeInfo, type) {\n return {\n kind: 'Type',\n schema: typeInfo.schema,\n type: type || typeInfo.type,\n };\n}\nexports.getTypeReference = getTypeReference;\nfunction isMetaField(fieldDef) {\n return fieldDef.name.slice(0, 2) === '__';\n}\n//# sourceMappingURL=SchemaReference.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar graphql_language_service_1 = require(\"graphql-language-service\");\ncodemirror_1.default.defineMode('graphql-variables', function (config) {\n var parser = graphql_language_service_1.onlineParser({\n eatWhitespace: function (stream) { return stream.eatSpace(); },\n lexRules: LexRules,\n parseRules: ParseRules,\n editorConfig: { tabSize: config.tabSize },\n });\n return {\n config: config,\n startState: parser.startState,\n token: parser.token,\n indent: indent,\n electricInput: /^\\s*[}\\]]/,\n fold: 'brace',\n closeBrackets: {\n pairs: '[]{}\"\"',\n explode: '[]{}',\n },\n };\n});\nfunction indent(state, textAfter) {\n var _a, _b;\n var levels = state.levels;\n var level = !levels || levels.length === 0\n ? state.indentLevel\n : levels[levels.length - 1] -\n (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0);\n return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0);\n}\nvar LexRules = {\n Punctuation: /^\\[|]|\\{|\\}|:|,/,\n Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,\n String: /^\"(?:[^\"\\\\]|\\\\(?:\"|\\/|\\\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*\"?/,\n Keyword: /^true|false|null/,\n};\nvar ParseRules = {\n Document: [graphql_language_service_1.p('{'), graphql_language_service_1.list('Variable', graphql_language_service_1.opt(graphql_language_service_1.p(','))), graphql_language_service_1.p('}')],\n Variable: [namedKey('variable'), graphql_language_service_1.p(':'), 'Value'],\n Value: function (token) {\n switch (token.kind) {\n case 'Number':\n return 'NumberValue';\n case 'String':\n return 'StringValue';\n case 'Punctuation':\n switch (token.value) {\n case '[':\n return 'ListValue';\n case '{':\n return 'ObjectValue';\n }\n return null;\n case 'Keyword':\n switch (token.value) {\n case 'true':\n case 'false':\n return 'BooleanValue';\n case 'null':\n return 'NullValue';\n }\n return null;\n }\n },\n NumberValue: [graphql_language_service_1.t('Number', 'number')],\n StringValue: [graphql_language_service_1.t('String', 'string')],\n BooleanValue: [graphql_language_service_1.t('Keyword', 'builtin')],\n NullValue: [graphql_language_service_1.t('Keyword', 'keyword')],\n ListValue: [graphql_language_service_1.p('['), graphql_language_service_1.list('Value', graphql_language_service_1.opt(graphql_language_service_1.p(','))), graphql_language_service_1.p(']')],\n ObjectValue: [graphql_language_service_1.p('{'), graphql_language_service_1.list('ObjectField', graphql_language_service_1.opt(graphql_language_service_1.p(','))), graphql_language_service_1.p('}')],\n ObjectField: [namedKey('attribute'), graphql_language_service_1.p(':'), 'Value'],\n};\nfunction namedKey(style) {\n return {\n style: style,\n match: function (token) { return token.kind === 'String'; },\n update: function (state, token) {\n state.name = token.value.slice(1, -1);\n },\n };\n}\n//# sourceMappingURL=mode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction jsonParse(str) {\n string = str;\n strLen = str.length;\n start = end = lastEnd = -1;\n ch();\n lex();\n var ast = parseObj();\n expect('EOF');\n return ast;\n}\nexports.default = jsonParse;\nvar string;\nvar strLen;\nvar start;\nvar end;\nvar lastEnd;\nvar code;\nvar kind;\nfunction parseObj() {\n var nodeStart = start;\n var members = [];\n expect('{');\n if (!skip('}')) {\n do {\n members.push(parseMember());\n } while (skip(','));\n expect('}');\n }\n return {\n kind: 'Object',\n start: nodeStart,\n end: lastEnd,\n members: members,\n };\n}\nfunction parseMember() {\n var nodeStart = start;\n var key = kind === 'String' ? curToken() : null;\n expect('String');\n expect(':');\n var value = parseVal();\n return {\n kind: 'Member',\n start: nodeStart,\n end: lastEnd,\n key: key,\n value: value,\n };\n}\nfunction parseArr() {\n var nodeStart = start;\n var values = [];\n expect('[');\n if (!skip(']')) {\n do {\n values.push(parseVal());\n } while (skip(','));\n expect(']');\n }\n return {\n kind: 'Array',\n start: nodeStart,\n end: lastEnd,\n values: values,\n };\n}\nfunction parseVal() {\n switch (kind) {\n case '[':\n return parseArr();\n case '{':\n return parseObj();\n case 'String':\n case 'Number':\n case 'Boolean':\n case 'Null':\n var token = curToken();\n lex();\n return token;\n }\n expect('Value');\n}\nfunction curToken() {\n return { kind: kind, start: start, end: end, value: JSON.parse(string.slice(start, end)) };\n}\nfunction expect(str) {\n if (kind === str) {\n lex();\n return;\n }\n var found;\n if (kind === 'EOF') {\n found = '[end of file]';\n }\n else if (end - start > 1) {\n found = '`' + string.slice(start, end) + '`';\n }\n else {\n var match = string.slice(start).match(/^.+?\\b/);\n found = '`' + (match ? match[0] : string[start]) + '`';\n }\n throw syntaxError(\"Expected \" + str + \" but found \" + found + \".\");\n}\nfunction syntaxError(message) {\n return { message: message, start: start, end: end };\n}\nfunction skip(k) {\n if (kind === k) {\n lex();\n return true;\n }\n}\nfunction ch() {\n if (end < strLen) {\n end++;\n code = end === strLen ? 0 : string.charCodeAt(end);\n }\n return code;\n}\nfunction lex() {\n lastEnd = end;\n while (code === 9 || code === 10 || code === 13 || code === 32) {\n ch();\n }\n if (code === 0) {\n kind = 'EOF';\n return;\n }\n start = end;\n switch (code) {\n case 34:\n kind = 'String';\n return readString();\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n kind = 'Number';\n return readNumber();\n case 102:\n if (string.slice(start, start + 5) !== 'false') {\n break;\n }\n end += 4;\n ch();\n kind = 'Boolean';\n return;\n case 110:\n if (string.slice(start, start + 4) !== 'null') {\n break;\n }\n end += 3;\n ch();\n kind = 'Null';\n return;\n case 116:\n if (string.slice(start, start + 4) !== 'true') {\n break;\n }\n end += 3;\n ch();\n kind = 'Boolean';\n return;\n }\n kind = string[start];\n ch();\n}\nfunction readString() {\n ch();\n while (code !== 34 && code > 31) {\n if (code === 92) {\n code = ch();\n switch (code) {\n case 34:\n case 47:\n case 92:\n case 98:\n case 102:\n case 110:\n case 114:\n case 116:\n ch();\n break;\n case 117:\n ch();\n readHex();\n readHex();\n readHex();\n readHex();\n break;\n default:\n throw syntaxError('Bad character escape sequence.');\n }\n }\n else if (end === strLen) {\n throw syntaxError('Unterminated string.');\n }\n else {\n ch();\n }\n }\n if (code === 34) {\n ch();\n return;\n }\n throw syntaxError('Unterminated string.');\n}\nfunction readHex() {\n if ((code >= 48 && code <= 57) ||\n (code >= 65 && code <= 70) ||\n (code >= 97 && code <= 102)) {\n return ch();\n }\n throw syntaxError('Expected hexadecimal digit.');\n}\nfunction readNumber() {\n if (code === 45) {\n ch();\n }\n if (code === 48) {\n ch();\n }\n else {\n readDigits();\n }\n if (code === 46) {\n ch();\n readDigits();\n }\n if (code === 69 || code === 101) {\n code = ch();\n if (code === 43 || code === 45) {\n ch();\n }\n readDigits();\n }\n}\nfunction readDigits() {\n if (code < 48 || code > 57) {\n throw syntaxError('Expected decimal digit.');\n }\n do {\n ch();\n } while (code >= 48 && code <= 57);\n}\n//# sourceMappingURL=jsonParse.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar graphql_language_service_1 = require(\"graphql-language-service\");\ncodemirror_1.default.defineMode('graphql-results', function (config) {\n var parser = graphql_language_service_1.onlineParser({\n eatWhitespace: function (stream) { return stream.eatSpace(); },\n lexRules: LexRules,\n parseRules: ParseRules,\n editorConfig: { tabSize: config.tabSize },\n });\n return {\n config: config,\n startState: parser.startState,\n token: parser.token,\n indent: indent,\n electricInput: /^\\s*[}\\]]/,\n fold: 'brace',\n closeBrackets: {\n pairs: '[]{}\"\"',\n explode: '[]{}',\n },\n };\n});\nfunction indent(state, textAfter) {\n var _a, _b;\n var levels = state.levels;\n var level = !levels || levels.length === 0\n ? state.indentLevel\n : levels[levels.length - 1] -\n (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0);\n return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0);\n}\nvar LexRules = {\n Punctuation: /^\\[|]|\\{|\\}|:|,/,\n Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,\n String: /^\"(?:[^\"\\\\]|\\\\(?:\"|\\/|\\\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*\"?/,\n Keyword: /^true|false|null/,\n};\nvar ParseRules = {\n Document: [graphql_language_service_1.p('{'), graphql_language_service_1.list('Entry', graphql_language_service_1.p(',')), graphql_language_service_1.p('}')],\n Entry: [graphql_language_service_1.t('String', 'def'), graphql_language_service_1.p(':'), 'Value'],\n Value: function (token) {\n switch (token.kind) {\n case 'Number':\n return 'NumberValue';\n case 'String':\n return 'StringValue';\n case 'Punctuation':\n switch (token.value) {\n case '[':\n return 'ListValue';\n case '{':\n return 'ObjectValue';\n }\n return null;\n case 'Keyword':\n switch (token.value) {\n case 'true':\n case 'false':\n return 'BooleanValue';\n case 'null':\n return 'NullValue';\n }\n return null;\n }\n },\n NumberValue: [graphql_language_service_1.t('Number', 'number')],\n StringValue: [graphql_language_service_1.t('String', 'string')],\n BooleanValue: [graphql_language_service_1.t('Keyword', 'builtin')],\n NullValue: [graphql_language_service_1.t('Keyword', 'keyword')],\n ListValue: [graphql_language_service_1.p('['), graphql_language_service_1.list('Value', graphql_language_service_1.p(',')), graphql_language_service_1.p(']')],\n ObjectValue: [graphql_language_service_1.p('{'), graphql_language_service_1.list('ObjectField', graphql_language_service_1.p(',')), graphql_language_service_1.p('}')],\n ObjectField: [graphql_language_service_1.t('String', 'property'), graphql_language_service_1.p(':'), 'Value'],\n};\n//# sourceMappingURL=mode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction hintList(cursor, token, list) {\n var hints = filterAndSortList(list, normalizeText(token.string));\n if (!hints) {\n return;\n }\n var tokenStart = token.type !== null && /\"|\\w/.test(token.string[0])\n ? token.start\n : token.end;\n return {\n list: hints,\n from: { line: cursor.line, ch: tokenStart },\n to: { line: cursor.line, ch: token.end },\n };\n}\nexports.default = hintList;\nfunction filterAndSortList(list, text) {\n if (!text) {\n return filterNonEmpty(list, function (entry) { return !entry.isDeprecated; });\n }\n var byProximity = list.map(function (entry) { return ({\n proximity: getProximity(normalizeText(entry.text), text),\n entry: entry,\n }); });\n var conciseMatches = filterNonEmpty(filterNonEmpty(byProximity, function (pair) { return pair.proximity <= 2; }), function (pair) { return !pair.entry.isDeprecated; });\n var sortedMatches = conciseMatches.sort(function (a, b) {\n return (a.entry.isDeprecated ? 1 : 0) - (b.entry.isDeprecated ? 1 : 0) ||\n a.proximity - b.proximity ||\n a.entry.text.length - b.entry.text.length;\n });\n return sortedMatches.map(function (pair) { return pair.entry; });\n}\nfunction filterNonEmpty(array, predicate) {\n var filtered = array.filter(predicate);\n return filtered.length === 0 ? array : filtered;\n}\nfunction normalizeText(text) {\n return text.toLowerCase().replace(/\\W/g, '');\n}\nfunction getProximity(suggestion, text) {\n var proximity = lexicalDistance(text, suggestion);\n if (suggestion.length > text.length) {\n proximity -= suggestion.length - text.length - 1;\n proximity += suggestion.indexOf(text) === 0 ? 0 : 0.5;\n }\n return proximity;\n}\nfunction lexicalDistance(a, b) {\n var i;\n var j;\n var d = [];\n var aLength = a.length;\n var bLength = b.length;\n for (i = 0; i <= aLength; i++) {\n d[i] = [i];\n }\n for (j = 1; j <= bLength; j++) {\n d[0][j] = j;\n }\n for (i = 1; i <= aLength; i++) {\n for (j = 1; j <= bLength; j++) {\n var cost = a[i - 1] === b[j - 1] ? 0 : 1;\n d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost);\n }\n }\n }\n return d[aLength][bLength];\n}\n//# sourceMappingURL=hintList.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\ncodemirror_1.default.defineOption('info', false, function (cm, options, old) {\n if (old && old !== codemirror_1.default.Init) {\n var oldOnMouseOver = cm.state.info.onMouseOver;\n codemirror_1.default.off(cm.getWrapperElement(), 'mouseover', oldOnMouseOver);\n clearTimeout(cm.state.info.hoverTimeout);\n delete cm.state.info;\n }\n if (options) {\n var state = (cm.state.info = createState(options));\n state.onMouseOver = onMouseOver.bind(null, cm);\n codemirror_1.default.on(cm.getWrapperElement(), 'mouseover', state.onMouseOver);\n }\n});\nfunction createState(options) {\n return {\n options: options instanceof Function\n ? { render: options }\n : options === true\n ? {}\n : options,\n };\n}\nfunction getHoverTime(cm) {\n var options = cm.state.info.options;\n return (options && options.hoverTime) || 500;\n}\nfunction onMouseOver(cm, e) {\n var state = cm.state.info;\n var target = e.target || e.srcElement;\n if (!(target instanceof HTMLElement)) {\n return;\n }\n if (target.nodeName !== 'SPAN' || state.hoverTimeout !== undefined) {\n return;\n }\n var box = target.getBoundingClientRect();\n var onMouseMove = function () {\n clearTimeout(state.hoverTimeout);\n state.hoverTimeout = setTimeout(onHover, hoverTime);\n };\n var onMouseOut = function () {\n codemirror_1.default.off(document, 'mousemove', onMouseMove);\n codemirror_1.default.off(cm.getWrapperElement(), 'mouseout', onMouseOut);\n clearTimeout(state.hoverTimeout);\n state.hoverTimeout = undefined;\n };\n var onHover = function () {\n codemirror_1.default.off(document, 'mousemove', onMouseMove);\n codemirror_1.default.off(cm.getWrapperElement(), 'mouseout', onMouseOut);\n state.hoverTimeout = undefined;\n onMouseHover(cm, box);\n };\n var hoverTime = getHoverTime(cm);\n state.hoverTimeout = setTimeout(onHover, hoverTime);\n codemirror_1.default.on(document, 'mousemove', onMouseMove);\n codemirror_1.default.on(cm.getWrapperElement(), 'mouseout', onMouseOut);\n}\nfunction onMouseHover(cm, box) {\n var pos = cm.coordsChar({\n left: (box.left + box.right) / 2,\n top: (box.top + box.bottom) / 2,\n });\n var state = cm.state.info;\n var options = state.options;\n var render = options.render || cm.getHelper(pos, 'info');\n if (render) {\n var token = cm.getTokenAt(pos, true);\n if (token) {\n var info = render(token, options, cm, pos);\n if (info) {\n showPopup(cm, box, info);\n }\n }\n }\n}\nfunction showPopup(cm, box, info) {\n var popup = document.createElement('div');\n popup.className = 'CodeMirror-info';\n popup.appendChild(info);\n document.body.appendChild(popup);\n var popupBox = popup.getBoundingClientRect();\n var popupStyle = window.getComputedStyle(popup);\n var popupWidth = popupBox.right -\n popupBox.left +\n parseFloat(popupStyle.marginLeft) +\n parseFloat(popupStyle.marginRight);\n var popupHeight = popupBox.bottom -\n popupBox.top +\n parseFloat(popupStyle.marginTop) +\n parseFloat(popupStyle.marginBottom);\n var topPos = box.bottom;\n if (popupHeight > window.innerHeight - box.bottom - 15 &&\n box.top > window.innerHeight - box.bottom) {\n topPos = box.top - popupHeight;\n }\n if (topPos < 0) {\n topPos = box.bottom;\n }\n var leftPos = Math.max(0, window.innerWidth - popupWidth - 15);\n if (leftPos > box.left) {\n leftPos = box.left;\n }\n popup.style.opacity = '1';\n popup.style.top = topPos + 'px';\n popup.style.left = leftPos + 'px';\n var popupTimeout;\n var onMouseOverPopup = function () {\n clearTimeout(popupTimeout);\n };\n var onMouseOut = function () {\n clearTimeout(popupTimeout);\n popupTimeout = setTimeout(hidePopup, 200);\n };\n var hidePopup = function () {\n codemirror_1.default.off(popup, 'mouseover', onMouseOverPopup);\n codemirror_1.default.off(popup, 'mouseout', onMouseOut);\n codemirror_1.default.off(cm.getWrapperElement(), 'mouseout', onMouseOut);\n if (popup.style.opacity) {\n popup.style.opacity = '0';\n setTimeout(function () {\n if (popup.parentNode) {\n popup.parentNode.removeChild(popup);\n }\n }, 600);\n }\n else if (popup.parentNode) {\n popup.parentNode.removeChild(popup);\n }\n };\n codemirror_1.default.on(popup, 'mouseover', onMouseOverPopup);\n codemirror_1.default.on(popup, 'mouseout', onMouseOut);\n codemirror_1.default.on(cm.getWrapperElement(), 'mouseout', onMouseOut);\n}\n//# sourceMappingURL=info-addon.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar getTypeInfo_1 = __importDefault(require(\"./utils/getTypeInfo\"));\nvar SchemaReference_1 = require(\"./utils/SchemaReference\");\nrequire(\"./utils/jump-addon\");\ncodemirror_1.default.registerHelper('jump', 'graphql', function (token, options) {\n if (!options.schema || !options.onClick || !token.state) {\n return;\n }\n var state = token.state;\n var kind = state.kind;\n var step = state.step;\n var typeInfo = getTypeInfo_1.default(options.schema, state);\n if ((kind === 'Field' && step === 0 && typeInfo.fieldDef) ||\n (kind === 'AliasedField' && step === 2 && typeInfo.fieldDef)) {\n return SchemaReference_1.getFieldReference(typeInfo);\n }\n else if (kind === 'Directive' && step === 1 && typeInfo.directiveDef) {\n return SchemaReference_1.getDirectiveReference(typeInfo);\n }\n else if (kind === 'Argument' && step === 0 && typeInfo.argDef) {\n return SchemaReference_1.getArgumentReference(typeInfo);\n }\n else if (kind === 'EnumValue' && typeInfo.enumValue) {\n return SchemaReference_1.getEnumValueReference(typeInfo);\n }\n else if (kind === 'NamedType' && typeInfo.type) {\n return SchemaReference_1.getTypeReference(typeInfo);\n }\n});\n//# sourceMappingURL=jump.js.map","\"use strict\";\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar codemirror_1 = __importDefault(require(\"codemirror\"));\nvar graphql_1 = require(\"graphql\");\nvar jsonParse_1 = __importDefault(require(\"../utils/jsonParse\"));\ncodemirror_1.default.registerHelper('lint', 'graphql-variables', function (text, options, editor) {\n if (!text) {\n return [];\n }\n var ast;\n try {\n ast = jsonParse_1.default(text);\n }\n catch (syntaxError) {\n if (syntaxError.stack) {\n throw syntaxError;\n }\n return [lintError(editor, syntaxError, syntaxError.message)];\n }\n var variableToType = options.variableToType;\n if (!variableToType) {\n return [];\n }\n return validateVariables(editor, variableToType, ast);\n});\nfunction validateVariables(editor, variableToType, variablesAST) {\n var errors = [];\n variablesAST.members.forEach(function (member) {\n var _a;\n if (member) {\n var variableName = (_a = member.key) === null || _a === void 0 ? void 0 : _a.value;\n var type = variableToType[variableName];\n if (!type) {\n errors.push(lintError(editor, member.key, \"Variable \\\"$\" + variableName + \"\\\" does not appear in any GraphQL query.\"));\n }\n else {\n validateValue(type, member.value).forEach(function (_a) {\n var _b = __read(_a, 2), node = _b[0], message = _b[1];\n errors.push(lintError(editor, node, message));\n });\n }\n }\n });\n return errors;\n}\nfunction validateValue(type, valueAST) {\n if (!type || !valueAST) {\n return [];\n }\n if (type instanceof graphql_1.GraphQLNonNull) {\n if (valueAST.kind === 'Null') {\n return [[valueAST, \"Type \\\"\" + type + \"\\\" is non-nullable and cannot be null.\"]];\n }\n return validateValue(type.ofType, valueAST);\n }\n if (valueAST.kind === 'Null') {\n return [];\n }\n if (type instanceof graphql_1.GraphQLList) {\n var itemType_1 = type.ofType;\n if (valueAST.kind === 'Array') {\n var values = valueAST.values || [];\n return mapCat(values, function (item) { return validateValue(itemType_1, item); });\n }\n return validateValue(itemType_1, valueAST);\n }\n if (type instanceof graphql_1.GraphQLInputObjectType) {\n if (valueAST.kind !== 'Object') {\n return [[valueAST, \"Type \\\"\" + type + \"\\\" must be an Object.\"]];\n }\n var providedFields_1 = Object.create(null);\n var fieldErrors_1 = mapCat(valueAST.members, function (member) {\n var _a;\n var fieldName = (_a = member === null || member === void 0 ? void 0 : member.key) === null || _a === void 0 ? void 0 : _a.value;\n providedFields_1[fieldName] = true;\n var inputField = type.getFields()[fieldName];\n if (!inputField) {\n return [\n [\n member.key,\n \"Type \\\"\" + type + \"\\\" does not have a field \\\"\" + fieldName + \"\\\".\",\n ],\n ];\n }\n var fieldType = inputField ? inputField.type : undefined;\n return validateValue(fieldType, member.value);\n });\n Object.keys(type.getFields()).forEach(function (fieldName) {\n if (!providedFields_1[fieldName]) {\n var fieldType = type.getFields()[fieldName].type;\n if (fieldType instanceof graphql_1.GraphQLNonNull) {\n fieldErrors_1.push([\n valueAST,\n \"Object of type \\\"\" + type + \"\\\" is missing required field \\\"\" + fieldName + \"\\\".\",\n ]);\n }\n }\n });\n return fieldErrors_1;\n }\n if ((type.name === 'Boolean' && valueAST.kind !== 'Boolean') ||\n (type.name === 'String' && valueAST.kind !== 'String') ||\n (type.name === 'ID' &&\n valueAST.kind !== 'Number' &&\n valueAST.kind !== 'String') ||\n (type.name === 'Float' && valueAST.kind !== 'Number') ||\n (type.name === 'Int' &&\n (valueAST.kind !== 'Number' || (valueAST.value | 0) !== valueAST.value))) {\n return [[valueAST, \"Expected value of type \\\"\" + type + \"\\\".\"]];\n }\n if (type instanceof graphql_1.GraphQLEnumType || type instanceof graphql_1.GraphQLScalarType) {\n if ((valueAST.kind !== 'String' &&\n valueAST.kind !== 'Number' &&\n valueAST.kind !== 'Boolean' &&\n valueAST.kind !== 'Null') ||\n isNullish(type.parseValue(valueAST.value))) {\n return [[valueAST, \"Expected value of type \\\"\" + type + \"\\\".\"]];\n }\n }\n return [];\n}\nfunction lintError(editor, node, message) {\n return {\n message: message,\n severity: 'error',\n type: 'validation',\n from: editor.posFromIndex(node.start),\n to: editor.posFromIndex(node.end),\n };\n}\nfunction isNullish(value) {\n return value === null || value === undefined || value !== value;\n}\nfunction mapCat(array, mapper) {\n return Array.prototype.concat.apply([], array.map(mapper));\n}\n//# sourceMappingURL=lint.js.map"],"names":[],"sourceRoot":""}