New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apollo-link-mock-graph

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-mock-graph - npm Package Compare versions

Comparing version

to
2.0.1

2

dist/main.js

@@ -16,2 +16,2 @@ !function(e){var n={};function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(n){return e[n]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=7)}([function(e,n,t){"use strict";function r(e){try{return e()}catch(e){}}t.d(n,"a",(function(){return r}))},function(e,n,t){"use strict";(function(e){var r=t(0);n.a=Object(r.a)((function(){return globalThis}))||Object(r.a)((function(){return window}))||Object(r.a)((function(){return self}))||Object(r.a)((function(){return e}))||Object(r.a)((function(){return r.a.constructor("return this")()}))}).call(this,t(5))},function(e,n,t){"use strict";(function(e,r){function i(e){try{return e()}catch(e){}}t.d(n,"a",(function(){return a}));var o=i((function(){return globalThis}))||i((function(){return window}))||i((function(){return self}))||i((function(){return e}))||i((function(){return i.constructor("return this")()})),u=!1;function a(){u&&(delete o.process,u=!1)}!o||i((function(){return"production"}))||i((function(){return r}))||(Object.defineProperty(o,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),u=!0)}).call(this,t(5),t(6))},,,function(e,n){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n){var t,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var c,s=[],l=!1,f=-1;function p(){l&&c&&(l=!1,c.length?s=c.concat(s):f=-1,s.length&&v())}function v(){if(!l){var e=a(p);l=!0;for(var n=s.length;n;){for(c=s,s=[];++f<n;)c&&c[f].run();f=-1,n=s.length}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(n){try{return r.call(null,e)}catch(n){return r.call(this,e)}}}(e)}}function d(e,n){this.fun=e,this.array=n}function m(){}i.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];s.push(new d(e,n)),1!==s.length||l||a(v)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,n,t){"use strict";t.r(n);

***************************************************************************** */
var r=function(e,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function i(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var o=function(){return(o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)};Object.create;Object.create;var u=Object.setPrototypeOf,a=void 0===u?function(e,n){return e.__proto__=n,e}:u,c=function(e){function n(t){void 0===t&&(t="Invariant Violation");var r=e.call(this,"number"==typeof t?"Invariant Violation: "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return r.framesToPop=1,r.name="Invariant Violation",a(r,n.prototype),r}return i(n,e),n}(Error);function s(e,n){if(!e)throw new c(n)}var l=["debug","log","warn","error","silent"],f=l.indexOf("log");function p(e){return function(){if(l.indexOf(e)>=f){var n=console[e]||console.log;return n.apply(console,arguments)}}}!function(e){e.debug=p("debug"),e.log=p("log"),e.warn=p("warn"),e.error=p("error")}(s||(s={}));var v=t(1),d=t(0),m="__",y=[m,m].join("DEV");var h=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(v.a,y,{value:"production"!==Object(d.a)((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),v.a[y]}}(),b=t(2);function g(e,n){if(!Boolean(e))throw new Error(n)}function E(e){return T(e,[])}function T(e,n){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,n){if(null===e)return"null";if(n.includes(e))return"[Circular]";const t=[...n,e];if(function(e){return"function"==typeof e.toJSON}(e)){const n=e.toJSON();if(n!==e)return"string"==typeof n?n:T(n,t)}else if(Array.isArray(e))return function(e,n){if(0===e.length)return"[]";if(n.length>2)return"[Array]";const t=Math.min(10,e.length),r=e.length-t,i=[];for(let r=0;r<t;++r)i.push(T(e[r],n));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,t);return function(e,n){const t=Object.entries(e);if(0===t.length)return"{}";if(n.length>2)return"["+function(e){const n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===n&&"function"==typeof e.constructor){const n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return n}(e)+"]";return"{ "+t.map(([e,t])=>e+": "+T(t,n)).join(", ")+" }"}(e,t)}(e,n);default:return String(e)}}Symbol.toStringTag;function _(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"==typeof e)return O(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O(e,n)}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function w(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I(e,n,t){return n&&w(e.prototype,n),t&&w(e,t),e}Object(b.a)(),__DEV__?s("boolean"==typeof h,h):s("boolean"==typeof h,36);var N=function(){return"function"==typeof Symbol},D=function(e){return N()&&Boolean(Symbol[e])},S=function(e){return D(e)?Symbol[e]:"@@"+e};N()&&!D("observable")&&(Symbol.observable=Symbol("observable"));var x=S("iterator"),j=S("observable"),k=S("species");function V(e,n){var t=e[n];if(null!=t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}function A(e){var n=e.constructor;return void 0!==n&&null===(n=n[k])&&(n=void 0),void 0!==n?n:$}function F(e){return e instanceof $}function q(e){q.log?q.log(e):setTimeout((function(){throw e}))}function P(e){Promise.resolve().then((function(){try{e()}catch(e){q(e)}}))}function C(e){var n=e._cleanup;if(void 0!==n&&(e._cleanup=void 0,n))try{if("function"==typeof n)n();else{var t=V(n,"unsubscribe");t&&t.call(n)}}catch(e){q(e)}}function L(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function M(e,n,t){e._state="running";var r=e._observer;try{var i=V(r,n);switch(n){case"next":i&&i.call(r,t);break;case"error":if(L(e),!i)throw t;i.call(r,t);break;case"complete":L(e),i&&i.call(r)}}catch(e){q(e)}"closed"===e._state?C(e):"running"===e._state&&(e._state="ready")}function U(e,n,t){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:n,value:t}],void P((function(){return function(e){var n=e._queue;if(n){e._queue=void 0,e._state="ready";for(var t=0;t<n.length&&(M(e,n[t].type,n[t].value),"closed"!==e._state);++t);}}(e)}))):void M(e,n,t);e._queue.push({type:n,value:t})}}var R=function(){function e(e,n){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var t=new B(this);try{this._cleanup=n.call(void 0,t)}catch(e){t.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(L(this),C(this))},I(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),B=function(){function e(e){this._subscription=e}var n=e.prototype;return n.next=function(e){U(this._subscription,"next",e)},n.error=function(e){U(this._subscription,"error",e)},n.complete=function(){U(this._subscription,"complete")},I(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),$=function(){function e(n){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof n)throw new TypeError("Observable initializer must be a function");this._subscriber=n}var n=e.prototype;return n.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new R(e,this._subscriber)},n.forEach=function(e){var n=this;return new Promise((function(t,r){if("function"==typeof e)var i=n.subscribe({next:function(n){try{e(n,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),t()}}))},n.map=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(A(this))((function(t){return n.subscribe({next:function(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error:function(e){t.error(e)},complete:function(){t.complete()}})}))},n.filter=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(A(this))((function(t){return n.subscribe({next:function(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error:function(e){t.error(e)},complete:function(){t.complete()}})}))},n.reduce=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var t=A(this),r=arguments.length>1,i=!1,o=arguments[1],u=o;return new t((function(t){return n.subscribe({next:function(n){var o=!i;if(i=!0,!o||r)try{u=e(u,n)}catch(e){return t.error(e)}else u=n},error:function(e){t.error(e)},complete:function(){if(!i&&!r)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(u),t.complete()}})}))},n.concat=function(){for(var e=this,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];var i=A(this);return new i((function(n){var r,o=0;return function e(u){r=u.subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){o===t.length?(r=void 0,n.complete()):e(i.from(t[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},n.flatMap=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var t=A(this);return new t((function(r){var i=[],o=n.subscribe({next:function(n){if(e)try{n=e(n)}catch(e){return r.error(e)}var o=t.from(n).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),u()}});i.push(o)},error:function(e){r.error(e)},complete:function(){u()}});function u(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},n[j]=function(){return this},e.from=function(n){var t="function"==typeof this?this:e;if(null==n)throw new TypeError(n+" is not an object");var r=V(n,j);if(r){var i=r.call(n);if(Object(i)!==i)throw new TypeError(i+" is not an object");return F(i)&&i.constructor===t?i:new t((function(e){return i.subscribe(e)}))}if(D("iterator")&&(r=V(n,x)))return new t((function(e){P((function(){if(!e.closed){for(var t,i=_(r.call(n));!(t=i()).done;){var o=t.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(n))return new t((function(e){P((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}));throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];var i="function"==typeof this?this:e;return new i((function(e){P((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}))},I(e,null,[{key:k,get:function(){return this}}]),e}();function Y(e){return null!==e&&"object"==typeof e}function G(e,n,t,r){if(function(e){return"IntValue"===e.kind}(t)||function(e){return"FloatValue"===e.kind}(t))e[n.value]=Number(t.value);else if(function(e){return"BooleanValue"===e.kind}(t)||function(e){return"StringValue"===e.kind}(t))e[n.value]=t.value;else if(function(e){return"ObjectValue"===e.kind}(t)){var i={};t.fields.map((function(e){return G(i,e.name,e.value,r)})),e[n.value]=i}else if(function(e){return"Variable"===e.kind}(t)){var o=(r||{})[t.name.value];e[n.value]=o}else if(function(e){return"ListValue"===e.kind}(t))e[n.value]=t.values.map((function(e){var t={};return G(t,n,e,r),t[n.value]}));else if(function(e){return"EnumValue"===e.kind}(t))e[n.value]=t.value;else{if(!function(e){return"NullValue"===e.kind}(t))throw __DEV__?new c('The inline argument "'.concat(n.value,'" of kind "').concat(t.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new c(52);e[n.value]=null}}N()&&Object.defineProperty($,Symbol("extensions"),{value:{symbol:j,hostReportError:q},configurable:!0});var J=["connection","include","skip","client","rest","export"],Q=(Object.assign((function(e,n,t){if(n&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){var r=t.connection.filter?t.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=n[e]})),"".concat(t.connection.key,"(").concat(Q(i),")")}return t.connection.key}var o=e;if(n){var u=Q(n);o+="(".concat(u,")")}return t&&Object.keys(t).forEach((function(e){-1===J.indexOf(e)&&(t[e]&&Object.keys(t[e]).length?o+="@".concat(e,"(").concat(Q(t[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var n=Q;return Q=e,n}}),function(e){return JSON.stringify(e,X)});function X(e,n){return Y(n)&&!Array.isArray(n)&&(n=Object.keys(n).sort().reduce((function(e,t){return e[t]=n[t],e}),{})),n}function z(e){return e.alias?e.alias.value:e.name.value}function W(e){return"Field"===e.kind}function H(e){__DEV__?s(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):s(e&&"Document"===e.kind,44);var n=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new c('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new c(45);return e}));return __DEV__?s(n.length<=1,"Ambiguous GraphQL document: contains ".concat(n.length," operations")):s(n.length<=1,46),e}function K(e,n){return n?n(e):$.of()}function Z(e){return"function"==typeof e?new te(e):e}function ee(e){return e.request.length<=1}var ne=function(e){function n(n,t){var r=e.call(this,n)||this;return r.link=t,r}return i(n,e),n}(Error),te=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return $.of()}))},e.from=function(n){return 0===n.length?e.empty():n.map(Z).reduce((function(e,n){return e.concat(n)}))},e.split=function(n,t,r){var i=Z(t),o=Z(r||new e(K));return ee(i)&&ee(o)?new e((function(e){return n(e)?i.request(e)||$.of():o.request(e)||$.of()})):new e((function(e,t){return n(e)?i.request(e,t)||$.of():o.request(e,t)||$.of()}))},e.execute=function(e,n){return e.request(function(e,n){var t=o({},e);return Object.defineProperty(n,"setContext",{enumerable:!1,value:function(e){t=o(o({},t),"function"==typeof e?e(t):e)}}),Object.defineProperty(n,"getContext",{enumerable:!1,value:function(){return o({},t)}}),n}(n.context,function(e){var n={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return n.operationName||(n.operationName="string"!=typeof n.query?n.query.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null||void 0:""),n}(function(e){for(var n=["query","operationName","variables","extensions","context"],t=0,r=Object.keys(e);t<r.length;t++){var i=r[t];if(n.indexOf(i)<0)throw __DEV__?new c("illegal argument: ".concat(i)):new c(24)}return e}(n))))||$.of()},e.concat=function(n,t){var r=Z(n);if(ee(r))return __DEV__&&s.warn(new ne("You are calling concat on a terminating link, which will have no effect",r)),r;var i=Z(t);return ee(i)?new e((function(e){return r.request(e,(function(e){return i.request(e)||$.of()}))||$.of()})):new e((function(e,n){return r.request(e,(function(e){return i.request(e,n)||$.of()}))||$.of()}))},e.prototype.split=function(n,t,r){return this.concat(e.split(n,t,r||new e(K)))},e.prototype.concat=function(n){return e.concat(this,n)},e.prototype.request=function(e,n){throw __DEV__?new c("request is not implemented"):new c(19)},e.prototype.onError=function(e,n){if(n&&n.error)return n.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}();Symbol.toStringTag;Symbol.toStringTag;const re={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"]},ie=new Set(Object.keys(re));function oe(e){const n=null==e?void 0:e.kind;return"string"==typeof n&&ie.has(n)}let ue,ae;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(ue||(ue={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(ae||(ae={}));const ce=Object.freeze({});function se(e,n,t=re){const r=new Map;for(const e of Object.values(ae))r.set(e,le(n,e));let i=void 0,o=Array.isArray(e),u=[e],a=-1,c=[],s=e,l=void 0,f=void 0;const p=[],v=[];do{a++;const e=a===u.length,h=e&&0!==c.length;if(e){if(l=0===v.length?void 0:p[p.length-1],s=f,f=v.pop(),h)if(o){s=s.slice();let e=0;for(const[n,t]of c){const r=n-e;null===t?(s.splice(r,1),e++):s[r]=t}}else{s=Object.defineProperties({},Object.getOwnPropertyDescriptors(s));for(const[e,n]of c)s[e]=n}a=i.index,u=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(f){if(l=o?a:u[a],s=f[l],null==s)continue;p.push(l)}let b;if(!Array.isArray(s)){var d,m;oe(s)||g(!1,`Invalid AST Node: ${E(s)}.`);const t=e?null===(d=r.get(s.kind))||void 0===d?void 0:d.leave:null===(m=r.get(s.kind))||void 0===m?void 0:m.enter;if(b=null==t?void 0:t.call(n,s,l,f,p,v),b===ce)break;if(!1===b){if(!e){p.pop();continue}}else if(void 0!==b&&(c.push([l,b]),!e)){if(!oe(b)){p.pop();continue}s=b}}var y;if(void 0===b&&h&&c.push([l,s]),e)p.pop();else i={inArray:o,index:a,keys:u,edits:c,prev:i},o=Array.isArray(s),u=o?s:null!==(y=t[s.kind])&&void 0!==y?y:[],a=-1,c=[],f&&v.push(f),f=s}while(void 0!==i);return 0!==c.length?c[c.length-1][1]:e}function le(e,n){const t=e[n];return"object"==typeof t?t:"function"==typeof t?{enter:t,leave:void 0}:{enter:e.enter,leave:e.leave}}function fe(e,n){var t=e.directives;return!t||!t.length||function(e){var n=[];e&&e.length&&e.forEach((function(e){if("skip"===(t=e.name.value)||"include"===t){var t,r=e.arguments,i=e.name.value;__DEV__?s(r&&1===r.length,"Incorrect number of arguments for the @".concat(i," directive.")):s(r&&1===r.length,38);var o=r[0];__DEV__?s(o.name&&"if"===o.name.value,"Invalid argument for the @".concat(i," directive.")):s(o.name&&"if"===o.name.value,39);var u=o.value;__DEV__?s(u&&("Variable"===u.kind||"BooleanValue"===u.kind),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):s(u&&("Variable"===u.kind||"BooleanValue"===u.kind),40),n.push({directive:e,ifArgument:o})}}));return n}(t).every((function(e){var t=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=n&&n[r.value.name.value],__DEV__?s(void 0!==i,"Invalid variable referenced in @".concat(t.name.value," directive.")):s(void 0!==i,37)):i=r.value.value,"skip"===t.name.value?!i:i}))}var pe=e=>{const[n,...t]=e;return n.toString()+t.map(e=>{if("string"==typeof e)return"."+e;if("number"==typeof e)return`[${e.toString()}]`;throw new Error("Invalid path (must be an array of strings and numbers)")}).join("")};function ve(e){return 9===e||32===e}const de=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function me(e){return ye[e.charCodeAt(0)]}const ye=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];const he={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>be(e.definitions,"\n\n")},OperationDefinition:{leave(e){const n=Ee("(",be(e.variableDefinitions,", "),")"),t=be([e.operation,be([e.name,n]),be(e.directives," ")]," ");return("query"===t?"":t+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:n,defaultValue:t,directives:r})=>e+": "+n+Ee(" = ",t)+Ee(" ",be(r," "))},SelectionSet:{leave:({selections:e})=>ge(e)},Field:{leave({alias:e,name:n,arguments:t,directives:r,selectionSet:i}){const o=Ee("",e,": ")+n;let u=o+Ee("(",be(t,", "),")");return u.length>80&&(u=o+Ee("(\n",Te(be(t,"\n")),"\n)")),be([u,be(r," "),i]," ")}},Argument:{leave:({name:e,value:n})=>e+": "+n},FragmentSpread:{leave:({name:e,directives:n})=>"..."+e+Ee(" ",be(n," "))},InlineFragment:{leave:({typeCondition:e,directives:n,selectionSet:t})=>be(["...",Ee("on ",e),be(n," "),t]," ")},FragmentDefinition:{leave:({name:e,typeCondition:n,variableDefinitions:t,directives:r,selectionSet:i})=>`fragment ${e}${Ee("(",be(t,", "),")")} on ${n} ${Ee("",be(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:n})=>n?function(e,n){const t=e.replace(/"""/g,'\\"""'),r=t.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every(e=>0===e.length||ve(e.charCodeAt(0))),u=t.endsWith('\\"""'),a=e.endsWith('"')&&!u,c=e.endsWith("\\"),s=a||c,l=!(null!=n&&n.minimize)&&(!i||e.length>70||s||o||u);let f="";const p=i&&ve(e.charCodeAt(0));return(l&&!p||o)&&(f+="\n"),f+=t,(l||s)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(de,me)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+be(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+be(e,", ")+"}"},ObjectField:{leave:({name:e,value:n})=>e+": "+n},Directive:{leave:({name:e,arguments:n})=>"@"+e+Ee("(",be(n,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:n,operationTypes:t})=>Ee("",e,"\n")+be(["schema",be(n," "),ge(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:n})=>e+": "+n},ScalarTypeDefinition:{leave:({description:e,name:n,directives:t})=>Ee("",e,"\n")+be(["scalar",n,be(t," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>Ee("",e,"\n")+be(["type",n,Ee("implements ",be(t," & ")),be(r," "),ge(i)]," ")},FieldDefinition:{leave:({description:e,name:n,arguments:t,type:r,directives:i})=>Ee("",e,"\n")+n+(_e(t)?Ee("(\n",Te(be(t,"\n")),"\n)"):Ee("(",be(t,", "),")"))+": "+r+Ee(" ",be(i," "))},InputValueDefinition:{leave:({description:e,name:n,type:t,defaultValue:r,directives:i})=>Ee("",e,"\n")+be([n+": "+t,Ee("= ",r),be(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>Ee("",e,"\n")+be(["interface",n,Ee("implements ",be(t," & ")),be(r," "),ge(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:n,directives:t,types:r})=>Ee("",e,"\n")+be(["union",n,be(t," "),Ee("= ",be(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:n,directives:t,values:r})=>Ee("",e,"\n")+be(["enum",n,be(t," "),ge(r)]," ")},EnumValueDefinition:{leave:({description:e,name:n,directives:t})=>Ee("",e,"\n")+be([n,be(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:n,directives:t,fields:r})=>Ee("",e,"\n")+be(["input",n,be(t," "),ge(r)]," ")},DirectiveDefinition:{leave:({description:e,name:n,arguments:t,repeatable:r,locations:i})=>Ee("",e,"\n")+"directive @"+n+(_e(t)?Ee("(\n",Te(be(t,"\n")),"\n)"):Ee("(",be(t,", "),")"))+(r?" repeatable":"")+" on "+be(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:n})=>be(["extend schema",be(e," "),ge(n)]," ")},ScalarTypeExtension:{leave:({name:e,directives:n})=>be(["extend scalar",e,be(n," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>be(["extend type",e,Ee("implements ",be(n," & ")),be(t," "),ge(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>be(["extend interface",e,Ee("implements ",be(n," & ")),be(t," "),ge(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:n,types:t})=>be(["extend union",e,be(n," "),Ee("= ",be(t," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:n,values:t})=>be(["extend enum",e,be(n," "),ge(t)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:n,fields:t})=>be(["extend input",e,be(n," "),ge(t)]," ")}};function be(e,n=""){var t;return null!==(t=null==e?void 0:e.filter(e=>e).join(n))&&void 0!==t?t:""}function ge(e){return Ee("{\n",Te(be(e,"\n")),"\n}")}function Ee(e,n,t=""){return null!=n&&""!==n?e+n+t:""}function Te(e){return Ee(" ",e.replace(/\n/g,"\n "))}function _e(e){var n;return null!==(n=null==e?void 0:e.some(e=>e.includes("\n")))&&void 0!==n&&n}var Oe=(e,n)=>{console.error("MockGraphLink: Failed to resolve a query from the mock graph; you may need to update the graph to contain all of the data being queried:\n\n",se(n,he),"\n\nErrors:\n",e)};function we(e,n){null!==n&&"object"==typeof n&&Object.keys(n).forEach(t=>{const r=n[t];Object.prototype.hasOwnProperty.call(e,t)?we(e[t],r):e[t]=r})}var Ie=class extends te{constructor(e,n={}){super();const{onError:t=Oe,possibleTypes:r,timeoutMs:i=100}=n;this.getMockGraph=e,this.onError=t,this.timeoutMs=i,this.lastQueryId=0,this.queriesInFlight=new Map,r&&(this.possibleTypes=r)}request(e,n){const t=e.query.definitions.find(n=>null==e.operationName?null==n.name:n.name.value===e.operationName);let r;if("query"===t.operation){if(r=this.getMockGraph().Query,!r)throw new Error('Query must be mocked to fulfill a "query" operation')}else{if("mutation"!==t.operation)throw new Error(`Can't yet mock operation type "${t.operation}"`);if(r=this.getMockGraph().Mutation,!r)throw new Error('Mutation must be mocked to fulfill a "mutation" operation')}const i=function(e){var n;H(e);for(var t=0,r=e.definitions;t<r.length;t++){var i=r[t];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||n||(n=i)}if(n)return n;throw __DEV__?new c("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new c(51)}(e.query);const o=function(e){void 0===e&&(e=[]);var n={};return e.forEach((function(e){n[e.name.value]=e})),n}(e.query.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))),u=[],a=(n,t,r)=>{const i={};return n.selections.forEach(c=>{if(fe(n,e.variables))if(W(c)){const e=s(c,t,r),n=z(c);void 0!==e&&(void 0===i[n]?i[n]=e:we(i[n],e))}else{let e;if(function(e){return"InlineFragment"===e.kind}(c))e=c;else if(e=o[c.name.value],!e)throw new Error("No fragment named "+c.name.value);const n=()=>{const n=a(e.selectionSet,t,r);we(i,n)};let s;e.typeCondition&&"NamedType"===e.typeCondition.kind&&"Name"===e.typeCondition.name.kind&&(s=e.typeCondition.name.value);const l=t.__typename;l?s===l?n():this.possibleTypes?this.possibleTypes[s]&&-1!==this.possibleTypes[s].indexOf(l)&&n():u.push({type:"unionInterfaceTypes",path:r,fragmentName:e.name&&e.name.value,objectType:l,fragmentType:s}):u.push({type:"noTypename",path:r,fragmentName:e.name.value})}}),i},s=(n,t,r)=>{const i=n.name.value,o=function(e,n){if(e.arguments&&e.arguments.length){var t={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return G(t,r,i,n)})),t}return null}(n,e.variables),c=[...r,o?`${i}(${JSON.stringify(o)})`:i],s=t[i];let f;if(void 0===s)u.push({type:"missing",path:c}),f=null;else if("function"==typeof s){let e,n;try{e=s(o||{})}catch(e){n=e}n?(u.push({type:"resolver",error:n,args:o,path:c}),f=null):void 0===e?(u.push({type:"fnReturnUndefined",args:o,path:c}),f=null):f=e}else o&&Object.keys(o).length&&"function"!=typeof s?(u.push({type:"fnRequired",args:o,path:c}),f=null):f=s;return n.selectionSet?null===f?f:Array.isArray(f)?l(n,f,c):a(n.selectionSet,f,c):f},l=(e,n,t)=>n.map((n,r)=>{if(null===n)return null;const i=[...t,r];return Array.isArray(n)?l(e,n,i):a(e.selectionSet,n,i)}),f=a(i.selectionSet,r,[]),p=u.length?u.map(e=>{let n=e.type;return"missing"===e.type?n="Field is missing from mock graph":"fnReturnUndefined"===e.type?n="Mock resolver returned undefined; did you mean to return null?":"fnRequired"===e.type?n="This field received args and thus must be mocked as a function.":"resolver"===e.type?n="Error from resolver: "+e.error.message:"noTypename"===e.type?n=`Can't resolve fragment ${e.fragmentName} because __typename is missing from the mock graph`:"unionInterfaceTypes"===e.type&&(n=`Can't resolve fragment ${e.fragmentName?e.fragmentName+" ":""}because its type (${e.fragmentType}) might not match the object's type (${e.objectType}). In order to handle union and interface types, you must pass \`possibleTypes\` when creating MockGraphLink. See https://github.com/dallonf/apollo-link-mock-graph/blob/master/README.md for details.`),n=`${pe(e.path)}: ${n}`,{...e,message:n}}):null;u.length&&this.onError(p,e.query),this.lastQueryId+=1;const v=this.lastQueryId,d=new Promise(e=>setTimeout(e,this.timeoutMs)).then(()=>(this.queriesInFlight.delete(v),{data:f,errors:p}));this.queriesInFlight.set(v,d);return new $(e=>{d.then(n=>{e.next(n),e.complete()})})}waitForQueries({waitToSettle:e=!0}={}){const n=[...this.queriesInFlight.values()];return n.length?Promise.all(n).then(()=>{if(e)return new Promise(e=>setTimeout(e)).then(()=>this.waitForQueries())}):Promise.resolve()}};n.default=Ie}]);
var r=function(e,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function i(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var o=function(){return(o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)};Object.create;Object.create;var u=Object.setPrototypeOf,a=void 0===u?function(e,n){return e.__proto__=n,e}:u,c=function(e){function n(t){void 0===t&&(t="Invariant Violation");var r=e.call(this,"number"==typeof t?"Invariant Violation: "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return r.framesToPop=1,r.name="Invariant Violation",a(r,n.prototype),r}return i(n,e),n}(Error);function s(e,n){if(!e)throw new c(n)}var l=["debug","log","warn","error","silent"],f=l.indexOf("log");function p(e){return function(){if(l.indexOf(e)>=f){var n=console[e]||console.log;return n.apply(console,arguments)}}}!function(e){e.debug=p("debug"),e.log=p("log"),e.warn=p("warn"),e.error=p("error")}(s||(s={}));var v=t(1),d=t(0),m="__",y=[m,m].join("DEV");var h=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(v.a,y,{value:"production"!==Object(d.a)((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),v.a[y]}}(),b=t(2);function g(e,n){if(!Boolean(e))throw new Error(n)}function E(e){return T(e,[])}function T(e,n){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,n){if(null===e)return"null";if(n.includes(e))return"[Circular]";const t=[...n,e];if(function(e){return"function"==typeof e.toJSON}(e)){const n=e.toJSON();if(n!==e)return"string"==typeof n?n:T(n,t)}else if(Array.isArray(e))return function(e,n){if(0===e.length)return"[]";if(n.length>2)return"[Array]";const t=Math.min(10,e.length),r=e.length-t,i=[];for(let r=0;r<t;++r)i.push(T(e[r],n));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,t);return function(e,n){const t=Object.entries(e);if(0===t.length)return"{}";if(n.length>2)return"["+function(e){const n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===n&&"function"==typeof e.constructor){const n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return n}(e)+"]";return"{ "+t.map(([e,t])=>e+": "+T(t,n)).join(", ")+" }"}(e,t)}(e,n);default:return String(e)}}Symbol.toStringTag;function _(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"==typeof e)return O(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O(e,n)}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function w(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I(e,n,t){return n&&w(e.prototype,n),t&&w(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Object(b.a)(),__DEV__?s("boolean"==typeof h,h):s("boolean"==typeof h,36);var N=function(){return"function"==typeof Symbol},D=function(e){return N()&&Boolean(Symbol[e])},S=function(e){return D(e)?Symbol[e]:"@@"+e};N()&&!D("observable")&&(Symbol.observable=Symbol("observable"));var j=S("iterator"),x=S("observable"),k=S("species");function V(e,n){var t=e[n];if(null!=t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}function A(e){var n=e.constructor;return void 0!==n&&null===(n=n[k])&&(n=void 0),void 0!==n?n:$}function F(e){return e instanceof $}function q(e){q.log?q.log(e):setTimeout((function(){throw e}))}function P(e){Promise.resolve().then((function(){try{e()}catch(e){q(e)}}))}function C(e){var n=e._cleanup;if(void 0!==n&&(e._cleanup=void 0,n))try{if("function"==typeof n)n();else{var t=V(n,"unsubscribe");t&&t.call(n)}}catch(e){q(e)}}function L(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function M(e,n,t){e._state="running";var r=e._observer;try{var i=V(r,n);switch(n){case"next":i&&i.call(r,t);break;case"error":if(L(e),!i)throw t;i.call(r,t);break;case"complete":L(e),i&&i.call(r)}}catch(e){q(e)}"closed"===e._state?C(e):"running"===e._state&&(e._state="ready")}function U(e,n,t){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:n,value:t}],void P((function(){return function(e){var n=e._queue;if(n){e._queue=void 0,e._state="ready";for(var t=0;t<n.length&&(M(e,n[t].type,n[t].value),"closed"!==e._state);++t);}}(e)}))):void M(e,n,t);e._queue.push({type:n,value:t})}}var R=function(){function e(e,n){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var t=new B(this);try{this._cleanup=n.call(void 0,t)}catch(e){t.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(L(this),C(this))},I(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),B=function(){function e(e){this._subscription=e}var n=e.prototype;return n.next=function(e){U(this._subscription,"next",e)},n.error=function(e){U(this._subscription,"error",e)},n.complete=function(){U(this._subscription,"complete")},I(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),$=function(){function e(n){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof n)throw new TypeError("Observable initializer must be a function");this._subscriber=n}var n=e.prototype;return n.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new R(e,this._subscriber)},n.forEach=function(e){var n=this;return new Promise((function(t,r){if("function"==typeof e)var i=n.subscribe({next:function(n){try{e(n,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),t()}}))},n.map=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(A(this))((function(t){return n.subscribe({next:function(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error:function(e){t.error(e)},complete:function(){t.complete()}})}))},n.filter=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(A(this))((function(t){return n.subscribe({next:function(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error:function(e){t.error(e)},complete:function(){t.complete()}})}))},n.reduce=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var t=A(this),r=arguments.length>1,i=!1,o=arguments[1],u=o;return new t((function(t){return n.subscribe({next:function(n){var o=!i;if(i=!0,!o||r)try{u=e(u,n)}catch(e){return t.error(e)}else u=n},error:function(e){t.error(e)},complete:function(){if(!i&&!r)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(u),t.complete()}})}))},n.concat=function(){for(var e=this,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];var i=A(this);return new i((function(n){var r,o=0;return function e(u){r=u.subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){o===t.length?(r=void 0,n.complete()):e(i.from(t[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},n.flatMap=function(e){var n=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var t=A(this);return new t((function(r){var i=[],o=n.subscribe({next:function(n){if(e)try{n=e(n)}catch(e){return r.error(e)}var o=t.from(n).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),u()}});i.push(o)},error:function(e){r.error(e)},complete:function(){u()}});function u(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},n[x]=function(){return this},e.from=function(n){var t="function"==typeof this?this:e;if(null==n)throw new TypeError(n+" is not an object");var r=V(n,x);if(r){var i=r.call(n);if(Object(i)!==i)throw new TypeError(i+" is not an object");return F(i)&&i.constructor===t?i:new t((function(e){return i.subscribe(e)}))}if(D("iterator")&&(r=V(n,j)))return new t((function(e){P((function(){if(!e.closed){for(var t,i=_(r.call(n));!(t=i()).done;){var o=t.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(n))return new t((function(e){P((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}));throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];var i="function"==typeof this?this:e;return new i((function(e){P((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}))},I(e,null,[{key:k,get:function(){return this}}]),e}();function Y(e){return null!==e&&"object"==typeof e}function G(e,n,t,r){if(function(e){return"IntValue"===e.kind}(t)||function(e){return"FloatValue"===e.kind}(t))e[n.value]=Number(t.value);else if(function(e){return"BooleanValue"===e.kind}(t)||function(e){return"StringValue"===e.kind}(t))e[n.value]=t.value;else if(function(e){return"ObjectValue"===e.kind}(t)){var i={};t.fields.map((function(e){return G(i,e.name,e.value,r)})),e[n.value]=i}else if(function(e){return"Variable"===e.kind}(t)){var o=(r||{})[t.name.value];e[n.value]=o}else if(function(e){return"ListValue"===e.kind}(t))e[n.value]=t.values.map((function(e){var t={};return G(t,n,e,r),t[n.value]}));else if(function(e){return"EnumValue"===e.kind}(t))e[n.value]=t.value;else{if(!function(e){return"NullValue"===e.kind}(t))throw __DEV__?new c('The inline argument "'.concat(n.value,'" of kind "').concat(t.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new c(52);e[n.value]=null}}N()&&Object.defineProperty($,Symbol("extensions"),{value:{symbol:x,hostReportError:q},configurable:!0});var J=["connection","include","skip","client","rest","export"],Q=(Object.assign((function(e,n,t){if(n&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){var r=t.connection.filter?t.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=n[e]})),"".concat(t.connection.key,"(").concat(Q(i),")")}return t.connection.key}var o=e;if(n){var u=Q(n);o+="(".concat(u,")")}return t&&Object.keys(t).forEach((function(e){-1===J.indexOf(e)&&(t[e]&&Object.keys(t[e]).length?o+="@".concat(e,"(").concat(Q(t[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var n=Q;return Q=e,n}}),function(e){return JSON.stringify(e,X)});function X(e,n){return Y(n)&&!Array.isArray(n)&&(n=Object.keys(n).sort().reduce((function(e,t){return e[t]=n[t],e}),{})),n}function z(e){return e.alias?e.alias.value:e.name.value}function W(e){return"Field"===e.kind}function H(e){__DEV__?s(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):s(e&&"Document"===e.kind,44);var n=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new c('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new c(45);return e}));return __DEV__?s(n.length<=1,"Ambiguous GraphQL document: contains ".concat(n.length," operations")):s(n.length<=1,46),e}function K(e,n){return n?n(e):$.of()}function Z(e){return"function"==typeof e?new te(e):e}function ee(e){return e.request.length<=1}var ne=function(e){function n(n,t){var r=e.call(this,n)||this;return r.link=t,r}return i(n,e),n}(Error),te=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return $.of()}))},e.from=function(n){return 0===n.length?e.empty():n.map(Z).reduce((function(e,n){return e.concat(n)}))},e.split=function(n,t,r){var i=Z(t),o=Z(r||new e(K));return ee(i)&&ee(o)?new e((function(e){return n(e)?i.request(e)||$.of():o.request(e)||$.of()})):new e((function(e,t){return n(e)?i.request(e,t)||$.of():o.request(e,t)||$.of()}))},e.execute=function(e,n){return e.request(function(e,n){var t=o({},e);return Object.defineProperty(n,"setContext",{enumerable:!1,value:function(e){t=o(o({},t),"function"==typeof e?e(t):e)}}),Object.defineProperty(n,"getContext",{enumerable:!1,value:function(){return o({},t)}}),n}(n.context,function(e){var n={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return n.operationName||(n.operationName="string"!=typeof n.query?n.query.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null||void 0:""),n}(function(e){for(var n=["query","operationName","variables","extensions","context"],t=0,r=Object.keys(e);t<r.length;t++){var i=r[t];if(n.indexOf(i)<0)throw __DEV__?new c("illegal argument: ".concat(i)):new c(24)}return e}(n))))||$.of()},e.concat=function(n,t){var r=Z(n);if(ee(r))return __DEV__&&s.warn(new ne("You are calling concat on a terminating link, which will have no effect",r)),r;var i=Z(t);return ee(i)?new e((function(e){return r.request(e,(function(e){return i.request(e)||$.of()}))||$.of()})):new e((function(e,n){return r.request(e,(function(e){return i.request(e,n)||$.of()}))||$.of()}))},e.prototype.split=function(n,t,r){return this.concat(e.split(n,t,r||new e(K)))},e.prototype.concat=function(n){return e.concat(this,n)},e.prototype.request=function(e,n){throw __DEV__?new c("request is not implemented"):new c(19)},e.prototype.onError=function(e,n){if(n&&n.error)return n.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}();Symbol.toStringTag;Symbol.toStringTag;const re={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"]},ie=new Set(Object.keys(re));function oe(e){const n=null==e?void 0:e.kind;return"string"==typeof n&&ie.has(n)}let ue,ae;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(ue||(ue={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(ae||(ae={}));const ce=Object.freeze({});function se(e,n,t=re){const r=new Map;for(const e of Object.values(ae))r.set(e,le(n,e));let i=void 0,o=Array.isArray(e),u=[e],a=-1,c=[],s=e,l=void 0,f=void 0;const p=[],v=[];do{a++;const e=a===u.length,h=e&&0!==c.length;if(e){if(l=0===v.length?void 0:p[p.length-1],s=f,f=v.pop(),h)if(o){s=s.slice();let e=0;for(const[n,t]of c){const r=n-e;null===t?(s.splice(r,1),e++):s[r]=t}}else{s=Object.defineProperties({},Object.getOwnPropertyDescriptors(s));for(const[e,n]of c)s[e]=n}a=i.index,u=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(f){if(l=o?a:u[a],s=f[l],null==s)continue;p.push(l)}let b;if(!Array.isArray(s)){var d,m;oe(s)||g(!1,`Invalid AST Node: ${E(s)}.`);const t=e?null===(d=r.get(s.kind))||void 0===d?void 0:d.leave:null===(m=r.get(s.kind))||void 0===m?void 0:m.enter;if(b=null==t?void 0:t.call(n,s,l,f,p,v),b===ce)break;if(!1===b){if(!e){p.pop();continue}}else if(void 0!==b&&(c.push([l,b]),!e)){if(!oe(b)){p.pop();continue}s=b}}var y;if(void 0===b&&h&&c.push([l,s]),e)p.pop();else i={inArray:o,index:a,keys:u,edits:c,prev:i},o=Array.isArray(s),u=o?s:null!==(y=t[s.kind])&&void 0!==y?y:[],a=-1,c=[],f&&v.push(f),f=s}while(void 0!==i);return 0!==c.length?c[c.length-1][1]:e}function le(e,n){const t=e[n];return"object"==typeof t?t:"function"==typeof t?{enter:t,leave:void 0}:{enter:e.enter,leave:e.leave}}function fe(e,n){var t=e.directives;return!t||!t.length||function(e){var n=[];e&&e.length&&e.forEach((function(e){if("skip"===(t=e.name.value)||"include"===t){var t,r=e.arguments,i=e.name.value;__DEV__?s(r&&1===r.length,"Incorrect number of arguments for the @".concat(i," directive.")):s(r&&1===r.length,38);var o=r[0];__DEV__?s(o.name&&"if"===o.name.value,"Invalid argument for the @".concat(i," directive.")):s(o.name&&"if"===o.name.value,39);var u=o.value;__DEV__?s(u&&("Variable"===u.kind||"BooleanValue"===u.kind),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):s(u&&("Variable"===u.kind||"BooleanValue"===u.kind),40),n.push({directive:e,ifArgument:o})}}));return n}(t).every((function(e){var t=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=n&&n[r.value.name.value],__DEV__?s(void 0!==i,"Invalid variable referenced in @".concat(t.name.value," directive.")):s(void 0!==i,37)):i=r.value.value,"skip"===t.name.value?!i:i}))}var pe=e=>{const[n,...t]=e;return n.toString()+t.map(e=>{if("string"==typeof e)return"."+e;if("number"==typeof e)return`[${e.toString()}]`;throw new Error("Invalid path (must be an array of strings and numbers)")}).join("")};function ve(e){return 9===e||32===e}const de=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function me(e){return ye[e.charCodeAt(0)]}const ye=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];const he={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>be(e.definitions,"\n\n")},OperationDefinition:{leave(e){const n=Ee("(",be(e.variableDefinitions,", "),")"),t=be([e.operation,be([e.name,n]),be(e.directives," ")]," ");return("query"===t?"":t+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:n,defaultValue:t,directives:r})=>e+": "+n+Ee(" = ",t)+Ee(" ",be(r," "))},SelectionSet:{leave:({selections:e})=>ge(e)},Field:{leave({alias:e,name:n,arguments:t,directives:r,selectionSet:i}){const o=Ee("",e,": ")+n;let u=o+Ee("(",be(t,", "),")");return u.length>80&&(u=o+Ee("(\n",Te(be(t,"\n")),"\n)")),be([u,be(r," "),i]," ")}},Argument:{leave:({name:e,value:n})=>e+": "+n},FragmentSpread:{leave:({name:e,directives:n})=>"..."+e+Ee(" ",be(n," "))},InlineFragment:{leave:({typeCondition:e,directives:n,selectionSet:t})=>be(["...",Ee("on ",e),be(n," "),t]," ")},FragmentDefinition:{leave:({name:e,typeCondition:n,variableDefinitions:t,directives:r,selectionSet:i})=>`fragment ${e}${Ee("(",be(t,", "),")")} on ${n} ${Ee("",be(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:n})=>n?function(e,n){const t=e.replace(/"""/g,'\\"""'),r=t.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every(e=>0===e.length||ve(e.charCodeAt(0))),u=t.endsWith('\\"""'),a=e.endsWith('"')&&!u,c=e.endsWith("\\"),s=a||c,l=!(null!=n&&n.minimize)&&(!i||e.length>70||s||o||u);let f="";const p=i&&ve(e.charCodeAt(0));return(l&&!p||o)&&(f+="\n"),f+=t,(l||s)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(de,me)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+be(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+be(e,", ")+"}"},ObjectField:{leave:({name:e,value:n})=>e+": "+n},Directive:{leave:({name:e,arguments:n})=>"@"+e+Ee("(",be(n,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:n,operationTypes:t})=>Ee("",e,"\n")+be(["schema",be(n," "),ge(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:n})=>e+": "+n},ScalarTypeDefinition:{leave:({description:e,name:n,directives:t})=>Ee("",e,"\n")+be(["scalar",n,be(t," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>Ee("",e,"\n")+be(["type",n,Ee("implements ",be(t," & ")),be(r," "),ge(i)]," ")},FieldDefinition:{leave:({description:e,name:n,arguments:t,type:r,directives:i})=>Ee("",e,"\n")+n+(_e(t)?Ee("(\n",Te(be(t,"\n")),"\n)"):Ee("(",be(t,", "),")"))+": "+r+Ee(" ",be(i," "))},InputValueDefinition:{leave:({description:e,name:n,type:t,defaultValue:r,directives:i})=>Ee("",e,"\n")+be([n+": "+t,Ee("= ",r),be(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>Ee("",e,"\n")+be(["interface",n,Ee("implements ",be(t," & ")),be(r," "),ge(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:n,directives:t,types:r})=>Ee("",e,"\n")+be(["union",n,be(t," "),Ee("= ",be(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:n,directives:t,values:r})=>Ee("",e,"\n")+be(["enum",n,be(t," "),ge(r)]," ")},EnumValueDefinition:{leave:({description:e,name:n,directives:t})=>Ee("",e,"\n")+be([n,be(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:n,directives:t,fields:r})=>Ee("",e,"\n")+be(["input",n,be(t," "),ge(r)]," ")},DirectiveDefinition:{leave:({description:e,name:n,arguments:t,repeatable:r,locations:i})=>Ee("",e,"\n")+"directive @"+n+(_e(t)?Ee("(\n",Te(be(t,"\n")),"\n)"):Ee("(",be(t,", "),")"))+(r?" repeatable":"")+" on "+be(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:n})=>be(["extend schema",be(e," "),ge(n)]," ")},ScalarTypeExtension:{leave:({name:e,directives:n})=>be(["extend scalar",e,be(n," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>be(["extend type",e,Ee("implements ",be(n," & ")),be(t," "),ge(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>be(["extend interface",e,Ee("implements ",be(n," & ")),be(t," "),ge(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:n,types:t})=>be(["extend union",e,be(n," "),Ee("= ",be(t," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:n,values:t})=>be(["extend enum",e,be(n," "),ge(t)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:n,fields:t})=>be(["extend input",e,be(n," "),ge(t)]," ")}};function be(e,n=""){var t;return null!==(t=null==e?void 0:e.filter(e=>e).join(n))&&void 0!==t?t:""}function ge(e){return Ee("{\n",Te(be(e,"\n")),"\n}")}function Ee(e,n,t=""){return null!=n&&""!==n?e+n+t:""}function Te(e){return Ee(" ",e.replace(/\n/g,"\n "))}function _e(e){var n;return null!==(n=null==e?void 0:e.some(e=>e.includes("\n")))&&void 0!==n&&n}var Oe=(e,n)=>{console.error("MockGraphLink: Failed to resolve a query from the mock graph; you may need to update the graph to contain all of the data being queried:\n\n",se(n,he),"\n\nErrors:\n",e)};function we(e,n){null!==n&&"object"==typeof n&&Object.keys(n).forEach(t=>{const r=n[t];Object.prototype.hasOwnProperty.call(e,t)?we(e[t],r):e[t]=r})}var Ie=class extends te{constructor(e,n={}){super();const{onError:t=Oe,possibleTypes:r,timeoutMs:i=100}=n;this.getMockGraph=e,this.onError=t,this.timeoutMs=i,this.lastQueryId=0,this.queriesInFlight=new Map,r&&(this.possibleTypes=r)}request(e,n){const t=e.query.definitions.find(n=>null==e.operationName?null==n.name:n.name.value===e.operationName);let r;if("query"===t.operation){if(r=this.getMockGraph().Query,!r)throw new Error('Query must be mocked to fulfill a "query" operation')}else{if("mutation"!==t.operation)throw new Error(`Can't yet mock operation type "${t.operation}"`);if(r=this.getMockGraph().Mutation,!r)throw new Error('Mutation must be mocked to fulfill a "mutation" operation')}const i=function(e){var n;H(e);for(var t=0,r=e.definitions;t<r.length;t++){var i=r[t];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||n||(n=i)}if(n)return n;throw __DEV__?new c("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new c(51)}(e.query);const o=function(e){void 0===e&&(e=[]);var n={};return e.forEach((function(e){n[e.name.value]=e})),n}(e.query.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))),u=[],a=(n,t,r)=>{const i={};return n.selections.forEach(c=>{if(fe(n,e.variables))if(W(c)){const e=s(c,t,r),n=z(c);void 0!==e&&(void 0===i[n]?i[n]=e:we(i[n],e))}else{let e;if(function(e){return"InlineFragment"===e.kind}(c))e=c;else if(e=o[c.name.value],!e)throw new Error("No fragment named "+c.name.value);const n=()=>{const n=a(e.selectionSet,t,r);we(i,n)};let s;e.typeCondition&&"NamedType"===e.typeCondition.kind&&"Name"===e.typeCondition.name.kind&&(s=e.typeCondition.name.value);const l=t.__typename;l?s===l?n():this.possibleTypes?this.possibleTypes[s]&&-1!==this.possibleTypes[s].indexOf(l)&&n():u.push({type:"unionInterfaceTypes",path:r,fragmentName:e.name&&e.name.value,objectType:l,fragmentType:s}):u.push({type:"noTypename",path:r,fragmentName:e.name.value})}}),i},s=(n,t,r)=>{const i=n.name.value,o=function(e,n){if(e.arguments&&e.arguments.length){var t={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return G(t,r,i,n)})),t}return null}(n,e.variables),c=[...r,o?`${i}(${JSON.stringify(o)})`:i],s=t[i];let f;if(void 0===s)u.push({type:"missing",path:c}),f=null;else if("function"==typeof s){let e,n;try{e=s(o||{})}catch(e){n=e}n?(u.push({type:"resolver",error:n,args:o,path:c}),f=null):void 0===e?(u.push({type:"fnReturnUndefined",args:o,path:c}),f=null):f=e}else o&&Object.keys(o).length&&"function"!=typeof s?(u.push({type:"fnRequired",args:o,path:c}),f=null):f=s;return n.selectionSet?null===f?f:Array.isArray(f)?l(n,f,c):a(n.selectionSet,f,c):f},l=(e,n,t)=>n.map((n,r)=>{if(null===n)return null;const i=[...t,r];return Array.isArray(n)?l(e,n,i):a(e.selectionSet,n,i)}),f=a(i.selectionSet,r,[]),p=u.length?u.map(e=>{let n=e.type;return"missing"===e.type?n="Field is missing from mock graph":"fnReturnUndefined"===e.type?n="Mock resolver returned undefined; did you mean to return null?":"fnRequired"===e.type?n="This field received args and thus must be mocked as a function.":"resolver"===e.type?n="Error from resolver: "+e.error.message:"noTypename"===e.type?n=`Can't resolve fragment ${e.fragmentName} because __typename is missing from the mock graph`:"unionInterfaceTypes"===e.type&&(n=`Can't resolve fragment ${e.fragmentName?e.fragmentName+" ":""}because its type (${e.fragmentType}) might not match the object's type (${e.objectType}). In order to handle union and interface types, you must pass \`possibleTypes\` when creating MockGraphLink. See https://github.com/dallonf/apollo-link-mock-graph/blob/master/README.md for details.`),n=`${pe(e.path)}: ${n}`,{...e,message:n}}):null;u.length&&this.onError(p,e.query),this.lastQueryId+=1;const v=this.lastQueryId,d=new Promise(e=>setTimeout(e,this.timeoutMs)).then(()=>(this.queriesInFlight.delete(v),{data:f,errors:p}));this.queriesInFlight.set(v,d);return new $(e=>{d.then(n=>{e.next(n),e.complete()})})}waitForQueries({waitToSettle:e=!0}={}){const n=[...this.queriesInFlight.values()];return n.length?Promise.all(n).then(()=>{if(e)return new Promise(e=>setTimeout(e)).then(()=>this.waitForQueries())}):Promise.resolve()}};n.default=Ie}]);
{
"name": "apollo-link-mock-graph",
"version": "2.0.0",
"version": "2.0.1",
"main": "dist/main.js",

@@ -26,7 +26,7 @@ "license": "MIT",

"webpack": "^4.46.0",
"webpack-cli": "^4.9.2"
"webpack-cli": "^3.3.12"
},
"dependencies": {
"@apollo/client": "^3.5.8",
"graphql": "^16.3.0",
"@apollo/client": "^3.6.9",
"graphql": "^16.5.0",
"source-map-support": "^0.5.21"

@@ -33,0 +33,0 @@ },